include/alp/flightmode.h File Reference


Detailed Description

Public header file for the Flight Mode API.

>

#include <stdint.h>
#include <stdbool.h>
#include <gtk/gtk.h>
#include <alp/sysclass.h>
#include <alp/notifymgr.h>

Go to the source code of this file.

Data Structures

struct  _AlpFlightModeEnablerStateConfirmationTag
struct  _AlpFlightModeHasChangedNotifyTag
struct  _AlpFlightModeProgressNotifyTag

Defines

#define ALP_FLIGHTMODE_BAD_PARAMETER_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00020000))
#define ALP_FLIGHTMODE_BASE_KEY_NAME   "/alp/flightmode/enablers/"
#define ALP_FLIGHTMODE_BLUETOOTH_ID   1
#define ALP_FLIGHTMODE_CALLBACKS_REGISTERING_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00060000))
#define ALP_FLIGHTMODE_CANCEL_ALL_FLIGHT_MODE_WINDOWS   "/alp/flightmode/private/cancel_all_flight_mode_windows"
#define ALP_FLIGHTMODE_CANT_GET_ENABLER_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00090000))
#define ALP_FLIGHTMODE_ENABLER_CALL_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000D0000))
#define ALP_FLIGHTMODE_ENABLER_DATA_ACCESS_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000C0000))
#define ALP_FLIGHTMODE_ENABLER_LOAD_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000B0000))
#define ALP_FLIGHTMODE_ENABLER_NOT_FOUND_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000A0000))
#define ALP_FLIGHTMODE_ENABLER_REGISTERING_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000E0000))
#define ALP_FLIGHTMODE_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00010000))
#define ALP_FLIGHTMODE_FINALIZE_PREFS_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00110000))
#define ALP_FLIGHTMODE_INITIALIZE_PREFS_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00100000))
#define ALP_FLIGHTMODE_NO_ENABLERS_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00070000))
#define ALP_FLIGHTMODE_NO_STORAGE_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00080000))
#define ALP_FLIGHTMODE_NOT_PROPERLY_INSTALLED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00030000))
#define ALP_FLIGHTMODE_NOTIFICATIONS   "/alp/clientflightmode"
#define ALP_FLIGHTMODE_OPERATION_IN_PROGRESS   "/alp/clientflightmode/operation_in_progress"
#define ALP_FLIGHTMODE_PENDING_STATE_KEY   "/alp/flightmode/pending_state"
#define ALP_FLIGHTMODE_PHONE_ID   0
#define ALP_FLIGHTMODE_PRIVATE_ENABLER_STATE_CONFIRMATION   "/alp/flightmode/private/enabler_state_confirmation"
#define ALP_FLIGHTMODE_PRIVATE_NOTIFICATIONS   "/alp/flightmode/private"
#define ALP_FLIGHTMODE_PRIVATE_NOTIFICATIONS_BASE   "/alp/flightmode/private/"
#define ALP_FLIGHTMODE_PRIVATE_SILENT_MODE_HAS_CHANGED   "/alp/flightmode/private/silent_mode_has_changed"
#define ALP_FLIGHTMODE_SETTINGS_DEFAULT_ACCESS_RIGHTS
#define ALP_FLIGHTMODE_SETTINGS_DIR_ACCESS_RIGHTS
#define ALP_FLIGHTMODE_SETTINGS_DIR_KEY   "/alp/flightmode"
#define ALP_FLIGHTMODE_SETTINGS_GROUP_NAME   "trusted"
#define ALP_FLIGHTMODE_SILENT_MODE_HAS_CHANGED   "/alp/clientflightmode/silent_mode_has_changed"
#define ALP_FLIGHTMODE_START_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00040000))
#define ALP_FLIGHTMODE_STOP_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00050000))
#define ALP_FLIGHTMODE_VERSION_KEY   "/alp/flightmode/version"
#define ALP_FLIGHTMODE_VERSION_STR   "v1.0.0"
#define ALP_FLIGHTMODE_VERSION_STR_LEN   6
#define ALP_FLIGHTMODE_WIFI_ID   2
#define ALP_FLIGHTMODE_WIRELESS_COMPONENT_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000F0000))
#define ALP_FLIGHTMODE_WIRELESS_OFF_STATE_KEY   "/alp/flightmode/wireless_state"
#define ALP_NOTIFY_PLUGIN_REGISTER(appID, notifyType, plugin_id, priority, flags)   alp_notify_register_launch(appID, notifyType plugin_id, priority, flags)
#define ALP_NOTIFY_PLUGIN_REGISTER_SERVER(notifyType, plugin_id, callbackProc, userData, priority, flags)   alp_notify_register((notifyType)(plugin_id), callbackProc, userData, priority, flags)
#define ALP_NOTIFY_PLUGIN_UNREGISTER(appID, notifyType, plugin_id, priority, flags)   alp_notify_unregister_launch(appID, (notifyType)(plugin_id), flags)
#define ALP_NOTIFY_PLUGIN_UNREGISTER_SERVER(notifyType, plugin_id, flags)   alp_notify_unregister(notifyType plugin_id, flags)

