nsISmsDatabaseService

nsISmsDatabaseService

Used to store and manage SMS text messages for the WebSMS API
1.0
28
Introduced
Gecko 13.0
Inherits from: nsISupports Last changed in Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)

Implemented by: @mozilla.org/sms/smsdatabaseservice;1. To create an instance, use:

var smsService = Components.classes["@mozilla.org/sms/smsdatabaseservice;1"]
                 .createInstance(Components.interfaces.nsISmsDatabaseService);

Method overview

long saveReceivedMessage(in DOMString aSender, in DOMString aBody, in unsigned long long aDate);
long saveSentMessage(in DOMString aReceiver, in DOMString aBody, in unsigned long long aDate);
void getMessage(in long messageId, in long requestId, [optional] in unsigned long long processId);
void deleteMessage(in long messageId, in long requestId, [optional] in unsigned long long processId);
void createMessageList(in nsIDOMMozSmsFilter filter, in boolean reverse, in long requestId, [optional] in unsigned long long processId);
void getNextMessageInList(in long listId, in long requestId, [optional] in unsigned long long processId);
void clearMessageList(in long listId);
void markMessageRead(in long messageId, in boolean value, in long requestId, [optional] in unsigned long long processId)

Methods

saveReceivedMessage()

void saveReceivedMessage(
  in DOMString aSender,
  in DOMString aBody,
  in unsigned long long aDate
);
Parameters
aSender
A DOMString with the sender of the text message.
aBody
A DOMString containing the body text of the message.
aDate
The timestamp of the message.

saveSentMessage()

void saveSentMessage(
  in DOMString a Receiver,
  in DOMString aBody,
  in unsigned long long aDate
);
Parameters
aReceiver
A DOMString with the receiver of the text message.
aBody
A DOMString containing the body text of the message.
aDate
The timestamp of the message.

getMessage()

void getMessage(
  in long messageId,
  in long requestId, 
  [optional] in unsigned long long processId
);
Parameters
messageId
A number representing the id of the message.
requestId
A number representing the id of the request.
processId Optional
A number representing the id of the process.

deleteMessage()

void deleteMessage(
  in long messageId,
  in long requestId, 
  [optional] in unsigned long long processId
);
Parameters
messageId
A number representing the id of the message.
requestId
A number representing the id of the request.
processId Optional
A number representing the id of the process.

createMessageList()

void createMessageList(
  in nsIDOMMozSmsFilter filter,
  in boolean reverse,
  in long requestId,
  [optional] in unsigned long long processId
);
Parameters
filter
A SmsFilter to filter out SMS messages from a list.
reverse
A Boolean indicating whether to reverse the ordering.
requestId
A number representing the id of the request.
processId Optional
A number representing the id of the process.

getNextMessageInList()

void getNextMessageInList(
  in long listId,
  in long requestId, 
  [optional] in unsigned long long processId
);
Parameters
listId
A number representing the id of the message list.
requestId
A number representing the id of the request.
processId Optional
A number representing the id of the process.

clearMessageList()

void getNextMessageInList(
  in long listId,
);
Parameters
listId
A number representing the id of the message list.

(Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)

markMessageRead()

void markMessageRead(
  in long messageId, 
  in boolean value,
  in long requestId, 
  [optional] in unsigned long long processId
);
Parameters
messageId
A number representing the id of the message.
value
A Boolean indicating whether a message is read or unread.
requestId
A number representing the id of the request.
processId Optional
A number representing the id of the process.

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, fscholz
 Last updated by: Sheppy,