API published in: S60 1st Ed
Link against: favouritesengine.lib
Required Capabilities
ReadUserData WriteUserData
#include <favouritesdb.h>
Inherits RFavouritesHandle.
This class encapsulates a session with bookmark database server. It provides a way to access the database, do administration (recovery, compaction) and explicit transaction support.
Public Member Functions |
|
IMPORT_C TInt | Open (RFavouritesSession &aSess, const TDesC &aName) |
Open the database. |
|
IMPORT_C TVersion | Version () const |
Get version information. |
|
IMPORT_C TInt | IsDamaged (TBool &aIsDamaged) |
Check if the database to be recovered is fully functional. |
|
IMPORT_C TInt | Recover () |
Perform database synchronous recovery. |
|
IMPORT_C TInt | Compact () |
Perform databas synchronous compaction. |
|
IMPORT_C TInt | Size (RDbDatabase::TSize &aSize) const |
Get available database size. |
|
IMPORT_C TInt | UpdateStats () |
Update database statistics. |
|
IMPORT_C TInt | Begin (TBool aWrite=EFalse) |
Explicitly begin a transaction. |
|
IMPORT_C TInt | Commit () |
Commit the transaction. |
|
IMPORT_C void | Rollback () |
Roll back the transaction. |
|
IMPORT_C void | CleanupRollbackPushL () |
Push a rollback on the cleanup stack. |
|
IMPORT_C TInt | Get (TInt aUid, CFavouritesItem &aItem) |
Get the item with this Uid. |
|
IMPORT_C TInt | GetAll (CFavouritesItemList &aItemList, TInt aParentFolderFilter=KFavouritesNullUid, CFavouritesItem::TType aTypeFilter=CFavouritesItem::ENone, const TDesC *aNameFilter=NULL, TInt32 aContextIdFilter=KFavouritesNullContextId) |
Get all items matching the supplied criteria. |
|
IMPORT_C TInt | GetUids (CArrayFix< TInt > &aUids, TInt aParentFolderFilter=KFavouritesNullUid, CFavouritesItem::TType aTypeFilter=CFavouritesItem::ENone, const TDesC *aNameFilter=NULL, TInt32 aContextIdFilter=KFavouritesNullContextId) |
Get uids of all items matching the supplied criteria. |
|
IMPORT_C TInt | PreferredUid (TInt aFolder, TInt &aPreferredUid) |
Get preferred Uid for a folder. |
|
IMPORT_C TInt | Delete (TInt aUid) |
Delete item by Uid. |
|
IMPORT_C TInt | Update (CFavouritesItem &aItem, TInt aUid, TBool aAutoRename) |
Update an item. |
|
IMPORT_C TInt | Add (CFavouritesItem &aItem, TBool aAutoRename) |
Add a new item to the database. |
|
IMPORT_C TInt | SetHomepage (CFavouritesItem &aItem) |
Update the Homepage item. |
|
IMPORT_C TInt | SetLastVisited (CFavouritesItem &aItem) |
Update the Last Visited. |
|
IMPORT_C TInt | SetFactoryItem (TInt aUid, TBool aFactoryItem) |
Set factory item flag on an item. |
|
IMPORT_C TInt | SetReadOnly (TInt aUid, TBool aReadOnly) |
Set read-only flag on an item. |
|
IMPORT_C TInt | SetModified (TInt aUid, TTime aModified) |
Manual setting of Last Modification Time of an item. |
|
IMPORT_C TInt | SetPreferredUid (TInt aFolder, TInt aUid) |
Set preferred Uid for a folder. |
|
IMPORT_C TInt | ItemExists (TInt aUid, TBool &aItemExists) |
Check if we already have this item. |
|
IMPORT_C TInt | FolderExists (TInt aFolder, TBool &aFolderExists) |
Check if the folder exists. |
|
IMPORT_C TInt | Count (TInt &aCount, TInt aParentFolderFilter=KFavouritesNullUid, CFavouritesItem::TType aTypeFilter=CFavouritesItem::ENone, const TDesC *aNameFilter=NULL, TInt32 aContextIdFilter=KFavouritesNullContextId) |
Count all items matching the supplied criteria. |
|
IMPORT_C TInt | SetData (TInt aUid, const MFavouritesItemData &aData) |
Set data associated with an item. |
|
IMPORT_C TInt | GetData (TInt aUid, MFavouritesItemData &aData) |
Get data associated with an item. |
|
IMPORT_C TInt | SetBrowserData (TInt aUid, const MFavouritesItemData &aData) |
Set Browser data associated with an item. |
|
IMPORT_C TInt | GetBrowserData (TInt aUid, MFavouritesItemData &aData) |
Get Browser associated with an item. |
|
IMPORT_C TInt | MakeUniqueName (TDes &aName, TInt aFolder) |
Check if aName is unique in aFolder; and if not, change to an unique one, appending a number. |
|
IMPORT_C TInt | MakeUniqueName (CFavouritesItem &aItem) |
Check if aName is unique in its folder; and if not, change to an unique one, appending a number. |
|
IMPORT_C CFavouritesItem * | CreateStartPageItemL () |
Create an empty item with uid KFavouritesStartPageUid. |
|
IMPORT_C CFavouritesItem * | CreateAdaptiveItemsFolderL () |
Create a folder with uid KFavouritesAdaptiveItemsFolderUid. |
|
IMPORT_C TInt | DeleteFile (TInt aUid) |
Delete file. |
|
Static Public Member Functions |
|
static IMPORT_C void | RestoreFactorySettingsL (const TDesC &aName, const TDesC &aReferenceDbPath, MRfsApMapper &aApMapper) |
User-level Restore Factory Settings operation. |
|
Add a new item to the database. If successful, its Uid, Last-Mod-Time (and possibly its name) is updated on return.
|
|
Explicitly begin a transaction.
|
|
Push a rollback on the cleanup stack. Call this after Begin() call, to make the transaction leave-safe.
|
|
Commit the transaction.
|
|
Perform databas synchronous compaction. This function requires exclusive access to the database.
|
|
Count all items matching the supplied criteria.
|
|
Create a folder with uid KFavouritesAdaptiveItemsFolderUid. Owner is the caller. Uid, type (folder) and parent (root) is set, other properties are uninitialized. The Browser needs this. Note that this item does not exist in the database.
|
|
Create an empty item with uid KFavouritesStartPageUid. Owner is the caller. Except its uid, the item is uninitialized. The Browser needs this. Note that this item does not exist in the database.
|
|
Delete item by Uid. If this is a folder, all descendants and the contents of them are deleted. Homepage or root cannot be deleted.
|
|
Delete file. See RFavouritesFile.
|
|
Check if the folder exists.
|
|
Get the item with this Uid.
|
|
Get all items matching the supplied criteria.
|
|
Get Browser associated with an item. This data is for Browser's dedicated use, do not tamper.
|
|
Get data associated with an item.
|
|
Get uids of all items matching the supplied criteria.
|
|
Check if the database to be recovered is fully functional.
|
|
Check if we already have this item.
|
|
Check if aName is unique in its folder; and if not, change to an unique one, appending a number. In case of any errors, aItem is unchanged. Names of special items (Start Page etc.) are not considered (can have conflicting names).
|
|
Check if aName is unique in aFolder; and if not, change to an unique one, appending a number. In case of any errors, aName is unchanged. Names of special items (Start Page etc.) are not considered (can have conflicting names).
|
|
Open the database. Created if does not exist.
|
|
Get preferred Uid for a folder.
|
|
Perform database synchronous recovery. This function requires exclusive access to the database.
|
|
User-level Restore Factory Settings operation. Delete all items that has "factory item" flag set, then add new ones from reference database. In case of name conflilcts, new names are generated. Leaves on any error.
|
|
Roll back the transaction.
|
|
Set Browser data associated with an item. Any existing data, belonging to item having aUid, is now replaced. The item itself is not changed. This data is for Browser's dedicated use, do not tamper. In case of any errors, the data is not saved.
|
|
Set data associated with an item. Any existing data, belonging to item having aUid, is now replaced. The item itself is not changed. In case of any errors, the data is not saved.
|
|
Set factory item flag on an item. (Item with this flag set will be deleted if RFS is executed.)
|
|
Update the Homepage item. If does not exist, it is now created. The old Homepage, if any, is overwritten. If successful, its Uid and Last-Mod-Time is updated on return. Name needs not be unique.
|
|
Update the Last Visited. If does not exist, it is now created. The old Last Visited, if any, is overwritten. If successful, its Uid is updated on return. Name needs not be unique.
|
|
Manual setting of Last Modification Time of an item. Note that the Last Modification Time is automatically set by any edit, so this method need not be used in usual circumstances. It is provided for administration purposes only.
|
|
Set preferred Uid for a folder.
|
|
Set read-only flag on an item.
|
|
Get available database size.
|
|
Update an item. Remember Homapage or Last Visited Page cannot be updated using this method.
|
|
Update database statistics.
|
|
Get version information.
|