2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CISS_COMMON_H__
18 #define __CISS_COMMON_H__
20 #include <app_service.h>
21 #include <tapi_common.h>
24 #include <TapiUtility.h>
25 #include <Elementary.h>
27 #include <Ecore_IMF.h>
33 #include "ciss-types.h"
34 #include "ciss-debug.h"
35 #include "ciss-string.h"
37 #define PACKAGE "org.tizen.ciss"
39 #if !defined(LOCALEDIR)
40 # define LOCALEDIR "/opt/apps/org.tizen.ciss/res/locale"
44 # define EDJDIR "/opt/apps/org.tizen.ciss/res/edje"
47 #define EDJ_PATH EDJDIR
48 #define EDJ_NAME EDJDIR"/ciss-mmi.edj"
49 #define GRP_MAIN "main"
50 #define IMG_DIR "/opt/apps/org.tizen.ciss/res/images"
52 #define _EDJ(o) elm_layout_edje_get(o)
57 #define deactivateSS 13
58 #define interrogateSS 14
60 #define registerPassword 17
61 #define getPassword 18
62 #define processUnstructuredSS_Data 19
63 #define forwardCheckSS_Indication 38
64 #define processUnstructuredSS_Request 59
65 #define unstructuredSS_Request 60
66 #define unstructuredSS_Notify 61
67 #define NULL_SS_OPERATION 0xff
68 #define TAPI_NOTIFY_SS_REL_COMP_MSG DBUS_TELEPHONY_SS_INTERFACE":RelCompMsg" /**< used for SAT Terminal Response */
70 typedef struct _EventHandler {
71 const char *event_type;
72 unsigned int event_id;
73 tapi_notification_cb func;
77 * The MMI string context
81 char user_string[MAX_USS_CHAR]; /**< String to be parsed */
82 int user_string_length; /**< length of string */
83 unsigned char dcs; /**< the data coding scheme for ussd */
84 unsigned char ss_flavor; /**< current SS code being processed */
85 unsigned char ss_type; /**< barring, forwarding, waiting, etc */
86 TelSsClass_t tapi_bsg; /**< The Basic Service Code */
87 char forward_number[CISS_NUMBER_LEN_MAX+1]; /**< call forwarding number*/
88 char nr_timer; /**< No Reply Timer */
89 char ss_password[CISS_MAX_PASSWORD_LEN+1]; /**< remember password if supplied so that */
90 char ss_new_password[CISS_MAX_PASSWORD_LEN+1]; /**< remember new password */
91 char ss_new_password2[CISS_MAX_PASSWORD_LEN+1]; /**< remember the new pwd supplied again */
92 char ss_code[MAX_SC_LEN + 1]; /**< the ss code */
93 TelSsUssdType_t ussd_type; /* Type of ussd */
97 * Received TAPI Event when CISS is not launched
100 int event_type; /**< Event type */
101 int request_id; /**< This parameter is applicable only for Asynchronous solicited responses. The request id for a service request is sent back in the asynchronous response. For unsolicited indications, request id will be -1 */
102 int status; /**< This parameter is applicable only for Asynchronous solicited responses. This status parameter informs the actual result of Asynchronous response. For unsolicited indications, status will be -1 */
103 void *p_data; /**< Event Data - Based on Event type response/indications. Event data information is captured in each API Section */
104 int data_length; /**< Event Data size */
108 * SS send Terminal Response to SIM AT.
111 int sat_command_id; /**< command ID */
112 unsigned short rel_comp_msg_length; /**< received Release Complete msg lengrh from NW via Telephony FW */
113 unsigned char rel_comp_msg_string[TAPI_MAX_RELEASE_COMPLETE_DATA_LEN]; /**< received Release Complete msg string from NW via Telephony FW */
114 } ciss_sat_terminal_response_t;
119 Evas_Object *win_main;
120 Evas_Object *indicator;
122 Evas_Object *layout_main;
123 Evas_Object *content;
127 Evas_Object *ef_entry, *ef_layout;
131 Elm_Object_Item *c_item[3];
133 Ecore_Event_Handler *ise_event_handler;
134 Ecore_Event_Handler *end_key_event_handler;
135 Ecore_IMF_Context *imf_context;
136 Elm_Genlist_Item_Class *itc_ime;
137 Elm_Genlist_Item_Class *itc_multi_line;
138 Elm_Genlist_Item_Class *itc_seperator_no_line;
139 Elm_Genlist_Item_Class *itc_underline;
141 TapiHandle *tapi_handle; /* Tapi handle */
142 ciss_service_t resp_ss_type; /*Response SS type from tapi*/
143 ciss_mmi_context_t mmi_ctx;
144 ciss_tapi_event_t tapi_event;
146 int ussd_action_require;
148 char req_string[REQ_STRING_MAX_LEN];
150 Eina_Bool is_sat_request;
151 ciss_sat_terminal_response_t sat_terminal_response;
153 service_h service_handle;
156 #endif /* __CISS_COMMON_H__ */