msg_plat/conversation_services_utilities_api/inc/ccsdefs.h
changeset 31 ebfee66fde93
child 34 84197e66a4bd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h	Fri Jun 04 10:25:39 2010 +0100
@@ -0,0 +1,303 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CS general definitions
+*
+*/
+
+
+#ifndef __C_CSSERVER_DEFS_H__
+#define __C_CSSERVER_DEFS_H__
+
+// INCLUDES FILES
+
+// SYSTEM INCLUDES
+#include <e32base.h>
+#include <e32math.h>
+#include <s32strm.h>
+#include <s32mem.h>
+#include <e32def.h>
+
+//-----------------------------------------------------------------------------
+// Conversation Server Details
+//-----------------------------------------------------------------------------
+/**
+ * Name of the conversation server.
+ */
+_LIT(KCsServerName,    "CsServer");
+
+/**
+ * Name of the conversation server executable.
+ */
+_LIT(KCsServerExeName, "CsServer.exe");
+
+/**
+ * Conversation Server data plugin interface UID
+ */
+const TUid KCsPluginInterfaceUid = { 0x2002A545 };
+
+//-----------------------------------------------------------------------------
+// Conversation Server general constants
+//-----------------------------------------------------------------------------
+/**
+ * Number of digits to compare (from right) for two phone numbers to match.
+ */
+const TInt KDefaultGsmNumberMatchLength = 7;
+
+/**
+ * Maximum internal buffer length used for IPC between conversation server and
+ * clients.
+ */
+const TInt KBufferMaxLen = 16000; // 16K
+
+/**
+ * Maximum number of special conversations that are being reserved
+ * 
+ */
+const TInt8 KMaxSpecialConversations = 3;
+
+//-----------------------------------------------------------------------------
+// Conversation Server event codes
+//-----------------------------------------------------------------------------
+const TUint32 KConversationEventNone             = 0x00000000;
+const TUint32 KConversationListEventNew          = 0x00000001;
+const TUint32 KConversationListEventUpdate       = 0x00000002;
+const TUint32 KConversationListEventDelete       = 0x00000004;
+const TUint32 KConversationEventNew              = 0x00000008;
+const TUint32 KConversationEventUpdate           = 0x00000010;
+const TUint32 KConversationEventDelete           = 0x00000020;
+const TUint32 KConversationCachingEventStarted   = 0x00000040;
+const TUint32 KConversationCachingEventCompleted = 0x00000080;
+const TUint32 KConversationCachingEventError     = 0x00000100;
+const TUint32 KConversationEventListRefresh      = 0x00000200;
+const TUint32 KConversationEventRefresh          = 0x00000400;
+
+//-----------------------------------------------------------------------------
+// Conversation Server caching status codes
+//-----------------------------------------------------------------------------
+const TUint8 KCachingStatusUnknown    = 0x00;
+const TUint8 KCachingStatusStarted    = 0x01;
+const TUint8 KCachingStatusCompleted  = 0x02;
+const TUint8 KCachingStatusError      = 0x04;
+
+//-----------------------------------------------------------------------------
+// Conversation Server special conversation codes
+//-----------------------------------------------------------------------------
+const TUint8 KUnknownConversationId       = 0x00;
+const TUint8 KBluetoothMsgsConversationId = 0x01;
+const TUint8 KInfraRedMsgsConversationId  = 0x02;
+
+//-----------------------------------------------------------------------------
+// Request commands to the conversation server
+//-----------------------------------------------------------------------------
+enum TCsServerRequestCommands
+{
+     EGetConversationList,
+     EGetConversationUnreadList,
+     EGetConversations,
+     EGetTotalUnreadCount,
+     ERequestChangeEvent,
+     ERemoveChangeEvent,
+     EGetCachingStatus,
+     ESetConversationListChangeObserver,
+     EResetConversationListChangeObserver,
+     ESetConversationChangeObserver,
+     EResetConversationChangeObserver,
+     ESetCachingStatusObserver,
+     EResetCachingStatusObserver,
+     EShutdown,
+     EUserDeleteConversation,
+     EGetConversationId,
+     EGetConversationIdFromAddress,
+     EGetConversationFromMessageId,
+     EUserMarkReadConversation
+};
+
+//-----------------------------------------------------------------------------
+// Response commands from the conversation server
+//-----------------------------------------------------------------------------
+enum TCsServerResponseCommand
+{
+    EGetConversationListOperationComplete,
+    EGetConversationOperationComplete,
+    EGetConversationListBufferOverflow,
+    EGetConversationBufferOverflow,
+    EAddConversationListEvent,
+    EDeleteConversationListEvent,
+    EModifyConversationListEvent,
+    EAddConversationEvent,
+    EDeleteConversationEvent,
+    EModifyConversationEvent,
+    ECachingStartedEvent,
+    ECachingCompletedEvent,
+    ECachingErrorEvent,
+    EInitRequestChange,  //initiate request change request to server
+    EUserDeleteConversationComplete,
+    ERefreshConversationListEvent,
+    ERefreshConversationEvent,
+    EGetConversationIdComplete,
+    EGetConversationIdFromAddressComplete,
+    EGetConversationFromMessageIdComplete,
+    EUserMarkReadConversationComplete    
+};
+
+//-----------------------------------------------------------------------------
+// Conversation Server data types
+//-----------------------------------------------------------------------------
+
+/**
+ * Conversation Identifier
+ */
+typedef TInt TCsConversationEntryID;
+
+/**
+ * Direction of a conversation event.
+ * @attention This enum can have values from 0 to 255 only.
+ */
+enum
+{
+ECsDirectionIncoming = 0,
+ECsDirectionOutgoing,
+ECsDirectionMissed,
+ECsDirectionUnknown
+};
+
+/**
+ * @typedef TCsDirection
+ * typedef to denoting direction of a conversation event.
+ */
+typedef TUint8 TCsDirection;
+
+/**
+ * Type of a conversation event.
+ * @attention This enum can have values from 0 to 255 only.
+ */
+enum
+{
+ECsSMS = 0,
+ECsMMS,
+ECsMmsNotification,
+ECsAudio,
+ECsBioMsg,
+ECsBlueTooth,
+ECsRingingTone,
+ECsProvisioning,
+ECsBioMsg_VCard,
+ECsBioMsg_VCal,
+ECsUnknown
+};
+
+/**
+ * @typedef TCsType
+ * typedef denoting type of a conversation event.
+ */
+typedef TUint8 TCsType;
+
+/**
+ * Attributes associated with a conversation event.
+ * These are bitmask values.
+ * Use CCsConversationEntry::ChangeAttributes() to set/ change
+ * @attention This enum can have values from 0 to 65535 only.
+ */
+enum
+{
+ECsAttributeNone            = 0x0000,
+ECsAttributeNew             = 0x0001,
+ECsAttributeDraft           = 0x0002,
+ECsAttributeAttachment      = 0x0004, // Attachment present
+ECsAttributeHighPriority    = 0x0008, // Priority high
+ECsAttributeLowPriority     = 0x0010, // Low high
+ECsAttributeUnread          = 0x0020, // Unread
+ECsAttributeSent            = 0x0040,
+ECsAttributeNewEntryAdded   = 0x0080  // When a new entry added
+};
+
+/**
+ * @typedef TCsAttribute
+ * typedef denoting attributes associated with a conversation event.
+ */
+typedef TUint16 TCsAttribute;
+
+/**
+ * Transit sending state of a conversation event.
+ * @attention This enum can have values from 0 to 255 only.
+ */
+enum
+{
+ECsSendStateUnknown = 0,
+ECsSendStateUponRequest,
+ECsSendStateWaiting,
+ECsSendStateSending,
+ECsSendStateScheduled,
+ECsSendStateResend,
+ECsSendStateSuspended,
+ECsSendStateFailed,
+ECsSendStateSent,
+ECsSendStateNotApplicable
+};
+
+/**
+ * @typedef TCsSendState
+ * typedef denoting transit sending state of a conversation event.
+ */
+typedef TUint8 TCsSendState;
+
+/**
+ * @typedef TCsMmsNotificationMsgState
+ * @attention This enum can have values from 0 to 255 only.
+ */
+
+enum 
+{
+EMsgStatusNull              = 0, // unknown status
+EMsgStatusReadyForFetching  = 1, // first state when received in inbox
+EMsgStatusRetrieving        = 2, // when MM is fetching ongoin
+EMsgStatusForwarding        = 3, // forwarding without retrival
+EMsgStatusForwarded         = 4, // state after successful forwarding
+EMsgStatusWaiting           = 5, // when settings changed manual->automatic
+EMsgStatusExpired           = 6, // expired time has exceed
+EMsgStatusFailed            = 7, // when fetching has failed (forwarding?)
+EMsgStatusDeleted           = 8  // when msg deleted from server
+};
+
+typedef TUint8 TCsMmsNotificationMsgState;
+
+/**
+ * Constant for defining the contacts db
+ * This shall be used for converting contact link to id's
+ */
+_LIT(KVPbkDefaultCntDbURI, "cntdb://c:contacts.cdb"); //Phone Store
+
+/**
+ * Internal offset used to identify SIM contacts.
+ */
+const TInt KSimIdOffset = 99999;
+
+/**
+ * @typedef TCsMsgPreviewProperty
+ */
+
+enum 
+{
+	EPreviewNone       = 0x00,
+	EPreviewImage      = 0x01,
+	EPreviewAudio      = 0x02,
+	EPreviewVideo      = 0x04,
+	EPreviewAttachment = 0x08
+};
+
+typedef TUint8 TCsMsgPreviewProperty;
+
+#endif // __C_CSSERVER_DEFS_H__
+
+// End of file