2012-02-19 15:44:29 -08:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIDOMMozSmsMessage;
|
|
|
|
interface nsIDOMMozSmsRequest;
|
2012-03-12 17:56:07 -07:00
|
|
|
interface nsIDOMMozSmsManager;
|
2012-02-19 15:44:29 -08:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
#define SMS_REQUEST_MANAGER_CID \
|
|
|
|
{ 0xa97a3129, 0x1e0b, 0x45da, \
|
|
|
|
{ 0xa3, 0x85, 0xcf, 0xe5, 0xb0, 0xb1, 0xc4, 0x8f } }
|
|
|
|
#define SMS_REQUEST_MANAGER_CONTRACTID "@mozilla.org/sms/smsrequestmanager;1"
|
|
|
|
%}
|
|
|
|
|
2012-05-17 12:42:38 -07:00
|
|
|
[scriptable, uuid(be747cca-ba07-410a-8b91-2754d5406d66)]
|
2012-02-19 15:44:29 -08:00
|
|
|
interface nsISmsRequestManager : nsISupports
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* All SMS related errors that could apply to SmsRequest objects.
|
|
|
|
* Make sure to keep this list in sync with the list in:
|
|
|
|
* embedding/android/GeckoSmsManager.java
|
|
|
|
*/
|
2012-02-19 15:44:29 -08:00
|
|
|
const unsigned short SUCCESS_NO_ERROR = 0;
|
|
|
|
const unsigned short NO_SIGNAL_ERROR = 1;
|
|
|
|
const unsigned short NOT_FOUND_ERROR = 2;
|
|
|
|
const unsigned short UNKNOWN_ERROR = 3;
|
|
|
|
const unsigned short INTERNAL_ERROR = 4;
|
2012-02-19 15:44:29 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new request object.
|
|
|
|
*
|
|
|
|
* @return the request ID.
|
|
|
|
*/
|
2012-03-12 17:56:07 -07:00
|
|
|
long createRequest(in nsIDOMMozSmsManager aManager,
|
2012-02-19 15:44:29 -08:00
|
|
|
out nsIDOMMozSmsRequest aRequest);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Track an already existing request object.
|
|
|
|
*
|
|
|
|
* @return the request ID.
|
|
|
|
*/
|
|
|
|
long addRequest(in nsIDOMMozSmsRequest aRequest);
|
|
|
|
|
|
|
|
void notifySmsSent(in long aRequestId,
|
|
|
|
in nsIDOMMozSmsMessage aMessage);
|
|
|
|
|
|
|
|
void notifySmsSendFailed(in long aRequestId,
|
|
|
|
in long aError);
|
|
|
|
|
|
|
|
void notifyGotSms(in long aRequestId,
|
|
|
|
in nsIDOMMozSmsMessage aMessage);
|
|
|
|
|
|
|
|
void notifyGetSmsFailed(in long aRequestId,
|
|
|
|
in long aError);
|
|
|
|
|
|
|
|
void notifySmsDeleted(in long aRequestId,
|
|
|
|
in bool aDeleted);
|
|
|
|
|
|
|
|
void notifySmsDeleteFailed(in long aRequestId,
|
|
|
|
in long aError);
|
|
|
|
|
|
|
|
void notifyNoMessageInList(in long aRequestId);
|
|
|
|
|
|
|
|
void notifyCreateMessageList(in long aRequestId,
|
|
|
|
in long aListId,
|
|
|
|
in nsIDOMMozSmsMessage aMessage);
|
|
|
|
|
|
|
|
void notifyGotNextMessage(in long aRequestId,
|
|
|
|
in nsIDOMMozSmsMessage aMessage);
|
|
|
|
|
|
|
|
void notifyReadMessageListFailed(in long aRequestId,
|
|
|
|
in long aError);
|
|
|
|
|
2012-05-17 12:42:38 -07:00
|
|
|
void notifyMarkedMessageRead(in long aRequestId,
|
|
|
|
in bool aRead);
|
|
|
|
|
|
|
|
void notifyMarkMessageReadFailed(in long aRequestId,
|
|
|
|
in long aError);
|
2012-02-19 15:44:29 -08:00
|
|
|
};
|