gecko/dom/mobilemessage/MobileMessageService.cpp
Birunthan Mohanathas 6d90091662 Bug 1058101 - Flatten dom/mobilemessage/src/ into parent directory. r=mccr8
--HG--
rename : dom/mobilemessage/src/Constants.cpp => dom/mobilemessage/Constants.cpp
rename : dom/mobilemessage/src/Constants.h => dom/mobilemessage/Constants.h
rename : dom/mobilemessage/src/DOMMobileMessageError.cpp => dom/mobilemessage/DOMMobileMessageError.cpp
rename : dom/mobilemessage/src/DOMMobileMessageError.h => dom/mobilemessage/DOMMobileMessageError.h
rename : dom/mobilemessage/src/DeletedMessageInfo.cpp => dom/mobilemessage/DeletedMessageInfo.cpp
rename : dom/mobilemessage/src/DeletedMessageInfo.h => dom/mobilemessage/DeletedMessageInfo.h
rename : dom/mobilemessage/src/MmsMessage.cpp => dom/mobilemessage/MmsMessage.cpp
rename : dom/mobilemessage/src/MmsMessage.h => dom/mobilemessage/MmsMessage.h
rename : dom/mobilemessage/src/MobileMessageCallback.cpp => dom/mobilemessage/MobileMessageCallback.cpp
rename : dom/mobilemessage/src/MobileMessageCallback.h => dom/mobilemessage/MobileMessageCallback.h
rename : dom/mobilemessage/src/MobileMessageCursorCallback.cpp => dom/mobilemessage/MobileMessageCursorCallback.cpp
rename : dom/mobilemessage/src/MobileMessageCursorCallback.h => dom/mobilemessage/MobileMessageCursorCallback.h
rename : dom/mobilemessage/src/MobileMessageManager.cpp => dom/mobilemessage/MobileMessageManager.cpp
rename : dom/mobilemessage/src/MobileMessageManager.h => dom/mobilemessage/MobileMessageManager.h
rename : dom/mobilemessage/src/MobileMessageService.cpp => dom/mobilemessage/MobileMessageService.cpp
rename : dom/mobilemessage/src/MobileMessageService.h => dom/mobilemessage/MobileMessageService.h
rename : dom/mobilemessage/src/MobileMessageThread.cpp => dom/mobilemessage/MobileMessageThread.cpp
rename : dom/mobilemessage/src/MobileMessageThread.h => dom/mobilemessage/MobileMessageThread.h
rename : dom/mobilemessage/src/SmsMessage.cpp => dom/mobilemessage/SmsMessage.cpp
rename : dom/mobilemessage/src/SmsMessage.h => dom/mobilemessage/SmsMessage.h
rename : dom/mobilemessage/src/SmsServicesFactory.cpp => dom/mobilemessage/SmsServicesFactory.cpp
rename : dom/mobilemessage/src/SmsServicesFactory.h => dom/mobilemessage/SmsServicesFactory.h
rename : dom/mobilemessage/src/Types.h => dom/mobilemessage/Types.h
rename : dom/mobilemessage/src/android/MobileMessageDatabaseService.cpp => dom/mobilemessage/android/MobileMessageDatabaseService.cpp
rename : dom/mobilemessage/src/android/MobileMessageDatabaseService.h => dom/mobilemessage/android/MobileMessageDatabaseService.h
rename : dom/mobilemessage/src/android/SmsService.cpp => dom/mobilemessage/android/SmsService.cpp
rename : dom/mobilemessage/src/android/SmsService.h => dom/mobilemessage/android/SmsService.h
rename : dom/mobilemessage/src/gonk/MmsPduHelper.jsm => dom/mobilemessage/gonk/MmsPduHelper.jsm
rename : dom/mobilemessage/src/gonk/MmsService.js => dom/mobilemessage/gonk/MmsService.js
rename : dom/mobilemessage/src/gonk/MmsService.manifest => dom/mobilemessage/gonk/MmsService.manifest
rename : dom/mobilemessage/src/gonk/MobileMessageDB.jsm => dom/mobilemessage/gonk/MobileMessageDB.jsm
rename : dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js => dom/mobilemessage/gonk/MobileMessageDatabaseService.js
rename : dom/mobilemessage/src/gonk/MobileMessageDatabaseService.manifest => dom/mobilemessage/gonk/MobileMessageDatabaseService.manifest
rename : dom/mobilemessage/src/gonk/SmsService.cpp => dom/mobilemessage/gonk/SmsService.cpp
rename : dom/mobilemessage/src/gonk/SmsService.h => dom/mobilemessage/gonk/SmsService.h
rename : dom/mobilemessage/src/gonk/WspPduHelper.jsm => dom/mobilemessage/gonk/WspPduHelper.jsm
rename : dom/mobilemessage/src/gonk/mms_consts.js => dom/mobilemessage/gonk/mms_consts.js
rename : dom/mobilemessage/src/gonk/wap_consts.js => dom/mobilemessage/gonk/wap_consts.js
rename : dom/mobilemessage/src/ipc/PMobileMessageCursor.ipdl => dom/mobilemessage/ipc/PMobileMessageCursor.ipdl
rename : dom/mobilemessage/src/ipc/PSms.ipdl => dom/mobilemessage/ipc/PSms.ipdl
rename : dom/mobilemessage/src/ipc/PSmsRequest.ipdl => dom/mobilemessage/ipc/PSmsRequest.ipdl
rename : dom/mobilemessage/src/ipc/SmsChild.cpp => dom/mobilemessage/ipc/SmsChild.cpp
rename : dom/mobilemessage/src/ipc/SmsChild.h => dom/mobilemessage/ipc/SmsChild.h
rename : dom/mobilemessage/src/ipc/SmsIPCService.cpp => dom/mobilemessage/ipc/SmsIPCService.cpp
rename : dom/mobilemessage/src/ipc/SmsIPCService.h => dom/mobilemessage/ipc/SmsIPCService.h
rename : dom/mobilemessage/src/ipc/SmsParent.cpp => dom/mobilemessage/ipc/SmsParent.cpp
rename : dom/mobilemessage/src/ipc/SmsParent.h => dom/mobilemessage/ipc/SmsParent.h
rename : dom/mobilemessage/src/ipc/SmsTypes.ipdlh => dom/mobilemessage/ipc/SmsTypes.ipdlh
2014-08-27 10:13:36 -07:00

