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 voidClose()
IMPORT_C const TDesC &DescriptionL()
CBkmrkProperties *ExtendedPropertiesL()
IMPORT_C voidGetCustomPropertyL(TUid, TInt &)
IMPORT_C voidGetCustomPropertyL(TUid, TReal &)
IMPORT_C voidGetCustomPropertyL(TUid, TDes &)
IMPORT_C voidGetCustomPropertyL(TUid, TDes8 &)
IMPORT_C Bookmark::TAttachmentIdIconIdL()
IMPORT_C Bookmark::TItemIdId()
IMPORT_C TBoolIsPublic()
IMPORT_C TBoolIsWritable()
CBookmarkBase *Item()
IMPORT_C TTimeLastModifiedL()
IMPORT_C RBkBookmarkOpenBookmarkL()
IMPORT_C RBkFolderOpenFolderL()
IMPORT_C RBkFolderOpenParentL()
IMPORT_C TSecureIdOwnerL()
IMPORT_C voidSetCustomPropertyL(TUid, TInt)
IMPORT_C voidSetCustomPropertyL(TUid, TReal)
IMPORT_C voidSetCustomPropertyL(TUid, const TDesC &)
IMPORT_C voidSetCustomPropertyL(TUid, const TDesC8 &)
IMPORT_C voidSetDescriptionL(const TDesC &)
IMPORT_C voidSetIconIdL(Bookmark::TAttachmentId)
voidSetItem(CBookmarkBase &)
IMPORT_C voidSetLastModifiedL(const TTime &)
IMPORT_C voidSetOwnerL(TSecureId)
IMPORT_C voidSetParentL(RBkFolder &)
IMPORT_C voidSetPublicL(TBool)
IMPORT_C voidSetTitleL(const TDesC &)
IMPORT_C voidSetWritableL(TBool)
IMPORT_C const TDesC &Title()
IMPORT_C Bookmark::TTypeType()
Private Member Functions
voidDeleteBkmrkItem(TAny *)
voidLeaveIfRootL()
Protected Attributes
CBookmarkBase *iItem

Constructor & Destructor Documentation

RBkNode()

IMPORT_CRBkNode()

RBkNode constructor

Member Functions Documentation

Close()

IMPORT_C voidClose()

Closes the RBkNode handle and decrements the reference count

DeleteBkmrkItem(TAny *)

voidDeleteBkmrkItem(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 voidGetCustomPropertyL(TUidaPropertyId,
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 aPropertyIdThe ID of the property you wish to get
TInt & aValueAn integer the data value

GetCustomPropertyL(TUid, TReal &)

IMPORT_C voidGetCustomPropertyL(TUidaPropertyId,
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 aPropertyIdThe ID of the property you wish to get
TReal & aValueA floating point data value

GetCustomPropertyL(TUid, TDes &)

IMPORT_C voidGetCustomPropertyL(TUidaPropertyId,
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 aPropertyIdThe ID of the property you wish to get
TDes & aValueA 16 bit descriptor

GetCustomPropertyL(TUid, TDes8 &)

IMPORT_C voidGetCustomPropertyL(TUidaPropertyId,
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 aPropertyIdThe ID of the property you wish to get
TDes8 & aValueAn 8 bit descriptor

IconIdL()

IMPORT_C Bookmark::TAttachmentIdIconIdL()const

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

Id()

IMPORT_C Bookmark::TItemIdId()const

Method for querying the bookmark item's database id.

IsPublic()

IMPORT_C TBoolIsPublic()const

Returns whether the item is public or private

IsWritable()

IMPORT_C TBoolIsWritable()const

Returns whether the item is read only or not

Item()

CBookmarkBase *Item()const

Not intended for external use.

LastModifiedL()

IMPORT_C TTimeLastModifiedL()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()

voidLeaveIfRootL()const [private]

OpenBookmarkL()

IMPORT_C RBkBookmarkOpenBookmarkL()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 RBkFolderOpenFolderL()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 RBkFolderOpenParentL()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 TSecureIdOwnerL()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 voidSetCustomPropertyL(TUidaPropertyId,
TIntaValue
)

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 aPropertyIdThe ID of the property you wish to set
TInt aValueAn integer data value

SetCustomPropertyL(TUid, TReal)

IMPORT_C voidSetCustomPropertyL(TUidaPropertyId,
TRealaValue
)

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 aPropertyIdThe ID of the property you wish to set
TReal aValueA floating point data value

SetCustomPropertyL(TUid, const TDesC &)

IMPORT_C voidSetCustomPropertyL(TUidaPropertyId,
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 aPropertyIdThe ID of the property you wish to set
const TDesC & aValueA 16 bit descriptor

SetCustomPropertyL(TUid, const TDesC8 &)

IMPORT_C voidSetCustomPropertyL(TUidaPropertyId,
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 aPropertyIdThe ID of the property you wish to set
const TDesC8 & aValueAn 8 bit descriptor

SetDescriptionL(const TDesC &)

IMPORT_C voidSetDescriptionL(const TDesC &aDescription)

Sets the item's decription text.

Parameters

const TDesC & aDescriptionThe item's new description

SetIconIdL(Bookmark::TAttachmentId)

IMPORT_C voidSetIconIdL(Bookmark::TAttachmentIdaIconId =  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 &)

voidSetItem(CBookmarkBase &aItem)

Not intended for external use.

Parameters

CBookmarkBase & aItem

SetLastModifiedL(const TTime &)

IMPORT_C voidSetLastModifiedL(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 & aTimeThe time to set.

SetOwnerL(TSecureId)

IMPORT_C voidSetOwnerL(TSecureIdaOwner =  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 voidSetParentL(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 & aNewParentThe new parent folder

SetPublicL(TBool)

IMPORT_C voidSetPublicL(TBoolaPublic)

Sets the public or private status.

Parameters

TBool aPublicWhether the item is to be public or private

SetTitleL(const TDesC &)

IMPORT_C voidSetTitleL(const TDesC &aTitle)

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

Parameters

const TDesC & aTitleThe item's new title.

SetWritableL(TBool)

IMPORT_C voidSetWritableL(TBoolaWritable)

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 aWritableWhether 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::TTypeType()const

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

Member Data Documentation

CBookmarkBase * iItem

CBookmarkBase *iItem[protected]