1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/mobilemessage/src/MmsMessage.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,105 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_dom_mobilemessage_MmsMessage_h 1.10 +#define mozilla_dom_mobilemessage_MmsMessage_h 1.11 + 1.12 +#include "nsIDOMMozMmsMessage.h" 1.13 +#include "nsString.h" 1.14 +#include "mozilla/dom/mobilemessage/Types.h" 1.15 +#include "mozilla/dom/MozMmsMessageBinding.h" 1.16 +#include "mozilla/Attributes.h" 1.17 + 1.18 +namespace mozilla { 1.19 +namespace dom { 1.20 + 1.21 +namespace mobilemessage { 1.22 +class MmsMessageData; 1.23 +} // namespace mobilemessage 1.24 + 1.25 +class ContentParent; 1.26 + 1.27 +class MmsMessage MOZ_FINAL : public nsIDOMMozMmsMessage 1.28 +{ 1.29 +public: 1.30 + NS_DECL_ISUPPORTS 1.31 + NS_DECL_NSIDOMMOZMMSMESSAGE 1.32 + 1.33 + // If this is changed, change the WebIDL dictionary as well. 1.34 + struct Attachment MOZ_FINAL 1.35 + { 1.36 + nsCOMPtr<nsIDOMBlob> content; 1.37 + nsString id; 1.38 + nsString location; 1.39 + 1.40 + explicit Attachment(const MmsAttachment& aAttachment) : 1.41 + content(aAttachment.mContent), 1.42 + id(aAttachment.mId), 1.43 + location(aAttachment.mLocation) 1.44 + {} 1.45 + }; 1.46 + 1.47 + MmsMessage(int32_t aId, 1.48 + uint64_t aThreadId, 1.49 + const nsAString& aIccId, 1.50 + mobilemessage::DeliveryState aDelivery, 1.51 + const nsTArray<MmsDeliveryInfo>& aDeliveryInfo, 1.52 + const nsAString& aSender, 1.53 + const nsTArray<nsString>& aReceivers, 1.54 + uint64_t aTimestamp, 1.55 + uint64_t aSentTimestamp, 1.56 + bool aRead, 1.57 + const nsAString& aSubject, 1.58 + const nsAString& aSmil, 1.59 + const nsTArray<Attachment>& aAttachments, 1.60 + uint64_t aExpiryDate, 1.61 + bool aReadReportRequested); 1.62 + 1.63 + MmsMessage(const mobilemessage::MmsMessageData& aData); 1.64 + 1.65 + static nsresult Create(int32_t aId, 1.66 + uint64_t aThreadId, 1.67 + const nsAString& aIccId, 1.68 + const nsAString& aDelivery, 1.69 + const JS::Value& aDeliveryInfo, 1.70 + const nsAString& aSender, 1.71 + const JS::Value& aReceivers, 1.72 + uint64_t aTimestamp, 1.73 + uint64_t aSentTimestamp, 1.74 + bool aRead, 1.75 + const nsAString& aSubject, 1.76 + const nsAString& aSmil, 1.77 + const JS::Value& aAttachments, 1.78 + uint64_t aExpiryDate, 1.79 + bool aReadReportRequested, 1.80 + JSContext* aCx, 1.81 + nsIDOMMozMmsMessage** aMessage); 1.82 + 1.83 + bool GetData(ContentParent* aParent, 1.84 + mobilemessage::MmsMessageData& aData); 1.85 + 1.86 +private: 1.87 + 1.88 + int32_t mId; 1.89 + uint64_t mThreadId; 1.90 + nsString mIccId; 1.91 + mobilemessage::DeliveryState mDelivery; 1.92 + nsTArray<MmsDeliveryInfo> mDeliveryInfo; 1.93 + nsString mSender; 1.94 + nsTArray<nsString> mReceivers; 1.95 + uint64_t mTimestamp; 1.96 + uint64_t mSentTimestamp; 1.97 + bool mRead; 1.98 + nsString mSubject; 1.99 + nsString mSmil; 1.100 + nsTArray<Attachment> mAttachments; 1.101 + uint64_t mExpiryDate; 1.102 + bool mReadReportRequested; 1.103 +}; 1.104 + 1.105 +} // namespace dom 1.106 +} // namespace mozilla 1.107 + 1.108 +#endif // mozilla_dom_mobilemessage_MmsMessage_h