Typedefs

typedef _AlpFlightModeEnablerStateConfirmationTag AlpFlightModeEnablerStateConfirmationType
typedef void * AlpFlightModeExternalStoragePtr
typedef _AlpFlightModeHasChangedNotifyTag AlpFlightModeHasChangedNotifyType
typedef _AlpFlightModeProgressNotifyTag AlpFlightModeProgressNotifyType

Functions

void alp_flightmode_broadcast_change (void)
gboolean alp_flightmode_can_activate_wireless_silent_mode (GtkWindow *windowParentP, char *wirelessComponentNameP, gboolean force)
void alp_flightmode_change_wireless_silent_mode (GtkWindow *windowParentP, AlpFlightModeExternalStoragePtr external_storage_ptr)
void alp_flightmode_close_dialogs (AlpFlightModeExternalStoragePtr external_storage_ptr)
void alp_flightmode_enabler_state_confirmation (gboolean wireless_off_state, gboolean enabler_state)
alp_status_t alp_flightmode_fini (AlpFlightModeExternalStoragePtr *external_storage_ptr)
gboolean alp_flightmode_get_pending (AlpFlightModeExternalStoragePtr external_storage_ptr)
alp_status_t alp_flightmode_init (AlpFlightModeExternalStoragePtr *external_storage_ptr)
gboolean alp_flightmode_installed (char *version, size_t size)
alp_status_t alp_flightmode_register_callbacks (AlpFlightModeExternalStoragePtr external_storage_ptr)
alp_status_t alp_flightmode_unregister_callbacks (AlpFlightModeExternalStoragePtr external_storage_ptr)
alp_status_t alp_flightmode_wireless_active_all (AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify)
alp_status_t alp_flightmode_wireless_deactive_all (AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify)
alp_status_t alp_flightmode_wireless_enabler_get_activity (AlpFlightModeExternalStoragePtr external_storage_ptr, uint32_t enablerId, gboolean *state)
alp_status_t alp_flightmode_wireless_enabler_set_activity (AlpFlightModeExternalStoragePtr external_storage_ptr, uint32_t enablerId, gboolean state, gboolean notify)
alp_status_t alp_flightmode_wireless_restore_all (AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify)
gboolean alp_flightmode_wireless_silent_get_mode (void)


Define Documentation

#define ALP_FLIGHTMODE_BAD_PARAMETER_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00020000))
 

#define ALP_FLIGHTMODE_BASE_KEY_NAME   "/alp/flightmode/enablers/"
 

Flight mode global settings: enablers directory, subfolder by enablers'name and then by enabler name key a boolean key

#define ALP_FLIGHTMODE_BLUETOOTH_ID   1
 

#define ALP_FLIGHTMODE_CALLBACKS_REGISTERING_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00060000))
 

#define ALP_FLIGHTMODE_CANCEL_ALL_FLIGHT_MODE_WINDOWS   "/alp/flightmode/private/cancel_all_flight_mode_windows"
 

#define ALP_FLIGHTMODE_CANT_GET_ENABLER_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00090000))
 

#define ALP_FLIGHTMODE_ENABLER_CALL_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000D0000))
 

#define ALP_FLIGHTMODE_ENABLER_DATA_ACCESS_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000C0000))
 

#define ALP_FLIGHTMODE_ENABLER_LOAD_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000B0000))
 

#define ALP_FLIGHTMODE_ENABLER_NOT_FOUND_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000A0000))
 

#define ALP_FLIGHTMODE_ENABLER_REGISTERING_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000E0000))
 

#define ALP_FLIGHTMODE_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00010000))
 

Flight mode error codes

#define ALP_FLIGHTMODE_FINALIZE_PREFS_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00110000))
 

#define ALP_FLIGHTMODE_INITIALIZE_PREFS_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00100000))
 

#define ALP_FLIGHTMODE_NO_ENABLERS_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00070000))
 

#define ALP_FLIGHTMODE_NO_STORAGE_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00080000))
 

#define ALP_FLIGHTMODE_NOT_PROPERLY_INSTALLED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00030000))
 

#define ALP_FLIGHTMODE_NOTIFICATIONS   "/alp/clientflightmode"
 

Flight mode public notification

#define ALP_FLIGHTMODE_OPERATION_IN_PROGRESS   "/alp/clientflightmode/operation_in_progress"
 

#define ALP_FLIGHTMODE_PENDING_STATE_KEY   "/alp/flightmode/pending_state"
 

