tizen 2.3.1 release
[framework/telephony/tel-plugin-dbus_tapi.git] / src / sat_manager.h
1 /*
2  * tel-plugin-dbus-tapi
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef SAT_MANAGER_H_
22 #define SAT_MANAGER_H_
23
24 #include <tcore.h>
25 #include <type/sat.h>
26 #include "common.h"
27
28
29 typedef union {
30         struct tel_sat_display_text_tlv displayTextInd; /**<    Parsed proactive command info from TLV to Telephony data type - display text    */
31         struct tel_sat_get_inkey_tlv getInkeyInd; /**<  Parsed proactive command info from TLV to Telephony data type - getInkey        */
32         struct tel_sat_get_input_tlv getInputInd; /**<  Parsed proactive command info from TLV to Telephony data type - getInput        */
33         struct tel_sat_play_tone_tlv play_tone;
34         struct tel_sat_setup_menu_tlv setupMenuInd; /**<        Parsed proactive command info from TLV to Telephony data type - setup menu      */
35         struct tel_sat_select_item_tlv selectItemInd; /**<      Parsed proactive command info from TLV to Telephony data type - select item     */
36         struct tel_sat_send_sms_tlv sendSMSInd;
37         struct tel_sat_send_ss_tlv send_ss;
38         struct tel_sat_send_ussd_tlv send_ussd;
39         struct tel_sat_setup_call_tlv setup_call;
40         struct tel_sat_refresh_tlv refresh;
41         struct tel_sat_provide_local_info_tlv provide_local_info;
42         struct tel_sat_setup_idle_mode_text_tlv idle_mode;
43         struct tel_sat_send_dtmf_tlv send_dtmf;
44         struct tel_sat_language_notification_tlv language_notification;
45         struct tel_sat_launch_browser_tlv launch_browser;
46         struct tel_sat_open_channel_tlv open_channel;
47         struct tel_sat_close_channel_tlv close_channel;
48         struct tel_sat_receive_channel_tlv receive_data;
49         struct tel_sat_send_channel_tlv send_data;
50         struct tel_sat_get_channel_status_tlv get_channel_status;
51         struct tel_sat_unsupproted_command_tlv unsupport_cmd;
52 } sat_manager_proactive_data;
53
54 /**
55  * This structure defines the Command Queue Info.
56  */
57 struct sat_manager_queue_data {
58         enum tel_sat_proactive_cmd_type cmd_type; /**<Type of Command*/
59         int cmd_id; /**<Command Id*/
60         sat_manager_proactive_data cmd_data; /**<Proactive Cmd Ind Info*/
61         gboolean noti_required; /* for missing SESSION END noti*/
62         char *cp_name; /**<cp_name*/
63 };
64
65
66 /*================================================================================================*/
67
68 // queue handling
69 void sat_manager_init_queue(struct custom_data *ctx, const char *cp_name);
70 gboolean sat_manager_remove_cmd_by_id(struct custom_data *ctx, int cmd_id);
71
72 //application request handling
73 gboolean sat_manager_handle_user_confirm(struct custom_data *ctx, TcorePlugin *plg, GVariant *user_confirm_data);
74 gboolean sat_manager_handle_app_exec_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint command_type, GVariant *exec_result);
75 gboolean sat_manager_handle_ui_display_status(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gboolean display_status);
76 gboolean sat_manager_handle_event_download_envelop(int event_type, int src_dev, int dest_dev, struct tel_sat_envelop_event_download_tlv *evt_download, GVariant *download_data);
77 gboolean sat_manager_update_language(struct custom_data *ctx, const char *plugin_name, GVariant *language_noti);
78
79 //proactive command processing
80 GVariant* sat_manager_caching_setup_menu_info(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_menu_tlv* setup_menu_tlv);
81 GVariant* sat_manager_display_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_display_text_tlv* display_text_tlv, int decode_error);
82 GVariant* sat_manager_select_item_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_select_item_tlv* select_item_tlv);
83 GVariant* sat_manager_get_inkey_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_inkey_tlv* get_inkey_tlv, int decode_error);
84 GVariant* sat_manager_get_input_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_input_tlv* get_input_tlv, int decode_error);
85 GVariant* sat_manager_play_tone_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_play_tone_tlv* play_tone_tlv);
86 GVariant* sat_manager_send_sms_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_sms_tlv* send_sms_tlv);
87 GVariant* sat_manager_send_ss_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ss_tlv* send_ss_tlv);
88 GVariant* sat_manager_send_ussd_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ussd_tlv* send_ussd_tlv);
89 GVariant* sat_manager_setup_call_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_call_tlv* setup_call_tlv);
90 GVariant* sat_manager_setup_event_list_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_event_list_tlv *event_list_tlv);
91 GVariant* sat_manager_setup_idle_mode_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_idle_mode_text_tlv *idle_mode_tlv, int decode_error);
92 GVariant* sat_manager_open_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_open_channel_tlv *open_channel_tlv);
93 GVariant* sat_manager_close_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_close_channel_tlv *close_channel_tlv);
94 GVariant* sat_manager_receive_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_receive_channel_tlv *receive_data_tlv);
95 GVariant* sat_manager_send_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_channel_tlv *send_data_tlv);
96 GVariant* sat_manager_get_channel_status_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_channel_status_tlv *get_channel_status_tlv);
97 GVariant* sat_manager_refresh_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_refresh_tlv *refresh_tlv);
98 void sat_manager_more_time_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_more_time_tlv *more_time_tlv);
99 GVariant* sat_manager_send_dtmf_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_dtmf_tlv *send_dtmf_tlv);
100 GVariant* sat_manager_launch_browser_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_launch_browser_tlv *launch_browser_tlv);
101 GVariant* sat_manager_provide_local_info_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_provide_local_info_tlv *provide_local_info_tlv);
102 GVariant* sat_manager_language_notification_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_language_notification_tlv *language_notification_tlv);
103 gboolean sat_manager_processing_unsupport_proactive_command(struct custom_data *ctx, const char *plugin_name, struct tel_sat_unsupproted_command_tlv *unsupport_tlv);
104 gboolean sat_manager_handle_sat_ui_launch_fail(struct custom_data *ctx, const char *plugin_name, struct tnoti_sat_proactive_ind *p_ind);
105
106 #endif /* SAT_MANAGER_H_ */