2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Declaration of FavouritesFile
19 #ifndef FAVOURITES_FILE_H
20 #define FAVOURITES_FILE_H
24 #include <FavouritesHandle.h>
26 // FORWARD DECLARATION
29 class CFavouritesFileImpl;
34 * RFavouritesFile is a class derived from RFavouritesHandle.
35 * Each favourites item or folder can have an associated file
36 * with arbitrary content.
38 class RFavouritesFile: public RFavouritesHandle
41 public: // Constructor and destructor
47 inline RFavouritesFile();
54 IMPORT_C void Close();
57 * Open existing file with shared read-access.
59 * @param aDb Database handle.
60 * @param aUid Uid of item.
63 IMPORT_C TInt Open( RFavouritesDb& aDb, TInt aUid );
66 * Create new file / replace existing with exclusive write-access.
67 * Existing content of the file, if any, is lost.
69 * @param aDb Database handle.
70 * @param aUid Uid of item.
73 IMPORT_C TInt Replace( RFavouritesDb& aDb, TInt aUid );
75 public: // new methods
80 * @param aDes Descriptor into which binary data is read. Any existing
81 * contents are overwritten. On return, its length is set to the number
85 IMPORT_C TInt Read( TDes8& aDes ) const;
90 * @param aDes Descriptor from which binary data is written.
93 IMPORT_C TInt Write( const TDesC8& aDes );
96 * Get the size of the file.
98 * @param aSize Gives back the size of the file.
101 IMPORT_C TInt Size(TInt &aSize) const;
103 private: // new methods
106 * Implementation of Open functions.
108 * @param aDb Database handle.
109 * @param aUid Uid of item.
110 * @param aFunction Function.
111 * @return Error code.
113 TInt DoOpen( RFavouritesDb& aDb, TInt aUid, TInt aFunction );
117 CFavouritesFileImpl* iImpl; ///< Implementation. Owned.
121 #include <FavouritesFile.inl>