dom/mobilemessage/interfaces/nsIRilMobileMessageDatabaseService.idl

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:47d071c2d471
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #include "domstubs.idl"
6 #include "nsISupports.idl"
7 #include "nsIMobileMessageDatabaseService.idl"
8
9 [scriptable, function, uuid(92986322-8d56-11e2-8816-73a531c493c2)]
10 interface nsIRilMobileMessageDatabaseCallback : nsISupports
11 {
12 /**
13 * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message
14 */
15 void notify(in nsresult aRv, in nsISupports aDomMessage);
16 };
17
18 [scriptable, function, uuid(32b02bbe-60a1-45e0-a748-ad40709b09dd)]
19 interface nsIRilMobileMessageDatabaseRecordCallback : nsISupports
20 {
21 /**
22 * |aMessageRecord| Object: the mobile-message database record
23 * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message. Noted, this value might be null.
24 */
25 void notify(in nsresult aRv, in jsval aMessageRecord, in nsISupports aDomMessage);
26 };
27
28 [scriptable, function, uuid(1b0ff03c-a2bc-11e3-a443-838d034c9805)]
29 interface nsIRilMobileMessageDatabaseConcatenationCallback : nsISupports
30 {
31 /**
32 * |aCompleteMessage|: jsval: the completely concatenated message. Noted, this value might be null.
33 */
34 void notify(in nsresult aRv, in jsval aCompleteMessage);
35 };
36
37 [scriptable, uuid(0b437a5c-a2bc-11e3-bd1b-dbb173eb35f8)]
38 interface nsIRilMobileMessageDatabaseService : nsIMobileMessageDatabaseService
39 {
40 /**
41 * |aMessage| Object: should contain the following properties for internal use:
42 * - |type| DOMString: "sms" or "mms"
43 * - |timestamp| Number: the timestamp of received message
44 * - |iccId| DOMString: [optional] the ICC ID of the SIM for receiving
45 * message if available.
46 *
47 * - If |type| == "sms", we also need:
48 * - |messageClass| DOMString: the message class of received message
49 * - |receiver| DOMString: the phone number of receiver
50 * - |pid| Number: the TP-PID field of the SMS TPDU, default 0.
51 * - |sender| DOMString: the phone number of sender
52 *
53 * - If |type| == "mms", we also need:
54 * - |delivery| DOMString: the delivery state of received message
55 * - |deliveryStatus| DOMString: the delivery status of received message
56 * - |receivers| DOMString Array: the phone numbers of receivers
57 * - |phoneNumber| DOMString: [optional] my own phone number.
58 */
59 void saveReceivedMessage(in jsval aMessage,
60 [optional] in nsIRilMobileMessageDatabaseCallback aCallback);
61
62 /**
63 * |aMessage| Object: should contain the following properties for internal use:
64 * - |type| DOMString: "sms" or "mms"
65 * - |sender| DOMString: the phone number of sender
66 * - |timestamp| Number: the timestamp of sending message
67 * - |deliveryStatusRequested| Bool: true when the delivery report is requested.
68 * - |iccId| DOMString: the ICC ID of the SIM for sending message
69 *
70 * - If |type| == "sms", we also need:
71 * - |receiver| DOMString: the phone number of receiver
72 *
73 * - If |type| == "mms", we also need:
74 * - |receivers| DOMString Array: the phone numbers of receivers
75 */
76 void saveSendingMessage(in jsval aMessage,
77 [optional] in nsIRilMobileMessageDatabaseCallback aCallback);
78
79 /**
80 * |aMessageId| Number: the message's DB record ID.
81 * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null).
82 * |aDelivery| DOMString: the new delivery value to update (can be null).
83 * |aDeliveryStatus| DOMString: the new delivery status to update (can be null).
84 * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers.
85 * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback.
86 */
87 void setMessageDeliveryByMessageId(in long aMessageId,
88 in DOMString aReceiver,
89 in DOMString aDelivery,
90 in DOMString aDeliveryStatus,
91 in DOMString aEnvelopeId,
92 [optional] in nsIRilMobileMessageDatabaseCallback aCallback);
93
94 /**
95 * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers.
96 * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null).
97 * |aDeliveryStatus| DOMString: the new delivery status to be updated (can be null).
98 * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback.
99 */
100 void setMessageDeliveryStatusByEnvelopeId(in DOMString aEnvelopeId,
101 in DOMString aReceiver,
102 in DOMString aDeliveryStatus,
103 [optional] in nsIRilMobileMessageDatabaseCallback aCallback);
104
105 /**
106 * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers.
107 * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null).
108 * |aReadStatus| DOMString: the new read status to be updated.
109 * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback.
110 */
111 void setMessageReadStatusByEnvelopeId(in DOMString aEnvelopeId,
112 in DOMString aReceiver,
113 in DOMString aReadStatus,
114 [optional] in nsIRilMobileMessageDatabaseCallback aCallback);
115
116 /**
117 * |aMessageId| Number: the message's DB record ID.
118 * |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which
119 * takes result flag, message record and domMessage as parameters.
120 */
121 void getMessageRecordById(in long aMessageId,
122 in nsIRilMobileMessageDatabaseRecordCallback aCallback);
123
124 /**
125 * |aTransactionId| DOMString: the transaction ID of MMS PDU.
126 * |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which
127 * takes result flag and message record as parameters.
128 */
129 void getMessageRecordByTransactionId(in DOMString aTransactionId,
130 in nsIRilMobileMessageDatabaseRecordCallback aCallback);
131
132 /**
133 * |aCrError| nsresult: the NS_ERROR defined in Components.results.
134 *
135 * @returns the error code defined in nsIMobileMessageCallback
136 */
137 jsval translateCrErrorToMessageCallbackError(in nsresult aCrError);
138
139 /**
140 * |aSmsSegment| jsval: Decoded Single SMS PDU.
141 * |aCallback| nsIRilMobileMessageDatabaseConcatenationCallback: a callback which
142 * takes result flag, and complete mesage as parameters.
143 */
144 void saveSmsSegment(in jsval aSmsSegment,
145 in nsIRilMobileMessageDatabaseConcatenationCallback aCallback);
146 };

mercurial