RBkNode Class Reference

class RBkNode

RBkNode is the base class for RBkBookmark and RBkFolder handle classes. Bookmarks and folders have many attributes in common. This class encapulates these elements and provides the implementation for accessing and setting them. It is also used when iterating through a folders child list where you can't know in advance whether the item is a bookmark or folder. A RBkNode can be passed as a parameter when opening RBkBookmark and RBkFolder handles once you know the RBkNode's type

Public Member Functions
RBkNode ()
IMPORT_C void Close ()
IMPORT_C const TDesC & DescriptionL ()
CBkmrkProperties * ExtendedPropertiesL ()
IMPORT_C void GetCustomPropertyL ( TUid , TInt &)
IMPORT_C void GetCustomPropertyL ( TUid , TReal &)
IMPORT_C void GetCustomPropertyL ( TUid , TDes &)
IMPORT_C void GetCustomPropertyL ( TUid , TDes8 &)
IMPORT_C Bookmark::TAttachmentId IconIdL ()
IMPORT_C Bookmark::TItemId Id ()
IMPORT_C TBool IsPublic ()
IMPORT_C TBool IsWritable ()
CBookmarkBase * Item ()
IMPORT_C TTime LastModifiedL ()
IMPORT_C RBkBookmark OpenBookmarkL ()
IMPORT_C RBkFolder OpenFolderL ()
IMPORT_C RBkFolder OpenParentL ()
IMPORT_C TSecureId OwnerL ()
IMPORT_C void SetCustomPropertyL ( TUid , TInt )
IMPORT_C void SetCustomPropertyL ( TUid , TReal )
IMPORT_C void SetCustomPropertyL ( TUid , const TDesC &)
IMPORT_C void SetCustomPropertyL ( TUid , const TDesC8 &)
IMPORT_C void SetDescriptionL (const TDesC &)
IMPORT_C void SetIconIdL ( Bookmark::TAttachmentId )
void SetItem ( CBookmarkBase &)
IMPORT_C void SetLastModifiedL (const TTime &)
IMPORT_C void SetOwnerL ( TSecureId )
IMPORT_C void SetParentL ( RBkFolder &)
IMPORT_C void SetPublicL ( TBool )
IMPORT_C void SetTitleL (const TDesC &)
IMPORT_C void SetWritableL ( TBool )
IMPORT_C const TDesC & Title ()
IMPORT_C Bookmark::TType Type ()
Private Member Functions
void DeleteBkmrkItem ( TAny *)
void LeaveIfRootL ()
Protected Attributes
CBookmarkBase * iItem

Constructor & Destructor Documentation

RBkNode()

IMPORT_C RBkNode ( )

RBkNode constructor

Member Functions Documentation

Close()

IMPORT_C void Close ( )

Closes the RBkNode handle and decrements the reference count

DeleteBkmrkItem(TAny *)

void DeleteBkmrkItem ( TAny * aPtr ) [private, static]

Parameters

TAny * aPtr

DescriptionL()

IMPORT_C const TDesC & DescriptionL ( ) const

Gets the item description text.

ExtendedPropertiesL()

CBkmrkProperties * ExtendedPropertiesL ( ) const

Not intended for external use.

GetCustomPropertyL(TUid, TInt &)

IMPORT_C void GetCustomPropertyL ( TUid aPropertyId,
TInt & aValue
) const

Gets a custom property for the given property ID. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to get
TInt & aValue An integer the data value

GetCustomPropertyL(TUid, TReal &)

IMPORT_C void GetCustomPropertyL ( TUid aPropertyId,
TReal & aValue
) const

Gets a custom property for the given property ID. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to get
TReal & aValue A floating point data value

GetCustomPropertyL(TUid, TDes &)

IMPORT_C void GetCustomPropertyL ( TUid aPropertyId,
TDes & aValue
) const

Gets a custom property for the given property ID. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to get
TDes & aValue A 16 bit descriptor

GetCustomPropertyL(TUid, TDes8 &)

IMPORT_C void GetCustomPropertyL ( TUid aPropertyId,
TDes8 & aValue
) const

Gets a custom property for the given property ID. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to get
TDes8 & aValue An 8 bit descriptor

IconIdL()

IMPORT_C Bookmark::TAttachmentId IconIdL ( ) const

Returns the ID if an icon is assigned to this bookmark item.

Id()

IMPORT_C Bookmark::TItemId Id ( ) const

Method for querying the bookmark item's database id.

IsPublic()

IMPORT_C TBool IsPublic ( ) const

Returns whether the item is public or private

IsWritable()

IMPORT_C TBool IsWritable ( ) const

Returns whether the item is read only or not

Item()

CBookmarkBase * Item ( ) const

Not intended for external use.

LastModifiedL()

IMPORT_C TTime LastModifiedL ( ) const

Returns the last modified time. If the last modified time was never set, this will return the value of midnight January 1st 1970 UTC. This can occur when using a version 1.0.0 database.

LeaveIfRootL()

void LeaveIfRootL ( ) const [private]

OpenBookmarkL()

IMPORT_C RBkBookmark OpenBookmarkL ( ) const

Opens RBkBookmark handle from this RBkNode handle. This is usually done when iterating through a folder. You must ensure that this RBkNode handle is of the type: Bookmark::ETypeBookmark before calling this method.

This method does NOT close the RBkNode handle

leave
Bookmark::KErrWrongType The method will leave if an attempt is made to call this with a RBkNode handle which is not of the Bookmark::ETypeBookmark type.

OpenFolderL()

IMPORT_C RBkFolder OpenFolderL ( ) const

