2011-11-24 03:45:55 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-17 12:42:38 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-11-24 03:45:55 -08:00
|
|
|
|
2013-03-01 00:38:47 -08:00
|
|
|
#ifndef mozilla_dom_mobilemessage_Types_h
|
|
|
|
#define mozilla_dom_mobilemessage_Types_h
|
2011-11-24 03:45:55 -08:00
|
|
|
|
2012-01-17 10:48:58 -08:00
|
|
|
#include "IPCMessageUtils.h"
|
|
|
|
|
2011-11-24 03:45:55 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2013-03-01 00:38:47 -08:00
|
|
|
namespace mobilemessage {
|
2011-11-24 03:45:55 -08:00
|
|
|
|
2013-03-08 23:21:55 -08:00
|
|
|
// For MmsMessageData.state and SmsMessageData.deliveryState
|
2011-12-20 00:07:25 -08:00
|
|
|
// Please keep the following files in sync with enum below:
|
2013-03-07 09:55:49 -08:00
|
|
|
// mobile/android/base/GeckoSmsManager.java
|
2011-11-24 03:45:55 -08:00
|
|
|
enum DeliveryState {
|
2011-12-20 00:07:25 -08:00
|
|
|
eDeliveryState_Sent = 0,
|
2011-11-24 03:45:55 -08:00
|
|
|
eDeliveryState_Received,
|
2012-12-11 01:09:42 -08:00
|
|
|
eDeliveryState_Sending,
|
|
|
|
eDeliveryState_Error,
|
2012-01-17 10:42:05 -08:00
|
|
|
eDeliveryState_Unknown,
|
2013-03-08 23:21:55 -08:00
|
|
|
eDeliveryState_NotDownloaded,
|
2011-11-24 03:45:55 -08:00
|
|
|
// This state should stay at the end.
|
2012-01-17 10:42:05 -08:00
|
|
|
eDeliveryState_EndGuard
|
2011-11-24 03:45:55 -08:00
|
|
|
};
|
|
|
|
|
2013-03-08 23:21:55 -08:00
|
|
|
// For {Mms,Sms}MessageData.deliveryStatus.
|
2012-10-30 03:53:24 -07:00
|
|
|
enum DeliveryStatus {
|
|
|
|
eDeliveryStatus_NotApplicable = 0,
|
|
|
|
eDeliveryStatus_Success,
|
|
|
|
eDeliveryStatus_Pending,
|
|
|
|
eDeliveryStatus_Error,
|
2013-05-10 11:50:18 -07:00
|
|
|
eDeliveryStatus_Reject,
|
|
|
|
eDeliveryStatus_Manual,
|
2012-10-30 03:53:24 -07:00
|
|
|
// This state should stay at the end.
|
|
|
|
eDeliveryStatus_EndGuard
|
|
|
|
};
|
|
|
|
|
2013-11-25 02:54:59 -08:00
|
|
|
// For MmsMessageData.readStatus.
|
|
|
|
enum ReadStatus {
|
|
|
|
eReadStatus_NotApplicable = 0,
|
|
|
|
eReadStatus_Success,
|
|
|
|
eReadStatus_Pending,
|
|
|
|
eReadStatus_Error,
|
|
|
|
// This state should stay at the end.
|
|
|
|
eReadStatus_EndGuard
|
|
|
|
};
|
|
|
|
|
2014-08-27 20:00:03 -07:00
|
|
|
// For {Mms,Sms}MessageData.messageClass.
|
2012-10-31 02:10:44 -07:00
|
|
|
enum MessageClass {
|
|
|
|
eMessageClass_Normal = 0,
|
|
|
|
eMessageClass_Class0,
|
|
|
|
eMessageClass_Class1,
|
|
|
|
eMessageClass_Class2,
|
|
|
|
eMessageClass_Class3,
|
|
|
|
// This state should stay at the end.
|
|
|
|
eMessageClass_EndGuard
|
|
|
|
};
|
|
|
|
|
2013-04-26 01:40:42 -07:00
|
|
|
// For ThreadData.
|
|
|
|
enum MessageType {
|
|
|
|
eMessageType_SMS = 0,
|
|
|
|
eMessageType_MMS,
|
|
|
|
// This state should stay at the end.
|
|
|
|
eMessageType_EndGuard
|
|
|
|
};
|
|
|
|
|
2013-03-01 00:38:47 -08:00
|
|
|
} // namespace mobilemessage
|
2011-11-24 03:45:55 -08:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delivery state serializer.
|
|
|
|
*/
|
|
|
|
template <>
|
2013-03-01 00:38:47 -08:00
|
|
|
struct ParamTraits<mozilla::dom::mobilemessage::DeliveryState>
|
2014-04-14 07:17:40 -07:00
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::dom::mobilemessage::DeliveryState,
|
|
|
|
mozilla::dom::mobilemessage::eDeliveryState_Sent,
|
|
|
|
mozilla::dom::mobilemessage::eDeliveryState_EndGuard>
|
2011-11-24 03:45:55 -08:00
|
|
|
{};
|
|
|
|
|
2012-10-30 03:53:24 -07:00
|
|
|
/**
|
|
|
|
* Delivery status serializer.
|
|
|
|
*/
|
|
|
|
template <>
|
2013-03-01 00:38:47 -08:00
|
|
|
struct ParamTraits<mozilla::dom::mobilemessage::DeliveryStatus>
|
2014-04-14 07:17:40 -07:00
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::dom::mobilemessage::DeliveryStatus,
|
|
|
|
mozilla::dom::mobilemessage::eDeliveryStatus_NotApplicable,
|
|
|
|
mozilla::dom::mobilemessage::eDeliveryStatus_EndGuard>
|
2012-10-30 03:53:24 -07:00
|
|
|
{};
|
|
|
|
|
2013-11-25 02:54:59 -08:00
|
|
|
/**
|
|
|
|
* Read status serializer.
|
|
|
|
*/
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::dom::mobilemessage::ReadStatus>
|
2014-04-14 07:17:40 -07:00
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::dom::mobilemessage::ReadStatus,
|
|
|
|
mozilla::dom::mobilemessage::eReadStatus_NotApplicable,
|
|
|
|
mozilla::dom::mobilemessage::eReadStatus_EndGuard>
|
2013-11-25 02:54:59 -08:00
|
|
|
{};
|
|
|
|
|
2012-10-31 02:10:44 -07:00
|
|
|
/**
|
|
|
|
* Message class serializer.
|
|
|
|
*/
|
|
|
|
template <>
|
2013-03-01 00:38:47 -08:00
|
|
|
struct ParamTraits<mozilla::dom::mobilemessage::MessageClass>
|
2014-04-14 07:17:40 -07:00
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::dom::mobilemessage::MessageClass,
|
|
|
|
mozilla::dom::mobilemessage::eMessageClass_Normal,
|
|
|
|
mozilla::dom::mobilemessage::eMessageClass_EndGuard>
|
2012-10-31 02:10:44 -07:00
|
|
|
{};
|
|
|
|
|
2013-04-26 01:40:42 -07:00
|
|
|
/**
|
|
|
|
* MessageType class serializer.
|
|
|
|
*/
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::dom::mobilemessage::MessageType>
|
2014-04-14 07:17:40 -07:00
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::dom::mobilemessage::MessageType,
|
|
|
|
mozilla::dom::mobilemessage::eMessageType_SMS,
|
|
|
|
mozilla::dom::mobilemessage::eMessageType_EndGuard>
|
2013-04-26 01:40:42 -07:00
|
|
|
{};
|
|
|
|
|
2011-11-24 03:45:55 -08:00
|
|
|
} // namespace IPC
|
|
|
|
|
2013-03-01 00:38:47 -08:00
|
|
|
#endif // mozilla_dom_mobilemessage_Types_h
|