sysd/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 sysd.
00012  *
00013  * sysd 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  * sysd 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) 2008 iRex Technologies B.V.
00029  * All rights reserved.
00030  */
00031 
00032 
00033 //----------------------------------------------------------------------------
00034 // Include Files
00035 //----------------------------------------------------------------------------
00036 
00037 #include <liberipc/eripc.h>
00038 #include "system.h"
00039 
00040 G_BEGIN_DECLS
00041 
00042 
00043 //----------------------------------------------------------------------------
00044 // Definitions
00045 //---------------------------------------------------------------------------- 
00046 
00047 /**
00048  * System Control IPC DBUS interface description
00049  *    
00050  * Methods incoming
00051  * ================
00052  * Name:     sysGetBatteryState Get the battery level and charge state
00053  * Args:     (none)
00054  * Returns:  1) level           integer, current battery level in percent
00055  *           2) state           string, charge state: "low", "charging", "discharging", "full"
00056  *
00057  * Name:     sysGetOrientation  Get the display orientation
00058  * Args:     (none)
00059  * Returns:  string, state: "portrait","landscape_clockwise","landscape_anticlockwise"
00060  *
00061  * Name:     sysGetPageturnInverted  Get the pageturn mode (inverted or normal)
00062  * Args:     (none)
00063  * Returns:  boolean, TRUE if page turning is inverted, FALSE of page turning is normal
00064  *
00065  * Name:     sysGetCardMountPoint get mountpoint of SDCard
00066  * Args:     (none)
00067  * Returns:  string , mountpoint (eg /media/mmcblk0p1) if mounted, NULL if not.
00068  *
00069  * Name:     sysGetDeviceCapabilities  Get the device's capabilities
00070  * Args:     (none)
00071  * Returns:  1) has_stylus      boolean, TRUE if device has stylus, FALSE otherwise
00072  *           2) has_wifi        boolean, TRUE if device has wifi, FALSE otherwise
00073  *           3) has_bluetooth   boolean, TRUE if device has bluetooth, FALSE otherwise
00074  *
00075  * Name:     sysSetBusy         Set busy indication
00076  * Args:     1) state           string, mode "nodialog", "delaydialog", "directdialog"
00077  *           2) message         string, message text or NULL for default text
00078  * Returns:  boolean, TRUE on success, FALSE otherwise
00079  *     
00080  * Name:     sysResetBusy       Reset busy indication
00081  * Args:     (none)
00082  * Returns:  boolean, TRUE on success, FALSE otherwise
00083  *     
00084  * Name:     sysSetBgBusy       Set background busy 
00085  * Args:     (none)
00086  * Returns:  boolean, TRUE on success, FALSE otherwise
00087  *     
00088  * Name:     sysResetBgBusy     Reset background busy indication
00089  * Args:     (none)
00090  * Returns:  boolean, TRUE on success, FALSE otherwise
00091  *     
00092  * Name:     sysBeep            Set system beep tone
00093  * Args:     1) duration_ms     integer, length of tone in ms (use intervals of 10ms) 
00094  *           2) tone            string, tone pitch: "high", "low"
00095  * Returns:  boolean, TRUE on success, FALSE otherwise
00096  *
00097  * Name:     sysRotate          Set orientation of display
00098  * Args:     1) mode            string, new mode: "portrait", "landscape", "toggle"
00099  * Returns:  boolean, TRUE on success, FALSE otherwise
00100  *
00101  * Name:     sysLockSensors     Set locking of sensors
00102  * Args:     1) mode            string, new mode: "lock", "unlock", "toggle"
00103  * Returns:  boolean, TRUE on success, FALSE otherwise
00104  *
00105  * Name:     sysGetStylus       Get stylus mode
00106  * Args:     none
00107  * Returns:  boolean, TRUE of enabled, FALSE otherwise
00108  *
00109  * Name:     sysSetStylus       Set stylus mode 
00110  * Args:     1) mode            string, new mode: "enable", "disable", "suspend", "resume", "high", "normal"
00111  * Returns:  boolean, TRUE on success, FALSE otherwise
00112  *
00113  * Name:     sysCardMount       Mount volume(s) on SD card
00114  * Args:     none
00115  * Returns:  boolean, TRUE on success, FALSE otherwise
00116  * Action:   Success means the command was executed and unmount has been started. When a volume
00117  *           is mounted this is reported through the broadcasted sysVolumeMounted signal
00118  *
00119  * Name:     sysCardUnmount     Unmount volume(s) on SD card
00120  * Args:     none
00121  * Returns:  boolean, TRUE on success, FALSE otherwise
00122  * Action:   Success means the command was executed and unmount has been started. When a volume
00123  *           is unmounted this is reported through the broadcasted sysVolumeUnmounted signal
00124  *
00125  * Name:     sysShutdown        Graciously shut down the device
00126  * Args:     none
00127  * Returns:  boolean, TRUE on success, FALSE otherwise
00128  * Action:   Success means the command was executed and shutdown has been initiated.
00129  *
00130  * Name:     startTask          Start a task
00131  * Args:     1) command_line    string, full path to application with arguments
00132  *           2) working_dir     string, current working directory
00133  *           3) label           string, text label shown under icon in popup menu
00134  *           4) image           string, full path to icon shown in popup menu (png, 60x60 pixels)
00135  * Returns:  1) error_code      integer, (1) error starting application
00136  *                                       (2) timeout waiting for application window
00137  *                                       (3) application exited before creating a window 
00138  *                                       (4) application returned an error (errr_msg follows)
00139  *           2) error_msg       string, error message text from application or NULL
00140  * Example:  dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.startTask string:"uds /usr/share/icons/file.png" string:"/usr/bin" string:"Document1" string:open
00141  *           dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.startTask string:"uds /media/mmcblk0p1/Library/test.txt" string:"/usr/bin" string:"Document1" string:open
00142  *           dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.startTask string:"firstboot" string:"/usr/bin" string:"firstboot" string:open
00143  *
00144  * Name:     stopTask           Stop a running task
00145  * Args:     1) command_line    string, full path to application with arguments
00146  * Returns:  boolean, TRUE on success, FALSE otherwise
00147  * 
00148  * Name:     activateTask       Activate a running task
00149  * Args:     1) command_line    string, full path to application with arguments
00150  * Returns:  boolean, TRUE on success, FALSE otherwise
00151  * 
00152  * Name:     menuRequestPopup   Set the popupmenu state when possible
00153  * Args:     1) state           string, new state: "show", "hide", "toggle", "block", "unblock"
00154  * Returns:  boolean, TRUE on success, FALSE otherwise
00155  * 
00156  * Name:     openUrl            Open URL in the web browser
00157  * Args:     1) url             string, URL
00158  *           2) label           string, text label shown under icon in popup menu, or NULL to derive from URL
00159  *           3) application     string, application name shown in "Back" bar of browser, or NULL to omit this bar
00160  * Returns:  1) error_code      integer, (1) error starting browser application
00161  *                                       (2) timeout waiting for browser window
00162  *                                       (3) browser exited before creating a window 
00163  *                                       (4) browser returned an error (errr_msg follows)
00164  *                                       (5) device does not have networking capabilities so browser is not started
00165  *           2) error_msg       string, error message text from application or NULL
00166  * Example:  dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openUrl string:"http://www.irextechnologies.com"
00167  *           dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openUrl string:"http://www.irextechnologies.com" string:"iRex homepage" string:"Home"
00168  *           dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openUrl string:"file:///media/mmcblk0p1/test.html" string:"Test page"
00169  *
00170  * Name:     openedWindow       Notify that a window was opened
00171  * Args:     1) application     string, base name of the application
00172  *           2) document        string, full path of the document
00173  *           3) label           string, text label shown under icon in popup menu
00174  *           4) image           string, full path to icon shown in popup menu (png, 60x60 pixels)
00175  *           5) ipc_service     string, IPC service name of the application
00176  *           6) pid             integer, process id
00177  *           7) window          integer, window ID (XID)
00178  * Returns:  boolean, TRUE on success, FALSE otherwise
00179  * When:     Send when a window was opened which is to be added to the Task Manager of Popupmenu. 
00180  *           Don't use this call when a window is opened in response to "openFile".
00181  * Example:  dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openedWindow string:"uds" string:"/media/mmcblk0p1/eBooks/bla.pdf" string:"bla" string:open string:com.irexnet.uds int32:2455 int32:12345
00182  * 
00183  * Name:     closedWindow       Notify that a window was closed
00184  * Args:     1) window          integer, window ID (XID)
00185  * Returns:  boolean, TRUE on success, FALSE otherwise
00186  * When:     Send when a window was closed which is listed in the Task Manager of Popupmenu. 
00187  *           Don't use this call when a window is closed in response to "closeFile".
00188  *    
00189  * Name:     connConnect        Request a network connection
00190  * Args:     1) ipc_service     string, IPC service name of the application
00191  *           2) medium          string, connection medium or NULL for automatic selection
00192  *           3) profile         string, gconf path of network profile to use or NULL for automatic selection
00193  * Returns:  boolean, TRUE on success, FALSE otherwise
00194  * Example:  dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.connConnect string:"com.irexnet.erbrowser" string:"wifi" string:""
00195  *
00196  * Name:     connDisconnect     Release the network connection
00197  * Args:     1) ipc_service     string, IPC service name of the application
00198  * Returns:  boolean, TRUE on success, FALSE otherwise
00199  * Example:  dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.connDisconnect string:"com.irexnet.erbrowser"
00200  *
00201  * Name:     connConnectionStatus  Set the connection status
00202  * Args:     1) is_connected    boolean, TRUE if connection is online, FALSE otherwise
00203  *           2) medium          string, connection medium in use
00204  *           3) profile         string, gconf path of network profile in use
00205  * Returns:  boolean, TRUE on success, FALSE otherwise
00206  *
00207  * Name:     connConnectionStatusRequest Ask the connection status
00208  * Args:     none
00209  * Returns:  boolean, TRUE on success, FALSE otherwise
00210  *
00211  *
00212  * Signal incoming
00213  * ===============
00214  *
00215  * Name:     startupComplete    Indicate that an application has finished startup
00216  * Args:     1) name            string, name of application (eg "settings" or "ctb")
00217  *           2) pid             integer, process id
00218  *           3) is_multidoc     boolean, TRUE if application can open/close documents over IPC, FALSE otherwise
00219  *           4) ipc_service     string, IPC service name (eg "/com/irexnet/ctb"), or NULL when no IPC services are implemented
00220  *           5) xid             integer, window id; set to 0 when the application should not be shown in the Task Manager
00221  *
00222  * 
00223  * Method calls outgoing
00224  * =====================
00225  *     
00226  * Name:     openFile           Open a file in a window
00227  * Args:     1) file            string, path to file
00228  * Returns:  1) integer, X window on success, -1 on failure
00229  *           2) string, custom error message or NULL for none
00230  * When:     Sent when a file, document or url is to be closed but the application (callee)
00231  * Action:   Application (callee) should create and realise, or reuse an existing window 
00232  *           for the given file and return the X window id in the method reply. The X window 
00233  *           can be obtained using GDK_WINDOW_XID(widget->window). When the file is already 
00234  *           opened by the callee, it may just return its X window id. This call implies that
00235  *           the window is activated (set to the foreground) so callee should also set its 
00236  *           context for the given window and set the Popupmenu menu context. 
00237  *           System Daemon adds a task to Task Manager of Popupmenu, or replaces the task 
00238  *           when an existing window is returned.
00239  *      
00240  * Name:     activatedWindow    Notify that a window was activated
00241  * Args:     1) window          integer, X window of the file
00242  * Returns:  boolean, TRUE on success, FALSE on failure
00243  * When:     Sent after a window was activated (set to the foreground)
00244  * Action:   Application (callee) should set its context for the given window and set the 
00245  *           Popupmenu menu context.
00246  *     
00247  * Name:     deactivatedWindow  Notify that a window was deactivated
00248  * Args:     1) window          integer, X window of the file
00249  * Returns:  boolean, TRUE on success, FALSE on failure
00250  * When:     Sent after a window was deactivated (set to the background)
00251  * Action:   Application (callee) may adapt its context and free resources.
00252  *
00253  * Name:     closeFile          Close a file
00254  * Args:     1) file            string, path to file
00255  * Returns:  boolean, TRUE on success, FALSE on failure
00256  * When:     Sent when a file, document or url is to be closed by the application (callee)
00257  * Action:   Application (callee) should close the file and may destroy its window and free 
00258  *           other resources. System Daemon removes the task from the Task Manager of Popupmenu.
00259  *
00260  *
00261  * Signals outgoing
00262  * ================
00263  * 
00264  * Name:     sysBatteryState
00265  * Args:     1) level           integer, charge level in percent
00266  *           2) state           string, state: "low", "charging", "discharging", "full"
00267  * When:     Sent on state change and when battery level changed n% (default: 5%)
00268  * Action:   Applications may use this information to inform the user.
00269  *     
00270  * Name:     sysPrepareStandby
00271  * Args:     (none)
00272  * When:     Sent just before the system enters standby mode
00273  * Action:   Applications must commit changes (flush) of all its open files. Failing to 
00274  *           handle this signal may result in unsaved data or currupt files.
00275  *
00276  * Name:     sysPrepareUnmount
00277  * Args:     1) mount_point     string, mount point of volume
00278  * When:     Sent just before unmounting the volume
00279  * Action:   Applications must close all its open files on the given volume. Failing to 
00280  *           handle this signal may result in unsaved data or currupt files.
00281  * Example:  dbus-send --type=signal --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.sysPrepareUnmount string:/media/mmcblk0p1
00282  *
00283  * Name:     sysVolumeMounted
00284  * Args:     1) mount_point     string, mount point of volume
00285  * When:     Sent just after a volume is mounted
00286  * Action:   Applications may use this to add/open the new volume.
00287  *     
00288  * Name:     sysVolumeUnmounted
00289  * Args:     1) mount_point     string, mount point of volume
00290  * When:     Sent just after unmounting the volume
00291  * Action:   Typically an application should have responded to a prior sysPrepareUnmount 
00292  *           signal, but when a device with volumes was removed unexpectedly it may need 
00293  *           to act on this signal.
00294  *     
00295  * Name:     sysChangedLocale
00296  * Args:     1) locale          string, locale code (ll_CC)
00297  * When:     Sent when the system's locale has changed
00298  * Action:   Applications should load language dependent screen texts and probably set new 
00299  *           labels for its menu items; to activate a new locale application should call:
00300  *             g_setenv("LANG", new_locale, TRUE);
00301  *             setlocale(LC_ALL, "");
00302  *
00303  * Name:     sysChangedPageturnInverted
00304  * Args:     1) is_inverted          boolean
00305  * When:     Sent when the system's pageturnmode  has changed
00306  * Action:   Applications (UDS) should invert the page turning. If is_inverted == TRUE, turn pages as in book
00307  *    
00308  * Name:     sysChangedOrientation
00309  * Args:     1) state           string, state: "portrait", "landscape_clockwise", "landscape_anticlockwise"
00310  * When:     Sent when the display's orientation has changed
00311  * Action:   Applications may need to adapt its screen size, coordinates and/or origin.
00312  *    
00313  * Name:     sysUsbState
00314  * Args:     1) state           string, state: "disconnected", "unmounted", "mounted"
00315  * When:     Sent on state change of USB connection to computer
00316  * Action:   Applications may use this information to control end user info.
00317  *
00318  */
00319 
00320 //----------------------------------------------------------------------------
00321 // Include Files
00322 //----------------------------------------------------------------------------
00323 
00324 #include <liberipc/eripc_support.h>
00325 
00326 
00327 //----------------------------------------------------------------------------
00328 // Forward Declarations
00329 //----------------------------------------------------------------------------
00330 
00331 #define DBUS_APPL_NAME          PACKAGE_NAME
00332                                 
00333 #define DBUS_SERVICE            "com.irexnet."  DBUS_APPL_NAME
00334 #define DBUS_PATH               "/com/irexnet/" DBUS_APPL_NAME
00335 #define DBUS_INTERFACE          "com.irexnet."  DBUS_APPL_NAME
00336                                 
00337 #define DBUS_SERVICE_CTB        "com.irexnet.ctb"
00338 #define DBUS_SERVICE_MENU       "com.irexnet.popupmenu"
00339 #define DBUS_SERVICE_CONN_WIFI  "com.irexnet.connwifi"
00340 #define DBUS_SERVICE_CONN_BLUE  "com.irexnet.connblue"
00341 #define DBUS_SERVICE_CONN_3G    "com.irexnet.conn3g"
00342 
00343     
00344 //----------------------------------------------------------------------------
00345 // Type Declarations
00346 //----------------------------------------------------------------------------
00347 
00348 //----------------------------------------------------------------------------
00349 // Global Constants
00350 //----------------------------------------------------------------------------
00351 
00352 extern eripc_client_context_t *eripcClient;
00353 
00354 
00355 //============================================================================
00356 // Public Functions
00357 //============================================================================
00358 
00359 /**---------------------------------------------------------------------------
00360  *
00361  * Name :  ipc_set_services
00362  *
00363  * @brief  Setup IPC connection and register API functions
00364  *
00365  * @param  --
00366  *
00367  * @return --
00368  *
00369  *--------------------------------------------------------------------------*/
00370 void ipc_set_services(void);
00371 
00372 /**---------------------------------------------------------------------------
00373  *
00374  * Name :  ipc_unset_services
00375  *
00376  * @brief  Unregister API functions
00377  *
00378  * @param  --
00379  *
00380  * @return --
00381  *
00382  *--------------------------------------------------------------------------*/
00383 void ipc_unset_services(void);
00384 
00385 /**---------------------------------------------------------------------------
00386  *
00387  * Name :  ipc_send_battery_state
00388  *
00389  * @brief  Send the sysBatteryState signal
00390  *
00391  * @param  battery_level Battery capacity remaining percentage
00392  * @param  state_charge  Battery charge mode
00393  * @param  time_left     Minutes to empty (discharging) or -1 (charging)
00394  *
00395  * @return --
00396  *
00397  *--------------------------------------------------------------------------*/
00398 void ipc_send_battery_state(gint battery_level, enum state_charge, gint time_left);
00399 
00400 /**---------------------------------------------------------------------------
00401  *
00402  * Name :  ipc_send_prepare_standby
00403  *
00404  * @brief  Send the sysPrepareStandby signal
00405  *
00406  * @param  --
00407  *
00408  * @return --
00409  *
00410  *--------------------------------------------------------------------------*/
00411 void ipc_send_prepare_standby(void);
00412 
00413 /**---------------------------------------------------------------------------
00414  *
00415  * Name :  ipc_send_prepare_unmount
00416  *
00417  * @brief  Send the sysPrepareUnmount signal
00418  *
00419  * @param  mount_point Mount point
00420  *
00421  * @return --
00422  *
00423  *--------------------------------------------------------------------------*/
00424 void ipc_send_prepare_unmount(const char *mount_point);
00425 
00426 /**---------------------------------------------------------------------------
00427  *
00428  * Name :  ipc_menu_set_item_state
00429  *
00430  * @brief  Set new menu item state
00431  *
00432  * @param  iname Item name
00433  * @param  pname Parent group name
00434  * @param  state State name
00435  *
00436  * @return --
00437  *
00438  *--------------------------------------------------------------------------*/
00439 void ipc_menu_set_item_state(const char *iname, const char *pname, const char *state);  
00440 
00441 /**---------------------------------------------------------------------------
00442  *
00443  * Name :  ipc_menu_set_statusitem_state
00444  *
00445  * @brief  Set new status item state
00446  *
00447  * @param  name Item name
00448  * @param  state State name
00449  *
00450  * @return --
00451  *
00452  *--------------------------------------------------------------------------*/
00453 void ipc_menu_set_statusitem_state(const char *name, const char *state);
00454 
00455 /**---------------------------------------------------------------------------
00456  *
00457  * Name :  ipc_send_volume_mounted
00458  *
00459  * @brief  Emit sysVolumeMounted signal
00460  *
00461  * @param  mount_point Mount point
00462  *
00463  * @return --
00464  *
00465  *--------------------------------------------------------------------------*/
00466 void ipc_send_volume_mounted(const char *mount_point);
00467 
00468 /**---------------------------------------------------------------------------
00469  *
00470  * Name :  ipc_send_volume_unmounted
00471  *
00472  * @brief  Emit sysVolumeUnmounted signal
00473  *
00474  * @param  mount_point Mount point
00475  *
00476  * @return --
00477  *
00478  *--------------------------------------------------------------------------*/
00479 void ipc_send_volume_unmounted(const char *mount_point);
00480 
00481 /**---------------------------------------------------------------------------
00482  *
00483  * Name :  ipc_send_changed_locale
00484  *
00485  * @brief  Emit sysChangedLocale signal
00486  *
00487  * @param  locale Locale string in form ll_CC
00488  *
00489  * @return --
00490  *
00491  *--------------------------------------------------------------------------*/
00492 void ipc_send_changed_locale(const char *locale);
00493 
00494 /**---------------------------------------------------------------------------
00495  *
00496  * Name :  ipc_send_demo_mode
00497  *
00498  * @brief  Emit sysChangeDemoMode signal
00499  *
00500  * @param  demo_mode to enable/disable demo_mode
00501  *
00502  * @return --
00503  *
00504  *--------------------------------------------------------------------------*/
00505 void ipc_send_demo_mode(gboolean demo_mode);
00506 
00507 /**---------------------------------------------------------------------------
00508  *
00509  * Name :  ipc_send_changed_pageturn_inverted
00510  *
00511  * @brief  Emit sysChangedPageturnInverted  signal
00512  *
00513  * @param  boolean is_inverted
00514  *
00515  * @return --
00516  *
00517  *--------------------------------------------------------------------------*/
00518 void ipc_send_changed_pageturn_inverted( gboolean is_inverted);
00519 
00520 /**---------------------------------------------------------------------------
00521  *
00522  * Name :  ipc_ctb_goto
00523  *
00524  * @brief  Set new location for Content Browser
00525  *
00526  * @param  location New location to show ("desktop"|"library")
00527  *
00528  * @return --
00529  *
00530  *--------------------------------------------------------------------------*/
00531 void ipc_ctb_goto(const char *location);
00532 
00533 /**---------------------------------------------------------------------------
00534  *
00535  * Name :  ipc_send_open
00536  *
00537  * @brief  Open new file by application
00538  *
00539  * @param  ipc_interface    IPC service name to send message to
00540  * @param  document         Full path to file
00541  * @param  callback_handler Function to receive reply
00542  * @param  callback_data    Data to pass to callback_handler
00543  *
00544  * @return TRUE if successfully opened by application, FALSE otherwise
00545  *
00546  *--------------------------------------------------------------------------*/
00547 gboolean ipc_send_open(const char *ipc_interface, 
00548                        const char *document, 
00549                        void *callback_handler, 
00550                        void *callback_data);
00551 
00552 /**---------------------------------------------------------------------------
00553  *
00554  * Name :  ipc_send_close
00555  *
00556  * @brief  Close file by application
00557  *
00558  * @param  ipc_interface    IPC service name to send message to
00559  * @param  document         Full path to file
00560  * @param  callback_handler Function to receive reply
00561  * @param  callback_data    Data to pass to callback_handler
00562  *
00563  * @return TRUE if successfully closed by application, FALSE otherwise
00564  *
00565  *--------------------------------------------------------------------------*/
00566 gboolean ipc_send_close(const char *ipc_interface, 
00567                         const char *document, 
00568                         void *callback_handler, 
00569                         void *callback_data);
00570 
00571 /**---------------------------------------------------------------------------
00572  *
00573  * Name :  ipc_send_reply
00574  *
00575  * @brief  Return a IPC reply message
00576  *
00577  * @param  context     ERIPC context to use for reply
00578  * @param  message_id  ERIPC message id to use for reply
00579  * @param  result      Boolean return value
00580  *
00581  * @return --
00582  *
00583  *--------------------------------------------------------------------------*/
00584 void ipc_send_reply(eripc_context_t *context, const char *message_id, gboolean result);
00585 
00586 /**---------------------------------------------------------------------------
00587  *
00588  * Name :  ipc_send_reply_task_start
00589  *
00590  * @brief  Return a IPC reply message to startTask call
00591  *
00592  * @param  context     ERIPC context to use for reply
00593  * @param  message_id  ERIPC message id to use for reply
00594  * @param  err_code    Integer, return code (0 for success, >0 for error)
00595  * @param  err_msg     String, custom error message or NULL for none
00596  *
00597  * @return --
00598  *
00599  *--------------------------------------------------------------------------*/
00600 void ipc_send_reply_task_start(eripc_context_t *context, const char *message_id, gint err_code, gchar *err_msg);
00601 
00602 /**---------------------------------------------------------------------------
00603  *
00604  * Name :  ipc_menu_add_task
00605  *
00606  * @brief  Add a task item
00607  *
00608  * @param  xid         window id
00609  * @param  label       Label text for menu
00610  *
00611  * @return --
00612  *
00613  *--------------------------------------------------------------------------*/
00614 void ipc_menu_add_task(gint xid, const char *label);
00615 
00616 /**---------------------------------------------------------------------------
00617  *
00618  * Name :  ipc_menu_set_first_task
00619  *
00620  * @brief  Set task item to front or list
00621  * 
00622  * @param  xid
00623  *
00624  * @return --
00625  *
00626  *--------------------------------------------------------------------------*/
00627 void ipc_menu_set_first_task(int xid);
00628 
00629 /**---------------------------------------------------------------------------
00630  *
00631  * Name :  ipc_menu_remove_task
00632  *
00633  * @brief  Remove a task item
00634  *
00635  * @param  application Application of task
00636  * @param  document Document of task
00637  *
00638  * @return --
00639  *
00640  *--------------------------------------------------------------------------*/
00641 void ipc_menu_remove_task(int xid);
00642 
00643 void ipc_menu_rename_task(int xid, const char* label);
00644 
00645 /**---------------------------------------------------------------------------
00646  *
00647  * Name :  ipc_show_busy
00648  *
00649  * @brief  Show a busy/wait prompt
00650  *
00651  * @param  show_mode TRUE to show the prompt, FALSE to remove it
00652  * @param  message   Busy message to show in dialog, or NULL for default text
00653  *
00654  * @return --
00655  *
00656  *--------------------------------------------------------------------------*/
00657 void ipc_show_busy(gboolean show_mode, const gchar *message);
00658 
00659 /**---------------------------------------------------------------------------
00660  *
00661  * Name :  ipc_show_splash
00662  *
00663  * @brief  Show a predefined splash screen
00664  *
00665  * @param  type Splash to show ("usbconnect" or "shutdown") or "hide" to remove
00666  *
00667  * @return --
00668  *
00669  *--------------------------------------------------------------------------*/
00670 void ipc_show_splash(const char *type);
00671 
00672 /**---------------------------------------------------------------------------
00673  *
00674  * Name :  ipc_show_message
00675  *
00676  * @brief  Show a predefined message dialog
00677  *
00678  * @param  type Message to show ("safelyremove")
00679  * @param  reply_handler Handler called when a reply is returned
00680  * @param  user_data Data to pass to the reply handler
00681  *
00682  * @return --
00683  *
00684  *--------------------------------------------------------------------------*/
00685 void ipc_show_message(const char *type, const void *reply_handler, const void *user_data);
00686 
00687 /**---------------------------------------------------------------------------
00688  *
00689  * Name :  ipc_confirm_usbconnect
00690  *
00691  * @brief  Ask user to confirm to connect over USB
00692  *
00693  * @param  show_mode TRUE to show the prompt, FALSE to remove it
00694  *
00695  * @return TRUE when user confirmed connection, FALSE otherwise
00696  *
00697  *--------------------------------------------------------------------------*/
00698 void ipc_confirm_usbconnect(gboolean show_mode);
00699 
00700 /**---------------------------------------------------------------------------
00701  *
00702  * Name :  ipc_confirm_install_drz
00703  *
00704  * @brief  Ask user to confirm to restart and install drz file(s)
00705  *
00706  * @param  show_mode TRUE to show the prompt, FALSE to remove it
00707  *
00708  * @return TRUE when user confirmed restart, FALSE otherwise
00709  *
00710  *--------------------------------------------------------------------------*/
00711 void ipc_confirm_install_drz(gboolean show_mode);
00712 
00713 /**---------------------------------------------------------------------------
00714  *
00715  * Name :  ipc_confirm_install_update
00716  *
00717  * @brief  Ask user to confirm to restart and install firmware update
00718  *
00719  * @param  show_mode TRUE to show the prompt, FALSE to remove it
00720  *
00721  * @return TRUE when user confirmed restart, FALSE otherwise
00722  *
00723  *--------------------------------------------------------------------------*/
00724 void ipc_confirm_install_update(gboolean show_mode);
00725 
00726 /**---------------------------------------------------------------------------
00727  *
00728  * Name :  ipc_send_usb_state
00729  *
00730  * @brief  Send the sysUsbState signal
00731  *
00732  * @param  state State ("disconnected", "unmounted", "mounted")
00733  *
00734  * @return --
00735  *
00736  *--------------------------------------------------------------------------*/
00737 void ipc_send_usb_state(const char *state);
00738 
00739 /**---------------------------------------------------------------------------
00740  *
00741  * Name :  ipc_send_volume_mounted_to
00742  *
00743  * @brief  Send the volumeMounted method call to an application
00744  *
00745  * @param  service IPC service
00746  * @param  mount_point Mount point
00747  *
00748  * @return --
00749  *
00750  *--------------------------------------------------------------------------*/
00751 void ipc_send_volume_mounted_to(const char *service, const char *mount_point);
00752 
00753 void ipc_refresh_ctb();
00754 
00755 void ipc_menu_show(const char *menu);
00756 void ipc_show_popup(const char *state);
00757 void ipc_send_changed_orientation(guint orientation);
00758 
00759 gboolean ipc_connect(const char *ipc_service, const char *medium, const char *profile);
00760 gboolean ipc_disconnect(const char *ipc_service);
00761 gboolean ipc_send_conn_status(const char *ipc_service, gboolean is_connected, const char *medium, const char *profile, const char *reason);
00762 gboolean ipc_broadcast_conn_status(gboolean is_connected, const char *medium, const char *profile, const char *reason);
00763 gboolean ipc_add_profile(const char *medium);
00764 gboolean ipc_edit_profile(const char *medium, const char *profile);
00765 
00766 void ipc_send_window_activated(const char *ipc_interface,  gint window);
00767 void ipc_send_window_deactivated(const char *ipc_interface,  gint window);
00768 
00769 G_END_DECLS
00770 
00771 #endif /* __IPC_H__ */
Generated by  doxygen 1.6.2-20100208