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"
11 #include "mozilla/dom/mobilemessage/Types.h"
12 #include "mozilla/dom/MozMmsMessageBinding.h"
13 #include "mozilla/dom/MozMobileMessageManagerBinding.h"
14 #include "mozilla/Attributes.h"
21 namespace mobilemessage
{
23 } // namespace mobilemessage
27 class MmsMessage MOZ_FINAL
: public nsIDOMMozMmsMessage
31 NS_DECL_NSIDOMMOZMMSMESSAGE
33 // If this is changed, change the WebIDL dictionary as well.
34 struct Attachment MOZ_FINAL
36 nsRefPtr
<File
> content
;
40 explicit Attachment(const MmsAttachment
& aAttachment
) :
41 content(aAttachment
.mContent
),
43 location(aAttachment
.mLocation
)
47 MmsMessage(int32_t aId
,
49 const nsAString
& aIccId
,
50 mobilemessage::DeliveryState aDelivery
,
51 const nsTArray
<MmsDeliveryInfo
>& aDeliveryInfo
,
52 const nsAString
& aSender
,
53 const nsTArray
<nsString
>& aReceivers
,
55 uint64_t aSentTimestamp
,
57 const nsAString
& aSubject
,
58 const nsAString
& aSmil
,
59 const nsTArray
<Attachment
>& aAttachments
,
61 bool aReadReportRequested
);
63 explicit MmsMessage(const mobilemessage::MmsMessageData
& aData
);
65 static nsresult
Create(int32_t aId
,
67 const nsAString
& aIccId
,
68 const nsAString
& aDelivery
,
69 const JS::Value
& aDeliveryInfo
,
70 const nsAString
& aSender
,
71 const JS::Value
& aReceivers
,
73 uint64_t aSentTimestamp
,
75 const nsAString
& aSubject
,
76 const nsAString
& aSmil
,
77 const JS::Value
& aAttachments
,
79 bool aReadReportRequested
,
81 nsIDOMMozMmsMessage
** aMessage
);
83 bool GetData(ContentParent
* aParent
,
84 mobilemessage::MmsMessageData
& aData
);
93 mobilemessage::DeliveryState mDelivery
;
94 nsTArray
<MmsDeliveryInfo
> mDeliveryInfo
;
96 nsTArray
<nsString
> mReceivers
;
98 uint64_t mSentTimestamp
;
102 nsTArray
<Attachment
> mAttachments
;
103 uint64_t mExpiryDate
;
104 bool mReadReportRequested
;
108 } // namespace mozilla
110 #endif // mozilla_dom_mobilemessage_MmsMessage_h