EPOC   SDK Home Glossary Indexes Previous Next Up

RSmsStorage class


Contents


RSmsStorage class — SMS messaging storage

Section Contents


Overview

Derivation

RTelSubSessionBase

Base class. Defines telephony sub-session.

Defined in

etelbgsm.h

Link against

gsmbas.lib

Description

This class encapsulates the functionality associated with SMS stores. Using this class, clients can open and close SMS stores, read, write and delete SMS messages from a store, determine which of a store’s message slots are filled, and receive notification when a message store is written to by another client.

This is the preferred class for working with stores, even though there is some overlap with the functionality provided by the RSmsMessaging class.

Writing derived classes

This class is not intended for user derivation


Construction and destruction


RSmsStorage() — Trivial default C++ constructor

RSmsStorage();

Description

The default C++ constructor constructs a messaging object, and initialises the member variables.


Functions to open and close message stores


Open() — Open message store

TInt Open(RSmsMessaging& aMessaging,const TDesC& aStore);

Description

This function opens a specified message store.

Arguments

RSmsMessaging& aMessaging

The messaging sub-session from which the store is to be opened.

const TDesC& aStore

The name of the message store to be opened. This can take one of the phone store type names — see SMS Phone store types.

Return value

TInt

An error code: see System error codes.

Note

Close() — Close message store

void Close();

Description

This function closes an open message store.


Query functions


GetInfo() — Get message store slot information — synchronous

TInt GetInfo(TInfo& aInfo) const;

Description

This synchronous function retrieves the total number of message storage slots, and the number of used slots in the message store. It does not give information about which slots are filled and which are empty.

Arguments

TInfo& aInfo

On return, contains the message store slot information.

Return value

TInt

An error code: see System error codes.


GetInfo() — Get message store slot information — asynchronous

void GetInfo(TRequestStatus& aStatus, TInfo& aInfo);

Description

This asynchronous function retrieves the total number of message storage slots, and the number of used slots in the message store. It does not give information about which slots are filled and which are empty.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TInfo& aInfo

On request completion, contains the message store slot information.


GetInfoCancel() — Cancel request for message store slot information

void GetInfoCancel() const;

Description

This function cancels an outstanding request for the message store slot information, placed using the asynchronous variant of the GetInfo() function.


ReadSms() — Read message from store — synchronous

TInt ReadSms(const TInt aIndex, TSmsMsgStoreEntry& aMsgEntry) const;

Description

This synchronous function reads the message in a specified slot of the message store.

Arguments

const TInt aIndex

The index of the slot from which the message is read.

TSmsMsgStoreEntry& aMsgEntry

On return, contains the read message.

Return value

TInt

An error code: see System error codes.


ReadSms() — Read message from store — asynchronous

void ReadSms(TRequestStatus& aStatus, const TInt aIndex, TSmsMsgStoreEntry& aMsgEntry);

Description

This asynchronous function reads the message in a specified slot of the message store.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

const TInt aIndex

The index of the slot from which the message is read.

TSmsMsgStoreEntry& aMsgEntry

On request completion, contains the read message.


ReadSmsCancel() — Cancel request to read SMS message in store

void ReadSmsCancel() const;

Description

This function cancels an outstanding request to read a specified message in the message store, placed using the asynchronous variant of the ReadSms() function.


WriteNotification() — Notification of changes to the message store

void WriteNotification(TRequestStatus& aStatus, TInt& aIndex);

Description

This function provides notification when a message is written to, or deleted from, the specified message store. The request completes when a new message is written to the store.

This is useful in the case where several clients are reading, writing and deleting messages from the same store.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TInt& aIndex

On request completion, contains the index of the new message.


WriteNotificationCancel() — Cancel notification of changes to the message store

void WriteNotificationCancel() const;

Description

This function cancels an outstanding request for notification of changes to the message store, placed using the WriteMessageNotification() function.


Modifier functions


Write() — Write message to store — synchronous

TInt Write(TInt& aIndex, const TSmsMsgStoreEntry& aMsg) const;

Description

This synchronous function writes a message to a message store.

Arguments

TInt& aIndex

On return, contains the index of the message slot in which the message was written.

const TSmsMsgStoreEntry& aMsg

The message to be written to the store.

Return value

TInt

An error code: see System error codes.

Notes:

Write() — Write message to store — asynchronous

void Write(TRequestStatus& aStatus, TInt& aIndex, const TSmsMsgStoreEntry& aMsg);

Description

This asynchronous function writes a message to a message store.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TInt& aIndex

On request completion, contains the index of the message slot in which the message was written.

const TSmsMsgStoreEntry& aMsg

The message to be written to the store.

Notes:

WriteCancel() — Cancel request to write a message to the store

void WriteCancel() const;

Description

This function cancels an outstanding write message request, placed using the asynchronous variant of the WriteMessage() function.


Delete() — Delete message — synchronous

TInt Delete(const TInt aIndex) const;

Description

This synchronous function deletes a message from a specified message slot.

Arguments

const TInt aIndex

The message store slot index which contains the message to be deleted.

Return value

TInt

An error code: see System error codes.


Delete() — Delete message — asynchronous

void Delete(TRequestStatus& aStatus, const TInt aIndex);

Description

This asynchronous function deletes a message from a specified message slot.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

const TInt aIndex

The index, of the slot in the message store, of the message to be deleted.


DeleteCancel() — Cancel request to delete a message

void DeleteCancel() const;

Description

This function cancels an outstanding request to delete a message, placed using the asynchronous variant of the DeleteMessage() function.


Enumerations


TStatus enum — Stored message status flags

EStatusUnread

The message is unread.

EStatusRead

The message has been read previously.

EStatusUnsent

The message has not been sent.

EStatusSent

The message has been sent.


Struct


TInfo struct — Message store slot information

TUint iUsed

The number of messages stored in a store.

TUint iTotal

The total number of messages that may be stored.


TSmsMsgStoreEntry struct — Stored message information

TSms iMsg

The actual stored message.

TStatus iStatus

The status of the stored message.

EPOC       SDK Home Glossary Indexes Previous Next Up