142 lines
5.8 KiB
C++

/* 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 "SmsMessage.h"
#include "MmsMessage.h"
#include "MobileMessageThread.h"
#include "MobileMessageService.h"
#include "DeletedMessageInfo.h"
namespace mozilla {
namespace dom {
namespace mobilemessage {
NS_IMPL_ISUPPORTS(MobileMessageService, nsIMobileMessageService)
/* static */ StaticRefPtr<MobileMessageService> MobileMessageService::sSingleton;
/* static */ already_AddRefed<MobileMessageService>
MobileMessageService::GetInstance()
{
if (!sSingleton) {
sSingleton = new MobileMessageService();
ClearOnShutdown(&sSingleton);
}
nsRefPtr<MobileMessageService> service = sSingleton.get();
return service.forget();
}
NS_IMETHODIMP
MobileMessageService::CreateSmsMessage(int32_t aId,
uint64_t aThreadId,
const nsAString& aIccId,
const nsAString& aDelivery,
const nsAString& aDeliveryStatus,
const nsAString& aSender,
const nsAString& aReceiver,
const nsAString& aBody,
const nsAString& aMessageClass,
uint64_t aTimestamp,
uint64_t aSentTimestamp,
uint64_t aDeliveryTimestamp,
bool aRead,
JSContext* aCx,
nsIDOMMozSmsMessage** aMessage)
{
return SmsMessage::Create(aId,
aThreadId,
aIccId,
aDelivery,
aDeliveryStatus,
aSender,
aReceiver,
aBody,
aMessageClass,
aTimestamp,
aSentTimestamp,
aDeliveryTimestamp,
aRead,
aCx,
aMessage);
}
NS_IMETHODIMP
MobileMessageService::CreateMmsMessage(int32_t aId,
uint64_t aThreadId,
const nsAString& aIccId,
const nsAString& aDelivery,
JS::Handle<JS::Value> aDeliveryInfo,
const nsAString& aSender,
JS::Handle<JS::Value> aReceivers,
uint64_t aTimestamp,
uint64_t aSentTimestamp,
bool aRead,
const nsAString& aSubject,
const nsAString& aSmil,
JS::Handle<JS::Value> aAttachments,
uint64_t aExpiryDate,
bool aReadReportRequested,
JSContext* aCx,
nsIDOMMozMmsMessage** aMessage)
{
return MmsMessage::Create(aId,
aThreadId,
aIccId,
aDelivery,
aDeliveryInfo,
aSender,
aReceivers,
aTimestamp,
aSentTimestamp,
aRead,
aSubject,
aSmil,
aAttachments,
aExpiryDate,
aReadReportRequested,
aCx,
aMessage);
}
NS_IMETHODIMP
MobileMessageService::CreateThread(uint64_t aId,
JS::Handle<JS::Value> aParticipants,
uint64_t aTimestamp,
const nsAString& aLastMessageSubject,
const nsAString& aBody,
uint64_t aUnreadCount,
const nsAString& aLastMessageType,
JSContext* aCx,
nsIDOMMozMobileMessageThread** aThread)
{
return MobileMessageThread::Create(aId,
aParticipants,
aTimestamp,
aLastMessageSubject,
aBody,
aUnreadCount,
aLastMessageType,
aCx,
aThread);
}
NS_IMETHODIMP
MobileMessageService::CreateDeletedMessageInfo(int32_t* aMessageIds,
uint32_t aMsgCount,
uint64_t* aThreadIds,
uint32_t aThreadCount,
nsIDeletedMessageInfo** aDeletedInfo)
{
return DeletedMessageInfo::Create(aMessageIds,
aMsgCount,
aThreadIds,
aThreadCount,
aDeletedInfo);
}
} // namespace mobilemessage
} // namespace dom
} // namespace mozilla