CCalCategoryManager Class Reference

class CCalCategoryManager : public CBase

A category manager used to manipulate the categories held by the Calendar store.

There are 12 built-in category types which are specified by CCalCategory::TCalCategoryType. In addition, clients can create as many of their own categories as they like by giving a name to the category. This class is used along with the class CCalCategory to manipulate the categories in the file, for instance to add, delete and get a list of entries filtered by their category.

Inherits from

Constructor & Destructor Documentation

CCalCategoryManager()

CCalCategoryManager()[private]

~CCalCategoryManager()

IMPORT_C~CCalCategoryManager()

The destructor frees all resources owned by the entry, prior to its destruction. capability

None

Member Functions Documentation

AddCategoryL(const CCalCategory &)

IMPORT_C voidAddCategoryL(const CCalCategory &aCategory)

Adds a new user-defined category to the server's category list.

The category list is held in the calendar file. There are 12 standard categories defined in CAgnCategory::TAgnCategoryType, and any user-defined categories that have been added. capability

WriteUserData

leave

KErrAlreadyExists The category is already in the list.

leave

KErrNotReady If the calendar file is on a drive where the media has been removed.

Parameters

const CCalCategory & aCategoryThe name of the new user-defined category to add to the server's category list.

CategoryCountL()

IMPORT_C TIntCategoryCountL()const

Gets the number of categories used in the calendar file.

These are the 12 built-in categories defined in CCalCategory::TCalCategoryType, and any user-defined categories (of type CCalCategory::ECalExtended) that have been added. capability

None

The number of categories used in the agenda file.

CategoryL(TInt)

IMPORT_C CCalCategory *CategoryL(TIntaIndex)const

Allocates and returns a new category based on the one stored at the specified index in the server's category list. capability

None

A pointer to the indexed category. The caller takes ownership.

Parameters

TInt aIndexThe index of the category in the server's category list.

ConstructL(CCalSession &)

voidConstructL(CCalSession &aSession)[private]

Parameters

CCalSession & aSession

DeleteCategoryL(const CCalCategory &, MCalProgressCallBack &)

IMPORT_C voidDeleteCategoryL(const CCalCategory &aCategory,
MCalProgressCallBack &aProgressCallBack
)

Deletes a user-defined category from the server's category list and updates all entries that belong to it, asynchronously.

Note that the operation is asynchronous. The callback parameter is used to observe the progress and completion. After each step, the callback object's Progress() function is called. MCalProgressCallBack::Completed() is get called when the process is finished. If the function leaves, neither callback will be called. This method will lock the calendar file. Any request made, by any client, before this has completed will leave with KErrLocked. capability

WriteUserData

leave

KErrLocked If a previous asynchronous request has been made which is not complete yet.

Parameters

const CCalCategory & aCategoryThe category to delete from the list.
MCalProgressCallBack & aProgressCallBackThe progress callback class.

FilterCategoryL(const CCalCategory &, RPointerArray< CCalEntry > &, MCalProgressCallBack &)

IMPORT_C voidFilterCategoryL(const CCalCategory &aCategory,
RPointerArray< CCalEntry > &aEntries,
MCalProgressCallBack &aProgressCallBack
)

Gets a list of all entries that belong to the specified category, asynchronously.

Note that the operation is asynchronous. The callback parameter is used to observe the progress and completion. After each step, the callback object's Progress() function is called. The aEntries will be filled in with entries when MCalProgressCallBack::Progress() or MCalProgressCallBack::Completed() is called. If the function leaves, neither callback will be called. This method will lock the calendar file. Any request made, by any client, before this has completed will leave with KErrLocked. capability

ReadUserData

Parameters

const CCalCategory & aCategoryThe category to filter on.
RPointerArray< CCalEntry > & aEntriesOn return, contains all entries that belong to the specified category.
MCalProgressCallBack & aProgressCallBackThe progress callback class.

FilterCategoryL(const CCalCategory &, RPointerArray< CCalEntry > &)

IMPORT_C voidFilterCategoryL(const CCalCategory &aCategory,
RPointerArray< CCalEntry > &aEntries
)

Gets a list of all entries that belong to the specified category, asynchronously.

capability

ReadUserData

Parameters

const CCalCategory & aCategoryThe category to filter on.
RPointerArray< CCalEntry > & aEntriesOn return, contains all entries that belong to the specified category.

NewL(CCalSession &)

IMPORT_C CCalCategoryManager *NewL(CCalSession &aSession)[static]

Allocates and constructs a category manager. capability

None

CCalCategoryManager pointer

Parameters

CCalSession & aSessionA file handle to the calendar file.

Member Data Documentation

CCalCategoryManagerImpl * iCCalCategoryManagerImpl

CCalCategoryManagerImpl *iCCalCategoryManagerImpl[private]