API Guide Home
(Online version only)

PmSysGadgetLibCommon.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright (c) 2004-2006 palmOne, Inc. or its subsidiaries.
00003  * All rights reserved.
00004  ******************************************************************************/
00005 /**
00006  * @defgroup    PmSysGadgetLib Gadget Library
00007  * @brief       This library provides supports for application that wants to
00008  *              manage system gadgets or support big buttons in the applications.
00009  *
00010  * Application that wishes to update/ retrieve the status of system gadget such
00011  * as the battery indicator, signal strength or bluetooth indicator can use this
00012  * library to do so. This library also provides APIs for application that wants
00013  * to include big button resource.
00014  *
00015  * @{
00016  * @}
00017  */
00018 /**
00019  * @ingroup PmSysGadgetLib
00020  */
00021 
00022 /**
00023  * @file  PmSysGadgetLibCommon.h
00024  * @brief Public 68k header file for system Library that exports system gadget related APIs.
00025  *
00026  * This file contains the common definitions and structures for the gadget-related APIs.
00027  * <hr>
00028  */
00029 
00030 #ifndef __PM_SYS_GADGET_LIB_COMMON_H__
00031 #define __PM_SYS_GADGET_LIB_COMMON_H__
00032 
00033 /********************************************************************
00034  * Constants
00035  ********************************************************************/
00036 
00037 #define kPmSysGadgetLibType     sysFileTLibrary       /**< Library type */
00038 #define kPmSysGadgetLibCreator  pmFileCSysGadgetLib   /**< Library creator ID */
00039 #define kPmSysGadgetLibName     "PmSysGadgetLib-PmSg" /**< Library name */
00040 
00041 /**
00042  * This selector gets sent with a frmGadgetMiscEvent to let you know that the
00043  * gadget has been selected.  The numbers are picked semi-randomly so that generic
00044  * code (like PmUIUtilFrmDoDialogWithCallback()) can tell that this is actually
00045  * a button press without doing the wrong thing for other people's gadget events.
00046  *
00047  * Note that in most code, you shouldn't need to worry about checking the data,
00048  * since you know exactly what gadgets are on your form and what kind of events
00049  * they send.
00050  **/
00051 #define kPmSysGadgetBbutGadgetMiscSelectSelector  7014                  /**< Randomish number so people can
00052                                                                              easily detect big button presses */
00053 #define kPmSysGadgetBbutGadgetMiscSelectData      ((void*)0xBADC0DE1)   /**< Magic # to make conflicts even less
00054                                                                              likely for  detecting big  button presses.*/
00055 
00056 
00057 /**
00058  * This is the type of big button resources.  The ID should match the ID of
00059  * the form...
00060  **/
00061 #define kPmSysGadgetBbutRscType                   'bBut'           /**< Registered: yes */
00062 
00063 /**
00064  * Feature that says that status gadget API exists and what revision it is
00065  **/
00066 /*@{*/
00067 #define kPmSysGadgetFtrIDStatusGadgetRev          1
00068 #define kPmSysGadgetFtrValStatusGadgetRev1        0x0001  // Revision 1 of API
00069 /*@}*/
00070 
00071 /**
00072  *  Constants added for PTT Notification
00073  */
00074 #define kPttNotificationEvent                     'pPTT'
00075 #define kPttNotificationStatusOffset              (0xF00)
00076 
00077 /********************************************************************
00078  * Enums
00079  ********************************************************************/
00080 /**
00081  * Equates for supporting system handled status gadgets
00082  **/
00083 typedef enum
00084   {
00085     pmSysGadgetStatusGadgetNone = 0,       /**< No type specified for status gadget */
00086     pmSysGadgetStatusGadgetBattery = 1,    /**< Status gadget is a battery meter */
00087     pmSysGadgetStatusGadgetSignal = 2,     /**< Status gadget is a signal strength indicator */
00088     pmSysGadgetStatusGadgetBt = 3,         /**< Status gadget is a Bluetooth status indicator */
00089     pmSysGadgetStatusGadgetEvdo = 4,       /**< Status gadget is an EVDO status indicator */
00090     pmSysGadgetStatusGadgetLine = 5,       /**< Status gadget is an Active line status indicator */
00091     pmSysGadgetStatusGadgetRoaming = 6,    /**< Status gadget is a Roaming status indicator */
00092     pmSysGadgetStatusGadgetCallFwd = 7,    /**< Status gadget is a Call Forwarding status indicator */
00093     pmSysGadgetStatusGadgetVm = 8,         /**< Status gadget is a Voicemail status indicator */
00094     pmSysGadgetStatusGadgetOperator = 9,   /**< Status gadget is an Operator status indicator */
00095     pmSysGadgetStatusGadgetPhoneCall = 10, /**< Status gadget is an Operator status indicator */
00096     pmSysGadgetStatusGadgetTty = 11,       /**< Status gadget is a TTY status indicator */
00097     pmSysGadgetStatusGadgetPtt = 12        /**< Status gadget is a PTT status indicator, RJS added 22May06 */
00098   } PmSysGadgetStatusGadgetTypeEnum;
00099 
00100 /** Bluetooth radio status */
00101 typedef enum
00102   {
00103     kIndicatorBtOff       = 0x0700, /**< Bt Radio turned off */
00104     kIndicatorBtOn,                 /**< Bt radio turned on */
00105     kIndicatorBtConnectHeadset,     /**< Connected to Headset */
00106     kIndicatorBtConnectOther,       /**< Connected to other Bt devices */
00107     kIndicatorBtDUN,                /**< Connected to DUN */
00108     kIndicatorBtConnectAudio,       /**< Connected audio **/
00109     kIndicatorBtConnectStereo       /**< Connected stereo **/
00110   } PmSysGadgetBtStatusTypeEnum;
00111 
00112 
00113 /********************************************************************
00114  * Structures
00115  ********************************************************************/
00116 
00117 /**
00118  * @brief This is the structure of a single big button mapping...
00119  **/
00120 typedef struct
00121   {
00122     UInt8 flags;
00123     UInt8 font;
00124 
00125     UInt16 gadgetID;
00126 
00127     UInt16 bitmapID;
00128     UInt16 stringID;
00129   }
00130 PmSysGadgetBbutMappingType;
00131 
00132 /**
00133  * @brief This is the structure of a big button resource...
00134  **/
00135 typedef struct
00136   {
00137     UInt16 version;
00138     PmSysGadgetBbutMappingType mapArr[0];
00139   }
00140 PmSysGadgetBbutResourceType;
00141 
00142 /**
00143 *   @brief This is the structure used by the PTT notification event
00144 **/
00145 typedef struct
00146 {
00147     UInt32 creatorId;     // creator ID where bitmap can be found
00148     UInt16 uBitmapId;     // bitmap to show in PTT gadget
00149     UInt16 uStatus;       // add the kPttNotificationStatusOffset to the PTT status
00150 }
00151 PmSysGadgetPttNotificationType;
00152 
00153 
00154 /********************************************************************
00155  * Traps
00156  ********************************************************************/
00157 /**
00158  * @name Function Traps
00159  */
00160 /*@{*/
00161 #define kPmSysGadgetLibTrapOpen                     sysLibTrapOpen
00162 #define kPmSysGadgetLibTrapClose                    sysLibTrapClose
00163 #define kPmSysGadgetLibTrapStatusGadgetTypeSet      (sysLibTrapCustom)
00164 #define kPmSysGadgetLibTrapStatusGadgetsUpdate      (sysLibTrapCustom+1)
00165 #define kPmSysGadgetLibTrapBbutInstallFromResource  (sysLibTrapCustom+2)
00166 #define kPmSysGadgetLibTrapBbutInstallNewButton     (sysLibTrapCustom+3)
00167 #define kPmSysGadgetLibTrapBbutSetLabel             (sysLibTrapCustom+4)
00168 #define kPmSysGadgetLibTrapBbutSetBitmap            (sysLibTrapCustom+5)
00169 #define kPmSysGadgetLibTrapBbutHitBigButton         (sysLibTrapCustom+6)
00170 /*@}*/
00171 
00172 #endif // __PM_SYS_GADGET_LIB_COMMON_H__

Top Palm Developer Network
© 2004-2008, Palm, Inc. All rights reserved.
Generated on Fri Jun 13 10:06:55 2008 for Palm API Guide