dom/mobilemessage/src/Types.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial