nsISmsDatabaseService 编辑

nsISmsDatabaseService

dom/sms/interfaces/nsISmsDatabaseService.idlScriptable Used to store and manage SMS text messages for the WebSMS API 1.0 66 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.

markMessageRead()

clearMessageList()

void getNextMessageInList(
  in long listId,
);
Parameters
listId
A number representing the id of the message list.
Requires Gecko 15.0(Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)
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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:98 次

字数:8596

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文