Opens RBkFolder handle from this RBkNode handle. This is usually done when iterating through a folder. You must ensure that this RBkNode handle is of the type: Bookmark::ETypeFolder before calling this method.

This method does NOT close the RBkNode handle

leave
Bookmark::KErrWrongType The method will leave if an attempt is made to call this with a RBkNode handle which is not of the Bookmark::ETypeFolder type.

OpenParentL()

IMPORT_C RBkFolder OpenParentL ( ) const

Method for querying a bookmark item's parent folder. Only the root will not have a parent. The method will leave if an attempt is made to call this on the root folder

leave
KErrNotFound This will leave if called on the root folder (the root folder has no parent).

OwnerL()

IMPORT_C TSecureId OwnerL ( ) const

Returns the item's owner if it is a private bookmark.

Bookmark::TVisibility
leave
KErrPermissionDenied This function will leave when the bookmark database is not opened as Bookmark::EVisibilityManager.

SetCustomPropertyL(TUid, TInt)

IMPORT_C void SetCustomPropertyL ( TUid aPropertyId,
TInt aValue
)

Assigns a new custom property value to the bookmark item. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to set
TInt aValue An integer data value

SetCustomPropertyL(TUid, TReal)

IMPORT_C void SetCustomPropertyL ( TUid aPropertyId,
TReal aValue
)

Assigns a new custom property value to the bookmark item. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to set
TReal aValue A floating point data value

SetCustomPropertyL(TUid, const TDesC &)

IMPORT_C void SetCustomPropertyL ( TUid aPropertyId,
const TDesC & aValue
)

Assigns a new custom property value to the bookmark item. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to set
const TDesC & aValue A 16 bit descriptor

SetCustomPropertyL(TUid, const TDesC8 &)

IMPORT_C void SetCustomPropertyL ( TUid aPropertyId,
const TDesC8 & aValue
)

Assigns a new custom property value to the bookmark item. This method will leave if no such property has been registered on the database

Parameters

TUid aPropertyId The ID of the property you wish to set
const TDesC8 & aValue An 8 bit descriptor

SetDescriptionL(const TDesC &)

IMPORT_C void SetDescriptionL ( const TDesC & aDescription )

Sets the item's decription text.

Parameters

const TDesC & aDescription The item's new description

SetIconIdL(Bookmark::TAttachmentId)

IMPORT_C void SetIconIdL ( Bookmark::TAttachmentId aIconId =  Bookmark::KNullAttachmentID )

Sets the icon. Call this with KNullIconID to remove the icon. Icons are stored centrally in the database and are shared by bookmark items. If the icon oes not exist in the database this method will leave

Parameters

Bookmark::TAttachmentId aIconId =  Bookmark::KNullAttachmentID The ID of the icon.

SetItem(CBookmarkBase &)

void SetItem ( CBookmarkBase & aItem )

Not intended for external use.

Parameters

CBookmarkBase & aItem

SetLastModifiedL(const TTime &)

IMPORT_C void SetLastModifiedL ( const TTime & aTime )

Sets the last modified time to an arbitrary value. Only applications which have opened the bookmark database as Bookmark::EVisibilityManager can use this function, otherwise it will leave with KErrPermissionDenied error code.

Note: The last modified time is automatically set to the current time during a commit. This function should only be used if the caller needs to set to a different time (for example when synchronising bookmarks).

leave
KErrPermissionDenied This function will leave, when the bookmark database is not opened in Bookmark::EVisibilityManager.

Parameters

const TTime & aTime The time to set.

SetOwnerL(TSecureId)

IMPORT_C void SetOwnerL ( TSecureId aOwner =  Bookmark::KNoOwnerId )

Sets the owner security ID of this bookmark item. All applications which have opened the bookmark database as Bookmark::EVisibilityManager can use this function. In other visibility modes the aOwner must be the current SID, otherwise function will leave with KErrPermissionDenied

leave
KErrPermissionDenied When the aOwner is not the current SID and the bookmark database is opened in non-manager mode.
leave
Bookmark::KErrOperationDenied This function will leave, if called on the root folder.

Parameters

TSecureId aOwner =  Bookmark::KNoOwnerId The new owner ID.

SetParentL(RBkFolder &)

IMPORT_C void SetParentL ( RBkFolder & aNewParent )

Moves the item to another folder

This function will leave if called on the root folder or an out of memory condition occurs.

leave
Bookmark::KErrReadOnly This function will leave if the item is read only.

Parameters

RBkFolder & aNewParent The new parent folder

SetPublicL(TBool)

IMPORT_C void SetPublicL ( TBool aPublic )

Sets the public or private status.

Parameters

TBool aPublic Whether the item is to be public or private

SetTitleL(const TDesC &)

IMPORT_C void SetTitleL ( const TDesC & aTitle )

Sets the item's title text. Folder titles must be unique.

Parameters

const TDesC & aTitle The item's new title.

SetWritableL(TBool)

IMPORT_C void SetWritableL ( TBool aWritable )

Sets item to Read Only. An item can always be made Read Only, but the bookmark database must be opened as Bookmark::EVisibilityManager in order to set an item back to Read/Write. This function will leave if called on the root folder.

Bookmark::TVisibility
leave
KErrPermissionDenied This function will leave, when the bookmark database is not opened in Bookmark::EVisibilityManager.
leave
Bookmark::KErrOperationDenied This function will leave, if called on the root folder.

Parameters

TBool aWritable Whether the item is to be read only or not

Title()

IMPORT_C const TDesC & Title ( ) const

Gets the items title text.

Type()

IMPORT_C Bookmark::TType Type ( ) const

Returns the type of the object that the RBkNode handle is connected to

Member Data Documentation

CBookmarkBase * iItem

CBookmarkBase * iItem [protected]