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