00001 #ifndef __IPC_H__ 00002 #define __IPC_H__ 00003 00004 /** 00005 * File Name : ipc.h 00006 * 00007 * Description: The dbus-based eripc functions 00008 */ 00009 00010 /* 00011 * This file is part of erbrowser. 00012 * 00013 * erbrowser is free software: you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License as published by 00015 * the Free Software Foundation, either version 2 of the License, or 00016 * (at your option) any later version. 00017 * 00018 * erbrowser is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 */ 00026 00027 /** 00028 * Copyright (C) 2009 iRex Technologies B.V. 00029 * All rights reserved. 00030 */ 00031 00032 00033 //---------------------------------------------------------------------------- 00034 // Include Files 00035 //---------------------------------------------------------------------------- 00036 00037 G_BEGIN_DECLS 00038 00039 00040 //---------------------------------------------------------------------------- 00041 // Definitions 00042 //---------------------------------------------------------------------------- 00043 00044 00045 //---------------------------------------------------------------------------- 00046 // Forward Declarations 00047 //---------------------------------------------------------------------------- 00048 00049 00050 //---------------------------------------------------------------------------- 00051 // Type Declarations 00052 //---------------------------------------------------------------------------- 00053 00054 typedef void (*ipc_callback_t)(void); 00055 00056 typedef struct 00057 { 00058 gboolean has_stylus; 00059 gboolean has_wifi; 00060 gboolean has_bluetooth; 00061 gboolean has_3g; 00062 } device_caps_t; 00063 00064 //---------------------------------------------------------------------------- 00065 // Global Constants 00066 //---------------------------------------------------------------------------- 00067 00068 00069 //============================================================================ 00070 // Public Functions 00071 //============================================================================ 00072 00073 /**--------------------------------------------------------------------------- 00074 * 00075 * Name : ipc_set_services 00076 * 00077 * @brief Setup IPC connection and register API functions 00078 * 00079 * @param -- 00080 * 00081 * @return -- 00082 * 00083 *--------------------------------------------------------------------------*/ 00084 void ipc_set_services (ipc_callback_t connect_cb, ipc_callback_t disconnect_cb, ipc_callback_t locale_cb); 00085 00086 00087 /**--------------------------------------------------------------------------- 00088 * 00089 * Name : ipc_unset_services 00090 * 00091 * @brief Unregister API functions 00092 * 00093 * @param -- 00094 * 00095 * @return -- 00096 * 00097 *--------------------------------------------------------------------------*/ 00098 void ipc_unset_services ( void ); 00099 00100 00101 /**--------------------------------------------------------------------------- 00102 * 00103 * Name : ipc_sys_startup_complete 00104 * 00105 * @brief Report "application started" to system daemon 00106 * 00107 * @param -- 00108 * 00109 * @return -- 00110 * 00111 *--------------------------------------------------------------------------*/ 00112 void ipc_sys_startup_complete ( void ); 00113 00114 00115 /**--------------------------------------------------------------------------- 00116 * 00117 * Name : ipc_sys_set_busy 00118 * 00119 * @brief Send message sysSetBusy to system daemon 00120 * to set the busy LED indication 00121 * 00122 * @param [in] on - TRUE to set busy indication, FALSE to stop busy 00123 * @param [in] message - Text to show in dialog, or NULL for default message 00124 * 00125 * @return TRUE on success, FALSE otherwise 00126 * 00127 *--------------------------------------------------------------------------*/ 00128 gboolean ipc_sys_set_busy ( gboolean on, const gchar *message ); 00129 gboolean ipc_sys_set_busy_nodialog ( gboolean on ); 00130 00131 00132 /**--------------------------------------------------------------------------- 00133 * 00134 * Name : ipc_sys_set_bg_busy 00135 * 00136 * @brief Send message sysSetBgBusy to system daemon 00137 * to set the busy LED indication 00138 * 00139 * @param [in] on - TRUE to set busy state, FALSE to stop busy 00140 * 00141 * @return TRUE on success, FALSE otherwise 00142 * 00143 *--------------------------------------------------------------------------*/ 00144 gboolean ipc_sys_bg_busy( gboolean on ); 00145 00146 00147 /**--------------------------------------------------------------------------- 00148 * 00149 * Name : ipc_menu_add_menu 00150 * 00151 * @brief Send message addMenu to popup menu 00152 * 00153 * @param [in] name - name (mnemonic) of the menu 00154 * @param [in] group1 .. group3 - name (mnemonic) of the menu groups 00155 * 00156 * @return TRUE on success, FALSE otherwise 00157 * 00158 *--------------------------------------------------------------------------*/ 00159 gboolean ipc_menu_add_menu ( const char *name, 00160 const char *group1, 00161 const char *group2, 00162 const char *group3 ); 00163 00164 00165 /**--------------------------------------------------------------------------- 00166 * 00167 * Name : ipc_menu_add_group 00168 * 00169 * @brief Send message addGroup to popup menu 00170 * 00171 * @param [in] name - name (mnemonic) of menu group 00172 * @param [in] parent - name (mnemonic) of the group this group belongs to, 00173 * or NULL when this group is at the highest level 00174 * @param [in] image - icon bitmap file 00175 * 00176 * @return TRUE on success, FALSE otherwise 00177 * 00178 *--------------------------------------------------------------------------*/ 00179 gboolean ipc_menu_add_group ( const char *name, 00180 const char *parent, 00181 const char *image ); 00182 00183 00184 /**--------------------------------------------------------------------------- 00185 * 00186 * Name : ipc_menu_add_item 00187 * 00188 * @brief Send message addGroup to popup menu 00189 * 00190 * @param [in] name - name (mnemonic) of menu item 00191 * @param [in] parent - name (mnemomic) of the menu group this item belongs to 00192 * @param [in] image - icon bitmap file 00193 * 00194 * @return TRUE on success, FALSE otherwise 00195 * 00196 *--------------------------------------------------------------------------*/ 00197 gboolean ipc_menu_add_item ( const char *name, 00198 const char *parent, 00199 const char *image ); 00200 00201 00202 /**--------------------------------------------------------------------------- 00203 * 00204 * Name : ipc_menu_set_menu_label 00205 * 00206 * @brief Send message setMenuLabel to popup menu 00207 * 00208 * @param [in] name - name (mnemonic) of the menu 00209 * @param [in] label - on-screen text at the top of the menu 00210 * 00211 * @return TRUE on success, FALSE otherwise 00212 * 00213 *--------------------------------------------------------------------------*/ 00214 gboolean ipc_menu_set_menu_label ( const char *name, 00215 const char *label ); 00216 00217 00218 /**--------------------------------------------------------------------------- 00219 * 00220 * Name : ipc_menu_set_group_label 00221 * 00222 * @brief Send message setGroupLabel to popup menu 00223 * 00224 * @param [in] name - name (mnemonic) of menu group 00225 * @param [in] label - on-screen text at the top of the menu group 00226 * 00227 * @return TRUE on success, FALSE otherwise 00228 * 00229 *--------------------------------------------------------------------------*/ 00230 gboolean ipc_menu_set_group_label ( const char *name, 00231 const char *label ); 00232 00233 00234 /**--------------------------------------------------------------------------- 00235 * 00236 * Name : ipc_menu_set_item_label 00237 * 00238 * @brief Send message setItemLabel to popup menu 00239 * 00240 * @param [in] name - name (mnemonic) of menu item 00241 * @param [in] parent - name (mnemomic) of the menu group this item belongs to 00242 * @param [in] label - on-screen text below icon 00243 * 00244 * @return TRUE on success, FALSE otherwise 00245 * 00246 *--------------------------------------------------------------------------*/ 00247 gboolean ipc_menu_set_item_label ( const char *name, 00248 const char *parent, 00249 const char *label ); 00250 00251 00252 /**--------------------------------------------------------------------------- 00253 * 00254 * Name : ipc_menu_show_menu 00255 * 00256 * @brief Send message showMenu to popup menu 00257 * 00258 * @param [in] name - name (mnemonic) of menu to be displayed 00259 * 00260 * @return TRUE on success, FALSE otherwise 00261 * 00262 *--------------------------------------------------------------------------*/ 00263 gboolean ipc_menu_show_menu ( const char *name ); 00264 00265 00266 /**--------------------------------------------------------------------------- 00267 * 00268 * Name : ipc_remove_menu 00269 * 00270 * @brief Remove menu from popup menu 00271 * 00272 * @param [in] name - name (mnemonic) of menu to be removed 00273 * 00274 * @return -- 00275 * 00276 *--------------------------------------------------------------------------*/ 00277 gboolean ipc_remove_menu( const char *name ); 00278 00279 00280 /**--------------------------------------------------------------------------- 00281 * 00282 * Name : ipc_menu_set_group_state 00283 * 00284 * @brief Send message setItemState to popup menu 00285 * 00286 * @param [in] name - name (mnemonic) of menu group to be set 00287 * @param [in] state - new state ("normal", "disabled") 00288 * 00289 * @return TRUE on success, FALSE otherwise 00290 * 00291 *--------------------------------------------------------------------------*/ 00292 gboolean ipc_menu_set_group_state ( const char *name, 00293 const char *state ); 00294 00295 00296 /**--------------------------------------------------------------------------- 00297 * 00298 * Name : ipc_menu_set_item_state 00299 * 00300 * @brief Send message setItemState to popup menu 00301 * 00302 * @param [in] name - name (mnemonic) of menu item to be set 00303 * @param [in] parent - name (mnemomic) of the menu group this item belongs to 00304 * @param [in] state - new state ("normal", "selected", "disabled") 00305 * 00306 * @return TRUE on success, FALSE otherwise 00307 * 00308 *--------------------------------------------------------------------------*/ 00309 gboolean ipc_menu_set_item_state ( const char *name, 00310 const char *parent, 00311 const char *state ); 00312 00313 gboolean ipc_sys_connect ( void ); 00314 gboolean ipc_sys_disconnect ( void ); 00315 gint ipc_sys_start_task ( const gchar *cmd_line, 00316 const gchar *work_dir, 00317 const gchar *label, 00318 const gchar *thumbnail_path, 00319 gchar **err_message ); 00320 const device_caps_t* ipc_sys_get_device_capabilities ( void ); 00321 00322 00323 G_END_DECLS 00324 00325 #endif /* __IPC_H__ */