class CCalSession : public CBase |
A handle to the calendar file.
When the client instantiates a CCalSession, it will connect to the calendar server. In turn, the client can use its APIs, for instance to create or open a calendar file.
The agenda data in the file can be accessed as entries. To access the entries, clients should use class CCalEntryView or CCalInstanceView to process the entry data. However, both view classes require the handle to the file which is represented by this class.
A calendar file can be opened on any writable drive. Note that if the file is opened on a removable media and that media is removed, operations will leave with KErrNotReady. This error can also happen when trying to access file attachments on removed media. When this error occurs, the user should close the CCalSession and re-open it once the media has been replaced. It is recommended that when using a calendar file on removable media, the user should watch for when the media is removed / replaced using the RFs::NotifyChange API.
The session object must not be destroyed until all the objects which where created by referencing it have been destroyed.
Private Member Functions | |
---|---|
CCalSession() | |
void | ConstructL() |
void | ConstructL(CCalSession &) |
Private Attributes | |
---|---|
CCalSessionImpl * | iImpl |
IMPORT_C | ~CCalSession | ( | ) |
IMPORT_C CCalCalendarInfo * | CalendarInfoL | ( | ) | const |
IMPORT_C TCalCollectionId | CollectionIdL | ( | ) | const |
Gets the Collection ID of the currently open Calendar file. Note that:
This ID should not be persisted because it is re-generated whenever the session is connected. This ID identifies the same Calendar file as the file ID retrieved form CCalSession::FileIdL(TCalFileId& aCalFileId)
void | ConstructL | ( | CCalSession & | aCalSession | ) | [private] |
CCalSession & aCalSession |
IMPORT_C void | CreateCalFileL | ( | const TDesC & | aFileName | ) | const |
const TDesC & aFileName | The name of the file to create. This is a combination of drive letter and file name, in other words, DriveLetter:FileName, but not a full path. |
IMPORT_C void | CreateCalFileL | ( | const TDesC & | aFileName, |
const CCalCalendarInfo & | aCalendarInfo | |||
) | const |
const TDesC & aFileName | The name of the file to create. This is a combination of drive letter and file name, in other words, DriveLetter:FileName, but not a full path. |
const CCalCalendarInfo & aCalendarInfo | The calendar info to set on the file. |
IMPORT_C const TDesC & | DefaultFileNameL | ( | ) | const |
IMPORT_C void | DeleteCalFileL | ( | const TDesC & | aFileName | ) | const |
Deletes a calendar file with the supplied filename. If the file is opened, it will be closed first
This also deletes all calendar attachment files referenced from this calendar store - these are the ones moved when the calendar has taken ownership of the file through the CCalAttachment::NewL APIs. Attachment files stored on a different drive to the calendar file will not be deleted.
const TDesC & aFileName | The combination of drive letter and file name, in other words, DriveLetter:FileName, but not a full path |
IMPORT_C void | DisableChangeBroadcast | ( | ) |
IMPORT_C void | DisablePubSubNotificationsL | ( | ) |
IMPORT_C void | EnableChangeBroadcast | ( | ) |
IMPORT_C void | EnablePubSubNotificationsL | ( | ) |
IMPORT_C void | FileIdL | ( | TCalFileId & | aCalFileId | ) | const |
TCalFileId & aCalFileId | On return will be the file ID of the currently open Calendar file. The file ID will be set to KNullFileId if the file is not opened. |
IMPORT_C void | GetFileNameL | ( | TCalPubSubData | aPubSubData, |
TDes & | aFileName | |||
) | const |
TCalPubSubData aPubSubData | The publish and subscribe data. |
TDes & aFileName | On return will be the full file name. |
IMPORT_C TBool | IsFileNameL | ( | TCalPubSubData | aPubSubData, |
const TDesC & | aFileName | |||
) | const |
TCalPubSubData aPubSubData | The publish and subscribe data. |
const TDesC & aFileName | The full file name to test. |
IMPORT_C TBool | IsOpenedFileL | ( | TCalPubSubData | aPubSubData | ) | const |
TCalPubSubData aPubSubData | The publish and subscribe data. |
IMPORT_C CDesCArray * | ListCalFilesL | ( | ) | const |
The calendar files can be stored on any drive.
Since the directories are not seen by clients, the filenames returned are a combination of drive letter and file name, in other words DriveLetter:FileName
The files are ordered alphabetically by drive letter. Files on the same drive are ordered by filename, for instance a:agenda, c:agenda, c:calendar, d:agenda, d:calendar.
IMPORT_C CCalSession * | NewL | ( | ) | [static] |
IMPORT_C CCalSession * | NewL | ( | CCalSession & | aCalSession | ) | [static] |
Allocates and constructs a session to the Calendar server
CCalSession & aCalSession | A reference to CalSession which is created beforehand. |
IMPORT_C void | OpenL | ( | const TDesC & | aFileName | ) | const |
Opens an calendar file using the server.
const TDesC & aFileName | The agenda file to open. This is a combination of drive letter and file name, in other words, DriveLetter:FileName, but not a full path. It leaves if a path is included explicitly. A default file is opened if aFileName is KNullDesC. |
IMPORT_C void | OpenL | ( | const TDesC & | aFileName, |
CalCommon::TCalFileVersionSupport & | aFileSupportStatus | |||
) | const |
Opens a calendar file using the server.
const TDesC & aFileName | The agenda file to open. This is a combination of drive letter and file name, in other words, DriveLetter:FileName, but not a full path. The default file is opened if aFileName is KNullDesC. |
CalCommon::TCalFileVersionSupport & aFileSupportStatus | On return indicates whether or not the calendar file needs to be converted from an older version. File conversion takes place when opening the first instance view or entry view. |
IMPORT_C void | SetCalendarInfoL | ( | const CCalCalendarInfo & | aCalendarInfo | ) | const |
const CCalCalendarInfo & aCalendarInfo | The calendar info to set on the file. |
IMPORT_C void | StartChangeNotification | ( | MCalChangeCallBack2 & | aCallBack, |
const CCalChangeNotificationFilter & | aFilter | |||
) |
Start notification of any changes to calendar entries. These changes can be filtered, and when a change occurs the MCalChangeCallBack2 callback function is called with details about the entry which has changed (TCalLocalUid and entry type) and the type of change (add/delete/modify).
MCalChangeCallBack2 & aCallBack | The class to notify when a change occurs. |
const CCalChangeNotificationFilter & aFilter | Filter notifications to only notify on certain types of entries. |
IMPORT_C void | StartChangeNotification | ( | MCalChangeCallBack * | aCallBack, |
MCalChangeCallBack::TChangeEntryType | aChangeEntryType, | |||
TBool | aIncludeUndatedTodos, | |||
TTime | aFilterStartTime, | |||
TTime | aFilterEndTime | |||
) |
Start notification of any changes to calendar entries. These changes can be filtered, and when a change occurs the MCalChangeCallBack callback function is called with the type of entry which has changed (event or todo).
MCalChangeCallBack * aCallBack | The class to notify when a change occurs. |
MCalChangeCallBack::TChangeEntryType aChangeEntryType | Filter notifications to only notify on entries of the specified type (event/todo/all). |
TBool aIncludeUndatedTodos | Filter notifications to include undated todos. |
TTime aFilterStartTime | Filter notification to only include entries that are wholly or partly covered by a time range. This specifies the start time of the time range. |
TTime aFilterEndTime | Filter notification to only include entries that are wholly or partly covered by a time range. This specifies the end time of the time range. |
IMPORT_C void | StartFileChangeNotificationL | ( | MCalFileChangeObserver & | aCallBack | ) |
Start notification of changes to calendar files. When a change occurs, the MCalFileChangeObserver callback function is called with change types (see MCalFileChangeObserver::TChangeType) about the files.
MCalFileChangeObserver & aCallBack | The class to notify when a change occurs. |
IMPORT_C void | StopChangeNotification | ( | ) |
IMPORT_C void | StopFileChangeNotification | ( | ) |
IMPORT_C TInt | _DebugRequestAllocatedCellsL | ( | ) |
IMPORT_C void | _DebugSetHeapFailL | ( | RAllocator::TAllocFail | aFail, |
TInt | aRate | |||
) |
Simulates a heap allocation failure for the server-side heap. Debug only.
The failure occurs on subsequent calls to new or any of the functions which allocate memory from the server-side heap.
The timing of the allocation failure depends on the type of allocation failure requested, i.e. on the value of aFail.
The simulation of heap allocation failure is cancelled if aFail is given the value RAllocator::ENone.
Notes:
1. If the failure type is RAllocator::EFailNext, the next attempt to allocate from the server-side heap fails; however, no further failures will occur.
2. For failure types RAllocator::EFailNext and RAllocator::ENone, set aRate to 1.
RAllocator::TAllocFail aFail | An enumeration which indicates how to simulate heap allocation failure. |
TInt aRate | The rate of failure; when aType is RAllocator::EDeterministic, heap allocation fails every aRate attempt. |
IMPORT_C void | __dbgClearTzClientCacheL | ( | TBool | aRestartCaching | ) |
TBool aRestartCaching | Set to ETrue if caching needs to be restarted after clearing current cache. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.