dom/sms/src/SmsMessage.h
author Graeme McCutcheon <graememcc_firefox@graeme-online.co.uk>
Thu, 11 Oct 2012 09:17:15 +0100
changeset 111907 1baac3f2334c5516cfa56ce944eafa4cec3e6356
parent 111880 e57c5417fb2c4c920333787a44bd24ca0d85291e
child 121143 3b05660cbdd2d5a166fdf7c0fe8cffe5433ff8bc
permissions -rw-r--r--
Bug 724513 - Part 1 - Add StartupCache method for disregarding disk file. r=mwu

/* -*- 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_sms_SmsMessage_h
#define mozilla_dom_sms_SmsMessage_h

#include "mozilla/dom/sms/PSms.h"
#include "nsIDOMSmsMessage.h"
#include "nsString.h"
#include "jspubtd.h"
#include "Types.h"
#include "mozilla/Attributes.h"

namespace mozilla {
namespace dom {
namespace sms {

class SmsMessage MOZ_FINAL : public nsIDOMMozSmsMessage
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMMOZSMSMESSAGE

  SmsMessage(int32_t aId,
             DeliveryState aDelivery,
             DeliveryStatus aDeliveryStatus,
             const nsString& aSender,
             const nsString& aReceiver,
             const nsString& aBody,
             MessageClass aMessageClass,
             uint64_t aTimestamp,
             bool aRead);
  SmsMessage(const SmsMessageData& aData);

  static nsresult Create(int32_t aId,
                         const nsAString& aDelivery,
                         const nsAString& aDeliveryStatus,
                         const nsAString& aSender,
                         const nsAString& aReceiver,
                         const nsAString& aBody,
                         const nsAString& aMessageClass,
                         const JS::Value& aTimestamp,
                         const bool aRead,
                         JSContext* aCx,
                         nsIDOMMozSmsMessage** aMessage);
  const SmsMessageData& GetData() const;

private:
  // Don't try to use the default constructor.
  SmsMessage();

  SmsMessageData mData;
};

} // namespace sms
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_sms_SmsMessage_h