4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
29 #include "generated-code.h"
31 #define AC_MANAGER "telephony_framework::api_manager"
32 #define AC_CALL "telephony_framework::api_call"
33 #define AC_MODEM "telephony_framework::api_modem"
34 #define AC_NETWORK "telephony_framework::api_network"
35 #define AC_PHONEBOOK "telephony_framework::api_phonebook"
36 #define AC_SAP "telephony_framework::api_sap"
37 #define AC_SAT "telephony_framework::api_sat"
38 #define AC_SIM "telephony_framework::api_sim"
39 #define AC_SMS "telephony_framework::api_sms"
40 #define AC_SS "telephony_framework::api_ss"
42 #define MY_DBUS_PATH "/org/tizen/telephony"
43 #define MY_DBUS_SERVICE "org.tizen.telephony"
45 enum dbus_tapi_sim_slot_id {
53 gpointer cached_sat_main_menu;
62 GDBusObjectManagerServer *manager;
63 TelephonyManager *mgr;
64 enum tel_sim_status sim1_status;
65 enum tel_sim_status sim2_status;
69 gboolean name_acquired;
73 struct dbus_request_info {
74 void *interface_object;
75 GDBusMethodInvocation *invocation;
78 #define DEFAULT_MSG_REQ_FAILED "Request failed"
80 #define GET_CP_NAME(invocation) dbus_plugin_get_cp_name_by_object_path(g_dbus_method_invocation_get_object_path(invocation))
81 #define MAKE_UR(ctx, object, invocation) dbus_plugin_macro_user_request_new(ctx, object, invocation)
82 #define FAIL_RESPONSE(ivc, msg) g_dbus_method_invocation_return_error (ivc, \
83 G_DBUS_ERROR, G_DBUS_ERROR_FAILED, msg);
85 gboolean dtapi_init(TcorePlugin *p);
86 void dtapi_deinit(TcorePlugin *p);
88 char *dbus_plugin_get_cp_name_by_object_path(const char *object_path);
89 UserRequest *dbus_plugin_macro_user_request_new(struct custom_data *ctx, void *object, GDBusMethodInvocation *invocation);
91 gboolean dbus_plugin_util_load_xml(char *docname, char *groupname, void **i_doc, void **i_root_node);
92 void dbus_plugin_util_unload_xml(void **i_doc, void **i_root_node);
94 void dtapi_dispatch_request(struct custom_data *ctx,
95 void *object, GDBusMethodInvocation *invocation,
96 enum tcore_request_command req_command,
97 void *req_data, unsigned int req_data_len);
98 TReturn dtapi_dispatch_request_ex(struct custom_data *ctx,
99 void *object, GDBusMethodInvocation *invocation,
100 enum tcore_request_command req_command,
101 void *req_data, unsigned int req_data_len);
103 gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
104 gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
105 gboolean dbus_plugin_network_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
107 gboolean dbus_plugin_setup_sap_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
108 gboolean dbus_plugin_sap_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
109 gboolean dbus_plugin_sap_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
111 gboolean dbus_plugin_setup_phonebook_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
112 gboolean dbus_plugin_phonebook_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
113 gboolean dbus_plugin_phonebook_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
115 gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
116 gboolean dbus_plugin_sim_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
117 gboolean dbus_plugin_sim_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
119 gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
120 gboolean dbus_plugin_sat_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
121 gboolean dbus_plugin_sat_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
123 gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
124 gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
125 gboolean dbus_plugin_sms_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
127 gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
128 gboolean dbus_plugin_call_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
129 gboolean dbus_plugin_call_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
131 gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
132 gboolean dbus_plugin_ss_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
133 gboolean dbus_plugin_ss_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
135 gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
136 gboolean dbus_plugin_modem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
137 gboolean dbus_plugin_modem_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
139 gboolean dbus_plugin_setup_oem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
140 gboolean dbus_plugin_oem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
141 gboolean dbus_plugin_oem_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
143 enum dbus_tapi_sim_slot_id get_sim_slot_id_by_cp_name(const char *cp_name);
145 #endif /* __COMMON_H__ */