include/alp/flightmode.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved.
00003  * Copyright (c) 2006 PalmSource, Inc (an ACCESS company). All rights reserved.
00004  *****************************************************************************/
00012 #ifndef ALP_FLIGHTMODE_H_
00013 #define ALP_FLIGHTMODE_H_
00014 
00030 #include <stdint.h>
00031 #include <stdbool.h>
00032 
00033 #include <gtk/gtk.h>
00034 
00035 #include <alp/sysclass.h>
00036 #include <alp/notifymgr.h>
00037 
00040 #define ALP_FLIGHTMODE_NOTIFICATIONS                                            "/alp/clientflightmode"
00041 #define ALP_FLIGHTMODE_OPERATION_IN_PROGRESS                            "/alp/clientflightmode/operation_in_progress"
00042 #define ALP_FLIGHTMODE_SILENT_MODE_HAS_CHANGED                          "/alp/clientflightmode/silent_mode_has_changed"
00043 
00046 #define ALP_FLIGHTMODE_PRIVATE_NOTIFICATIONS                            "/alp/flightmode/private"
00047 #define ALP_FLIGHTMODE_PRIVATE_NOTIFICATIONS_BASE                       "/alp/flightmode/private/"
00048 #define ALP_FLIGHTMODE_PRIVATE_ENABLER_STATE_CONFIRMATION       "/alp/flightmode/private/enabler_state_confirmation"
00049 #define ALP_FLIGHTMODE_PRIVATE_SILENT_MODE_HAS_CHANGED          "/alp/flightmode/private/silent_mode_has_changed"
00050 #define ALP_FLIGHTMODE_CANCEL_ALL_FLIGHT_MODE_WINDOWS           "/alp/flightmode/private/cancel_all_flight_mode_windows"
00051 
00054 #define ALP_FLIGHTMODE_PHONE_ID                                                         0
00055 #define ALP_FLIGHTMODE_BLUETOOTH_ID                                                     1
00056 #define ALP_FLIGHTMODE_WIFI_ID                                                          2
00057 
00058 
00063 #define ALP_FLIGHTMODE_SETTINGS_DIR_KEY "/alp/flightmode"
00064 
00070 #define ALP_FLIGHTMODE_SETTINGS_DIR_ACCESS_RIGHTS            ((mode_t) S_IRUSR | S_IWUSR | S_IXUSR | \
00071                                                                 S_IRGRP | S_IWGRP | S_IXGRP | \
00072                                                                 S_IROTH | S_IWOTH | S_IXOTH )
00073 
00079 #define ALP_FLIGHTMODE_SETTINGS_DEFAULT_ACCESS_RIGHTS        ((mode_t) S_IRUSR | S_IWUSR | S_IXUSR | \
00080                                                                 S_IRGRP | S_IWGRP | S_IXGRP | \
00081                                                                 S_IROTH | S_IWOTH | S_IXOTH )
00082 
00088 #define ALP_FLIGHTMODE_SETTINGS_GROUP_NAME                  "trusted"
00089 
00092 #define ALP_FLIGHTMODE_VERSION_KEY "/alp/flightmode/version"
00093 #define ALP_FLIGHTMODE_VERSION_STR "v1.0.0"
00094 #define ALP_FLIGHTMODE_VERSION_STR_LEN 6
00095 
00098 #define ALP_FLIGHTMODE_WIRELESS_OFF_STATE_KEY "/alp/flightmode/wireless_state"
00099 
00102 #define ALP_FLIGHTMODE_PENDING_STATE_KEY "/alp/flightmode/pending_state"
00103 
00108 #define ALP_FLIGHTMODE_BASE_KEY_NAME "/alp/flightmode/enablers/"
00109 
00110 
00114 #define ALP_FLIGHTMODE_ERROR                                                            ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00010000))
00115 #define ALP_FLIGHTMODE_BAD_PARAMETER_ERROR                                      ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00020000))
00116 #define ALP_FLIGHTMODE_NOT_PROPERLY_INSTALLED_ERROR                     ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00030000))
00117         
00118 #define ALP_FLIGHTMODE_START_FAILED_ERROR                                       ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00040000))
00119 #define ALP_FLIGHTMODE_STOP_FAILED_ERROR                                        ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00050000))
00120 
00121 #define ALP_FLIGHTMODE_CALLBACKS_REGISTERING_FAILED_ERROR       ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00060000))
00122 
00123 #define ALP_FLIGHTMODE_NO_ENABLERS_ERROR                                        ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00070000))
00124 #define ALP_FLIGHTMODE_NO_STORAGE_ERROR                                         ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00080000))
00125 #define ALP_FLIGHTMODE_CANT_GET_ENABLER_ERROR                           ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00090000))
00126 
00127 #define ALP_FLIGHTMODE_ENABLER_NOT_FOUND_ERROR                          ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000A0000))
00128 #define ALP_FLIGHTMODE_ENABLER_LOAD_FAILED_ERROR                        ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000B0000))
00129 #define ALP_FLIGHTMODE_ENABLER_DATA_ACCESS_FAILED_ERROR         ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000C0000))
00130 #define ALP_FLIGHTMODE_ENABLER_CALL_FAILED_ERROR                        ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000D0000))
00131 #define ALP_FLIGHTMODE_ENABLER_REGISTERING_FAILED_ERROR         ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000E0000))
00132 
00133 #define ALP_FLIGHTMODE_WIRELESS_COMPONENT_ERROR                         ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000F0000))
00134 #define ALP_FLIGHTMODE_INITIALIZE_PREFS_ERROR                           ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00100000))
00135 #define ALP_FLIGHTMODE_FINALIZE_PREFS_ERROR                                     ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00110000))
00136 
00137 #define ALP_NOTIFY_PLUGIN_REGISTER_SERVER(notifyType, plugin_id, callbackProc, userData, priority, flags) alp_notify_register((notifyType)(plugin_id), callbackProc, userData,  priority,  flags)
00138 #define ALP_NOTIFY_PLUGIN_UNREGISTER_SERVER(notifyType, plugin_id, flags) alp_notify_unregister(notifyType plugin_id, flags)
00139 
00140 #define ALP_NOTIFY_PLUGIN_UNREGISTER(appID, notifyType, plugin_id, priority, flags) alp_notify_unregister_launch(appID, (notifyType)(plugin_id),  flags)
00141 #define ALP_NOTIFY_PLUGIN_REGISTER(appID, notifyType, plugin_id, priority, flags) alp_notify_register_launch(appID, notifyType plugin_id,  priority,  flags)
00142 
00143 
00146 typedef struct _AlpFlightModeProgressNotifyTag AlpFlightModeProgressNotifyType;
00147 struct _AlpFlightModeProgressNotifyTag {
00148         char            wireless_enabler_name[30+1];
00149         bool            wireless_enabler_state;
00150         char            stage_name[30+1];
00151         guint32         stage;
00152         guint32 steps;
00153 };
00154 
00157 typedef struct _AlpFlightModeEnablerStateConfirmationTag AlpFlightModeEnablerStateConfirmationType;
00158 struct _AlpFlightModeEnablerStateConfirmationTag {
00159         gboolean wireless_off_state;
00160         gboolean pending;
00161         gboolean enablers_pending;
00162         gboolean enabler_state;
00163 };
00164 
00167 typedef struct _AlpFlightModeHasChangedNotifyTag AlpFlightModeHasChangedNotifyType;
00168 struct _AlpFlightModeHasChangedNotifyTag {
00169         gboolean wireless_off_state;
00170         gboolean pending;
00171 };
00172 
00173 typedef void* AlpFlightModeExternalStoragePtr;
00174 
00175 #ifdef __cplusplus
00176 extern "C" {
00177 #endif
00178 
00179 
00180 
00210 gboolean alp_flightmode_can_activate_wireless_silent_mode (GtkWindow * windowParentP, char* wirelessComponentNameP, gboolean force);
00211 
00212 
00225 gboolean alp_flightmode_wireless_silent_get_mode(void);
00226 
00227 
00228 
00250 void alp_flightmode_change_wireless_silent_mode(GtkWindow * windowParentP, AlpFlightModeExternalStoragePtr external_storage_ptr);
00251 
00252 
00261 void alp_flightmode_close_dialogs(AlpFlightModeExternalStoragePtr external_storage_ptr);
00262 
00276 gboolean alp_flightmode_installed(char* version, size_t size);
00277 
00278 
00301 alp_status_t alp_flightmode_wireless_enabler_set_activity(AlpFlightModeExternalStoragePtr external_storage_ptr, uint32_t enablerId, gboolean state, gboolean notify);
00302 
00303 
00322 alp_status_t alp_flightmode_wireless_enabler_get_activity(AlpFlightModeExternalStoragePtr external_storage_ptr, uint32_t enablerId, gboolean* state);
00323 
00324 
00335 alp_status_t alp_flightmode_wireless_deactive_all(AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify);
00336 
00348 alp_status_t alp_flightmode_wireless_active_all(AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify);
00349 
00350 
00365 alp_status_t alp_flightmode_wireless_restore_all(AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify);
00366 
00367 
00380 void alp_flightmode_broadcast_change(void);
00381 
00382 
00393 gboolean alp_flightmode_get_pending(AlpFlightModeExternalStoragePtr external_storage_ptr);
00394 
00395 
00407 alp_status_t alp_flightmode_register_callbacks(AlpFlightModeExternalStoragePtr external_storage_ptr);
00408 
00423 alp_status_t alp_flightmode_unregister_callbacks(AlpFlightModeExternalStoragePtr external_storage_ptr);
00424 
00425 
00446 void alp_flightmode_enabler_state_confirmation(gboolean wireless_off_state, gboolean enabler_state);
00447 
00448 
00456 alp_status_t alp_flightmode_init(AlpFlightModeExternalStoragePtr* external_storage_ptr);
00457 
00458 
00459 
00468 alp_status_t alp_flightmode_fini(AlpFlightModeExternalStoragePtr* external_storage_ptr);
00469 
00470 
00471 
00472 
00478 #ifdef __cplusplus
00479 }
00480 #endif
00481 
00482 #endif
00483 

Generated on Wed Jul 30 07:06:39 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.