2015-05-03 22:32:37 +03: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 11:22:25 +04: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/. */
|
|
|
|
|
2015-10-19 14:54:06 +03:00
|
|
|
#include "SmsMessageInternal.h"
|
|
|
|
#include "MmsMessageInternal.h"
|
|
|
|
#include "MobileMessageThreadInternal.h"
|
2013-03-09 11:22:25 +04:00
|
|
|
#include "MobileMessageService.h"
|
2014-06-27 09:17:47 +04:00
|
|
|
#include "DeletedMessageInfo.h"
|
2013-03-09 11:22:25 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace mobilemessage {
|
|
|
|
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS(MobileMessageService, nsIMobileMessageService)
|
2013-03-09 11:22:25 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
MobileMessageService::CreateSmsMessage(int32_t aId,
|
2013-04-05 16:15:52 +04:00
|
|
|
uint64_t aThreadId,
|
2013-11-02 14:17:16 +04:00
|
|
|
const nsAString& aIccId,
|
2013-03-09 11:22:25 +04:00
|
|
|
const nsAString& aDelivery,
|
|
|
|
const nsAString& aDeliveryStatus,
|
|
|
|
const nsAString& aSender,
|
|
|
|
const nsAString& aReceiver,
|
|
|
|
const nsAString& aBody,
|
|
|
|
const nsAString& aMessageClass,
|
2014-03-20 06:45:55 +04:00
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
uint64_t aDeliveryTimestamp,
|
|
|
|
bool aRead,
|
2013-03-09 11:22:25 +04:00
|
|
|
JSContext* aCx,
|
2015-10-19 14:54:06 +03:00
|
|
|
nsISmsMessage** aMessage)
|
2013-03-09 11:22:25 +04:00
|
|
|
{
|
2015-10-19 14:54:06 +03:00
|
|
|
return SmsMessageInternal::Create(aId,
|
|
|
|
aThreadId,
|
|
|
|
aIccId,
|
|
|
|
aDelivery,
|
|
|
|
aDeliveryStatus,
|
|
|
|
aSender,
|
|
|
|
aReceiver,
|
|
|
|
aBody,
|
|
|
|
aMessageClass,
|
|
|
|
aTimestamp,
|
|
|
|
aSentTimestamp,
|
|
|
|
aDeliveryTimestamp,
|
|
|
|
aRead,
|
|
|
|
aCx,
|
|
|
|
aMessage);
|
2013-03-09 11:22:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2014-03-20 06:45:55 +04:00
|
|
|
MobileMessageService::CreateMmsMessage(int32_t aId,
|
|
|
|
uint64_t aThreadId,
|
|
|
|
const nsAString& aIccId,
|
|
|
|
const nsAString& aDelivery,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aDeliveryInfo,
|
2014-03-20 06:45:55 +04:00
|
|
|
const nsAString& aSender,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aReceivers,
|
2014-03-20 06:45:55 +04:00
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
bool aRead,
|
|
|
|
const nsAString& aSubject,
|
|
|
|
const nsAString& aSmil,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aAttachments,
|
2014-03-20 06:45:55 +04:00
|
|
|
uint64_t aExpiryDate,
|
|
|
|
bool aReadReportRequested,
|
|
|
|
JSContext* aCx,
|
2015-10-19 14:54:06 +03:00
|
|
|
nsIMmsMessage** aMessage)
|
2013-03-09 11:22:25 +04:00
|
|
|
{
|
2015-10-19 14:54:06 +03:00
|
|
|
return MmsMessageInternal::Create(aId,
|
|
|
|
aThreadId,
|
|
|
|
aIccId,
|
|
|
|
aDelivery,
|
|
|
|
aDeliveryInfo,
|
|
|
|
aSender,
|
|
|
|
aReceivers,
|
|
|
|
aTimestamp,
|
|
|
|
aSentTimestamp,
|
|
|
|
aRead,
|
|
|
|
aSubject,
|
|
|
|
aSmil,
|
|
|
|
aAttachments,
|
|
|
|
aExpiryDate,
|
|
|
|
aReadReportRequested,
|
|
|
|
aCx,
|
|
|
|
aMessage);
|
2013-03-09 11:22:25 +04:00
|
|
|
}
|
|
|
|
|
2013-04-09 06:21:54 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
MobileMessageService::CreateThread(uint64_t aId,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aParticipants,
|
2014-03-20 06:45:55 +04:00
|
|
|
uint64_t aTimestamp,
|
2013-11-06 16:46:06 +04:00
|
|
|
const nsAString& aLastMessageSubject,
|
2013-04-09 06:21:54 +04:00
|
|
|
const nsAString& aBody,
|
|
|
|
uint64_t aUnreadCount,
|
2013-04-26 12:40:42 +04:00
|
|
|
const nsAString& aLastMessageType,
|
2013-04-09 06:21:54 +04:00
|
|
|
JSContext* aCx,
|
2015-10-19 14:54:06 +03:00
|
|
|
nsIMobileMessageThread** aThread)
|
2013-04-09 06:21:54 +04:00
|
|
|
{
|
2015-10-19 14:54:06 +03:00
|
|
|
return MobileMessageThreadInternal::Create(aId,
|
|
|
|
aParticipants,
|
|
|
|
aTimestamp,
|
|
|
|
aLastMessageSubject,
|
|
|
|
aBody,
|
|
|
|
aUnreadCount,
|
|
|
|
aLastMessageType,
|
|
|
|
aCx,
|
|
|
|
aThread);
|
2013-04-09 06:21:54 +04:00
|
|
|
}
|
|
|
|
|
2014-06-27 09:17:47 +04: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 11:22:25 +04:00
|
|
|
} // namespace mobilemessage
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|