dom/mobilemessage/src/Types.h

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:a8d8792cb3e9
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_Types_h
7 #define mozilla_dom_mobilemessage_Types_h
8
9 #include "IPCMessageUtils.h"
10
11 namespace mozilla {
12 namespace dom {
13 namespace mobilemessage {
14
15 // For MmsMessageData.state and SmsMessageData.deliveryState
16 // Please keep the following files in sync with enum below:
17 // mobile/android/base/GeckoSmsManager.java
18 enum DeliveryState {
19 eDeliveryState_Sent = 0,
20 eDeliveryState_Received,
21 eDeliveryState_Sending,
22 eDeliveryState_Error,
23 eDeliveryState_Unknown,
24 eDeliveryState_NotDownloaded,
25 // This state should stay at the end.
26 eDeliveryState_EndGuard
27 };
28
29 // For {Mms,Sms}MessageData.deliveryStatus.
30 enum DeliveryStatus {
31 eDeliveryStatus_NotApplicable = 0,
32 eDeliveryStatus_Success,
33 eDeliveryStatus_Pending,
34 eDeliveryStatus_Error,
35 eDeliveryStatus_Reject,
36 eDeliveryStatus_Manual,
37 // This state should stay at the end.
38 eDeliveryStatus_EndGuard
39 };
40
41 // For MmsMessageData.readStatus.
42 enum ReadStatus {
43 eReadStatus_NotApplicable = 0,
44 eReadStatus_Success,
45 eReadStatus_Pending,
46 eReadStatus_Error,
47 // This state should stay at the end.
48 eReadStatus_EndGuard
49 };
50
51 // For {Mms,Sms}FilterData.read.
52 enum ReadState {
53 eReadState_Unknown = -1,
54 eReadState_Unread,
55 eReadState_Read,
56 // This state should stay at the end.
57 eReadState_EndGuard
58 };
59
60 // For {Mms,Sms}FilterData.messageClass.
61 enum MessageClass {
62 eMessageClass_Normal = 0,
63 eMessageClass_Class0,
64 eMessageClass_Class1,
65 eMessageClass_Class2,
66 eMessageClass_Class3,
67 // This state should stay at the end.
68 eMessageClass_EndGuard
69 };
70
71 // For ThreadData.
72 enum MessageType {
73 eMessageType_SMS = 0,
74 eMessageType_MMS,
75 // This state should stay at the end.
76 eMessageType_EndGuard
77 };
78
79 } // namespace mobilemessage
80 } // namespace dom
81 } // namespace mozilla
82
83 namespace IPC {
84
85 /**
86 * Delivery state serializer.
87 */
88 template <>
89 struct ParamTraits<mozilla::dom::mobilemessage::DeliveryState>
90 : public ContiguousEnumSerializer<
91 mozilla::dom::mobilemessage::DeliveryState,
92 mozilla::dom::mobilemessage::eDeliveryState_Sent,
93 mozilla::dom::mobilemessage::eDeliveryState_EndGuard>
94 {};
95
96 /**
97 * Delivery status serializer.
98 */
99 template <>
100 struct ParamTraits<mozilla::dom::mobilemessage::DeliveryStatus>
101 : public ContiguousEnumSerializer<
102 mozilla::dom::mobilemessage::DeliveryStatus,
103 mozilla::dom::mobilemessage::eDeliveryStatus_NotApplicable,
104 mozilla::dom::mobilemessage::eDeliveryStatus_EndGuard>
105 {};
106
107 /**
108 * Read status serializer.
109 */
110 template <>
111 struct ParamTraits<mozilla::dom::mobilemessage::ReadStatus>
112 : public ContiguousEnumSerializer<
113 mozilla::dom::mobilemessage::ReadStatus,
114 mozilla::dom::mobilemessage::eReadStatus_NotApplicable,
115 mozilla::dom::mobilemessage::eReadStatus_EndGuard>
116 {};
117
118 /**
119 * Read state serializer.
120 */
121 template <>
122 struct ParamTraits<mozilla::dom::mobilemessage::ReadState>
123 : public ContiguousEnumSerializer<
124 mozilla::dom::mobilemessage::ReadState,
125 mozilla::dom::mobilemessage::eReadState_Unknown,
126 mozilla::dom::mobilemessage::eReadState_EndGuard>
127 {};
128
129 /**
130 * Message class serializer.
131 */
132 template <>
133 struct ParamTraits<mozilla::dom::mobilemessage::MessageClass>
134 : public ContiguousEnumSerializer<
135 mozilla::dom::mobilemessage::MessageClass,
136 mozilla::dom::mobilemessage::eMessageClass_Normal,
137 mozilla::dom::mobilemessage::eMessageClass_EndGuard>
138 {};
139
140 /**
141 * MessageType class serializer.
142 */
143 template <>
144 struct ParamTraits<mozilla::dom::mobilemessage::MessageType>
145 : public ContiguousEnumSerializer<
146 mozilla::dom::mobilemessage::MessageType,
147 mozilla::dom::mobilemessage::eMessageType_SMS,
148 mozilla::dom::mobilemessage::eMessageType_EndGuard>
149 {};
150
151 } // namespace IPC
152
153 #endif // mozilla_dom_mobilemessage_Types_h

mercurial