Bumping manifests a=b2g-bump
[gecko.git] / dom / mobilemessage / MobileMessageService.cpp
blobcb638eca4bfcf186932b85b8d3af5c38b3a22086
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/. */
5 #include "SmsMessage.h"
6 #include "MmsMessage.h"
7 #include "MobileMessageThread.h"
8 #include "MobileMessageService.h"
9 #include "DeletedMessageInfo.h"
11 namespace mozilla {
12 namespace dom {
13 namespace mobilemessage {
15 NS_IMPL_ISUPPORTS(MobileMessageService, nsIMobileMessageService)
17 /* static */ StaticRefPtr<MobileMessageService> MobileMessageService::sSingleton;
19 /* static */ already_AddRefed<MobileMessageService>
20 MobileMessageService::GetInstance()
22 if (!sSingleton) {
23 sSingleton = new MobileMessageService();
24 ClearOnShutdown(&sSingleton);
27 nsRefPtr<MobileMessageService> service = sSingleton.get();
28 return service.forget();
31 NS_IMETHODIMP
32 MobileMessageService::CreateSmsMessage(int32_t aId,
33 uint64_t aThreadId,
34 const nsAString& aIccId,
35 const nsAString& aDelivery,
36 const nsAString& aDeliveryStatus,
37 const nsAString& aSender,
38 const nsAString& aReceiver,
39 const nsAString& aBody,
40 const nsAString& aMessageClass,
41 uint64_t aTimestamp,
42 uint64_t aSentTimestamp,
43 uint64_t aDeliveryTimestamp,
44 bool aRead,
45 JSContext* aCx,
46 nsIDOMMozSmsMessage** aMessage)
48 return SmsMessage::Create(aId,
49 aThreadId,
50 aIccId,
51 aDelivery,
52 aDeliveryStatus,
53 aSender,
54 aReceiver,
55 aBody,
56 aMessageClass,
57 aTimestamp,
58 aSentTimestamp,
59 aDeliveryTimestamp,
60 aRead,
61 aCx,
62 aMessage);
65 NS_IMETHODIMP
66 MobileMessageService::CreateMmsMessage(int32_t aId,
67 uint64_t aThreadId,
68 const nsAString& aIccId,
69 const nsAString& aDelivery,
70 JS::Handle<JS::Value> aDeliveryInfo,
71 const nsAString& aSender,
72 JS::Handle<JS::Value> aReceivers,
73 uint64_t aTimestamp,
74 uint64_t aSentTimestamp,
75 bool aRead,
76 const nsAString& aSubject,
77 const nsAString& aSmil,
78 JS::Handle<JS::Value> aAttachments,
79 uint64_t aExpiryDate,
80 bool aReadReportRequested,
81 JSContext* aCx,
82 nsIDOMMozMmsMessage** aMessage)
84 return MmsMessage::Create(aId,
85 aThreadId,
86 aIccId,
87 aDelivery,
88 aDeliveryInfo,
89 aSender,
90 aReceivers,
91 aTimestamp,
92 aSentTimestamp,
93 aRead,
94 aSubject,
95 aSmil,
96 aAttachments,
97 aExpiryDate,
98 aReadReportRequested,
99 aCx,
100 aMessage);
103 NS_IMETHODIMP
104 MobileMessageService::CreateThread(uint64_t aId,
105 JS::Handle<JS::Value> aParticipants,
106 uint64_t aTimestamp,
107 const nsAString& aLastMessageSubject,
108 const nsAString& aBody,
109 uint64_t aUnreadCount,
110 const nsAString& aLastMessageType,
111 JSContext* aCx,
112 nsIDOMMozMobileMessageThread** aThread)
114 return MobileMessageThread::Create(aId,
115 aParticipants,
116 aTimestamp,
117 aLastMessageSubject,
118 aBody,
119 aUnreadCount,
120 aLastMessageType,
121 aCx,
122 aThread);
125 NS_IMETHODIMP
126 MobileMessageService::CreateDeletedMessageInfo(int32_t* aMessageIds,
127 uint32_t aMsgCount,
128 uint64_t* aThreadIds,
129 uint32_t aThreadCount,
130 nsIDeletedMessageInfo** aDeletedInfo)
132 return DeletedMessageInfo::Create(aMessageIds,
133 aMsgCount,
134 aThreadIds,
135 aThreadCount,
136 aDeletedInfo);
139 } // namespace mobilemessage
140 } // namespace dom
141 } // namespace mozilla