nsISmsRequestManager 编辑

nsISmsRequestManager

dom/sms/interfaces/nsISmsRequestManager.idlScriptable Used to manage SMS related requests and notifications 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/smsrequestmanager;1. To create an instance, use:

var smsRequestManager = Components.classes["@mozilla.org/sms/smsrequestmanager;1"]
                        .createInstance(Components.interfaces.nsISmsRequestManager);

Method overview

long addRequest(in nsIDOMMozSmsRequest aRequest);
long createRequest(in nsIDOMMozSmsManager aManager, out nsIDOMMozSmsRequest aRequest);
void notifyCreateMessageList(in long aRequestId, in long aListId, in nsIDOMMozSmsMessage aMessage);
void notifyGetSmsFailed(in long aRequestId, in long aError);
void notifyGotNextMessage(in long aRequestId, in nsIDOMMozSmsMessage aMessage);
void notifyGotSms(in long aRequestId, in nsIDOMMozSmsMessage aMessage);
void notifyMarkedMessageRead(in long aRequestId, in bool aRead);
void notifyMarkMessageReadFailed(in long aRequestId, in long aError);
void notifyNoMessageInList(in long aRequestId);
void notifyReadMessageListFailed(in long aRequestId, in long aError);
void notifySmsDeleted(in long aRequestId, in bool aDeleted);
void notifySmsDeleteFailed(in long aRequestId, in long aError);
void notifySmsSendFailed(in long aRequestId, in long aError);
void notifySmsSent(in long aRequestId, in nsIDOMMozSmsMessage aMessage);

Constants

All SMS related errors that could apply to SmsRequest objects.

ConstantValueDescription
SUCCESS_NO_ERROR0 
NO_SIGNAL_ERROR1 
NOT_FOUND_ERROR2 
UNKNOWN_ERROR3 
INTERNAL_ERROR4 

Methods

addRequest()

Track an already existing request object.

long addRequest(
  in nsIDOMMozSmsRequest aRequest
);
Parameters
aRequest
An SmsRequest.
Return value

The request ID.

createRequest()

Create a new request object.

long createRequest(
  in nsIDOMMozSmsManager aManager,
  out nsIDOMMozSmsRequest aRequest
);
Parameters
aManager
An SmsManager.
aRequest
An SmsRequest.
Return value

The request ID.

notifyCreateMessageList()

void notifyCreateMessageList(
  in long aRequestId,
  in long aListId,
  in nsIDOMMozSmsMessage aMessage
);
Parameters
aRequestId
A number representing the id of the request.
aListId
A number representing the id of the list.
aMessage
An SmsMessage.

notifyGetSmsFailed()

void notifyGetSmsFailed(
  in long aRequestId,
  in long aError
);
Parameters
aRequestId
A number representing the id of the request.
aError
A number with an error code. See constants.

notifyGotNextMessage()

void notifyGotNextMessage(
  in long aRequestId,
  in nsIDOMMozSmsMessage aMessage
);
Parameters
aRequestId
A number representing the id of the request.
aMessage
An SmsMessage.

notifyGotSms()

void notifyGotSms(
  in long aRequestId,
  in nsIDOMMozSmsMessage aMessage
);
Parameters
aRequestId
A number representing the id of the request.
aMessage
An SmsMessage.

notifyMarkedMessageRead()

Requires Gecko 15.0(Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)
void notifyMarkedMessageRead(
  in long aRequestId
  in bool aRead
);
Parameters
aRequestId
A number representing the id of the request.
aRead
A Boolean indicating whether a message is read or unread.

notifyMarkMessageReadFailed()

Requires Gecko 15.0(Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)
void notifyMarkMessageReadFailed(
  in long aRequestId
  in long aError
);
Parameters
aRequestId
A number representing the id of the request.
aError
A number with an error code. See constants.

notifyNoMessageInList()

void notifyNoMessageInList(
  in long aRequestId
);
Parameters
aRequestId
A number representing the id of the request.

notifyReadMessageListFailed()

void notifyReadMessageListFailed(
  in long aRequestId,
  in long aError
);
Parameters
aRequestId
A number representing the id of the request.
aError
A number with an error code. See constants.

notifySmsDeleted()

void notifySmsDeleted(
  in long aRequestId,
  in bool aDeleted
);
Parameters
aRequestId
A number representing the id of the request.
aDeleted
A Boolean indictating whether the SMS is deleted.

notifySmsDeleteFailed()

void notifySmsDeleteFailed(
  in long aRequestId,
  in long aError
);
Parameters
aRequestId
A number representing the id of the request.
aError
A number with an error code. See constants.

notifySmsSendFailed()

void notifySmsSendFailed(
  in long aRequestId,
  in long aError
);
Parameters
aRequestId
A number representing the id of the request.
aError
A number with an error code. See constants.

notifySmsSent()

void notifySmsSent(
  in long aRequestId,
  in nsIDOMMozSmsMessage aMessage
);
Parameters
aRequestId
A number representing the id of the request.
aMessage
An SmsMessage.

See also

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

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

发布评论

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

词条统计

浏览:23 次

字数:12653

最后编辑:7年前

编辑次数:0 次

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