DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Implementation

Mercurial (d1ed7de67f5a)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_mobilemessage_MmsMessage_h
#define mozilla_dom_mobilemessage_MmsMessage_h

#include "nsIDOMMozMmsMessage.h"
#include "nsString.h"
#include "mozilla/dom/mobilemessage/Types.h"
#include "mozilla/dom/MozMmsMessageBinding.h"
#include "mozilla/dom/MozMobileMessageManagerBinding.h"
#include "mozilla/Attributes.h"

namespace mozilla {
namespace dom {

namespace mobilemessage {
class MmsMessageData;
} // namespace mobilemessage

class ContentParent;

class MmsMessage MOZ_FINAL : public nsIDOMMozMmsMessage
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMMOZMMSMESSAGE

  // If this is changed, change the WebIDL dictionary as well.
  struct Attachment MOZ_FINAL
  {
    nsCOMPtr<nsIDOMBlob> content;
    nsString id;
    nsString location;

    explicit Attachment(const MmsAttachment& aAttachment) :
      content(aAttachment.mContent),
      id(aAttachment.mId),
      location(aAttachment.mLocation)
    {}
  };

  MmsMessage(int32_t aId,
             uint64_t aThreadId,
             const nsAString& aIccId,
             mobilemessage::DeliveryState aDelivery,
             const nsTArray<MmsDeliveryInfo>& aDeliveryInfo,
             const nsAString& aSender,
             const nsTArray<nsString>& aReceivers,
             uint64_t aTimestamp,
             uint64_t aSentTimestamp,
             bool aRead,
             const nsAString& aSubject,
             const nsAString& aSmil,
             const nsTArray<Attachment>& aAttachments,
             uint64_t aExpiryDate,
             bool aReadReportRequested);

  MmsMessage(const mobilemessage::MmsMessageData& aData);

  static nsresult Create(int32_t aId,
                         uint64_t aThreadId,
                         const nsAString& aIccId,
                         const nsAString& aDelivery,
                         const JS::Value& aDeliveryInfo,
                         const nsAString& aSender,
                         const JS::Value& aReceivers,
                         uint64_t aTimestamp,
                         uint64_t aSentTimestamp,
                         bool aRead,
                         const nsAString& aSubject,
                         const nsAString& aSmil,
                         const JS::Value& aAttachments,
                         uint64_t aExpiryDate,
                         bool aReadReportRequested,
                         JSContext* aCx,
                         nsIDOMMozMmsMessage** aMessage);

  bool GetData(ContentParent* aParent,
               mobilemessage::MmsMessageData& aData);

private:

  ~MmsMessage() {}

  int32_t mId;
  uint64_t mThreadId;
  nsString mIccId;
  mobilemessage::DeliveryState mDelivery;
  nsTArray<MmsDeliveryInfo> mDeliveryInfo;
  nsString mSender;
  nsTArray<nsString> mReceivers;
  uint64_t mTimestamp;
  uint64_t mSentTimestamp;
  bool mRead;
  nsString mSubject;
  nsString mSmil;
  nsTArray<Attachment> mAttachments;
  uint64_t mExpiryDate;
  bool mReadReportRequested;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_mobilemessage_MmsMessage_h