00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 #ifndef __ALP_APPLICATION_MGR_H_
00034 #define __ALP_APPLICATION_MGR_H_
00035
00036 #include <sys/types.h>
00037 #include <glib.h>
00038 #include <hiker/ipc.h>
00039 #include <hiker/types.h>
00040 #include <hiker/config_defines.h>
00041
00042 #include <hiker/traces.h>
00043
00044
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048
00055 typedef void (*AlpRelaunchHandler) (int argc, char* argv[], gpointer cbData);
00056 typedef void (*AlpExitHandler) (gpointer cbData);
00057 typedef uint32_t AlpWatcherRef;
00058
00059
00060
00061
00062
00063 #define ALP_STATUS_APP_PARAM ((alp_status_t)ALP_CLASS_APPSERVER | 0x00010000)
00064 #define ALP_STATUS_APP_IPC ((alp_status_t)ALP_CLASS_APPSERVER | 0x00020000)
00065 #define ALP_STATUS_APP_NOT_FOUND ((alp_status_t)ALP_CLASS_APPSERVER | 0x00030000) // Something not found in some list.
00066 #define ALP_STATUS_APP_NO_CONTEXT ((alp_status_t)ALP_CLASS_APPSERVER | 0x00040000) // No AlpAppContext.
00067 #define ALP_STATUS_APP_NO_LAUNCHPAD ((alp_status_t)ALP_CLASS_APPSERVER | 0x00050000) // missing launchpad
00068 #define ALP_STATUS_APP_MSG ((alp_status_t)ALP_CLASS_APPSERVER | 0x00060000) // malformed message
00069 #define ALP_STATUS_APP_RUNNING ((alp_status_t)ALP_CLASS_APPSERVER | 0x00070000) // app is already running (can't debug running apps)
00070 #define ALP_STATUS_APP_MEM ((alp_status_t)ALP_CLASS_APPSERVER | 0x00080000) // Memory allocation failed.
00071 #define ALP_STATUS_APP_LAUNCHPAD ((alp_status_t)ALP_CLASS_APPSERVER | 0x00090000) // An error with the launchpad.
00072 #define ALP_STATUS_APP_BLOCKED ((alp_status_t)ALP_CLASS_APPSERVER | 0x000A0000) // The app is currently blocked from launching.
00073
00074
00075
00076
00077 #define ALP_APP_PROP_NAME "name"
00078 #define ALP_APP_PROP_VENDOR "vendor"
00079 #define ALP_APP_PROP_BACKGROUNDING "backgrounding"
00080 #define ALP_APP_PROP_HIDDEN "hidden" // Boolean. "true" to hide app from users.
00081 #define ALP_APP_PROP_JUMP_LIST "jump-list" // Default is to display primary launched apps only. Set to "never" or "always" to override.
00082 #define ALP_APP_PROP_ENABLE_THEME "enable-theme" // Boolean. "true" to enable our theming engine. Defaults to TRUE eventually, but for development ease, it will default to FALSE until the theming is mature.
00083 #define ALP_APP_PROP_TRANSIENT "transient" // Boolean. "true" to be always retired when the primary app changes, regardless of whether or not the apps is launched with ALP_APP_TRANSIENT.
00084 #define ALP_APP_PROP_UPDATE "update-menu" // Boolean. "true" to show "Update" item in Launcher "Applications" menu
00085 #define ALP_APP_PROP_SETTINGS "settings-menu" // Boolean. "true" to show "Settings" item in Launcher "Applications" menu
00086 #define ALP_APP_PROP_PREVENT_DELETE "prevent-delete" // Boolean. "true" if application cannot be deleted
00087 #define ALP_APP_PROP_PREVENT_COPY "prevent-copy" // Boolean. "true" if application cannot be copied
00088 #define ALP_APP_PROP_ICON "icon" // Path to an icon resource or an ALP stock icon ID
00089 #define ALP_APP_PROP_VERSION "version" // Version string for application
00090
00091
00092
00093
00094
00095
00096
00099 #define ALP_APP_PROP_BG_UNSUPPORTED "unsupported"
00100
00104 #define ALP_APP_PROP_BG_SUPPORTED "supported"
00105
00109 #define ALP_APP_PROP_BG_PREFERRED "preferred"
00110
00115 #define ALP_APP_PROP_BG_REQUIRED "required"
00116
00117
00118
00119
00121 typedef enum
00122 {
00123 ALP_APP_BACKGROUND_UNSUPPORTED = 1,
00124 ALP_APP_BACKGROUND_SUPPORTED,
00125 ALP_APP_BACKGROUND_PREFERRED,
00126 ALP_APP_BACKGROUND_REQUIRED,
00127
00128 ALP_APP_BACKGROUND_DEFAULT = ALP_APP_BACKGROUND_UNSUPPORTED
00129 } AlpAppBackgroundingType;
00130
00131
00133
00159 alp_status_t alp_app_launch(const char *bundleID, int argc, char *const argv[], pid_t *outPID);
00160
00162
00173 alp_status_t alp_app_launch_async(const char *bundleID, int argc, char *const argv[]);
00174
00175
00177
00190 alp_status_t alp_app_retire(const char *bundleID);
00191
00192
00194
00217 alp_status_t alp_app_exit(const char *bundleID);
00218
00219
00221
00233 alp_status_t alp_app_watcher_add(const char *bundleID, AlpWatcherRef *outWatcherRef, gboolean *outAppRan);
00234
00236
00245 alp_status_t alp_app_watcher_check(AlpWatcherRef watcherRef, gboolean *outAppRan);
00246
00248
00262 alp_status_t alp_app_watcher_block(AlpWatcherRef watcherRef, gboolean blockLaunch);
00263
00265
00275 alp_status_t alp_app_watcher_remove(AlpWatcherRef watcherRef, gboolean *outAppRan);
00276
00277
00279
00289 alp_status_t alp_app_current(char **outBundleID);
00290
00291
00293
00305 alp_status_t alp_app_set_backgrounding(AlpAppBackgroundingType newBackgrounding);
00306
00308
00322 alp_status_t alp_app_set_relaunch_handler(AlpRelaunchHandler procP, gpointer cbData);
00323
00324
00326
00339 alp_status_t alp_app_add_exit_handler(AlpExitHandler procP, gpointer cbData);
00340
00342
00350 alp_status_t alp_app_remove_exit_handler(AlpExitHandler procP);
00351
00353
00364 alp_status_t alp_app_remove_exit_handler_with_data(AlpExitHandler procP, gpointer cbData);
00365
00366
00368
00374 alp_status_t alp_app_theme_update(void);
00375
00376
00378
00385 alp_status_t alp_app_reset_system(void);
00386
00387
00388
00389
00390 #define PKG_ID_MAX_LEN 256
00391
00392
00393
00395
00399 #define ALP_APP_PRIMARY "--alp-primary"
00400
00402
00409 #define ALP_APP_BACKGROUNDED "--alp-backgrounded"
00410
00412
00416 #define ALP_APP_DISPLAY "--alp-display"
00417
00419
00423 #define ALP_APP_FIND "--alp-find"
00424
00426
00431 #define ALP_APP_FIND_CANCEL "--alp-find-cancel"
00432
00434
00439 #define ALP_APP_DEBUG "--alp-debug"
00440
00442
00445 #define ALP_APP_NOTIFY "--alp-notify"
00446
00448
00451 #define ALP_APP_EXCHANGE "--alp-exchange"
00452
00454
00457 #define ALP_APP_ALARM "--alp-alarm"
00458
00460
00469 #define ALP_APP_ALERT "--alp-alert"
00470
00472
00483 #define ALP_APP_TRANSIENT "--alp-transient"
00484
00486
00514 #ifdef __cplusplus
00515 }
00516 #endif
00517
00518 #endif // __ALP_APPLICATION_MGR_H_
00519
00520