dom/mobilemessage/src/MmsMessage.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:e3bcab6642e5
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/. */
5
6 #ifndef mozilla_dom_mobilemessage_MmsMessage_h
7 #define mozilla_dom_mobilemessage_MmsMessage_h
8
9 #include "nsIDOMMozMmsMessage.h"
10 #include "nsString.h"
11 #include "mozilla/dom/mobilemessage/Types.h"
12 #include "mozilla/dom/MozMmsMessageBinding.h"
13 #include "mozilla/Attributes.h"
14
15 namespace mozilla {
16 namespace dom {
17
18 namespace mobilemessage {
19 class MmsMessageData;
20 } // namespace mobilemessage
21
22 class ContentParent;
23
24 class MmsMessage MOZ_FINAL : public nsIDOMMozMmsMessage
25 {
26 public:
27 NS_DECL_ISUPPORTS
28 NS_DECL_NSIDOMMOZMMSMESSAGE
29
30 // If this is changed, change the WebIDL dictionary as well.
31 struct Attachment MOZ_FINAL
32 {
33 nsCOMPtr<nsIDOMBlob> content;
34 nsString id;
35 nsString location;
36
37 explicit Attachment(const MmsAttachment& aAttachment) :
38 content(aAttachment.mContent),
39 id(aAttachment.mId),
40 location(aAttachment.mLocation)
41 {}
42 };
43
44 MmsMessage(int32_t aId,
45 uint64_t aThreadId,
46 const nsAString& aIccId,
47 mobilemessage::DeliveryState aDelivery,
48 const nsTArray<MmsDeliveryInfo>& aDeliveryInfo,
49 const nsAString& aSender,
50 const nsTArray<nsString>& aReceivers,
51 uint64_t aTimestamp,
52 uint64_t aSentTimestamp,
53 bool aRead,
54 const nsAString& aSubject,
55 const nsAString& aSmil,
56 const nsTArray<Attachment>& aAttachments,
57 uint64_t aExpiryDate,
58 bool aReadReportRequested);
59
60 MmsMessage(const mobilemessage::MmsMessageData& aData);
61
62 static nsresult Create(int32_t aId,
63 uint64_t aThreadId,
64 const nsAString& aIccId,
65 const nsAString& aDelivery,
66 const JS::Value& aDeliveryInfo,
67 const nsAString& aSender,
68 const JS::Value& aReceivers,
69 uint64_t aTimestamp,
70 uint64_t aSentTimestamp,
71 bool aRead,
72 const nsAString& aSubject,
73 const nsAString& aSmil,
74 const JS::Value& aAttachments,
75 uint64_t aExpiryDate,
76 bool aReadReportRequested,
77 JSContext* aCx,
78 nsIDOMMozMmsMessage** aMessage);
79
80 bool GetData(ContentParent* aParent,
81 mobilemessage::MmsMessageData& aData);
82
83 private:
84
85 int32_t mId;
86 uint64_t mThreadId;
87 nsString mIccId;
88 mobilemessage::DeliveryState mDelivery;
89 nsTArray<MmsDeliveryInfo> mDeliveryInfo;
90 nsString mSender;
91 nsTArray<nsString> mReceivers;
92 uint64_t mTimestamp;
93 uint64_t mSentTimestamp;
94 bool mRead;
95 nsString mSubject;
96 nsString mSmil;
97 nsTArray<Attachment> mAttachments;
98 uint64_t mExpiryDate;
99 bool mReadReportRequested;
100 };
101
102 } // namespace dom
103 } // namespace mozilla
104
105 #endif // mozilla_dom_mobilemessage_MmsMessage_h

mercurial