Bumping manifests a=b2g-bump
[gecko.git] / dom / mobilemessage / MmsMessage.h
blob3d4612ae883b6ce2ffe100d965d222b48a4eb4cb
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_mobilemessage_MmsMessage_h
7 #define mozilla_dom_mobilemessage_MmsMessage_h
9 #include "nsIDOMMozMmsMessage.h"
10 #include "nsString.h"
11 #include "mozilla/dom/mobilemessage/Types.h"
12 #include "mozilla/dom/MozMmsMessageBinding.h"
13 #include "mozilla/dom/MozMobileMessageManagerBinding.h"
14 #include "mozilla/Attributes.h"
16 namespace mozilla {
17 namespace dom {
19 class File;
21 namespace mobilemessage {
22 class MmsMessageData;
23 } // namespace mobilemessage
25 class ContentParent;
27 class MmsMessage MOZ_FINAL : public nsIDOMMozMmsMessage
29 public:
30 NS_DECL_ISUPPORTS
31 NS_DECL_NSIDOMMOZMMSMESSAGE
33 // If this is changed, change the WebIDL dictionary as well.
34 struct Attachment MOZ_FINAL
36 nsRefPtr<File> content;
37 nsString id;
38 nsString location;
40 explicit Attachment(const MmsAttachment& aAttachment) :
41 content(aAttachment.mContent),
42 id(aAttachment.mId),
43 location(aAttachment.mLocation)
47 MmsMessage(int32_t aId,
48 uint64_t aThreadId,
49 const nsAString& aIccId,
50 mobilemessage::DeliveryState aDelivery,
51 const nsTArray<MmsDeliveryInfo>& aDeliveryInfo,
52 const nsAString& aSender,
53 const nsTArray<nsString>& aReceivers,
54 uint64_t aTimestamp,
55 uint64_t aSentTimestamp,
56 bool aRead,
57 const nsAString& aSubject,
58 const nsAString& aSmil,
59 const nsTArray<Attachment>& aAttachments,
60 uint64_t aExpiryDate,
61 bool aReadReportRequested);
63 explicit MmsMessage(const mobilemessage::MmsMessageData& aData);
65 static nsresult Create(int32_t aId,
66 uint64_t aThreadId,
67 const nsAString& aIccId,
68 const nsAString& aDelivery,
69 const JS::Value& aDeliveryInfo,
70 const nsAString& aSender,
71 const JS::Value& aReceivers,
72 uint64_t aTimestamp,
73 uint64_t aSentTimestamp,
74 bool aRead,
75 const nsAString& aSubject,
76 const nsAString& aSmil,
77 const JS::Value& aAttachments,
78 uint64_t aExpiryDate,
79 bool aReadReportRequested,
80 JSContext* aCx,
81 nsIDOMMozMmsMessage** aMessage);
83 bool GetData(ContentParent* aParent,
84 mobilemessage::MmsMessageData& aData);
86 private:
88 ~MmsMessage() {}
90 int32_t mId;
91 uint64_t mThreadId;
92 nsString mIccId;
93 mobilemessage::DeliveryState mDelivery;
94 nsTArray<MmsDeliveryInfo> mDeliveryInfo;
95 nsString mSender;
96 nsTArray<nsString> mReceivers;
97 uint64_t mTimestamp;
98 uint64_t mSentTimestamp;
99 bool mRead;
100 nsString mSubject;
101 nsString mSmil;
102 nsTArray<Attachment> mAttachments;
103 uint64_t mExpiryDate;
104 bool mReadReportRequested;
107 } // namespace dom
108 } // namespace mozilla
110 #endif // mozilla_dom_mobilemessage_MmsMessage_h