2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-03-09 07:22:25 +00: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 "SmsMessage.h"
|
|
|
|
#include "MmsMessage.h"
|
2013-04-09 02:21:54 +00:00
|
|
|
#include "MobileMessageThread.h"
|
2013-03-09 07:22:25 +00:00
|
|
|
#include "MobileMessageService.h"
|
2014-06-27 05:17:47 +00:00
|
|
|
#include "DeletedMessageInfo.h"
|
2013-03-09 07:22:25 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace mobilemessage {
|
|
|
|
|
2014-04-27 07:06:00 +00:00
|
|
|
NS_IMPL_ISUPPORTS(MobileMessageService, nsIMobileMessageService)
|
2013-03-09 07:22:25 +00:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
MobileMessageService::CreateSmsMessage(int32_t aId,
|
2013-04-05 12:15:52 +00:00
|
|
|
uint64_t aThreadId,
|
2013-11-02 10:17:16 +00:00
|
|
|
const nsAString& aIccId,
|
2013-03-09 07:22:25 +00:00
|
|
|
const nsAString& aDelivery,
|
|
|
|
const nsAString& aDeliveryStatus,
|
|
|
|
const nsAString& aSender,
|
|
|
|
const nsAString& aReceiver,
|
|
|
|
const nsAString& aBody,
|
|
|
|
const nsAString& aMessageClass,
|
2014-03-20 02:45:55 +00:00
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
uint64_t aDeliveryTimestamp,
|
|
|
|
bool aRead,
|
2013-03-09 07:22:25 +00:00
|
|
|
JSContext* aCx,
|
|
|
|
nsIDOMMozSmsMessage** aMessage)
|
|
|
|
{
|
|
|
|
return SmsMessage::Create(aId,
|
2013-04-05 12:15:52 +00:00
|
|
|
aThreadId,
|
2013-11-02 10:17:16 +00:00
|
|
|
aIccId,
|
2013-03-09 07:22:25 +00:00
|
|
|
aDelivery,
|
|
|
|
aDeliveryStatus,
|
|
|
|
aSender,
|
|
|
|
aReceiver,
|
|
|
|
aBody,
|
|
|
|
aMessageClass,
|
|
|
|
aTimestamp,
|
2013-09-23 02:31:32 +00:00
|
|
|
aSentTimestamp,
|
2013-11-01 12:00:55 +00:00
|
|
|
aDeliveryTimestamp,
|
2013-03-09 07:22:25 +00:00
|
|
|
aRead,
|
|
|
|
aCx,
|
|
|
|
aMessage);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2014-03-20 02:45:55 +00:00
|
|
|
MobileMessageService::CreateMmsMessage(int32_t aId,
|
|
|
|
uint64_t aThreadId,
|
|
|
|
const nsAString& aIccId,
|
|
|
|
const nsAString& aDelivery,
|
2014-01-09 17:39:36 +00:00
|
|
|
JS::Handle<JS::Value> aDeliveryInfo,
|
2014-03-20 02:45:55 +00:00
|
|
|
const nsAString& aSender,
|
2014-01-09 17:39:36 +00:00
|
|
|
JS::Handle<JS::Value> aReceivers,
|
2014-03-20 02:45:55 +00:00
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
bool aRead,
|
|
|
|
const nsAString& aSubject,
|
|
|
|
const nsAString& aSmil,
|
2014-01-09 17:39:36 +00:00
|
|
|
JS::Handle<JS::Value> aAttachments,
|
2014-03-20 02:45:55 +00:00
|
|
|
uint64_t aExpiryDate,
|
|
|
|
bool aReadReportRequested,
|
|
|
|
JSContext* aCx,
|
2013-03-09 07:22:25 +00:00
|
|
|
nsIDOMMozMmsMessage** aMessage)
|
|
|
|
{
|
|
|
|
return MmsMessage::Create(aId,
|
2013-04-05 12:15:52 +00:00
|
|
|
aThreadId,
|
2013-11-02 10:17:16 +00:00
|
|
|
aIccId,
|
2013-03-20 10:24:48 +00:00
|
|
|
aDelivery,
|
2013-10-22 08:57:25 +00:00
|
|
|
aDeliveryInfo,
|
2013-03-09 07:22:25 +00:00
|
|
|
aSender,
|
|
|
|
aReceivers,
|
|
|
|
aTimestamp,
|
2013-09-23 02:31:32 +00:00
|
|
|
aSentTimestamp,
|
2013-03-09 07:22:25 +00:00
|
|
|
aRead,
|
|
|
|
aSubject,
|
|
|
|
aSmil,
|
|
|
|
aAttachments,
|
2013-05-01 16:22:52 +00:00
|
|
|
aExpiryDate,
|
2013-11-22 07:12:07 +00:00
|
|
|
aReadReportRequested,
|
2013-03-09 07:22:25 +00:00
|
|
|
aCx,
|
|
|
|
aMessage);
|
|
|
|
}
|
|
|
|
|
2013-04-09 02:21:54 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
MobileMessageService::CreateThread(uint64_t aId,
|
2014-01-09 17:39:36 +00:00
|
|
|
JS::Handle<JS::Value> aParticipants,
|
2014-03-20 02:45:55 +00:00
|
|
|
uint64_t aTimestamp,
|
2013-11-06 12:46:06 +00:00
|
|
|
const nsAString& aLastMessageSubject,
|
2013-04-09 02:21:54 +00:00
|
|
|
const nsAString& aBody,
|
|
|
|
uint64_t aUnreadCount,
|
2013-04-26 08:40:42 +00:00
|
|
|
const nsAString& aLastMessageType,
|
2013-04-09 02:21:54 +00:00
|
|
|
JSContext* aCx,
|
|
|
|
nsIDOMMozMobileMessageThread** aThread)
|
|
|
|
{
|
|
|
|
return MobileMessageThread::Create(aId,
|
|
|
|
aParticipants,
|
|
|
|
aTimestamp,
|
2013-11-06 12:46:06 +00:00
|
|
|
aLastMessageSubject,
|
2013-04-09 02:21:54 +00:00
|
|
|
aBody,
|
|
|
|
aUnreadCount,
|
2013-04-26 08:40:42 +00:00
|
|
|
aLastMessageType,
|
2013-04-09 02:21:54 +00:00
|
|
|
aCx,
|
|
|
|
aThread);
|
|
|
|
}
|
|
|
|
|
2014-06-27 05:17:47 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2013-03-09 07:22:25 +00:00
|
|
|
} // namespace mobilemessage
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|