williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Started by DS, October 1996 williamr@2: // Clipboard williamr@2: // williamr@2: // williamr@2: williamr@2: #if !defined(__BACLIPB_H__) williamr@2: #define __BACLIPB_H__ williamr@2: williamr@2: #if !defined(__e32std_h__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #if !defined(__e32base_h__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #if !defined(__s32file_h__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: class CClipboard : public CBase williamr@2: /** Clipboard. A repository of copied data which is available for pasting. The williamr@2: clipboard storage drive is defined in the HAL layer, in HAL::EClipboardDrive. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C static CClipboard* NewForReadingLC(RFs& aFs); williamr@2: IMPORT_C static CClipboard* NewForReadingL(RFs& aFs); williamr@2: IMPORT_C static CClipboard* NewForWritingLC(RFs& aFs); williamr@2: IMPORT_C static TInt Clear(RFs& aFs); williamr@2: IMPORT_C ~CClipboard(); williamr@2: // williamr@2: // Necessary only when writing williamr@2: IMPORT_C void CommitL(); williamr@2: // williamr@2: inline CStreamStore& Store() const; williamr@2: inline CStreamDictionary& StreamDictionary() const; williamr@2: williamr@2: // Provide functionality to read and write floating point numbers williamr@2: // in a native format. williamr@2: // (see note below) williamr@2: williamr@2: IMPORT_C void CopyToL ( TReal aReal ) __SOFTFP; williamr@2: IMPORT_C TBool PasteFromL ( TReal& aReal ); williamr@2: // Get a number from the clipboard, return false if it is not present williamr@2: // in which case the parameter is unmodified. williamr@2: williamr@2: // Gets the drive where the clipboard file is stored williamr@2: IMPORT_C static TDriveName ClipboardFileDrive(); williamr@2: williamr@2: williamr@2: private: williamr@2: inline CClipboard(RFs& aFs); williamr@2: static CClipboard* NewLC(RFs& aFs); williamr@2: void ConstructReadL(); williamr@2: private: williamr@2: CFileStore* iStore; williamr@2: CStreamDictionary* iStreamDictionary; williamr@2: RFs& iFs; williamr@2: }; williamr@2: williamr@2: williamr@2: inline CStreamStore& CClipboard::Store() const williamr@2: /** Returns a reference to the clipboard's file store. williamr@2: williamr@2: @return A reference to the clipboard's store. */ williamr@2: { return *iStore; } williamr@2: williamr@2: williamr@2: inline CStreamDictionary& CClipboard::StreamDictionary() const williamr@2: /** Returns a reference to the clipboard's stream dictionary. williamr@2: williamr@2: @return A reference to the clipboard's stream dictionary. */ williamr@2: { return *iStreamDictionary; } williamr@2: williamr@2: williamr@2: // NB the floating point copy and paste member functions are currently the only williamr@2: // ones of this type defined in the class. Most clipboard data consists of williamr@2: // more complex objects known only at a higher level than BAFL. This raises the williamr@2: // question of whether the clipboard should provide equivalent functionality williamr@2: // for other basic data types or whether there should be a utility class williamr@2: // elsewhere to do all such operations in a standard format and handle the williamr@2: // multiple representations too. - PNJ, January 1997. williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #endif