»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Application Engines CALINTERIMAPI »
CCalCategoryManager
Location:
calcategorymanager.h
Link against: calinterimapi.lib
Class CCalCategoryManager
class CCalCategoryManager : public CBase;
Description
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.
Derivation
CBase
- Base class for all classes to be instantiated on the heap
CCalCategoryManager
- A category manager used to manipulate the categories held by the Calendar store
Members
Defined in CCalCategoryManager
:
AddCategoryL()
, CategoryCountL()
, CategoryL()
, DeleteCategoryL()
, FilterCategoryL()
, NewL()
, ~CCalCategoryManager()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Construction and destruction
static IMPORT_C CCalCategoryManager *NewL(CCalSession &aSession);
Description
Allocates and constructs a category manager.
Parameters
CCalSession &aSession |
A file handle to the calendar file.
|
|
Return value
IMPORT_C ~CCalCategoryManager();
Description
The destructor frees all resources owned by the entry, prior to its destruction.
IMPORT_C TInt CategoryCountL() const;
Description
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.
Return value
TInt
|
The number of categories used in the agenda file.
|
|
IMPORT_C CCalCategory *CategoryL(TInt aIndex) const;
Description
Allocates and returns a new category based on the one stored at the specified index in the server's category list.
Parameters
TInt aIndex |
The index of the category in the server's category list.
|
|
Return value
CCalCategory *
|
A pointer to the indexed category. The caller takes ownership.
|
|
Capability: |
WriteUserData |
|
IMPORT_C void AddCategoryL(const CCalCategory &aCategory);
Description
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.
Parameters
const CCalCategory &aCategory |
The name of the new user-defined category to add to the server's category list.
|
|
Leave codes
KErrAlreadyExists |
The category is already in the list.
|
|
IMPORT_C void FilterCategoryL(const CCalCategory &aCategory, RPointerArray< CCalEntry > &aEntries, MCalProgressCallBack &aProgressCallBack);
Description
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 MAgnProgressCallBack::Progress()
or MAgnProgressCallBack::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.
Parameters
Capability: |
WriteUserData |
|
IMPORT_C void DeleteCategoryL(const CCalCategory &aCategory, MCalProgressCallBack &aProgressCallBack);
Description
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. MAgnProgressCallBack::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.
Parameters
Leave codes
KErrInUse |
This can be caused by one of two reasons: either the category is not user-defined (the 12 standard categories are defined
in CAgnCategory::TAgnCategoryType and cannot be deleted), or the category is user-defined but it is in use.
|
|