dom/mobilemessage/src/MobileMessageThread.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/mobilemessage/src/MobileMessageThread.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     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_MobileMessageThread_h
    1.10 +#define mozilla_dom_mobilemessage_MobileMessageThread_h
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +#include "mozilla/dom/mobilemessage/SmsTypes.h"
    1.14 +#include "nsIDOMMozMobileMessageThread.h"
    1.15 +#include "nsString.h"
    1.16 +
    1.17 +namespace mozilla {
    1.18 +namespace dom {
    1.19 +
    1.20 +class MobileMessageThread MOZ_FINAL : public nsIDOMMozMobileMessageThread
    1.21 +{
    1.22 +private:
    1.23 +  typedef mobilemessage::ThreadData ThreadData;
    1.24 +
    1.25 +public:
    1.26 +  NS_DECL_ISUPPORTS
    1.27 +  NS_DECL_NSIDOMMOZMOBILEMESSAGETHREAD
    1.28 +
    1.29 +  MobileMessageThread(uint64_t aId,
    1.30 +                      const nsTArray<nsString>& aParticipants,
    1.31 +                      uint64_t aTimestamp,
    1.32 +                      const nsString& aLastMessageSubject,
    1.33 +                      const nsString& aBody,
    1.34 +                      uint64_t aUnreadCount,
    1.35 +                      mobilemessage::MessageType aLastMessageType);
    1.36 +
    1.37 +  MobileMessageThread(const ThreadData& aData);
    1.38 +
    1.39 +  static nsresult Create(uint64_t aId,
    1.40 +                         const JS::Value& aParticipants,
    1.41 +                         uint64_t aTimestamp,
    1.42 +                         const nsAString& aLastMessageSubject,
    1.43 +                         const nsAString& aBody,
    1.44 +                         uint64_t aUnreadCount,
    1.45 +                         const nsAString& aLastMessageType,
    1.46 +                         JSContext* aCx,
    1.47 +                         nsIDOMMozMobileMessageThread** aThread);
    1.48 +
    1.49 +  const ThreadData& GetData() const { return mData; }
    1.50 +
    1.51 +private:
    1.52 +  // Don't try to use the default constructor.
    1.53 +  MobileMessageThread() MOZ_DELETE;
    1.54 +
    1.55 +  ThreadData mData;
    1.56 +};
    1.57 +
    1.58 +} // namespace dom
    1.59 +} // namespace mozilla
    1.60 +
    1.61 +#endif // mozilla_dom_mobilemessage_MobileMessageThread_h

mercurial