class RCbsTopicMessages : public RSubSessionBase |
Public Member Functions | |
---|---|
RCbsTopicMessages () | |
TInt | Close () |
TInt | DeleteMessage (const TCbsMessageHandle &) |
TInt | FindMessageByHandle (const TCbsMessageHandle &, TCbsMessage &) |
TInt | GetMessage ( TCbsTopicNumber , TInt , TCbsMessage &) |
TInt | GetMessageContents (const TCbsMessageHandle &, TDes &) |
TInt | GetMessageCount ( TCbsTopicNumber , TInt &) |
TInt | GetMessageIndexByHandle (const TCbsMessageHandle &, TInt &) |
IMPORT_C TInt | GetNextAndPrevMessageHandle (const TCbsMessageHandle &, TCbsMessageHandle &, TCbsMessageHandle &, TInt &) |
TInt | LockMessage (const TCbsMessageHandle &) |
TInt | Open ( RCbs &) |
TInt | ReadMessage (const TCbsMessageHandle &) |
TInt | SaveMessage (const TCbsMessageHandle &) |
TInt | DeleteMessage | ( | const TCbsMessageHandle & | aHandle | ) |
Deletes an existing message.
Note that it does not care a lot about the status of the message.
Check also the description of LockMessage method.
const TCbsMessageHandle & aHandle | It is handle to the message. |
TInt | FindMessageByHandle | ( | const TCbsMessageHandle & | aHandle, |
TCbsMessage & | aMessage | |||
) |
Finds a message by given handle.
const TCbsMessageHandle & aHandle | It is handle to the message. |
TCbsMessage & aMessage | It will contain the message information. |
TInt | GetMessage | ( | TCbsTopicNumber | aNumber, |
TInt | aIndex, | |||
TCbsMessage & | aMessage | |||
) |
Returns message information.
TCbsTopicNumber aNumber | Topic number |
TInt aIndex | It is index to the message in topic. |
TCbsMessage & aMessage | It will contain the message information. |
TInt | GetMessageContents | ( | const TCbsMessageHandle & | aHandle, |
TDes & | aBuffer | |||
) |
Returns the message contents.
const TCbsMessageHandle & aHandle | It is handle to the message. |
TDes & aBuffer | It will contain the contents (as much as it fits). |
TInt | GetMessageCount | ( | TCbsTopicNumber | aNumber, |
TInt & | aCount | |||
) |
Returns the total amount of messages the topic contains.
TCbsTopicNumber aNumber | Topic number. |
TInt & aCount | It will contain the total amount of messages. |
TInt | GetMessageIndexByHandle | ( | const TCbsMessageHandle & | aHandle, |
TInt & | aIndex | |||
) |
Returns the index of a message with given handle in topic.
Result code KErrNotFound indicates that no message was found with the given handle.
const TCbsMessageHandle & aHandle | Handle of the message |
TInt & aIndex | Return: index of the message in message topic |
IMPORT_C TInt | GetNextAndPrevMessageHandle | ( | const TCbsMessageHandle & | aCurrentMsgHandle, |
TCbsMessageHandle & | aPrevMsgHandle, | |||
TCbsMessageHandle & | aNextMsgHandle, | |||
TInt & | aPosition | |||
) |
Returns the handles of messages that precede and succeed the given message in server-side list of topic messages.
Topic is resolved from the given message handle
If the given handle specifies the first message in topic, aPosition has ECbsHead bit up. If the given handle specifies the last message in topic, aPosition has ECbsTail bit up.
Return code values: KErrNone aPrevMsgHandle, aNextMsgHandle and aPosition contain valid values. KErrNotFound aCurrentMsgHandle specified a message that was not found.
const TCbsMessageHandle & aCurrentMsgHandle | Handle that specifies the message whose surroundings are returned |
TCbsMessageHandle & aPrevMsgHandle | Returns: handle of message preceding the given message |
TCbsMessageHandle & aNextMsgHandle | Returns: handle of message succeeding the given topic |
TInt & aPosition | Returns: position of current topic in list |
TInt | LockMessage | ( | const TCbsMessageHandle & | aHandle | ) |
Locks the message.
Note that a single topic messages subsession can have at most one locked message.
Message can be unlocked by trying to lock a null message. Locked message will also be automatically unlocked when subsession is closed. If a message is locked, then it will not be deleted from the database. Thus, deleting a message or trying to delete a topic that contains such a message will fail.
Locking a message does not prevent to save the message nor read the message.
const TCbsMessageHandle & aHandle | It is handle to the message to be locked. |
TInt | Open | ( | RCbs & | aServer | ) |
Creates a subsession to the server. Before using any other method it must be called.
RCbs & aServer | It is the cbs server. |
TInt | ReadMessage | ( | const TCbsMessageHandle & | aHandle | ) |
Sets the message as read.
const TCbsMessageHandle & aHandle | It is handle to the message to be set read. |
TInt | SaveMessage | ( | const TCbsMessageHandle & | aHandle | ) |
Saves a message (i.e., the saved message won't be deleted to make room for new messages).
Return codes: KErrNone Message is saved. KErrGeneral Message not saved -- total maximum of saved messages reached.
const TCbsMessageHandle & aHandle | Handle to the message to be saved. |
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.