class RAgendaServ : public RSessionBase |
The client interface to the agenda server.
This class accesses agenda data by sending messages synchronously to the server. This allows shared access to an agenda file by more than one client.
Most functions in this class should not be used directly. If there is a corresponding version of the function in the model class, that should be used instead.
Note that a separate instance of the RAgendaServ class is required for each agenda file that is open. Only one file can be open at any one time in the same server session.
The API is used as follows:
RAgendaServ* agnServer = RAgendaServ::NewL(); // allocate and construct server session CleanupStack::PushL(agnServer); // ensure object is deleted agnServer->Connect(); // connect to the server CleanupClosePushL(*agnServer); // ensure that the session's Close() method gets called CAgnEntryModel* model = CAgnEntryModel::NewL(); // allocate and construct model CleanupStack::PushL(model); model->SetServer(agnServer); // set model's server session pointer model->OpenL(fileName) // open file using server // ...Use agenda model API as normal - invokes corresponding server functions CleanupStack::PopAndDestroy(3); // model, close session with server, agnServer
Private Member Functions | |
---|---|
RAgendaServ() | |
void | ConstructL() |
CAgnEntry * | CreateEntryFromBufferStreamL(RReadStream &) |
CBufFlat * | CreateTransmitBufferL(TInt) |
TInt | DoConnect() |
void | ExternalizeFilterL(const TAgnFilter &, RWriteStream &) |
TBool | FindSession(const CCalSessionImpl &) |
CAgnSimpleEntry * | InternalizeSimpleEntryL(RReadStream &) |
void | LoadingInstancesFromBufferL(CArrayFix< TAgnInstance > &, TInt) |
void | Panic(TAgnClientPanic) |
CAgnEntry * | ReadEntryFromServerSessionL(TInt) |
void | SendFileAttachmentHandlesL(CAgnEntry &, TInt64) |
TInt | ServerRequestL(TInt, TAny *, TAny *, TAny *, TAny *) |
TInt | StartServer() |
void | TransferFileHandleToServerL(TCalLocalUid, TInt, CAgnAttachmentFile &, TInt64) |
void | WriteBinaryDataToNewAttachmentFileL(CAgnEntry &, TInt, TInt64) |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Private Attributes | |
---|---|
CBufFlat * | iBuffer |
RPointerArray< CCalSessionImpl > | iCalSessions |
TInt | iLastSessionId |
TInt | iReferenceCount |
CAgnSimpleEntryAllocator * | iSimpleEntryAllocator |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
~RAgendaServ | ( | ) |
The destructor frees all resources owned by the server, prior to its destruction.
void | AddCategoryToListL | ( | const TDesC & | aName, |
TInt64 | aFileId | |||
) |
adds a category to the list capability
WriteUserData
TAgnEntryId | AddEntryL | ( | CAgnEntry & | aEntry, |
TInt64 | aFileId | |||
) |
Add a new enty to the server capability
WriteUserData
capability
ReadUserData
void | AddSessionL | ( | const CCalSessionImpl & | aSession, |
TInt & | aSessionId | |||
) |
const CCalSessionImpl & aSession | |
TInt & aSessionId |
TBool | AgendaFileExistsL | ( | const TDesC & | aFileName | ) |
const TDesC & aFileName |
void | CancelChangeNotification | ( | TInt | aSessionId, |
TUint8 | aNotificaitonType | |||
) |
TInt | CategoryCountL | ( | TInt64 | aFileId | ) |
returns the number of categories in the category list capability
None
TInt64 aFileId |
CAgnCategory * | CategoryL | ( | TInt | aIndex, |
TInt64 | aFileId | |||
) |
returns a category created from the category at aIndex in the category list capability
ReadUserData
void | CloseAgenda | ( | TInt | aSessionId | ) |
Closes the file that is open in the current agenda server session. capability
None
TInt aSessionId |
void | CommitL | ( | TCalCollectionId | aCalCollectionId | ) |
capability
WriteUserData
TCalCollectionId aCalCollectionId |
TInt | Connect | ( | ) |
Connects the client process to the agenda server.
This function must be called before the server can be used.
An error code. KErrNone if successful.
void | CreateAgendaFileL | ( | const TDesC & | aFileName | ) |
capability
WriteUserData
const TDesC & aFileName |
CAgnEntry * | CreateEntryFromBufferStreamL | ( | RReadStream & | readStream | ) | const [private] |
RReadStream & readStream |
TBool | CreateEntryIteratorL | ( | TInt64 | aFileId | ) |
Creates an iterator for iterating though all the entries in the file.
This may be used for activities such as merging or finding. The function returns EFalse if no entries are available. If any entries are available, the iterator is set to the first one.
Although this API does not have a trailing L it can leave
capability
None
ETrue if there are entries in the file. EFalse if there are none.
TInt64 aFileId |
CBufFlat * | CreateTransmitBufferL | ( | TInt | aBufferSize | ) | const [private] |
Checks the size of the incoming buffer, and if it is larger than the size of the buffer already defined, allocates enough space in aBuffer, and transfers the data from the server
capability
ReadUserData
TInt aBufferSize |
void | DeleteAgendaFileL | ( | const TDesC & | aFileName, |
TInt | aSessionId | |||
) |
capability
WriteUserData
void | DeleteEntryByGuidL | ( | const TDesC8 & | aGuid, |
TBool | aCommitAndNotify, | |||
TInt64 | aFileId | |||
) |
capability
WriteUserData
void | DeleteEntryL | ( | TAgnEntryId | aEntryId, |
TCalCollectionId | aCalCollectionId | |||
) |
capability
WriteUserData
TAgnEntryId aEntryId | |
TCalCollectionId aCalCollectionId |
void | DeleteEntryL | ( | const RArray< TCalLocalUid > & | aIds, |
TCalCollectionId | aCalCollectionId | |||
) |
capability
WriteUserData
const RArray< TCalLocalUid > & aIds | |
TCalCollectionId aCalCollectionId |
void | DeleteSimpleEntry | ( | CAgnSimpleEntry * | aSimpleEntry | ) |
Deletes a sort entry from the sort entry allocator (a specialised memory handler for sort entry objects).
A sort entry is an entry in an agenda index. The function frees the sort entry object and puts it on the free list.
CAgnSimpleEntry * aSimpleEntry | Pointer to the simple entry to delete. |
void | DestroyInstanceIterator | ( | TInt | aIteratorId | ) |
Destroy instance iterator with specified iterator id capability
ReadUserData
TInt aIteratorId |
void | EntriesReferencingFileAttachmentL | ( | RArray< TCalLocalUid > & | aUids, |
const CAgnAttachment & | aAttachment, | |||
TInt64 | aFileId | |||
) |
Fetch local UIDs of all entries that reference the attachment specified. capability
ReadUserData
RArray< TCalLocalUid > & aUids | |
const CAgnAttachment & aAttachment | |
TInt64 aFileId |
TBool | EntryIteratorNextL | ( | TInt64 | aFileId | ) |
Moves the entry iterator to the next entry.
Returns EFalse if no more entries exist.
Although this API does not have a trailing L it can leave
capability
None
ETrue if there is are more entries. EFalse if there are no more entries.
TInt64 aFileId |
void | ExternalizeFilterL | ( | const TAgnFilter & | aFilter, |
RWriteStream & | aStream | |||
) | const [private] |
const TAgnFilter & aFilter | |
RWriteStream & aStream |
CAgnAttachment * | FetchAttachmentByIdL | ( | TUint32 | aAttachUid, |
TInt64 | aFileId | |||
) |
void | FetchAttachmentsL | ( | CCalAttachmentIteratorImpl & | aIteratorImpl, |
CCalAttachmentManager::TSortOrder | aSortOrder, | |||
TInt64 | aFileId | |||
) |
Fetch all file attachments in the order specified and add them to the iterator. capability
ReadUserData
CCalAttachmentIteratorImpl & aIteratorImpl | |
CCalAttachmentManager::TSortOrder aSortOrder | |
TInt64 aFileId |
void | FetchEntryByGuidL | ( | const TDesC8 & | aGuid, |
RPointerArray< CAgnEntry > & | aList, | |||
TInt64 | aFileId | |||
) | const |
capability
ReadUserData
const TDesC8 & aGuid | |
RPointerArray< CAgnEntry > & aList | |
TInt64 aFileId |
CAgnEntry * | FetchEntryByIteratorL | ( | TInt64 | aFileId | ) |
Retrieves the ID for the entry at the current iterator position.
The ID can be used to retrieve the entry using CAgnEntryModel::FetchEntryL().
capability
None
The ID for the entry at the current iterator position
TInt64 aFileId |
CAgnEntry * | FetchEntryL | ( | TAgnEntryId & | aId, |
TInt64 | aFileId | |||
) | const |
Fetches a complete entry from the server capability
ReadUserData
TAgnEntryId & aId | |
TInt64 aFileId |
CAgnEntry * | FetchEntryL | ( | TCalLocalUid | aId, |
TInt64 | aFileId | |||
) | const |
Fetches a complete entry from the server capability
ReadUserData
TCalLocalUid aId | |
TInt64 aFileId |
void | FetchFileHandleL | ( | RFile & | aFileHandle, |
TUint32 | aAttachmentUid, | |||
TInt64 | aFileId | |||
) |
void | FetchSimpleEntriesByGuidL | ( | const TDesC8 & | aUid, |
RPointerArray< CAgnSimpleEntry > & | aLiteEntries, | |||
RArray< TInt > | aCalCollectionIds | |||
) | const |
Get an array of lite entries from the server
On return the instance ids and lite entries will have corresponding indices in the arrays (Lite-entries are just time information, with no text, etc)
capability
ReadUserData
const TDesC8 & aUid | The UID of the lite entries to fetch |
RPointerArray< CAgnSimpleEntry > & aLiteEntries | on return will contain the fetched lite entries. |
RArray< TInt > aCalCollectionIds |
void | FilterCategoryL | ( | CArrayFixSeg< TAgnEntryId > & | aEntries, |
TInt64 | aFileId | |||
) |
package up step size and category capability
None
CArrayFixSeg< TAgnEntryId > & aEntries | |
TInt64 aFileId |
void | FilterCategorySynchronouslyL | ( | const CAgnCategory & | aCategory, |
TCalCollectionId | aCalCollectionId | |||
) |
const CAgnCategory & aCategory | |
TCalCollectionId aCalCollectionId |
void | FindInstancesL | ( | RArray< TInt64 > & | aCalCollectionIds, |
CArrayFix< TAgnInstance > & | aInstances, | |||
const TFindInstanceParams & | aParams | |||
) |
capability
ReadUserData
RArray< TInt64 > & aCalCollectionIds | |
CArrayFix< TAgnInstance > & aInstances | |
const TFindInstanceParams & aParams |
TBool | FindSession | ( | const CCalSessionImpl & | aSession | ) | [private] |
const CCalSessionImpl & aSession |
CCalCalendarInfoImpl * | GetCalendarInfoLC | ( | const TDesC & | aFilename, |
CCalSessionImpl & | aSessionImpl | |||
) | const |
capability
ReadUserData
const TDesC & aFilename | |
CCalSessionImpl & aSessionImpl |
void | GetChangesSinceLastNotificationL | ( | RArray< TCalChangeEntry > & | aChangeItems, |
TCalCollectionId | aCalCollectionId, | |||
TCalFileId & | aFileId | |||
) |
capability
ReadUserData
RArray< TCalChangeEntry > & aChangeItems | |
TCalCollectionId aCalCollectionId | |
TCalFileId & aFileId |
void | GetEntryUidsSinceDateL | ( | RArray< TCalLocalUid > & | aUids, |
const TTime & | aFilter, | |||
TInt64 | aFileId | |||
) |
Place the uids of entries that have a last changed data greater than aDate and which meet the selection criteria specified in aFilter into the aUids array. capability
None
RArray< TCalLocalUid > & aUids | |
const TTime & aFilter | |
TInt64 aFileId |
void | GetFileChangesSinceLastNotificationL | ( | RPointerArray< CAgnFileChangeInfo > & | aAgnFileChangeInfo, |
TInt | aSessionId | |||
) |
RPointerArray< CAgnFileChangeInfo > & aAgnFileChangeInfo | |
TInt aSessionId |
HBufC8 * | GetPropertyValueL | ( | const TDesC & | aFilename, |
TStreamId | aStreamId | |||
) | const |
capability
ReadUserData
CAgnSimpleEntry * | GetSimpleEntryL | ( | const TAgnEntryId & | aId, |
TCalCollectionId | aCalCollectionId | |||
) | const |
Get a lite entry from the server (Lite-entries are just time information, with no text, etc) capability
ReadUserData
const TAgnEntryId & aId | |
TCalCollectionId aCalCollectionId |
CAgnSimpleEntry * | GetSimpleEntryL | ( | TCalCollectionId | aShortFileId, |
TUint32 | aId | |||
) | const |
Get a lite entry from the server (Lite-entries are just time information, with no text, etc) capability
ReadUserData
TCalCollectionId aShortFileId | |
TUint32 aId |
void | GetSimpleEntryL | ( | const RArray< TAgnInstance > & | aEntryIds, |
RPointerArray< CAgnSimpleEntry > & | aLiteEntries | |||
) | const |
Get an array of lite entries from the server
On return the instance ids and lite entries will have corresponding indices in the arrays (Lite-entries are just time information, with no text, etc)
capability
ReadUserData
const RArray< TAgnInstance > & aEntryIds | |
RPointerArray< CAgnSimpleEntry > & aLiteEntries | on return will contain the fetched lite entries. |
TInt | InstanceIteratorCountL | ( | TInt | aIteratorId | ) | const |
Get the number of instances stored in an iterator capability
ReadUserData
TInt aIteratorId |
TInt | InstanceIteratorLocateIndexL | ( | TInt | aIteratorId, |
TAgnInstance & | aInstanceId | |||
) |
Find the index of the given instance in the iterator. capability
ReadUserData
TInt aIteratorId | |
TAgnInstance & aInstanceId |
void | InstanceIteratorNextL | ( | TInt | aIteratorId, |
CArrayFix< TAgnInstance > & | aInstances, | |||
TInt | aIndex | |||
) | const |
Fetch the available instances start from specified index capability
ReadUserData
TInt aIteratorId | |
CArrayFix< TAgnInstance > & aInstances | |
TInt aIndex |
void | InstanceIteratorPreviousL | ( | TInt | aIteratorId, |
CArrayFix< TAgnInstance > & | aInstances, | |||
TInt | aIndex | |||
) | const |
Fetch the previous instances which index are before given index capability
ReadUserData
TInt aIteratorId | |
CArrayFix< TAgnInstance > & aInstances | |
TInt aIndex |
CAgnSimpleEntry * | InternalizeSimpleEntryL | ( | RReadStream & | aStream | ) | const [private] |
RReadStream & aStream |
void | LoadingInstancesFromBufferL | ( | CArrayFix< TAgnInstance > & | aInstances, |
TInt | aBufSize | |||
) | const [private] |
CArrayFix< TAgnInstance > & aInstances | |
TInt aBufSize |
RAgendaServ * | NewL | ( | ) | [static] |
Constructs a new RAgendaServ, initialising all member data to NULL.
A pointer to the client interface to the agenda server.
void | NextInstancesL | ( | const RArray< TInt64 > | aFileIds, |
CArrayFix< TAgnInstance > & | aInstances, | |||
const TFindInstanceParams & | aParams | |||
) | const |
Finds the next instances in the calendar store
capability
ReadUserData
const RArray< TInt64 > aFileIds | |
CArrayFix< TAgnInstance > & aInstances | The next instances. Note that the instances will be appended to the end of the array |
const TFindInstanceParams & aParams | The filter settings to use when finding the next instances |
void | OpenAgendaL | ( | const CCalSessionImpl & | aSession, |
const TDesC & | aFileName, | |||
CalCommon::TCalFileVersionSupport & | status, | |||
TInt64 & | aFileId, | |||
TCalCollectionId & | aCollectionId | |||
) |
capability
None
const CCalSessionImpl & aSession | |
const TDesC & aFileName | |
CalCommon::TCalFileVersionSupport & status | |
TInt64 & aFileId | |
TCalCollectionId & aCollectionId |
void | Panic | ( | TAgnClientPanic | aPanic | ) | const [private] |
TAgnClientPanic aPanic |
void | PreviousInstancesL | ( | const RArray< TInt64 > | aFileIds, |
CArrayFix< TAgnInstance > & | aInstances, | |||
TFindInstanceParams & | aParams | |||
) | const |
Finds previous instances in the calendar store
capability
ReadUserData
const RArray< TInt64 > aFileIds | |
CArrayFix< TAgnInstance > & aInstances | The previous instances. Note that the instances will be inserted at the begining of the array |
TFindInstanceParams & aParams | The filter settings to use when fidning the previous instances |
CAgnEntry * | ReadEntryFromServerSessionL | ( | TInt | aBufferSize | ) | const [private] |
TInt aBufferSize |
TBool | RemoveSession | ( | const CCalSessionImpl & | aSession | ) |
const CCalSessionImpl & aSession |
void | RequestChangeNotification | ( | TRequestStatus & | aStatus, |
TInt | aSessionId, | |||
TUint8 | aNotificaitonType | |||
) |
TRequestStatus & aStatus | |
TInt aSessionId | |
TUint8 aNotificaitonType |
void | RequestProgress | ( | TRequestStatus & | aStatus, |
TCalCollectionId | aCalCollectionId | |||
) |
TRequestStatus & aStatus | |
TCalCollectionId aCalCollectionId |
CAgnContent * | RestoreAlarmActionL | ( | TStreamId | aId, |
TInt64 | aFileId | |||
) |
capability
ReadUserData
HBufC * | RestoreTextL | ( | TStreamId | aId, |
TInt64 | aFileId | |||
) |
Restore the notes text from the server capability
ReadUserData
void | Rollback | ( | TCalCollectionId | aCalCollectionId | ) |
capability
WriteUserData
TCalCollectionId aCalCollectionId |
void | SendFileAttachmentHandlesL | ( | CAgnEntry & | aEntry, |
TInt64 | aFileId | |||
) | [private] |
For all attachments on this entry, find out whether they are file attachments. If it contains a file handle, then it must be transferred to the server through a separate IPC call (TransferFileHandleToServerL). If it contains binary data, then a file handle must be fetched from the server, to which the binary data will be written directly (WriteBinaryDataToNewAttachmentFileL).
TInt | ServerRequestL | ( | TInt | aCommand, |
TAny * | aArg1 = NULL, | |||
TAny * | aArg2 = NULL, | |||
TAny * | aArg3 = NULL, | |||
TAny * | aArg4 = NULL | |||
) | const [private] |
void | SetCalendarInfoL | ( | const TDesC & | aFilename, |
const CCalCalendarInfoImpl & | aCalendarInfo | |||
) | const |
capability
WriteUserData
const TDesC & aFilename | |
const CCalCalendarInfoImpl & aCalendarInfo |
void | SetChangeNotificationParametersL | ( | MCalChangeCallBack2::TChangeEntryType | aEntryType, |
TBool | aIncludeUndatedTodos, | |||
TTime | aFilterStartTimeUtc, | |||
TTime | aFilterEndTimeUtc, | |||
TInt64 | aFileId | |||
) |
MCalChangeCallBack2::TChangeEntryType aEntryType | |
TBool aIncludeUndatedTodos | |
TTime aFilterStartTimeUtc | |
TTime aFilterEndTimeUtc | |
TInt64 aFileId |
void | SetEnablePubSubNotificationsL | ( | TBool | aEnablePubSubNotifacation, |
TInt64 | aFileId | |||
) |
void | StartBuildIndex | ( | TBool | aNeedProgressReport, |
TRequestStatus & | aStatus, | |||
TCalCollectionId | aCalCollectionId | |||
) |
Start building the Indexes asynchronously.
TBool aNeedProgressReport | |
TRequestStatus & aStatus | |
TCalCollectionId aCalCollectionId |
void | StartCategoryTaskL | ( | TBool | aReportProgress, |
TRequestStatus & | aStatus, | |||
const CAgnCategory & | aCategory, | |||
CCalAsyncTaskManager::TAsyncAction | aTask, | |||
TCalCollectionId | aCalCollectionId | |||
) |
capability
WriteUserData
TBool aReportProgress | |
TRequestStatus & aStatus | |
const CAgnCategory & aCategory | |
CCalAsyncTaskManager::TAsyncAction aTask | |
TCalCollectionId aCalCollectionId |
void | StartTidyByDateL | ( | TBool | aReportProgress, |
TRequestStatus & | aStatus, | |||
const TAgnFilter & | aFilter, | |||
const TTime & | aTodaysDate, | |||
const CalCommon::TCalTimeRange & | aCalTimeRange, | |||
TCalCollectionId | aCalCollectionId | |||
) |
Start tidying by ToDo list asynchronously. capability
WriteUserData
capability
ReadUserData
TBool aReportProgress | |
TRequestStatus & aStatus | |
const TAgnFilter & aFilter | |
const TTime & aTodaysDate | |
const CalCommon::TCalTimeRange & aCalTimeRange | |
TCalCollectionId aCalCollectionId |
TStreamId | StoreAlarmActionL | ( | const CAgnContent & | aAlarmAction | ) |
const CAgnContent & aAlarmAction |
void | TransferFileHandleToServerL | ( | TCalLocalUid | aLocalUid, |
TInt | aAttachmentIndex, | |||
CAgnAttachmentFile & | aFileAttachment, | |||
TInt64 | aFileId | |||
) | [private] |
Store a new attachment with a file handle. The file handle is transferred to the Calendar server, which moves the file to the Calendar store. On the server-side, this will also update the entry containing this attachment with the new attachment metadata. capability
WriteUserData
TCalLocalUid aLocalUid | |
TInt aAttachmentIndex | |
CAgnAttachmentFile & aFileAttachment | |
TInt64 aFileId |
TTime | TzRulesLastModifiedDateL | ( | TInt64 | aFileId | ) |
Get the last modified time for tz rules from time zone server It is called when the client getting the last modified date for an entry since the last modified time of an entry is not updated when tz database is updated. capability
none
TInt64 aFileId |
void | UpdateEntryL | ( | CAgnEntry & | aEntry, |
TBool | aDeleteChildren, | |||
TCalCollectionId | aCalCollectionId | |||
) |
Updates an existing entry on the server capability
WriteUserData
capability
ReadUserData
leave
CAgnEntry & aEntry | |
TBool aDeleteChildren | |
TCalCollectionId aCalCollectionId |
void | WaitUntilLoadedL | ( | TCalCollectionId | aCalCollectionId | ) |
TCalCollectionId aCalCollectionId |
void | WriteBinaryDataToNewAttachmentFileL | ( | CAgnEntry & | aEntry, |
TInt | aAttachmentIndex, | |||
TInt64 | aFileId | |||
) | [private] |
Store a new attachment from binary data. A new file handle is created on the Calendar server, and this is transferred to the client side so that the binary data can be written directly. On the server-side, this will also update the entry containing this attachment with the new attachment metadata. capability
WriteUserData
TInt | _DebugRequestAllocatedCellsL | ( | ) |
Gets the number of allocated cells in the server space, debug only. capability
None
TInt | _DebugRequestAllocatedHeapSizeL | ( | ) |
Gets the number of allocated cells in the server space, debug only. capability
None
void | _DebugSetHeapFailL | ( | TInt | aHeapAllocationFailureFlag, |
TInt | aCount | |||
) |
Set heap allocation failure according the arguments, debug only. capability
None
void | __dbgClearTzClientCacheL | ( | TBool | aRestartCaching | ) |
capability
none
TBool aRestartCaching |
CAgnSimpleEntryAllocator * | iSimpleEntryAllocator | [private] |