lowlevellibsandfws/apputils/inc/BACLIPB.H
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Started by DS, October 1996
       
    15 // Clipboard
       
    16 // 
       
    17 //
       
    18 
       
    19 #if !defined(__BACLIPB_H__)
       
    20 #define __BACLIPB_H__
       
    21 
       
    22 #if !defined(__e32std_h__)
       
    23 #include <e32std.h>
       
    24 #endif
       
    25 
       
    26 #if !defined(__e32base_h__)
       
    27 #include <e32base.h>
       
    28 #endif
       
    29 
       
    30 #if !defined(__s32file_h__)
       
    31 #include <s32file.h>
       
    32 #endif
       
    33 
       
    34 class CClipboard : public CBase
       
    35 /** Clipboard. A repository of copied data which is available for pasting. The 
       
    36 clipboard storage drive is defined in the HAL layer, in HAL::EClipboardDrive. 
       
    37 @publishedAll
       
    38 @released
       
    39 */
       
    40     {
       
    41 public:
       
    42 	IMPORT_C static CClipboard* NewForReadingLC(RFs& aFs);
       
    43 	IMPORT_C static CClipboard* NewForReadingL(RFs& aFs);
       
    44 	IMPORT_C static CClipboard* NewForWritingLC(RFs& aFs);
       
    45 	IMPORT_C static TInt Clear(RFs& aFs);
       
    46 	IMPORT_C ~CClipboard();
       
    47 	//
       
    48 	// Necessary only when writing
       
    49 	IMPORT_C void CommitL();
       
    50 	//
       
    51 	inline CStreamStore& Store() const;
       
    52 	inline CStreamDictionary& StreamDictionary() const;
       
    53 
       
    54     // Provide functionality to read and write floating point numbers
       
    55     // in a native format.
       
    56     // (see note below)
       
    57 
       
    58     IMPORT_C void  CopyToL     ( TReal aReal ) __SOFTFP;
       
    59     IMPORT_C TBool PasteFromL  ( TReal& aReal );
       
    60     // Get a number from the clipboard, return false if it is not present
       
    61     // in which case the parameter is unmodified.
       
    62 
       
    63 	// Gets the drive where the clipboard file is stored
       
    64 	IMPORT_C static TDriveName ClipboardFileDrive();
       
    65 	 
       
    66 
       
    67 private:
       
    68 	inline CClipboard(RFs& aFs);
       
    69 	static CClipboard* NewLC(RFs& aFs);
       
    70 	void ConstructReadL();
       
    71 private:
       
    72 	CFileStore* iStore;
       
    73 	CStreamDictionary* iStreamDictionary;
       
    74 	RFs& iFs;
       
    75     };
       
    76 
       
    77 
       
    78 inline CStreamStore& CClipboard::Store() const
       
    79 	/** Returns a reference to the clipboard's file store.
       
    80 	
       
    81 	@return A reference to the clipboard's store. */
       
    82 	{ return *iStore; }
       
    83 
       
    84 
       
    85 inline CStreamDictionary& CClipboard::StreamDictionary() const
       
    86 	/** Returns a reference to the clipboard's stream dictionary.
       
    87 	
       
    88 	@return A reference to the clipboard's stream dictionary. */
       
    89 	{ return *iStreamDictionary; }
       
    90 
       
    91 
       
    92 // NB the floating point copy and paste member functions are currently the only
       
    93 // ones of this type defined in the class.  Most clipboard data consists of
       
    94 // more complex objects known only at a higher level than BAFL.  This raises the
       
    95 // question of whether the clipboard should provide equivalent functionality
       
    96 // for other basic data types or whether there should be a utility class
       
    97 // elsewhere to do all such operations in a standard format and handle the
       
    98 // multiple representations too. - PNJ, January 1997.
       
    99 
       
   100 
       
   101 
       
   102 
       
   103 
       
   104 
       
   105 #endif