|
API Guide Home (Online version only) |
![]() |
00001 /******************************************************************************* 00002 * Copyright (c) 2004-2005 palmOne, Inc. or its subsidiaries. 00003 * All rights reserved. 00004 ******************************************************************************/ 00005 /** 00006 * @defgroup HsNav 5-Way Navigation Library 00007 * @brief This library provides 5-way navigation support for applications 00008 * on the Treo 600 devices. 00009 * 00010 * The 5-way navigation features and APIs described here have already existed 00011 * in Palm OS SDK for Palm OS ver. 5.4.1 and above, and applications that are 00012 * developed for newer devices should be using PalmSource's Palm OS definitions 00013 * of these features and APIs. Developers can use palmOne defined features to extend 00014 * support back to Treo 600 devices. 00015 * 00016 * For more information on 5-way navigation support, please refer to palmOne 00017 * Developer Guide and also the Palm OS Documentation. 00018 * 00019 * @{ 00020 * @} 00021 */ 00022 /** 00023 * @ingroup HsNav 00024 */ 00025 00026 /** 00027 * @file HsNavCommon.h 00028 * @brief Public common header file for 5-way navigation support on Treo 600. 00029 * 00030 * This file contains the common constant and structures used to support 5-way navigation 00031 * in an application. 00032 * 00033 */ 00034 00035 #ifndef __HS_NAV_COMMON_H__ 00036 #define __HS_NAV_COMMON_H__ 00037 00038 00039 #include <Bitmap.h> // for RGBColorType 00040 00041 #if 0 00042 #pragma mark -------- HS-Specific ------------- 00043 #endif 00044 00045 //********************************************************* 00046 // The current version of the navigation API (this is the 00047 // value set for hsFtrIDNavigationSupported feature) 00048 //********************************************************* 00049 #define hsNavAPIVersion 2 00050 00051 00052 //********************************************************* 00053 // Focus treatment definitions 00054 //********************************************************* 00055 #define hsNavFocusRingWidth 6 // Width in double-density coordinates 00056 #define hsNavFocusRingWidthSingleDensity 3 // Width in single-density coordinates 00057 #define hsNavFocusRingNoExtraInfo ((Int16)0xFFFF) 00058 00059 00060 enum HsNavFocusColorEnumTag 00061 { 00062 hsNavFocusColorInsideBottomRightRing = 0, // Deprecated (HsNav version 1 focus treatment) 00063 hsNavFocusColorInsideTopLeftRing = 1, // Deprecated (HsNav version 1 focus treatment) 00064 hsNavFocusColorMiddleRing = 2, // Deprecated (HsNav version 1 focus treatment) 00065 hsNavFocusColorOutsideRing = 3, // Deprecated (HsNav version 1 focus treatment) 00066 hsNavFocusColorSecondaryHighlight = 4, 00067 hsNavFocusColorRing1 = 5, // HsNav version 2 focus treatment. Innermost ring. 00068 hsNavFocusColorRing2 = 6, // HsNav version 2 focus treatment. 00069 hsNavFocusColorRing3 = 7, // HsNav version 2 focus treatment. 00070 hsNavFocusColorRing4 = 8, // HsNav version 2 focus treatment. 00071 hsNavFocusColorRing5 = 9, // HsNav version 2 focus treatment. 00072 hsNavFocusColorRing6 = 10 // HsNav version 2 focus treatment. Outermost ring. 00073 }; 00074 typedef UInt16 HsNavFocusColorEnum; 00075 00076 00077 enum HsNavFocusRingStyleEnumTag 00078 { 00079 hsNavFocusRingStyleObjectTypeDefault = 0, 00080 hsNavFocusRingStyleSquare = 1, 00081 hsNavFocusRingStyleRound = 2, 00082 hsNavFocusRingStyleHorizontalBars = 3, 00083 hsNavFocusRingStyleInvalid = 0xFFFF 00084 }; 00085 typedef UInt16 HsNavFocusRingStyleEnum; 00086 00087 #if PALMOS_SDK_VERSION < 0x0541 00088 00089 // FrmNavFocusRingStyleEnum's definition should always be exactly the same as 00090 // HsNavFocusRingStyleEnum's definition since we want their use to be 00091 // completely interchangeable. HsNavFocusRingStyleEnum is what the Treo600 00092 // SDK used and FrmNavFocusRingStyleEnum is what PSI (and Treo650) will use in 00093 // their SDK. PSI originally was not going to take focus ring related API 00094 // but this changed after Treo600 shipped. 00095 enum FrmNavFocusRingStyleEnumTag 00096 { 00097 frmNavFocusRingStyleObjectTypeDefault = 0, 00098 frmNavFocusRingStyleSquare = 1, 00099 frmNavFocusRingStyleRound = 2, 00100 frmNavFocusRingStyleHorizontalBars = 3, 00101 frmNavFocusRingStyleInvalid = 0xFFFF 00102 }; 00103 typedef UInt16 FrmNavFocusRingStyleEnum; 00104 #define frmNavFocusRingNoExtraInfo ((Int16)0xFFFF) 00105 00106 #endif // PALMOS_SDK_VERSION < 0x0541 00107 00108 #if 0 00109 #pragma mark -------- Incs:Core:UI:UIResources.h ------------- 00110 #endif 00111 00112 #define formNavRscType 'fnav' 00113 00114 00115 #if 0 00116 #pragma mark -------- Incs:Core:System:TextMgr.h --------------- 00117 #endif 00118 00119 //********************************************************* 00120 // Macro for detecting if character is a rocker character 00121 //********************************************************* 00122 00123 // <c> is a rocker key if the event modifier <m> has the command bit set 00124 // and <c> is in the proper range 00125 #define TxtCharIsRockerKey(m, c) ((((m) & commandKeyMask) != 0) && \ 00126 ((((c) >= vchrRockerUp) && ((c) <= vchrRockerCenter)))) 00127 00128 00129 #if 0 00130 #pragma mark -------- Incs:Core:CoreTraps.h ---------------- 00131 #endif 00132 00133 //********************************************************* 00134 // Selector definitions for Navigation API functions 00135 //********************************************************* 00136 #if PALMOS_SDK_VERSION < 0x0541 00137 00138 #define sysTrapNavSelector 0xA46F 00139 00140 #define NavSelectorFrmCountObjectsInNavOrder 0x0 00141 #define NavSelectorFrmGetNavOrder 0x1 00142 #define NavSelectorFrmSetNavOrder 0x2 00143 #define NavSelectorFrmGetNavEntry 0x3 00144 #define NavSelectorFrmSetNavEntry 0x4 00145 #define NavSelectorFrmGetNavState 0x5 00146 #define NavSelectorFrmSetNavState 0x6 00147 #define NavSelectorFrmNavDrawFocusRing 0x7 00148 #define NavSelectorFrmNavRemoveFocusRing 0x8 00149 #define NavSelectorFrmNavGetFocusRingInfo 0x9 00150 00151 #endif // PALMOS_SDK_VERSION < 0x0541 00152 00153 #define NavSelectorFrmNavObjectTakeFocus 0xA 00154 00155 00156 #if 0 00157 #pragma mark ------- Incs:Core:System:ErrorBase.h -------- 00158 #endif 00159 00160 //********************************************************* 00161 // Error class and codes for UI Library 00162 //********************************************************* 00163 #if PALMOS_SDK_VERSION < 0x0541 00164 00165 #define uilibErrorClass 0x3A00 // UI Library (Forms, Controls, etc) 00166 00167 #define uilibErrInvalidParam (uilibErrorClass | 1) 00168 #define uilibErrCurrentFocusInvalid (uilibErrorClass | 2) 00169 #define uilibErrObjectFocusModeOff (uilibErrorClass | 3) 00170 #define uilibErrObjectNotFound (uilibErrorClass | 4) 00171 #define uilibErrNoNavInfoForForm (uilibErrorClass | 5) 00172 #define uilibErrInvalidFocusObject (uilibErrorClass | 6) 00173 #define uilibErrFormDoesNotHaveFocus (uilibErrorClass | 7) 00174 00175 #endif // PALMOS_SDK_VERSION < 0x0541 00176 00177 00178 #if 0 00179 #pragma mark -------- Incs:Core:UI:Form.h ----------- 00180 #endif 00181 00182 //********************************************************* 00183 // Nav Flags (used with navFlags field of FrmNavHeaderType) 00184 //********************************************************* 00185 #if PALMOS_SDK_VERSION < 0x0541 00186 00187 typedef UInt32 FrmNavHeaderFlagsType; 00188 00189 #define kFrmNavHeaderFlagsObjectFocusStartState 0x00000001 00190 #define kFrmNavHeaderFlagsAppFocusStartState 0x00000002 00191 #define kFrmNavHeaderFlagsAutoGenerated 0x80000000 00192 00193 #define kFrmNavHeaderFlagsStartStateMask 0x00000003 00194 #define kFrmNavHeaderFlagsDefaultStartStateValue 0x00000000 00195 #define kFrmNavHeaderFlagsObjectFocusStartStateValue 0x00000001 00196 #define kFrmNavHeaderFlagsAppFocusStartStateValue 0x00000002 00197 #define kFrmNavHeaderFlagsInvalidStartStateValue 0x00000003 00198 00199 00200 //********************************************************* 00201 // Object Flags (used with objectFlags field of 00202 // FrmNavOrderEntryType) 00203 //********************************************************* 00204 typedef UInt16 FrmNavObjectFlagsType; 00205 00206 #define kFrmNavObjectFlagsSkip 0x0001 00207 #define kFrmNavObjectFlagsForceInteractionMode 0x0002 00208 #define kFrmNavObjectFlagsIsBigButton 0x8000 00209 00210 00211 //********************************************************* 00212 // Nav State Flags (used with stateFlags parameter of 00213 // FrmGetNavState and FrmSetNavState API functions) 00214 //********************************************************* 00215 typedef UInt32 FrmNavStateFlagsType; 00216 00217 #define kFrmNavStateFlagsInteractionMode 0x00000001 00218 #define kFrmNavStateFlagsObjectFocusMode 0x00000002 00219 00220 00221 //********************************************************* 00222 // The current version of the navigation structures 00223 // (FrmNavOrderEntryType and FrmNavHeaderType) 00224 //********************************************************* 00225 #define kFrmNavInfoVersion 1 00226 00227 #endif // PALMOS_SDK_VERSION < 0x0541 00228 00229 00230 #if 0 00231 #pragma mark -------- Incs:Core:System:SystemMgr.h ----------- 00232 #endif 00233 00234 #if PALMOS_SDK_VERSION < 0x0541 00235 00236 #define sysFtrNumFiveWayNavVersion 32 // version of the 5-way nav if any 00237 00238 #endif // PALMOS_SDK_VERSION < 0x0541 00239 00240 00241 #if 0 00242 #pragma mark -------- Public Structures ---------------- 00243 #endif 00244 00245 #if PALMOS_SDK_VERSION < 0x0541 00246 00247 //********************************************************* 00248 // Structures used with Navigation API functions 00249 //********************************************************* 00250 00251 typedef struct FrmNavOrderEntryTag 00252 { 00253 UInt16 objectID; 00254 FrmNavObjectFlagsType objectFlags; 00255 UInt16 aboveObjectID; 00256 UInt16 belowObjectID; 00257 } FrmNavOrderEntryType; 00258 00259 00260 typedef struct FrmNavHeaderTag 00261 { 00262 UInt16 version; // This is version 1 00263 UInt16 numberOfObjects; 00264 UInt16 headerSizeInBytes; // 20 for the version 1 structure 00265 UInt16 listElementSizeInBytes; // 8 for the version 1 structure 00266 FrmNavHeaderFlagsType navFlags; 00267 UInt16 initialObjectIDHint; 00268 UInt16 jumpToObjectIDHint; 00269 UInt16 bottomLeftObjectIDHint; 00270 UInt16 padding1; 00271 } FrmNavHeaderType; 00272 00273 #endif // PALMOS_SDK_VERSION < 0x0541 00274 00275 #endif // __HS_NAV_COMMON_H__ 00276 00277
| Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:06:53 2008 for Palm API Guide |