Flight mode global settings: pending mode state (boolean key)

#define ALP_FLIGHTMODE_PHONE_ID   0
 

Flight mode wireless enabler index

#define ALP_FLIGHTMODE_PRIVATE_ENABLER_STATE_CONFIRMATION   "/alp/flightmode/private/enabler_state_confirmation"
 

#define ALP_FLIGHTMODE_PRIVATE_NOTIFICATIONS   "/alp/flightmode/private"
 

Flight mode private notifications is that should only be registered by Flight mode status gadget

#define ALP_FLIGHTMODE_PRIVATE_NOTIFICATIONS_BASE   "/alp/flightmode/private/"
 

#define ALP_FLIGHTMODE_PRIVATE_SILENT_MODE_HAS_CHANGED   "/alp/flightmode/private/silent_mode_has_changed"
 

#define ALP_FLIGHTMODE_SETTINGS_DEFAULT_ACCESS_RIGHTS
 

Value:

((mode_t) S_IRUSR | S_IWUSR | S_IXUSR | \
                                                                S_IRGRP | S_IWGRP | S_IXGRP | \
                                                                S_IROTH | S_IWOTH | S_IXOTH )
Flight mode global settings: default access rights

as flight mode is accessed by any client that embbeds flight mode lib we are force to share settings to every one (0777)

#define ALP_FLIGHTMODE_SETTINGS_DIR_ACCESS_RIGHTS
 

Value:

((mode_t) S_IRUSR | S_IWUSR | S_IXUSR | \
                                                                S_IRGRP | S_IWGRP | S_IXGRP | \
                                                                S_IROTH | S_IWOTH | S_IXOTH )
Flight mode global settings: directory access rights

as flight mode is accessed by any client that embbeds flight mode lib we are force to share settings to every one (0777)

#define ALP_FLIGHTMODE_SETTINGS_DIR_KEY   "/alp/flightmode"
 

Flight mode global settings: directory

careful: flight mode global settings have to be created by fligth mode engine

#define ALP_FLIGHTMODE_SETTINGS_GROUP_NAME   "trusted"
 

Flight mode global settings: group name

as flight mode is accessed by any client that embbeds flight mode lib we are force to share settings to "trusted" that can be retrived using getgrnam("trusted") - see linux man

#define ALP_FLIGHTMODE_SILENT_MODE_HAS_CHANGED   "/alp/clientflightmode/silent_mode_has_changed"
 

#define ALP_FLIGHTMODE_START_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00040000))
 

#define ALP_FLIGHTMODE_STOP_FAILED_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x00050000))
 

#define ALP_FLIGHTMODE_VERSION_KEY   "/alp/flightmode/version"
 

Flight mode global settings: version string constants

#define ALP_FLIGHTMODE_VERSION_STR   "v1.0.0"
 

#define ALP_FLIGHTMODE_VERSION_STR_LEN   6
 

#define ALP_FLIGHTMODE_WIFI_ID   2
 

#define ALP_FLIGHTMODE_WIRELESS_COMPONENT_ERROR   ((alp_status_t) (ALP_CLASS_FLIGHTMODE | 0x000F0000))
 

#define ALP_FLIGHTMODE_WIRELESS_OFF_STATE_KEY   "/alp/flightmode/wireless_state"
 

Flight mode global settings: wireless off state (boolean key)

#define ALP_NOTIFY_PLUGIN_REGISTER appID,
notifyType,
plugin_id,
priority,
flags   )     alp_notify_register_launch(appID, notifyType plugin_id, priority, flags)
 

#define ALP_NOTIFY_PLUGIN_REGISTER_SERVER notifyType,
plugin_id,
callbackProc,
userData,
priority,
flags   )     alp_notify_register((notifyType)(plugin_id), callbackProc, userData, priority, flags)
 

#define ALP_NOTIFY_PLUGIN_UNREGISTER appID,
notifyType,
plugin_id,
priority,
flags   )     alp_notify_unregister_launch(appID, (notifyType)(plugin_id), flags)
 

#define ALP_NOTIFY_PLUGIN_UNREGISTER_SERVER notifyType,
plugin_id,
flags   )     alp_notify_unregister(notifyType plugin_id, flags)
 


Typedef Documentation

typedef struct _AlpFlightModeEnablerStateConfirmationTag AlpFlightModeEnablerStateConfirmationType
 

Flight Mode /Wireless Off has change data notification

typedef void* AlpFlightModeExternalStoragePtr
 

typedef struct _AlpFlightModeHasChangedNotifyTag AlpFlightModeHasChangedNotifyType
 

Flight Mode /Wireless Off has change data notification

typedef struct _AlpFlightModeProgressNotifyTag AlpFlightModeProgressNotifyType
 

Flight Mode / Wireless Off progress data notification


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

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