|
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/. */ |
|
5 |
|
6 #ifndef mozilla_dom_mobilemessage_MobileMessageThread_h |
|
7 #define mozilla_dom_mobilemessage_MobileMessageThread_h |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 #include "mozilla/dom/mobilemessage/SmsTypes.h" |
|
11 #include "nsIDOMMozMobileMessageThread.h" |
|
12 #include "nsString.h" |
|
13 |
|
14 namespace mozilla { |
|
15 namespace dom { |
|
16 |
|
17 class MobileMessageThread MOZ_FINAL : public nsIDOMMozMobileMessageThread |
|
18 { |
|
19 private: |
|
20 typedef mobilemessage::ThreadData ThreadData; |
|
21 |
|
22 public: |
|
23 NS_DECL_ISUPPORTS |
|
24 NS_DECL_NSIDOMMOZMOBILEMESSAGETHREAD |
|
25 |
|
26 MobileMessageThread(uint64_t aId, |
|
27 const nsTArray<nsString>& aParticipants, |
|
28 uint64_t aTimestamp, |
|
29 const nsString& aLastMessageSubject, |
|
30 const nsString& aBody, |
|
31 uint64_t aUnreadCount, |
|
32 mobilemessage::MessageType aLastMessageType); |
|
33 |
|
34 MobileMessageThread(const ThreadData& aData); |
|
35 |
|
36 static nsresult Create(uint64_t aId, |
|
37 const JS::Value& aParticipants, |
|
38 uint64_t aTimestamp, |
|
39 const nsAString& aLastMessageSubject, |
|
40 const nsAString& aBody, |
|
41 uint64_t aUnreadCount, |
|
42 const nsAString& aLastMessageType, |
|
43 JSContext* aCx, |
|
44 nsIDOMMozMobileMessageThread** aThread); |
|
45 |
|
46 const ThreadData& GetData() const { return mData; } |
|
47 |
|
48 private: |
|
49 // Don't try to use the default constructor. |
|
50 MobileMessageThread() MOZ_DELETE; |
|
51 |
|
52 ThreadData mData; |
|
53 }; |
|
54 |
|
55 } // namespace dom |
|
56 } // namespace mozilla |
|
57 |
|
58 #endif // mozilla_dom_mobilemessage_MobileMessageThread_h |