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:21:55 +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/. */
|
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
#ifndef mozilla_dom_mobilemessage_MmsMessageInternal_h
|
|
|
|
#define mozilla_dom_mobilemessage_MmsMessageInternal_h
|
2013-03-09 07:21:55 +00:00
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
#include "nsIMmsMessage.h"
|
2013-03-09 07:21:55 +00:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "mozilla/dom/mobilemessage/Types.h"
|
2015-10-19 11:46:08 +00:00
|
|
|
#include "mozilla/dom/MmsMessageBinding.h"
|
2014-06-25 03:57:16 +00:00
|
|
|
#include "mozilla/dom/MozMobileMessageManagerBinding.h"
|
2013-03-09 07:21:55 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
class ContentParent;
|
2015-05-12 12:09:51 +00:00
|
|
|
class Blob;
|
2015-10-19 11:46:08 +00:00
|
|
|
struct MmsAttachment;
|
2015-10-19 11:54:06 +00:00
|
|
|
class MmsMessage;
|
2014-10-08 16:15:22 +00:00
|
|
|
|
2013-04-10 12:18:41 +00:00
|
|
|
namespace mobilemessage {
|
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
class MmsMessageData;
|
2013-04-10 12:18:41 +00:00
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
class MmsMessageInternal final : public nsIMmsMessage
|
2013-03-09 07:21:55 +00:00
|
|
|
{
|
2015-10-19 11:54:06 +00:00
|
|
|
// This allows the MmsMessage class to access jsval data members
|
|
|
|
// like |deliveryInfo|, |receivers|, and |attachments| without JS API.
|
|
|
|
friend class mozilla::dom::MmsMessage;
|
|
|
|
|
2013-03-09 07:21:55 +00:00
|
|
|
public:
|
2015-10-19 11:46:08 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS(MmsMessageInternal)
|
|
|
|
NS_DECL_NSIMMSMESSAGE
|
|
|
|
|
|
|
|
MmsMessageInternal(int32_t aId,
|
|
|
|
uint64_t aThreadId,
|
|
|
|
const nsAString& aIccId,
|
|
|
|
mobilemessage::DeliveryState aDelivery,
|
|
|
|
const nsTArray<MmsDeliveryInfo>& aDeliveryInfo,
|
|
|
|
const nsAString& aSender,
|
|
|
|
const nsTArray<nsString>& aReceivers,
|
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
bool aRead,
|
|
|
|
const nsAString& aSubject,
|
|
|
|
const nsAString& aSmil,
|
|
|
|
const nsTArray<MmsAttachment>& aAttachments,
|
|
|
|
uint64_t aExpiryDate,
|
|
|
|
bool aReadReportRequested);
|
|
|
|
|
|
|
|
explicit MmsMessageInternal(const MmsMessageData& aData);
|
2013-04-10 12:18:41 +00:00
|
|
|
|
2014-03-20 02:45:55 +00:00
|
|
|
static nsresult Create(int32_t aId,
|
|
|
|
uint64_t aThreadId,
|
|
|
|
const nsAString& aIccId,
|
|
|
|
const nsAString& aDelivery,
|
|
|
|
const JS::Value& aDeliveryInfo,
|
|
|
|
const nsAString& aSender,
|
|
|
|
const JS::Value& aReceivers,
|
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
bool aRead,
|
|
|
|
const nsAString& aSubject,
|
|
|
|
const nsAString& aSmil,
|
|
|
|
const JS::Value& aAttachments,
|
|
|
|
uint64_t aExpiryDate,
|
|
|
|
bool aReadReportRequested,
|
|
|
|
JSContext* aCx,
|
2015-10-19 11:46:08 +00:00
|
|
|
nsIMmsMessage** aMessage);
|
2013-03-09 07:21:55 +00:00
|
|
|
|
2013-04-10 12:18:41 +00:00
|
|
|
bool GetData(ContentParent* aParent,
|
2015-10-19 11:46:08 +00:00
|
|
|
MmsMessageData& aData);
|
2013-04-10 12:18:41 +00:00
|
|
|
|
2013-03-09 07:21:55 +00:00
|
|
|
private:
|
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
~MmsMessageInternal() {}
|
2014-06-23 19:56:07 +00:00
|
|
|
|
2014-03-20 02:45:55 +00:00
|
|
|
int32_t mId;
|
|
|
|
uint64_t mThreadId;
|
|
|
|
nsString mIccId;
|
|
|
|
mobilemessage::DeliveryState mDelivery;
|
|
|
|
nsTArray<MmsDeliveryInfo> mDeliveryInfo;
|
|
|
|
nsString mSender;
|
|
|
|
nsTArray<nsString> mReceivers;
|
|
|
|
uint64_t mTimestamp;
|
|
|
|
uint64_t mSentTimestamp;
|
|
|
|
bool mRead;
|
|
|
|
nsString mSubject;
|
|
|
|
nsString mSmil;
|
2015-10-19 11:46:08 +00:00
|
|
|
nsTArray<MmsAttachment> mAttachments;
|
2014-03-20 02:45:55 +00:00
|
|
|
uint64_t mExpiryDate;
|
|
|
|
bool mReadReportRequested;
|
2013-03-09 07:21:55 +00:00
|
|
|
};
|
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
} // namespace mobilemessage
|
2013-03-09 07:21:55 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-10-19 11:46:08 +00:00
|
|
|
#endif // mozilla_dom_mobilemessage_MmsMessageInternal_h
|