hello-world/include/ipc.h

Go to the documentation of this file.
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 hello-world.
00012  *
00013  * hello-world 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  * hello-world 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 #include <liberipc/eripc.h>
00038 
00039 G_BEGIN_DECLS
00040 
00041 
00042 //----------------------------------------------------------------------------
00043 // Definitions
00044 //---------------------------------------------------------------------------- 
00045 
00046 
00047 //----------------------------------------------------------------------------
00048 // Forward Declarations
00049 //----------------------------------------------------------------------------
00050 
00051 
00052 //----------------------------------------------------------------------------
00053 // Type Declarations
00054 //----------------------------------------------------------------------------
00055 
00056 
00057 //----------------------------------------------------------------------------
00058 // Global Constants
00059 //----------------------------------------------------------------------------
00060 
00061 
00062 //============================================================================
00063 // Public Functions
00064 //============================================================================
00065 
00066 /**---------------------------------------------------------------------------
00067  *
00068  * Name :  ipc_set_services
00069  *
00070  * @brief  Setup IPC connection and register API functions
00071  *
00072  * @param  --
00073  *
00074  * @return --
00075  *
00076  *--------------------------------------------------------------------------*/
00077 void ipc_set_services ( void );
00078 
00079 
00080 /**---------------------------------------------------------------------------
00081  *
00082  * Name :  ipc_unset_services
00083  *
00084  * @brief  Unregister API functions
00085  *
00086  * @param  --
00087  *
00088  * @return --
00089  *
00090  *--------------------------------------------------------------------------*/
00091 void ipc_unset_services ( void );
00092 
00093 
00094 /**---------------------------------------------------------------------------
00095  *
00096  * Name :  ipc_sys_startup_complete
00097  *
00098  * @brief  Report "application started" to sysd
00099  *
00100  * @param  --
00101  *
00102  * @return --
00103  *
00104  *--------------------------------------------------------------------------*/
00105 void ipc_sys_startup_complete ( void );
00106 
00107 
00108 /**---------------------------------------------------------------------------
00109  *
00110  * Name :  ipc_sys_start_task
00111  *
00112  * @brief  Send message startTask to system control,
00113  *         usually to open a document in the relevant viewer application
00114  *
00115  * @param  [in]  cmd_line - command-line to launch the task (executable + options)
00116  * @param  [in]  work_dir - working directory in which to start this task
00117  * @param  [in]  label - text to show in popup menu
00118  * @param  [in]  thumbnail_path - the file containing the thumbnail to show in popup menu
00119  * @param  [out] err_message - error message text from application
00120  *
00121  * @return error code (0 for success, >0 for failure)
00122  *
00123  *--------------------------------------------------------------------------*/
00124 gint ipc_sys_start_task ( const gchar  *cmd_line,
00125                           const gchar  *work_dir,
00126                           const gchar  *label,
00127                           const gchar  *thumbnail_path,
00128                           gchar        **err_message );
00129 
00130 
00131 /**---------------------------------------------------------------------------
00132  *
00133  * Name :  ipc_sys_stop_task
00134  *
00135  * @brief  Send message stopTask to system control,
00136  *         usually to close a documen that has previously been open using ipc_sys_start_task()
00137  *
00138  * @param  [in] cmd_line - command-line passed to ipc_sys_start_task() when launching the task
00139  *
00140  * @return TRUE on success, FALSE otherwise
00141  *
00142  *--------------------------------------------------------------------------*/
00143 gboolean ipc_sys_stop_task ( const gchar  *cmd_line );
00144 
00145 
00146 /**---------------------------------------------------------------------------
00147  *
00148  * Name :  ipc_menu_add_menu
00149  *
00150  * @brief  Send message addMenu to popup menu
00151  *
00152  * @param  [in] name - name (mnemonic) of the menu
00153  * @param  [in] group1 .. group3 - name (mnemonic) of the menu groups
00154  *
00155  * @return TRUE on success, FALSE otherwise
00156  *
00157  *--------------------------------------------------------------------------*/
00158 gboolean ipc_menu_add_menu ( const char *name,
00159                              const char *group1,
00160                              const char *group2,
00161                              const char *group3 );
00162 
00163 
00164 /**---------------------------------------------------------------------------
00165  *
00166  * Name :  ipc_menu_add_group
00167  *
00168  * @brief  Send message addGroup to popup menu
00169  *
00170  * @param  [in] name - name (mnemonic) of menu group
00171  * @param  [in] parent - name (mnemonic) of the group this group belongs to,
00172  *                       or NULL when this group is at the highest level
00173  * @param  [in] image - icon bitmap file
00174  *
00175  * @return TRUE on success, FALSE otherwise
00176  *
00177  *--------------------------------------------------------------------------*/
00178 gboolean ipc_menu_add_group ( const char *name,
00179                               const char *parent, 
00180                               const char *image  );
00181 
00182 
00183 /**---------------------------------------------------------------------------
00184  *
00185  * Name :  ipc_menu_add_item
00186  *
00187  * @brief  Send message addGroup to popup menu
00188  *
00189  * @param  [in] name - name (mnemonic) of menu item
00190  * @param  [in] parent - name (mnemomic) of the menu group this item belongs to
00191  * @param  [in] image - icon bitmap file
00192  *
00193  * @return TRUE on success, FALSE otherwise
00194  *
00195  *--------------------------------------------------------------------------*/
00196 gboolean ipc_menu_add_item ( const char *name,
00197                              const char *parent, 
00198                              const char *image  );
00199 
00200 
00201 /**---------------------------------------------------------------------------
00202  *
00203  * Name :  ipc_menu_set_menu_label
00204  *
00205  * @brief  Send message setMenuLabel to popup menu
00206  *
00207  * @param  [in] name - name (mnemonic) of the menu
00208  * @param  [in] label - on-screen text at the top of the menu
00209  *
00210  * @return TRUE on success, FALSE otherwise
00211  *
00212  *--------------------------------------------------------------------------*/
00213 gboolean ipc_menu_set_menu_label ( const char *name,
00214                                    const char *label );
00215 
00216 
00217 /**---------------------------------------------------------------------------
00218  *
00219  * Name :  ipc_menu_set_group_label
00220  *
00221  * @brief  Send message setGroupLabel to popup menu
00222  *
00223  * @param  [in] name - name (mnemonic) of menu group
00224  * @param  [in] label - on-screen text at the top of the menu group
00225  *
00226  * @return TRUE on success, FALSE otherwise
00227  *
00228  *--------------------------------------------------------------------------*/
00229 gboolean ipc_menu_set_group_label ( const char *name,
00230                                     const char *label );
00231 
00232 
00233 /**---------------------------------------------------------------------------
00234  *
00235  * Name :  ipc_menu_set_item_label
00236  *
00237  * @brief  Send message setItemLabel to popup menu
00238  *
00239  * @param  [in] name - name (mnemonic) of menu item
00240  * @param  [in] parent - name (mnemomic) of the menu group this item belongs to
00241  * @param  [in] label - on-screen text below icon
00242  *
00243  * @return TRUE on success, FALSE otherwise
00244  *
00245  *--------------------------------------------------------------------------*/
00246 gboolean ipc_menu_set_item_label ( const char *name,
00247                                    const char *parent, 
00248                                    const char *label );
00249 
00250 
00251 /**---------------------------------------------------------------------------
00252  *
00253  * Name :  ipc_menu_show_menu
00254  *
00255  * @brief  Send message showMenu to popup menu
00256  *
00257  * @param  [in] name - name (mnemonic) of menu to be displayed
00258  *
00259  * @return TRUE on success, FALSE otherwise
00260  *
00261  *--------------------------------------------------------------------------*/
00262 gboolean ipc_menu_show_menu ( const char *name );
00263 
00264 
00265 /**---------------------------------------------------------------------------
00266  *
00267  * Name :  ipc_remove_menu
00268  *
00269  * @brief  Remove menu from popup menu.
00270  *
00271  * @param  [in] name - name (mnemonic) of menu to be removed
00272  *
00273  * @return --
00274  *
00275  *--------------------------------------------------------------------------*/
00276 gboolean ipc_remove_menu( const char *name );
00277 
00278 
00279 /**---------------------------------------------------------------------------
00280  *
00281  * Name :  ipc_menu_set_group_state
00282  *
00283  * @brief  Send message setItemState to popup menu
00284  *
00285  * @param  [in] name - name (mnemonic) of menu group to be set
00286  * @param  [in] state - new state ("normal", "disabled")
00287  *
00288  * @return TRUE on success, FALSE otherwise
00289  *
00290  *--------------------------------------------------------------------------*/
00291 gboolean ipc_menu_set_group_state ( const char *name,
00292                                     const char *state );
00293 
00294 
00295 /**---------------------------------------------------------------------------
00296  *
00297  * Name :  ipc_menu_set_item_state
00298  *
00299  * @brief  Send message setItemState to popup menu
00300  *
00301  * @param  [in] name - name (mnemonic) of menu item to be set
00302  * @param  [in] parent - name (mnemomic) of the menu group this item belongs to
00303  * @param  [in] state - new state ("normal", "selected", "disabled")
00304  *
00305  * @return TRUE on success, FALSE otherwise
00306  *
00307  *--------------------------------------------------------------------------*/
00308 gboolean ipc_menu_set_item_state ( const char *name,
00309                                    const char *parent, 
00310                                    const char *state  );
00311 
00312 
00313 /**---------------------------------------------------------------------------
00314  *
00315  * Name :  ipc_sys_busy
00316  *
00317  * @brief  Send message sysSetBusy to system daemon
00318  *
00319  * @param  [in] look_busy - TRUE to show, FALSE to remove the busy indication
00320  *
00321  * @return TRUE on success, FALSE otherwise
00322  *
00323  *--------------------------------------------------------------------------*/
00324 gboolean ipc_sys_busy( gboolean look_busy );
00325 
00326 
00327 /**---------------------------------------------------------------------------
00328  *
00329  * Name : ipc_sys_is_pageturn_inverted
00330  *
00331  * @brief  Query sysd if pageturning is inverted
00332  *
00333  * @return TRUE if inverted, FALSE otherwise
00334  *
00335  *--------------------------------------------------------------------------*/
00336 gboolean ipc_sys_is_pageturn_inverted();
00337 
00338 
00339 /**---------------------------------------------------------------------------
00340  *
00341  * Name :  ipc_sys_is_in_portrait_mode
00342  *
00343  * @brief  Query sysd if device in portrait mode
00344  *
00345  * @return TRUE if in portrait mode, FALSE otherwise (landscape)
00346  *
00347  *--------------------------------------------------------------------------*/
00348 gboolean ipc_sys_is_in_portrait_mode();
00349 
00350 
00351 G_END_DECLS
00352 
00353 #endif /* __IPC_H__ */
Generated by  doxygen 1.6.2-20100208