dom/mobilemessage/src/MmsMessage.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/Attributes.h"
    15 namespace mozilla {
    16 namespace dom {
    18 namespace mobilemessage {
    19 class MmsMessageData;
    20 } // namespace mobilemessage
    22 class ContentParent;
    24 class MmsMessage MOZ_FINAL : public nsIDOMMozMmsMessage
    25 {
    26 public:
    27   NS_DECL_ISUPPORTS
    28   NS_DECL_NSIDOMMOZMMSMESSAGE
    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;
    37     explicit Attachment(const MmsAttachment& aAttachment) :
    38       content(aAttachment.mContent),
    39       id(aAttachment.mId),
    40       location(aAttachment.mLocation)
    41     {}
    42   };
    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);
    60   MmsMessage(const mobilemessage::MmsMessageData& aData);
    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);
    80   bool GetData(ContentParent* aParent,
    81                mobilemessage::MmsMessageData& aData);
    83 private:
    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 };
   102 } // namespace dom
   103 } // namespace mozilla
   105 #endif // mozilla_dom_mobilemessage_MmsMessage_h

mercurial