|
API Guide Home (Online version only) |
![]() |
00001 /****************************************************************************** 00002 * Copyright (c) 2004 palmOne, Inc. or its subsidiaries. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 /** 00006 * @ingroup PmSysGadgetLib 00007 */ 00008 00009 /** 00010 * @file PmSysGadgetLib.h 00011 * @version 1.0 00012 * @brief System Library that exports status-related APIs. 00013 * 00014 * This library is based on status gadgets APIs from HsExtensions and 00015 * was broken apart from HsExtensions so the APIs could be ported to other platforms. 00016 * 00017 */ 00018 00019 /* 00020 * $Id: //depot/Components/Libraries/PmSysGadget/1.2D/Incs/IncsPublic/68K/Libraries/PmSysGadget/PmSysGadgetLib.h#1 $ 00021 * 00022 */ 00023 00024 #ifndef __PM_STATUS_LIB_H__ 00025 #define __PM_STATUS_LIB_H__ 00026 00027 #include <PmSysGadgetLibCommon.h> 00028 #include <PalmTypes.h> 00029 00030 /******************************************************************** 00031 * Prototypes 00032 ********************************************************************/ 00033 00034 #ifdef __cplusplus 00035 extern "C" { 00036 #endif 00037 00038 /** 00039 * @brief Standard library open routine 00040 * 00041 * @param refNum: IN: Library reference number 00042 * @retval Err Error Code 00043 */ 00044 Err 00045 PmSysGadgetLibOpen (UInt16 refNum) 00046 SYS_TRAP (kPmSysGadgetLibTrapOpen); 00047 /** 00048 * @brief Standard library close routine 00049 * 00050 * @param refNum: IN: Library reference number 00051 * @retval Err Error Code 00052 */ 00053 Err 00054 PmSysGadgetLibClose (UInt16 refNum) 00055 SYS_TRAP (kPmSysGadgetLibTrapClose); 00056 00057 /** 00058 * @brief Tell the system that a gadget on the form is a certain type of status gadget so that 00059 * the system can properly draw and update it. 00060 * 00061 * Tell the system that a gadget on the form is a certain type of status gadget so that 00062 * the system can properly draw and update it. 00063 * A form can only have one gadget for each status type. If more than one gadget is 00064 * set to a certain type, only the last one set will be recorded. This function can also be 00065 * used to erase and release a gadget whose type has already been set. To do this, type 00066 * should be set to 0. 00067 * 00068 * @param refNum: IN: Library reference number 00069 * @param frmP: IN: Form to draw gadget on 00070 * @param gadgetID: IN: Gadget resource ID 00071 * @param type: IN: Gadget type (battery, signal, bluetooth, etc) 00072 * @retval Err Error code 00073 */ 00074 Err 00075 PmSysGadgetStatusGadgetTypeSet (UInt16 refNum, void* frmP, UInt16 gadgetID, 00076 UInt16 /*PmStatusGadgetTypeEnum*/ type) 00077 SYS_TRAP (kPmSysGadgetLibTrapStatusGadgetTypeSet); 00078 00079 /** 00080 * @brief Explicitly update all status gadgets on the current form. 00081 * 00082 * @param refNum: IN: Library reference number 00083 * @retval Nothing 00084 */ 00085 void 00086 PmSysGadgetStatusGadgetsUpdate (UInt16 refNum) 00087 SYS_TRAP (kPmSysGadgetLibTrapStatusGadgetsUpdate); 00088 00089 /// Installs big buttons on the given form based on a 'bBut' 00090 /// resource with the same ID. A 'bBut' resource is basically 00091 /// just an array of HsBigButtonMappingType. 00092 /// 00093 /// Once installed, the gadget will get events from PalmOS and 00094 /// will sent a 'gadgetMisc' event with the selector 00095 /// bbutGadgetMiscSelectSelector when selected. 00096 /// 00097 /// IMPORTANT: 00098 /// The form must not be visible when you install the buttons, 00099 /// since we don't draw them (it turns out to be impossible to 00100 /// check whether the gadget is visible without peeking 00101 /// into its data structure, which we can only do from the 00102 /// event handler). 00103 /// 00104 /// @param refNum: IN: Library reference number 00105 /// @param frmP: IN: The form to install the big buttons on. 00106 /// @retval Err Error code. 00107 Err 00108 PmSysGadgetBbutInstallFromResource (UInt16 refNum, FormType* frmP) 00109 SYS_TRAP (kPmSysGadgetLibTrapBbutInstallFromResource); 00110 00111 /// Set big button on a form. 00112 /// 00113 /// @param refNum: IN: Library reference number 00114 /// @param frmP: IN: The form to set the big button's gadget on. 00115 /// @param gadgetID: IN: The ID of the big button's gadget. 00116 /// @param textP: IN: Pointer to string to set on the gadget. 00117 /// @param font: IN: Font ID to be used for the text. 00118 /// @param flags: IN: Flags associated to the gadget. 00119 /// @retval None. 00120 void 00121 PmSysGadgetBbutInstallNewButton (UInt16 refNum, FormType* frmP, UInt16 gadgetID, 00122 const Char* textP, FontID font, UInt8 flags) 00123 SYS_TRAP (kPmSysGadgetLibTrapBbutInstallNewButton); 00124 00125 /// Set label on a big button gadget. 00126 /// 00127 /// @param refNum: IN: Library reference number 00128 /// @param frmP: IN: The form containing the big button's gadget. 00129 /// @param gadgetID: IN: The ID of the big button's gadget. 00130 /// @param newLabel: IN: Pointer to label string to set on the gadget. 00131 /// @retval None. 00132 void 00133 PmSysGadgetBbutSetLabel (UInt16 refNum, FormType* frmP, UInt16 gadgetID, const Char* newLabel) 00134 SYS_TRAP (kPmSysGadgetLibTrapBbutSetLabel); 00135 00136 /// Set bitmap image on a big button gadget. 00137 /// 00138 /// @param refNum: IN: Library reference number 00139 /// @param frmP: IN: The form containing the big button's gadget. 00140 /// @param gadgetID: IN: The ID of the big button's gadget. 00141 /// @param bitmapP: IN: Pointer to the bitmap to set on the gadget. 00142 /// @retval None. 00143 void 00144 PmSysGadgetBbutSetBitmap (UInt16 refNum, FormType* frmP, UInt16 gadgetID, const BitmapPtr bitmapP) 00145 SYS_TRAP (kPmSysGadgetLibTrapBbutSetBitmap); 00146 00147 /// Like CtlHitControl, but for big buttons. 00148 /// 00149 /// Notes: 00150 /// Due to the fact that PalmOS lacks accessors for 00151 /// gadgets directly, this function (and any others that 00152 /// refer to a big button's gadget) takes a form pointer 00153 /// and an index instead of a FormGadgetType*. 00154 /// 00155 /// @param frmP: IN: The form containing the big button's gadget. 00156 /// @param gadgetIndex: IN: The index of the big button's gadget. 00157 /// @retval None. 00158 void 00159 PmSysGadgetBbutHitBigButton (UInt16 refNum, FormType* frmP, UInt16 gadgetIndex) 00160 SYS_TRAP (kPmSysGadgetLibTrapBbutHitBigButton); 00161 00162 #ifdef __cplusplus 00163 } 00164 #endif 00165 00166 #endif // __PM_STATUS_LIB_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 |