add new files to open just into INTEL.
[apps/core/preloaded/ciss.git] / include / ciss-common.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
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
7  *
8  * http://www.tizenopensource.org/license
9  *
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.
15  */
16
17 #ifndef __CISS_COMMON_H__
18 #define __CISS_COMMON_H__
19
20 #include <app_service.h>
21 #include <tapi_common.h>
22 #include <ITapiSs.h>
23 #include <ITapiSat.h>
24 #include <TapiUtility.h>
25 #include <Elementary.h>
26 #include <vconf.h>
27 #include <Ecore_IMF.h>
28 #include <stdio.h>
29 #include <string.h>
30 #include <stdlib.h>
31 #include <sqlite3.h>
32
33 #include "ciss-types.h"
34 #include "ciss-debug.h"
35 #include "ciss-string.h"
36
37 #define PACKAGE "org.tizen.ciss"
38
39 #if !defined(LOCALEDIR)
40     #  define LOCALEDIR "/opt/apps/org.tizen.ciss/res/locale"
41 #endif
42
43 #if !defined(EDJDIR)
44     #  define EDJDIR "/opt/apps/org.tizen.ciss/res/edje"
45 #endif
46         
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"
51
52 #define _EDJ(o)         elm_layout_edje_get(o)
53
54 #define registerSS                      10
55 #define eraseSS                         11
56 #define activateSS                      12
57 #define deactivateSS                    13
58 #define interrogateSS                   14
59 #define notifySS                        16
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 */
69
70 typedef struct _EventHandler {
71         const char *event_type;
72         unsigned int event_id;
73         tapi_notification_cb func;
74 } EventHandler;
75
76 /**
77  * The MMI string context
78  */
79 typedef struct {
80         unsigned char                   opcode;
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 */
94 }ciss_mmi_context_t;
95
96 /**
97 * Received TAPI Event when CISS is not launched
98 */
99 typedef struct {
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 */
105 } ciss_tapi_event_t;
106
107 /**
108 * SS send Terminal Response to SIM AT.
109 */
110 typedef struct {
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;
115
116 typedef struct {
117         Evas *evas;
118
119         Evas_Object *win_main;
120         Evas_Object *indicator;
121         Evas_Object *nf;
122         Evas_Object *layout_main;
123         Evas_Object *content;
124         Evas_Object *view;
125         Evas_Object *popup;
126         Evas_Object *entry;
127         Evas_Object *ef_entry, *ef_layout;
128         Evas_Object *button;
129         Evas_Object *bg;
130
131         Elm_Object_Item *c_item[3];
132         Ecore_Timer *timer;
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;
140
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;
145
146         int ussd_action_require;
147         char input[256];
148         char req_string[REQ_STRING_MAX_LEN];
149
150         Eina_Bool is_sat_request;
151         ciss_sat_terminal_response_t sat_terminal_response;
152
153         service_h service_handle;
154 } ciss_appdata_t;
155
156 #endif /* __CISS_COMMON_H__ */
157