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