Bug 720632 - Part 1: nsISmsRequestManager. r=cjones,gal

This commit is contained in:
Philipp von Weitershausen 2012-02-20 00:44:29 +01:00
parent ebecfda977
commit 3e3cc86931
2 changed files with 83 additions and 2 deletions

View File

@ -48,13 +48,14 @@ include $(topsrcdir)/dom/dom-config.mk
XPIDLSRCS = \
nsIDOMNavigatorSms.idl \
nsIDOMSmsManager.idl \
nsISmsService.idl \
nsIDOMSmsMessage.idl \
nsIDOMSmsEvent.idl \
nsISmsDatabaseService.idl \
nsIDOMSmsRequest.idl \
nsIDOMSmsFilter.idl \
nsIDOMSmsCursor.idl \
nsISmsDatabaseService.idl \
nsISmsRequestManager.idl \
nsISmsService.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,80 @@
/* 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;
interface nsPIDOMWindow;
interface nsIScriptContext;
%{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"
%}
[scriptable, uuid(1638b963-3a45-4937-b6a9-280c1bfb166c)]
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
*/
const unsigned short 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;
/**
* Create a new request object.
*
* @return the request ID.
*/
long createRequest(in nsPIDOMWindow aWindow,
in nsIScriptContext aScriptContext,
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);
};