michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_mobilemessage_MmsMessage_h michael@0: #define mozilla_dom_mobilemessage_MmsMessage_h michael@0: michael@0: #include "nsIDOMMozMmsMessage.h" michael@0: #include "nsString.h" michael@0: #include "mozilla/dom/mobilemessage/Types.h" michael@0: #include "mozilla/dom/MozMmsMessageBinding.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: namespace mobilemessage { michael@0: class MmsMessageData; michael@0: } // namespace mobilemessage michael@0: michael@0: class ContentParent; michael@0: michael@0: class MmsMessage MOZ_FINAL : public nsIDOMMozMmsMessage michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIDOMMOZMMSMESSAGE michael@0: michael@0: // If this is changed, change the WebIDL dictionary as well. michael@0: struct Attachment MOZ_FINAL michael@0: { michael@0: nsCOMPtr content; michael@0: nsString id; michael@0: nsString location; michael@0: michael@0: explicit Attachment(const MmsAttachment& aAttachment) : michael@0: content(aAttachment.mContent), michael@0: id(aAttachment.mId), michael@0: location(aAttachment.mLocation) michael@0: {} michael@0: }; michael@0: michael@0: MmsMessage(int32_t aId, michael@0: uint64_t aThreadId, michael@0: const nsAString& aIccId, michael@0: mobilemessage::DeliveryState aDelivery, michael@0: const nsTArray& aDeliveryInfo, michael@0: const nsAString& aSender, michael@0: const nsTArray& aReceivers, michael@0: uint64_t aTimestamp, michael@0: uint64_t aSentTimestamp, michael@0: bool aRead, michael@0: const nsAString& aSubject, michael@0: const nsAString& aSmil, michael@0: const nsTArray& aAttachments, michael@0: uint64_t aExpiryDate, michael@0: bool aReadReportRequested); michael@0: michael@0: MmsMessage(const mobilemessage::MmsMessageData& aData); michael@0: michael@0: static nsresult Create(int32_t aId, michael@0: uint64_t aThreadId, michael@0: const nsAString& aIccId, michael@0: const nsAString& aDelivery, michael@0: const JS::Value& aDeliveryInfo, michael@0: const nsAString& aSender, michael@0: const JS::Value& aReceivers, michael@0: uint64_t aTimestamp, michael@0: uint64_t aSentTimestamp, michael@0: bool aRead, michael@0: const nsAString& aSubject, michael@0: const nsAString& aSmil, michael@0: const JS::Value& aAttachments, michael@0: uint64_t aExpiryDate, michael@0: bool aReadReportRequested, michael@0: JSContext* aCx, michael@0: nsIDOMMozMmsMessage** aMessage); michael@0: michael@0: bool GetData(ContentParent* aParent, michael@0: mobilemessage::MmsMessageData& aData); michael@0: michael@0: private: michael@0: michael@0: int32_t mId; michael@0: uint64_t mThreadId; michael@0: nsString mIccId; michael@0: mobilemessage::DeliveryState mDelivery; michael@0: nsTArray mDeliveryInfo; michael@0: nsString mSender; michael@0: nsTArray mReceivers; michael@0: uint64_t mTimestamp; michael@0: uint64_t mSentTimestamp; michael@0: bool mRead; michael@0: nsString mSubject; michael@0: nsString mSmil; michael@0: nsTArray mAttachments; michael@0: uint64_t mExpiryDate; michael@0: bool mReadReportRequested; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_mobilemessage_MmsMessage_h