Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

appmgr.h

Go to the documentation of this file.
00001 /********************************************************************
00002 
00003 Copyright 2006, ACCESS Systems Americas, Inc. All rights reserved.
00004 
00005 The contents of this file are subject to the Mozilla Public License Version
00006 1.1 (the "License"); you may not use this file except in compliance with
00007 the License. You may obtain a copy of the License at
00008 http://www.mozilla.org/MPL/
00009 
00010 Software distributed under the License is distributed on an "AS IS" basis,
00011 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012 for the specific language governing rights and limitations under the
00013 License.
00014 
00015 The Original Code is the entire contents of this file.
00016 
00017 The Initial Developer of the Original Code is ACCESS Systems Americas, Inc.
00018 
00019 Portions created by ACCESS Systems Americas, Inc. are Copyright  2006. All
00020 Rights Reserved.
00021 
00022 Contributor(s): none.
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         App Server error codes
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 // String constants for standard application properties (from the package manifest file)
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 // constants for standard application property values (from the package manifest file)
00094 
00095 
00096 // Values for ALP_APP_PROP_BACKGROUNDING
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 // Miscellaneous Constants:
00388 
00389 // maximum length in bytes of app name/"id".  DOLATER: Document as policy somewhere.
00390 #define PKG_ID_MAX_LEN 256
00391 
00392 
00393 // Standard launch arguments
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 }       // extern "C"
00516 #endif
00517 
00518 #endif // __ALP_APPLICATION_MGR_H_
00519 
00520 

Generated on Sat Dec 16 20:29:47 2006 for hiker-0.9 by  doxygen 1.4.4