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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_mobilemessage_MmsMessage_h
|
|
|
|
#define mozilla_dom_mobilemessage_MmsMessage_h
|
|
|
|
|
|
|
|
#include "nsIDOMMozMmsMessage.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "mozilla/dom/mobilemessage/Types.h"
|
2014-03-07 11:51:48 +00:00
|
|
|
#include "mozilla/dom/MozMmsMessageBinding.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-05-12 12:09:51 +00:00
|
|
|
class Blob;
|
2014-10-08 16:15:22 +00:00
|
|
|
|
2013-04-10 12:18:41 +00:00
|
|
|
namespace mobilemessage {
|
|
|
|
class MmsMessageData;
|
|
|
|
} // namespace mobilemessage
|
|
|
|
|
|
|
|
class ContentParent;
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class MmsMessage final : public nsIDOMMozMmsMessage
|
2013-03-09 07:21:55 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMMOZMMSMESSAGE
|
|
|
|
|
2014-03-07 11:51:48 +00:00
|
|
|
// If this is changed, change the WebIDL dictionary as well.
|
2015-03-21 16:28:04 +00:00
|
|
|
struct Attachment final
|
2014-03-07 11:51:48 +00:00
|
|
|
{
|
2015-05-12 12:09:51 +00:00
|
|
|
nsRefPtr<Blob> content;
|
2014-03-07 11:51:48 +00:00
|
|
|
nsString id;
|
|
|
|
nsString location;
|
|
|
|
|
|
|
|
explicit Attachment(const MmsAttachment& aAttachment) :
|
|
|
|
content(aAttachment.mContent),
|
|
|
|
id(aAttachment.mId),
|
|
|
|
location(aAttachment.mLocation)
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
2014-03-20 02:45:55 +00:00
|
|
|
MmsMessage(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<Attachment>& aAttachments,
|
|
|
|
uint64_t aExpiryDate,
|
|
|
|
bool aReadReportRequested);
|
2013-03-09 07:21:55 +00:00
|
|
|
|
2014-09-01 22:26:43 +00:00
|
|
|
explicit MmsMessage(const mobilemessage::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,
|
2013-03-09 07:21:55 +00:00
|
|
|
nsIDOMMozMmsMessage** aMessage);
|
|
|
|
|
2013-04-10 12:18:41 +00:00
|
|
|
bool GetData(ContentParent* aParent,
|
|
|
|
mobilemessage::MmsMessageData& aData);
|
|
|
|
|
2013-03-09 07:21:55 +00:00
|
|
|
private:
|
|
|
|
|
2014-06-23 19:56:07 +00:00
|
|
|
~MmsMessage() {}
|
|
|
|
|
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;
|
|
|
|
nsTArray<Attachment> mAttachments;
|
|
|
|
uint64_t mExpiryDate;
|
|
|
|
bool mReadReportRequested;
|
2013-03-09 07:21:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_mobilemessage_MmsMessage_h
|