michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_mobilemessage_Types_h michael@0: #define mozilla_dom_mobilemessage_Types_h michael@0: michael@0: #include "IPCMessageUtils.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: namespace mobilemessage { michael@0: michael@0: // For MmsMessageData.state and SmsMessageData.deliveryState michael@0: // Please keep the following files in sync with enum below: michael@0: // mobile/android/base/GeckoSmsManager.java michael@0: enum DeliveryState { michael@0: eDeliveryState_Sent = 0, michael@0: eDeliveryState_Received, michael@0: eDeliveryState_Sending, michael@0: eDeliveryState_Error, michael@0: eDeliveryState_Unknown, michael@0: eDeliveryState_NotDownloaded, michael@0: // This state should stay at the end. michael@0: eDeliveryState_EndGuard michael@0: }; michael@0: michael@0: // For {Mms,Sms}MessageData.deliveryStatus. michael@0: enum DeliveryStatus { michael@0: eDeliveryStatus_NotApplicable = 0, michael@0: eDeliveryStatus_Success, michael@0: eDeliveryStatus_Pending, michael@0: eDeliveryStatus_Error, michael@0: eDeliveryStatus_Reject, michael@0: eDeliveryStatus_Manual, michael@0: // This state should stay at the end. michael@0: eDeliveryStatus_EndGuard michael@0: }; michael@0: michael@0: // For MmsMessageData.readStatus. michael@0: enum ReadStatus { michael@0: eReadStatus_NotApplicable = 0, michael@0: eReadStatus_Success, michael@0: eReadStatus_Pending, michael@0: eReadStatus_Error, michael@0: // This state should stay at the end. michael@0: eReadStatus_EndGuard michael@0: }; michael@0: michael@0: // For {Mms,Sms}FilterData.read. michael@0: enum ReadState { michael@0: eReadState_Unknown = -1, michael@0: eReadState_Unread, michael@0: eReadState_Read, michael@0: // This state should stay at the end. michael@0: eReadState_EndGuard michael@0: }; michael@0: michael@0: // For {Mms,Sms}FilterData.messageClass. michael@0: enum MessageClass { michael@0: eMessageClass_Normal = 0, michael@0: eMessageClass_Class0, michael@0: eMessageClass_Class1, michael@0: eMessageClass_Class2, michael@0: eMessageClass_Class3, michael@0: // This state should stay at the end. michael@0: eMessageClass_EndGuard michael@0: }; michael@0: michael@0: // For ThreadData. michael@0: enum MessageType { michael@0: eMessageType_SMS = 0, michael@0: eMessageType_MMS, michael@0: // This state should stay at the end. michael@0: eMessageType_EndGuard michael@0: }; michael@0: michael@0: } // namespace mobilemessage michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: namespace IPC { michael@0: michael@0: /** michael@0: * Delivery state serializer. michael@0: */ michael@0: template <> michael@0: struct ParamTraits michael@0: : public ContiguousEnumSerializer< michael@0: mozilla::dom::mobilemessage::DeliveryState, michael@0: mozilla::dom::mobilemessage::eDeliveryState_Sent, michael@0: mozilla::dom::mobilemessage::eDeliveryState_EndGuard> michael@0: {}; michael@0: michael@0: /** michael@0: * Delivery status serializer. michael@0: */ michael@0: template <> michael@0: struct ParamTraits michael@0: : public ContiguousEnumSerializer< michael@0: mozilla::dom::mobilemessage::DeliveryStatus, michael@0: mozilla::dom::mobilemessage::eDeliveryStatus_NotApplicable, michael@0: mozilla::dom::mobilemessage::eDeliveryStatus_EndGuard> michael@0: {}; michael@0: michael@0: /** michael@0: * Read status serializer. michael@0: */ michael@0: template <> michael@0: struct ParamTraits michael@0: : public ContiguousEnumSerializer< michael@0: mozilla::dom::mobilemessage::ReadStatus, michael@0: mozilla::dom::mobilemessage::eReadStatus_NotApplicable, michael@0: mozilla::dom::mobilemessage::eReadStatus_EndGuard> michael@0: {}; michael@0: michael@0: /** michael@0: * Read state serializer. michael@0: */ michael@0: template <> michael@0: struct ParamTraits michael@0: : public ContiguousEnumSerializer< michael@0: mozilla::dom::mobilemessage::ReadState, michael@0: mozilla::dom::mobilemessage::eReadState_Unknown, michael@0: mozilla::dom::mobilemessage::eReadState_EndGuard> michael@0: {}; michael@0: michael@0: /** michael@0: * Message class serializer. michael@0: */ michael@0: template <> michael@0: struct ParamTraits michael@0: : public ContiguousEnumSerializer< michael@0: mozilla::dom::mobilemessage::MessageClass, michael@0: mozilla::dom::mobilemessage::eMessageClass_Normal, michael@0: mozilla::dom::mobilemessage::eMessageClass_EndGuard> michael@0: {}; michael@0: michael@0: /** michael@0: * MessageType class serializer. michael@0: */ michael@0: template <> michael@0: struct ParamTraits michael@0: : public ContiguousEnumSerializer< michael@0: mozilla::dom::mobilemessage::MessageType, michael@0: mozilla::dom::mobilemessage::eMessageType_SMS, michael@0: mozilla::dom::mobilemessage::eMessageType_EndGuard> michael@0: {}; michael@0: michael@0: } // namespace IPC michael@0: michael@0: #endif // mozilla_dom_mobilemessage_Types_h