1 { 2 File: HIToolbox/HITextLengthFilter.h 3 4 Contains: Header file for HITextLengthFilter object. 5 6 Version: HIToolbox-624~3 7 8 Copyright: � 1984-2008 by Apple Computer, Inc., all rights reserved. 9 10 Bugs?: For bug reports, consult the following page on 11 the World Wide Web: 12 13 http://bugs.freepascal.org 14 15 } 16 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 } 17 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 } 18 { 19 Modified for use with Free Pascal 20 Version 308 21 Please report any bugs to <gpc@microbizz.nl> 22 } 23 24 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE} 25 {$mode macpas} 26 {$modeswitch cblocks} 27 {$packenum 1} 28 {$macro on} 29 {$inline on} 30 {$calling mwpascal} 31 32 unit HITextLengthFilter; 33 interface 34 {$setc UNIVERSAL_INTERFACES_VERSION := $0400} 35 {$setc GAP_INTERFACES_VERSION := $0308} 36 37 {$ifc not defined USE_CFSTR_CONSTANT_MACROS} 38 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE} 39 {$endc} 40 41 {$ifc defined CPUPOWERPC and defined CPUI386} 42 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386} 43 {$endc} 44 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN} 45 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN} 46 {$endc} 47 48 {$ifc not defined __ppc__ and defined CPUPOWERPC32} 49 {$setc __ppc__ := 1} 50 {$elsec} 51 {$setc __ppc__ := 0} 52 {$endc} 53 {$ifc not defined __ppc64__ and defined CPUPOWERPC64} 54 {$setc __ppc64__ := 1} 55 {$elsec} 56 {$setc __ppc64__ := 0} 57 {$endc} 58 {$ifc not defined __i386__ and defined CPUI386} 59 {$setc __i386__ := 1} 60 {$elsec} 61 {$setc __i386__ := 0} 62 {$endc} 63 {$ifc not defined __x86_64__ and defined CPUX86_64} 64 {$setc __x86_64__ := 1} 65 {$elsec} 66 {$setc __x86_64__ := 0} 67 {$endc} 68 {$ifc not defined __arm__ and defined CPUARM} 69 {$setc __arm__ := 1} 70 {$elsec} 71 {$setc __arm__ := 0} 72 {$endc} 73 {$ifc not defined __arm64__ and defined CPUAARCH64} 74 {$setc __arm64__ := 1} 75 {$elsec} 76 {$setc __arm64__ := 0} 77 {$endc} 78 79 {$ifc defined cpu64} 80 {$setc __LP64__ := 1} 81 {$elsec} 82 {$setc __LP64__ := 0} 83 {$endc} 84 85 86 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__} 87 {$error Conflicting definitions for __ppc__ and __i386__} 88 {$endc} 89 90 {$ifc defined __ppc__ and __ppc__} 91 {$setc TARGET_CPU_PPC := TRUE} 92 {$setc TARGET_CPU_PPC64 := FALSE} 93 {$setc TARGET_CPU_X86 := FALSE} 94 {$setc TARGET_CPU_X86_64 := FALSE} 95 {$setc TARGET_CPU_ARM := FALSE} 96 {$setc TARGET_CPU_ARM64 := FALSE} 97 {$setc TARGET_OS_MAC := TRUE} 98 {$setc TARGET_OS_IPHONE := FALSE} 99 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 100 {$setc TARGET_OS_EMBEDDED := FALSE} 101 {$elifc defined __ppc64__ and __ppc64__} 102 {$setc TARGET_CPU_PPC := FALSE} 103 {$setc TARGET_CPU_PPC64 := TRUE} 104 {$setc TARGET_CPU_X86 := FALSE} 105 {$setc TARGET_CPU_X86_64 := FALSE} 106 {$setc TARGET_CPU_ARM := FALSE} 107 {$setc TARGET_CPU_ARM64 := FALSE} 108 {$setc TARGET_OS_MAC := TRUE} 109 {$setc TARGET_OS_IPHONE := FALSE} 110 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 111 {$setc TARGET_OS_EMBEDDED := FALSE} 112 {$elifc defined __i386__ and __i386__} 113 {$setc TARGET_CPU_PPC := FALSE} 114 {$setc TARGET_CPU_PPC64 := FALSE} 115 {$setc TARGET_CPU_X86 := TRUE} 116 {$setc TARGET_CPU_X86_64 := FALSE} 117 {$setc TARGET_CPU_ARM := FALSE} 118 {$setc TARGET_CPU_ARM64 := FALSE} 119 {$ifc defined iphonesim} 120 {$setc TARGET_OS_MAC := FALSE} 121 {$setc TARGET_OS_IPHONE := TRUE} 122 {$setc TARGET_IPHONE_SIMULATOR := TRUE} 123 {$elsec} 124 {$setc TARGET_OS_MAC := TRUE} 125 {$setc TARGET_OS_IPHONE := FALSE} 126 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 127 {$endc} 128 {$setc TARGET_OS_EMBEDDED := FALSE} 129 {$elifc defined __x86_64__ and __x86_64__} 130 {$setc TARGET_CPU_PPC := FALSE} 131 {$setc TARGET_CPU_PPC64 := FALSE} 132 {$setc TARGET_CPU_X86 := FALSE} 133 {$setc TARGET_CPU_X86_64 := TRUE} 134 {$setc TARGET_CPU_ARM := FALSE} 135 {$setc TARGET_CPU_ARM64 := FALSE} 136 {$ifc defined iphonesim} 137 {$setc TARGET_OS_MAC := FALSE} 138 {$setc TARGET_OS_IPHONE := TRUE} 139 {$setc TARGET_IPHONE_SIMULATOR := TRUE} 140 {$elsec} 141 {$setc TARGET_OS_MAC := TRUE} 142 {$setc TARGET_OS_IPHONE := FALSE} 143 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 144 {$endc} 145 {$setc TARGET_OS_EMBEDDED := FALSE} 146 {$elifc defined __arm__ and __arm__} 147 {$setc TARGET_CPU_PPC := FALSE} 148 {$setc TARGET_CPU_PPC64 := FALSE} 149 {$setc TARGET_CPU_X86 := FALSE} 150 {$setc TARGET_CPU_X86_64 := FALSE} 151 {$setc TARGET_CPU_ARM := TRUE} 152 {$setc TARGET_CPU_ARM64 := FALSE} 153 {$setc TARGET_OS_MAC := FALSE} 154 {$setc TARGET_OS_IPHONE := TRUE} 155 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 156 {$setc TARGET_OS_EMBEDDED := TRUE} 157 {$elifc defined __arm64__ and __arm64__} 158 {$setc TARGET_CPU_PPC := FALSE} 159 {$setc TARGET_CPU_PPC64 := FALSE} 160 {$setc TARGET_CPU_X86 := FALSE} 161 {$setc TARGET_CPU_X86_64 := FALSE} 162 {$setc TARGET_CPU_ARM := FALSE} 163 {$setc TARGET_CPU_ARM64 := TRUE} 164 {$ifc defined ios} 165 {$setc TARGET_OS_MAC := FALSE} 166 {$setc TARGET_OS_IPHONE := TRUE} 167 {$setc TARGET_OS_EMBEDDED := TRUE} 168 {$elsec} 169 {$setc TARGET_OS_MAC := TRUE} 170 {$setc TARGET_OS_IPHONE := FALSE} 171 {$setc TARGET_OS_EMBEDDED := FALSE} 172 {$endc} 173 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 174 {$elsec} 175 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.} 176 {$endc} 177 178 {$ifc defined __LP64__ and __LP64__ } 179 {$setc TARGET_CPU_64 := TRUE} 180 {$elsec} 181 {$setc TARGET_CPU_64 := FALSE} 182 {$endc} 183 184 {$ifc defined FPC_BIG_ENDIAN} 185 {$setc TARGET_RT_BIG_ENDIAN := TRUE} 186 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE} 187 {$elifc defined FPC_LITTLE_ENDIAN} 188 {$setc TARGET_RT_BIG_ENDIAN := FALSE} 189 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE} 190 {$elsec} 191 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.} 192 {$endc} 193 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE} 194 {$setc CALL_NOT_IN_CARBON := FALSE} 195 {$setc OLDROUTINENAMES := FALSE} 196 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE} 197 {$setc OPAQUE_UPP_TYPES := TRUE} 198 {$setc OTCARBONAPPLICATION := TRUE} 199 {$setc OTKERNEL := FALSE} 200 {$setc PM_USE_SESSION_APIS := TRUE} 201 {$setc TARGET_API_MAC_CARBON := TRUE} 202 {$setc TARGET_API_MAC_OS8 := FALSE} 203 {$setc TARGET_API_MAC_OSX := TRUE} 204 {$setc TARGET_CARBON := TRUE} 205 {$setc TARGET_CPU_68K := FALSE} 206 {$setc TARGET_CPU_MIPS := FALSE} 207 {$setc TARGET_CPU_SPARC := FALSE} 208 {$setc TARGET_OS_UNIX := FALSE} 209 {$setc TARGET_OS_WIN32 := FALSE} 210 {$setc TARGET_RT_MAC_68881 := FALSE} 211 {$setc TARGET_RT_MAC_CFM := FALSE} 212 {$setc TARGET_RT_MAC_MACHO := TRUE} 213 {$setc TYPED_FUNCTION_POINTERS := TRUE} 214 {$setc TYPE_BOOL := FALSE} 215 {$setc TYPE_EXTENDED := FALSE} 216 {$setc TYPE_LONGLONG := TRUE} 217 uses MacTypes,CFString; 218 {$endc} {not MACOSALLINCLUDE} 219 220 221 {$ifc TARGET_OS_MAC} 222 223 {$ALIGN POWER} 224 225 { 226 HITextLengthFilter 227 228 This object enforces a maximum character length on a text field. It is typically attached as a 229 delegate to an editable text view, such as an EditUnicodeText, HIComboBox, HISearchField, or 230 HITextView object. 231 232 This object handles the following Carbon events: 233 234 kEventClassTextField 235 kEventTextShouldChangeInRange 236 237 This object does not send or post any Carbon events. 238 239 This object has no dependencies on other AppObjects. 240 241 This object is customizable to specify the maximum length for the text field. 242 Your application customizes the maximum length for the text field by specifying 243 a value for the kEventParamTextLength param of the kEventHIObjectInitialize event 244 used when creating an instance of this object. 245 } 246 247 248 { 249 * kHITextLengthFilterClassID 250 * 251 * Discussion: 252 * HIObject class ID for the HITextLengthFilter object. 253 } 254 {$ifc USE_CFSTR_CONSTANT_MACROS} 255 {$definec kHITextLengthFilterClassID CFSTRP('com.apple.appobjects.HITextLengthFilter')} 256 {$endc} 257 258 { 259 * Summary: 260 * Initialization event parameters for HITextLengthFilter objects. 261 } 262 const 263 { 264 * [typeUInt32] The maximum text length in characters that is 265 * allowed by this object. 266 } 267 kEventParamTextLength = FourCharCode('TLEN'); 268 269 {$endc} {TARGET_OS_MAC} 270 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE} 271 272 end. 273 {$endc} {not MACOSALLINCLUDE} 274