opensrv_plat/messagequeue_api/inc/msg_enums.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2 * ============================================================================
       
     3 *  Name        : msg_enums.h
       
     4 *  Part of     : message queue library
       
     5 *  Version     : %version: 3 %
       
     6 *
       
     7 *  Copyright © 2007-2008 Nokia.  All rights reserved.
       
     8 *  All rights reserved.
       
     9 *  Redistribution and use in source and binary forms, with or without modification, 
       
    10 *  are permitted provided that the following conditions are met:
       
    11 *  Redistributions of source code must retain the above copyright notice, this list 
       
    12 *  of conditions and the following disclaimer.Redistributions in binary form must 
       
    13 *  reproduce the above copyright notice, this list of conditions and the following 
       
    14 *  disclaimer in the documentation and/or other materials provided with the distribution.
       
    15 *  Neither the name of the Nokia Corporation nor the names of its contributors may be used 
       
    16 *  to endorse or promote products derived from this software without specific prior written 
       
    17 *  permission.
       
    18 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
       
    19 *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
       
    20 *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
       
    21 *  SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
       
    22 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
       
    23 *  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
       
    24 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
       
    25 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
       
    26 *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    27 * ============================================================================
       
    28 * Template version: 1.0
       
    29 */
       
    30 
       
    31 
       
    32 #ifndef __MSG_ENUMS_H__
       
    33 #define __MSG_ENUMS_H__
       
    34 
       
    35 #include <stdio.h>
       
    36 #include <gtypes.h>
       
    37 #define MAX_PARAM_LEN 1024
       
    38 
       
    39 
       
    40 /**
       
    41 * set of resuest ids from the clients
       
    42 */
       
    43 //enum Request_Types Request_Types;
       
    44 enum Request_Types
       
    45 	{
       
    46 	// login  
       
    47 	ELogin_Request = 1,	
       
    48 	// logout 
       
    49 	ELogout_Request,
       
    50 	EServer_DisConnect_Request,
       
    51 	//Fetch Contact : only used when there are no contacts
       
    52 	EFetch_Contacts_Error,
       
    53 	//to send a message
       
    54 	ESend_Request,
       
    55 	//For send error
       
    56 	ESend_Error,
       
    57 	//to fetch the presence
       
    58 	EPresence_Request,
       
    59 	// to add a list
       
    60 	EAdd_List_Request,
       
    61 	// to delete a list
       
    62 	EDelete_List_Request,
       
    63 	// to rename a list
       
    64 	ERename_List_Request,
       
    65 	// to add a contact
       
    66 	EAdd_Contact_Request,
       
    67 	// to delete a contact
       
    68 	EDelete_Contact_Request,
       
    69 	//accept a local pending request
       
    70 	EAccept_Contact_Request,
       
    71 	//Reject local pending request
       
    72 	EReject_Contact_Request,
       
    73 	// to rename a contact
       
    74 	ERename_Conatct_Request,
       
    75 	//to receive message
       
    76 	EText_Message_Receive,
       
    77 	//The order here should not be changed
       
    78 	//The logic in code is heavily dependant
       
    79 	//on the order of these three enums
       
    80 	// to fetch the contacts from server
       
    81 	ECurrent_Member_Contacts,
       
    82 	//local pending
       
    83 	ELocal_Pending_Contacts,
       
    84 	//remote pending
       
    85 	ERemote_Pending_Contacts,
       
    86 	
       
    87 	//user is our client and contact is othr end 
       
    88 	//user -> contact
       
    89 	//contact -> user
       
    90 	
       
    91 	//Some other contact trying to add client
       
    92 	ETrying_To_Add_Contact,
       
    93 	//User added a contact
       
    94 	EKnown_Contact_Added,
       
    95 	//User added contact and it is remote pending
       
    96 	ESubscribe_Remote_Pending,
       
    97 	//Remote pending request rejected or user removed the contact from list
       
    98 	ESubscribe_Removed_Or_Rejected,
       
    99 	//Remote pending request accepted for subscribe of contact presence
       
   100 	//So now the user can know the presence of contact
       
   101 	ESubscribe_RP_Accepted,
       
   102 	//Remote pending request accepted for publish of users presence
       
   103 	//So now the contact can know the presence of user
       
   104 	EPublish_RP_Accepted,
       
   105 	//Removed from publish list
       
   106 	EPublish_Removed_Or_Rejected,
       
   107 	//
       
   108 	ETrying_To_Add_Contact_Known,
       
   109 	//
       
   110 	ETrying_To_Add_Contact_Publish,
       
   111 	
       
   112 	//to update own presence
       
   113 	EUpdateOwnPresence,
       
   114 	//to update own avtar
       
   115 	EUpdateOwnAvtar,
       
   116     //clear avatar
       
   117 	EClearOwnAvatar,
       
   118 	//presence notification
       
   119 	EPresenceNotification,	
       
   120 	
       
   121 	//Kill the process
       
   122 	EKill_Process,
       
   123 	//Search for contacts
       
   124 	ESearch,
       
   125 	
       
   126 	//get the search keys
       
   127 	ESearch_Get_Keys,
       
   128 	
       
   129 	//Search state changed
       
   130 	ESearch_State_During,
       
   131 	
       
   132 	//Search state changed : Done
       
   133 	ESearch_State_Finished,	
       
   134 	
       
   135 	EUserEndGprs,
       
   136 	
       
   137 	//Fetch the contacts
       
   138 	EFetchCachedContacts,
       
   139 
       
   140 	// add if  required
       
   141 	} ;
       
   142 	
       
   143 /**
       
   144 * message types send and recieve via queue
       
   145 */	
       
   146 enum Message_Types
       
   147 	{
       
   148 	EInteger,
       
   149 	EString,
       
   150 	EChar,
       
   151 	EEnums
       
   152 	// add here if need
       
   153 	};
       
   154 /**
       
   155 * Message header for request
       
   156 */
       
   157 typedef struct message_hdr_req message_hdr_req;
       
   158 
       
   159 struct message_hdr_req
       
   160 	{
       
   161 	gint message_type; //Type of the message
       
   162 	gchar continue_flag;
       
   163 	gint protocol_id;//from TRequestId	
       
   164 	gint session_id;//from TRequestId
       
   165 	gint request_id;//from TRequestId
       
   166 	};
       
   167 	
       
   168 /**
       
   169 * Message header for response 
       
   170 */
       
   171 typedef struct message_hdr_resp message_hdr_resp;
       
   172 
       
   173 struct message_hdr_resp
       
   174 	{
       
   175 	//Warning : !!!!!!!!!!!!!! The order should not be changed 
       
   176 	message_hdr_req hdr_req;
       
   177 	gchar continue_flag;
       
   178 	gint response; //success or not 
       
   179 	gint error_type; //if not, error type
       
   180 	};
       
   181 	
       
   182 
       
   183 /**
       
   184 * operations state enums variables 
       
   185 */
       
   186 
       
   187 enum Login_State
       
   188 	{
       
   189 	// default request  error
       
   190 	EGeneral_Err = -1,
       
   191 	// connected to server successfully  
       
   192 	EConnected,	
       
   193 	// connecting to server in progress 
       
   194 	EConnecting,
       
   195 	// not connected to server or logged off
       
   196 	ENotConnected
       
   197 
       
   198 	// add if  required
       
   199 	};
       
   200 	
       
   201 /**
       
   202 * error codes..
       
   203 */
       
   204 enum error_codes 
       
   205 	{
       
   206 	INVALID_PARAMETERES = -7000,
       
   207 	DBUS_CONNECTION_ERROR,
       
   208 	TP_CONNMGR_ERROR,
       
   209 	TP_CONNECTION_ERROR,
       
   210 	TP_HASHTABLE_ERROR,
       
   211 	MEM_ALLOCATION_ERROR,
       
   212 	NOT_CONNECTED,
       
   213 	CONNECTION_STATUS_ERROR,
       
   214 	MSG_Q_SEND_FAILED,
       
   215 	TP_SEARCH_CHAN_ERROR,
       
   216 	TP_SEARCH_IFACE_ERROR,
       
   217 	TP_AVATAR_IFACE_ERROR,
       
   218 	
       
   219 	ELOGIN_AUTHENTICATION, //CASE 3 FRM SPEC 
       
   220 	ELOGIN_NONE_SPECIFIED,//CAN BE USER CANCELLING THE A/P ETC.,  CASE 0 FRM SPEC
       
   221 	ELOGIN_NETWORK_ERROR, //For the network errors
       
   222 	ELOGIN_AUTHORIZATION, //ALL SSL RELATED ERRORS OTHR CASES
       
   223 	};
       
   224 	
       
   225 #endif //__MSG_ENUMS_H__