TextInputSources.pas 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
  1. {
  2. File: HIToolbox/TextInputSources.h
  3. Version: HIToolbox-343~1
  4. Copyright: © 2006 Apple Inc. All rights reserved.
  5. }
  6. { Pascal Translation: Gale R Paeper, <[email protected]>, 2008 }
  7. {
  8. Modified for use with Free Pascal
  9. Version 210
  10. Please report any bugs to <[email protected]>
  11. }
  12. {$mode macpas}
  13. {$packenum 1}
  14. {$macro on}
  15. {$inline on}
  16. {$calling mwpascal}
  17. unit TextInputSources;
  18. interface
  19. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  20. {$setc GAP_INTERFACES_VERSION := $0210}
  21. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  22. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  23. {$endc}
  24. {$ifc defined CPUPOWERPC and defined CPUI386}
  25. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  26. {$endc}
  27. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  28. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  29. {$endc}
  30. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  31. {$setc __ppc__ := 1}
  32. {$elsec}
  33. {$setc __ppc__ := 0}
  34. {$endc}
  35. {$ifc not defined __i386__ and defined CPUI386}
  36. {$setc __i386__ := 1}
  37. {$elsec}
  38. {$setc __i386__ := 0}
  39. {$endc}
  40. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  41. {$error Conflicting definitions for __ppc__ and __i386__}
  42. {$endc}
  43. {$ifc defined __ppc__ and __ppc__}
  44. {$setc TARGET_CPU_PPC := TRUE}
  45. {$setc TARGET_CPU_X86 := FALSE}
  46. {$elifc defined __i386__ and __i386__}
  47. {$setc TARGET_CPU_PPC := FALSE}
  48. {$setc TARGET_CPU_X86 := TRUE}
  49. {$elsec}
  50. {$error Neither __ppc__ nor __i386__ is defined.}
  51. {$endc}
  52. {$setc TARGET_CPU_PPC_64 := FALSE}
  53. {$ifc defined FPC_BIG_ENDIAN}
  54. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  55. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  56. {$elifc defined FPC_LITTLE_ENDIAN}
  57. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  58. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  59. {$elsec}
  60. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  61. {$endc}
  62. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  63. {$setc CALL_NOT_IN_CARBON := FALSE}
  64. {$setc OLDROUTINENAMES := FALSE}
  65. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  66. {$setc OPAQUE_UPP_TYPES := TRUE}
  67. {$setc OTCARBONAPPLICATION := TRUE}
  68. {$setc OTKERNEL := FALSE}
  69. {$setc PM_USE_SESSION_APIS := TRUE}
  70. {$setc TARGET_API_MAC_CARBON := TRUE}
  71. {$setc TARGET_API_MAC_OS8 := FALSE}
  72. {$setc TARGET_API_MAC_OSX := TRUE}
  73. {$setc TARGET_CARBON := TRUE}
  74. {$setc TARGET_CPU_68K := FALSE}
  75. {$setc TARGET_CPU_MIPS := FALSE}
  76. {$setc TARGET_CPU_SPARC := FALSE}
  77. {$setc TARGET_OS_MAC := TRUE}
  78. {$setc TARGET_OS_UNIX := FALSE}
  79. {$setc TARGET_OS_WIN32 := FALSE}
  80. {$setc TARGET_RT_MAC_68881 := FALSE}
  81. {$setc TARGET_RT_MAC_CFM := FALSE}
  82. {$setc TARGET_RT_MAC_MACHO := TRUE}
  83. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  84. {$setc TYPE_BOOL := FALSE}
  85. {$setc TYPE_EXTENDED := FALSE}
  86. {$setc TYPE_LONGLONG := TRUE}
  87. uses MacTypes, CFArray, CFBase, CFDictionary, CFURL;
  88. {$ALIGN POWER}
  89. {
  90. * TextInputSources.h
  91. *
  92. * Summary:
  93. * Specifies the modern, non-Script-Manager-based interfaces for
  94. * operating on text input sources: finding information about them,
  95. * selecting/enabling/disabling them, and receiving notifications
  96. * about relevant changes.
  97. *
  98. * Discussion:
  99. * Text input sources are of three general categories: keyboard
  100. * input sources (keyboard layouts, keyboard input methods and input
  101. * modes), palette input sources (character palette, keyboard
  102. * viewer, private dictionary panels), and ink. Palette input
  103. * sources and ink input sources are categorized as non-keyboard
  104. * input sources, although palette input sources may still involve
  105. * some keyboard interaction. Keyboard input methods may be
  106. * mode-enabled (e.g. Kotoeri), in which case they may be the parent
  107. * of several input modes which are directly selectable in the user
  108. * interface (e.g. hiragana, katakana, romaji); in this case the
  109. * parent input method is not directly selectable. Non-mode-enabled
  110. * input methods are directly selectable.
  111. *
  112. *
  113. * Some input sources are invisible to system UI; they do not appear
  114. * in the normal user interface for manipulating input sources.
  115. * Examples include input sources such as ink, the dictionary panel,
  116. * and some assistiveware; these have their own special UI for
  117. * enabling, disabling, etc. Other examples include special keyboard
  118. * layouts used by input methods, which have their own ways of
  119. * controlling use of these keyboard layouts.
  120. *
  121. *
  122. * Some input sources are pre-installed by Apple. Other input
  123. * sources (of any type) may be installed as third party products
  124. * themselves or as part of installing certain applications. Most
  125. * non-invisible input sources may be enabled or disabled by users
  126. * using International Preferences, which displays a list of all
  127. * visible installed input sources (Setup Assistant also enables
  128. * some input sources); there is a separate UI for enabling ink.
  129. * Applications may enable or disable input sources programmatically
  130. * using some of the functions here. At least one keyboard input
  131. * source is enabled (the system ensures this). At most one ink
  132. * input source may be enabled; multiple instances of other input
  133. * source types may be enabled.
  134. *
  135. *
  136. * Some enabled input sources are invisible but programmatically
  137. * selectable, such as ink. Some are visible but not
  138. * programmatically selectable, such as mode-savvy parent input
  139. * methods (which must be visible so that International Preferences
  140. * can display the parent input method for a group of input modes).
  141. *
  142. *
  143. *
  144. * Input modes can only be changed from disabled to enabled if their
  145. * parent input method is enabled. Input modes can only be selected
  146. * if both they and their parent input method are enabled.
  147. *
  148. *
  149. * Exactly one keyboard input source is selected at any time; this
  150. * is the current keyboard input source. Selecting a new keyboard
  151. * input source deselects the previous keyboard input source.
  152. * Multiple palette input sources may be selected - e.g. there may
  153. * be one or more character palettes and one or more keyboard
  154. * viewers selected in addition to the selected keyboard input
  155. * source. Selecting or deselecting a palette (or ink) input source
  156. * does not affect any other input source. Input methods that
  157. * provide associated input palettes may programmatically deselect
  158. * the palette when the input method is deselected, for example.
  159. }
  160. {
  161. *===============================================================================
  162. * Basic type
  163. *===============================================================================
  164. }
  165. {
  166. * TISInputSourceRef
  167. *
  168. * Summary:
  169. * Opaque CF object that unambiguously (within a single process)
  170. * represents a text input source.
  171. *
  172. * Discussion:
  173. * Cannot be shared cross-process.
  174. }
  175. type
  176. TISInputSourceRef = ^SInt32; { an opaque 32-bit type }
  177. {
  178. * TISInputSourceGetTypeID()
  179. *
  180. * Summary:
  181. * Gets the CFTypeID of a TISInputSourceRef.
  182. *
  183. * Result:
  184. * Returns the CFTypeID of a TISInputSourceRef, for comparison with
  185. * the result of CFGetTypeID().
  186. *
  187. * Availability:
  188. * Mac OS X: in version 10.5 and later in Carbon.framework
  189. * CarbonLib: not available
  190. * Non-Carbon CFM: not available
  191. }
  192. function TISInputSourceGetTypeID: CFTypeID; external name '_TISInputSourceGetTypeID';
  193. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  194. {
  195. *===============================================================================
  196. * Property key constants,
  197. *
  198. * Input sources may have additional properties beyond those listed here,
  199. * and some input sources do not have values for some of the properties
  200. * listed here. The property value for a particular input source can be
  201. * obtained using TISGetInputSourceProperty. A set of specific property
  202. * key-value pairs can also be used as a filter when creating a list of
  203. * input sources using TISCreateInputSourceList.
  204. *
  205. * The following keys may be used with both TISGetInputSourceProperty and
  206. * TISCreateInputSourceList:
  207. *===============================================================================
  208. }
  209. {
  210. * kTISPropertyInputSourceCategory
  211. *
  212. * Summary:
  213. * The property key constant for a CFStringRef value that indicates
  214. * the category of input source.
  215. *
  216. * Discussion:
  217. * The possible values are specified by property value constants
  218. * kTISCategoryKeyboardInputSource, kTISCategoryPaletteInputSource,
  219. * kTISCategoryInkInputSource.
  220. *
  221. * Availability:
  222. * Mac OS X: in version 10.5 and later in Carbon.framework
  223. * CarbonLib: not available
  224. * Non-Carbon CFM: not available
  225. }
  226. var kTISPropertyInputSourceCategory: CFStringRef; external name '_kTISPropertyInputSourceCategory'; (* attribute const *)
  227. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  228. {
  229. * kTISPropertyInputSourceType
  230. *
  231. * Summary:
  232. * The property key constant for a CFStringRef value that indicates
  233. * the specific type of input source.
  234. *
  235. * Discussion:
  236. * The possible values are specified by property value constants
  237. * kTISTypeKeyboardLayout, kTISTypeKeyboardInputMethodWithoutModes,
  238. * kTISTypeKeyboardInputMethodModeEnabled,
  239. * kTISTypeKeyboardInputMode, kTISTypeCharacterPalette,
  240. * kTISTypeKeyboardViewer, kTISTypeInk.
  241. *
  242. * Availability:
  243. * Mac OS X: in version 10.5 and later in Carbon.framework
  244. * CarbonLib: not available
  245. * Non-Carbon CFM: not available
  246. }
  247. var kTISPropertyInputSourceType: CFStringRef; external name '_kTISPropertyInputSourceType'; (* attribute const *)
  248. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  249. {
  250. * kTISPropertyInputSourceIsASCIICapable
  251. *
  252. * Summary:
  253. * The property key constant for a CFBooleanRef value that indicates
  254. * whether the input source identifies itself as ASCII-capable.
  255. *
  256. * Availability:
  257. * Mac OS X: in version 10.5 and later in Carbon.framework
  258. * CarbonLib: not available
  259. * Non-Carbon CFM: not available
  260. }
  261. var kTISPropertyInputSourceIsASCIICapable: CFStringRef; external name '_kTISPropertyInputSourceIsASCIICapable'; (* attribute const *)
  262. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  263. {
  264. * kTISPropertyInputSourceIsEnableCapable
  265. *
  266. * Summary:
  267. * The property key constant for a CFBooleanRef value that indicates
  268. * whether the input source can ever (given the right conditions) be
  269. * programmatically enabled using TISEnableInputSource.
  270. *
  271. * Discussion:
  272. * This is a static property of an input source, and does not depend
  273. * on any current state.
  274. *
  275. * Most input sources can be programmatically enabled at any time;
  276. * kTISPropertyInputSourceIsEnableCapable is true for these.
  277. *
  278. *
  279. * Some input sources can never be programmatically enabled. These
  280. * are mainly input method private keyboard layouts that are used by
  281. * the input method via TISSetInputMethodKeyboardLayoutOverride, but
  282. * which cannot be directly enabled and used as keyboard layout
  283. * input sources. kTISPropertyInputSourceIsEnableCapable is false
  284. * for these.
  285. *
  286. * Some input sources can only be programmatically enabled under the
  287. * correct conditions. These are mainly input modes, which can only
  288. * be changed from disabled to enabled if their parent input method
  289. * is enabled (however, they can already be in the enabled state -
  290. * but not currently selectable - if their parent input method is
  291. * disabled). kTISPropertyInputSourceIsEnableCapable is true for
  292. * these.
  293. *
  294. * Availability:
  295. * Mac OS X: in version 10.5 and later in Carbon.framework
  296. * CarbonLib: not available
  297. * Non-Carbon CFM: not available
  298. }
  299. var kTISPropertyInputSourceIsEnableCapable: CFStringRef; external name '_kTISPropertyInputSourceIsEnableCapable'; (* attribute const *)
  300. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  301. {
  302. * kTISPropertyInputSourceIsSelectCapable
  303. *
  304. * Summary:
  305. * The property key constant for a CFBooleanRef value that indicates
  306. * whether the input source can ever (given the right conditions) be
  307. * programmatically selected using TISSelectInputSource.
  308. *
  309. * Discussion:
  310. * This is a static property of an input source, and does not depend
  311. * on any current state.
  312. *
  313. * Most input sources can be programmatically selected if they are
  314. * enabled; kTISPropertyInputSourceIsSelectCapable is true for
  315. * these.
  316. *
  317. * Some input sources can never be programmatically selected even if
  318. * they are enabled. These are mainly input methods that have modes
  319. * (parent input methods); only their modes can be selected.
  320. * kTISPropertyInputSourceIsSelectCapable is false for these.
  321. *
  322. *
  323. * Some input sources which are enabled can only be programmatically
  324. * selected under the correct conditions. These are mainly input
  325. * modes, which can only be selected if both they and their parent
  326. * input method are enabled. kTISPropertyInputSourceIsSelectCapable
  327. * is true for these.
  328. *
  329. * Input source which can never be enabled - i.e. for which
  330. * kTISPropertyInputSourceIsEnableCapable is false - can also never
  331. * be selected. kTISPropertyInputSourceIsSelectCapable is false for
  332. * these.
  333. *
  334. * Availability:
  335. * Mac OS X: in version 10.5 and later in Carbon.framework
  336. * CarbonLib: not available
  337. * Non-Carbon CFM: not available
  338. }
  339. var kTISPropertyInputSourceIsSelectCapable: CFStringRef; external name '_kTISPropertyInputSourceIsSelectCapable'; (* attribute const *)
  340. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  341. {
  342. * kTISPropertyInputSourceIsEnabled
  343. *
  344. * Summary:
  345. * The property key constant for a CFBooleanRef value that indicates
  346. * whether the input source is currently enabled.
  347. *
  348. * Availability:
  349. * Mac OS X: in version 10.5 and later in Carbon.framework
  350. * CarbonLib: not available
  351. * Non-Carbon CFM: not available
  352. }
  353. var kTISPropertyInputSourceIsEnabled: CFStringRef; external name '_kTISPropertyInputSourceIsEnabled'; (* attribute const *)
  354. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  355. {
  356. * kTISPropertyInputSourceIsSelected
  357. *
  358. * Summary:
  359. * The property key constant for a CFBooleanRef value that indicates
  360. * whether the input source is currently selected.
  361. *
  362. * Availability:
  363. * Mac OS X: in version 10.5 and later in Carbon.framework
  364. * CarbonLib: not available
  365. * Non-Carbon CFM: not available
  366. }
  367. var kTISPropertyInputSourceIsSelected: CFStringRef; external name '_kTISPropertyInputSourceIsSelected'; (* attribute const *)
  368. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  369. {
  370. * kTISPropertyInputSourceID
  371. *
  372. * Summary:
  373. * The property key constant for a CFStringRef value for the unique
  374. * reverse DNS name associated with the input source.
  375. *
  376. * Discussion:
  377. * 1. For keyboard input methods and for input sources of the
  378. * palette or ink category, this is typically the bundle ID, e.g.
  379. * "com.apple.Kotoeri".
  380. *
  381. * 2. For keyboard input modes, this is typically the bundle ID of
  382. * the parent input method plus a suffix that uniquely identifies
  383. * the input mode, e.g. "com.apple.Kotoeri.Katakana" (it is not the
  384. * generic input mode name used across input methods, e.g.
  385. * "com.apple.inputmethod.Japanese.Katakana").
  386. *
  387. * 3. For keyboard layouts this is a new identification mechanism
  388. * typically structured as "com.company.keyboardlayout.name", e.g.
  389. * "com.apple.keyboardlayout.US".
  390. *
  391. * Availability:
  392. * Mac OS X: in version 10.5 and later in Carbon.framework
  393. * CarbonLib: not available
  394. * Non-Carbon CFM: not available
  395. }
  396. var kTISPropertyInputSourceID: CFStringRef; external name '_kTISPropertyInputSourceID'; (* attribute const *)
  397. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  398. {
  399. * kTISPropertyBundleID
  400. *
  401. * Summary:
  402. * The property key constant for a CFStringRef value for the reverse
  403. * DNS BundleID associated with the input source.
  404. *
  405. * Discussion:
  406. * Not valid for all input sources (especially some keyboard
  407. * layouts).
  408. *
  409. * Availability:
  410. * Mac OS X: in version 10.5 and later in Carbon.framework
  411. * CarbonLib: not available
  412. * Non-Carbon CFM: not available
  413. }
  414. var kTISPropertyBundleID: CFStringRef; external name '_kTISPropertyBundleID'; (* attribute const *)
  415. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  416. {
  417. * kTISPropertyInputModeID
  418. *
  419. * Summary:
  420. * The property key constant for a CFStringRef value that identifies
  421. * a particular usage class for input modes.
  422. *
  423. * Discussion:
  424. * For example, "com.apple.inputmethod.Japanese.Katakana" identifies
  425. * a standard Katakana-input usage class that may be associated with
  426. * input modes from several different input methods.
  427. *
  428. * This InputModeID can be attached to a TSMDocument using
  429. * TSMSetDocumentProperty with the tag
  430. * kTSMDocumentInputModePropertyTag, in order to control which input
  431. * mode usage class should be used with that TSMDocument.
  432. *
  433. * Availability:
  434. * Mac OS X: in version 10.5 and later in Carbon.framework
  435. * CarbonLib: not available
  436. * Non-Carbon CFM: not available
  437. }
  438. var kTISPropertyInputModeID: CFStringRef; external name '_kTISPropertyInputModeID'; (* attribute const *)
  439. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  440. {
  441. * kTISPropertyLocalizedName
  442. *
  443. * Summary:
  444. * The property key constant for a CFStringRef value for the input
  445. * source's localized name for UI purposes.
  446. *
  447. * Discussion:
  448. * Uses the best match (determined by CFBundle) between the
  449. * localization being used by the caller and the available
  450. * localizations of the input source name. In some cases this may
  451. * fall back to an unlocalized name.
  452. *
  453. * Availability:
  454. * Mac OS X: in version 10.5 and later in Carbon.framework
  455. * CarbonLib: not available
  456. * Non-Carbon CFM: not available
  457. }
  458. var kTISPropertyLocalizedName: CFStringRef; external name '_kTISPropertyLocalizedName'; (* attribute const *)
  459. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  460. {
  461. *===============================================================================
  462. * The following keys may be used with TISGetInputSourceProperty, but may NOT
  463. * be used in the filter dictionary passed to TISCreateInputSourceList:
  464. *===============================================================================
  465. }
  466. {
  467. * kTISPropertyInputSourceLanguages
  468. *
  469. * Summary:
  470. * The property key constant for a value which is a CFArrayRef of
  471. * CFStringRefs, where each CFString is the language code for a
  472. * language that can be input using the input source.
  473. *
  474. * Discussion:
  475. * Languages codes are in the same BCP 47 format as returned by
  476. * CFLocaleCreateCanonicalLanguageIdentifierFromString. The first
  477. * language code in the array is the language for which the input
  478. * source is intended. If there is no such language (e.g. for the
  479. * Unicode Hex Input keyboard layout), the first language code is an
  480. * empty string.
  481. *
  482. * NOTE: This key (and a corresponding value) may not be used in the
  483. * filter dictionary passed to TISCreateInputSourceList.
  484. *
  485. * Availability:
  486. * Mac OS X: in version 10.5 and later in Carbon.framework
  487. * CarbonLib: not available
  488. * Non-Carbon CFM: not available
  489. }
  490. var kTISPropertyInputSourceLanguages: CFStringRef; external name '_kTISPropertyInputSourceLanguages'; (* attribute const *)
  491. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  492. {
  493. * kTISPropertyUnicodeKeyLayoutData
  494. *
  495. * Summary:
  496. * The property key constant for a value which is a CFDataRef that
  497. * refers to the 'uchr' keyboard layout data for a keyboard layout
  498. * input source.
  499. *
  500. * Discussion:
  501. * The uchr data is in native-endian order. If the input source is
  502. * not a keyboard layout, or is a keyboard layout for which only
  503. * 'KCHR data' is available, the value is NULL.
  504. *
  505. * NOTE: This key (and a corresponding value) may not be used in the
  506. * filter dictionary passed to TISCreateInputSourceList.
  507. *
  508. * Availability:
  509. * Mac OS X: in version 10.5 and later in Carbon.framework
  510. * CarbonLib: not available
  511. * Non-Carbon CFM: not available
  512. }
  513. var kTISPropertyUnicodeKeyLayoutData: CFStringRef; external name '_kTISPropertyUnicodeKeyLayoutData'; (* attribute const *)
  514. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  515. {
  516. * kTISPropertyIconRef
  517. *
  518. * Summary:
  519. * The property key constant for an IconRef value for the input
  520. * source icon.
  521. *
  522. * Discussion:
  523. * IconRefs are the normal icon format for keyboard layouts and
  524. * input methods. If an IconRef is not available for the specified
  525. * input source, the value is NULL.
  526. *
  527. * NOTE: This key (and a corresponding value) may not be used in the
  528. * filter dictionary passed to TISCreateInputSourceList.
  529. *
  530. * Availability:
  531. * Mac OS X: in version 10.5 and later in Carbon.framework
  532. * CarbonLib: not available
  533. * Non-Carbon CFM: not available
  534. }
  535. var kTISPropertyIconRef: CFStringRef; external name '_kTISPropertyIconRef'; (* attribute const *)
  536. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  537. {
  538. * kTISPropertyIconImageURL
  539. *
  540. * Summary:
  541. * The property key constant for a CFURLRef value indicating the
  542. * file containing the image (typically TIFF) to be used as the
  543. * input source icon.
  544. *
  545. * Discussion:
  546. * TIFF files are the normal icon format for input modes. If an
  547. * image file URL is not available for the specified input source,
  548. * the value will be NULL. Note that other image formats (e.g. JPEG,
  549. * PNG) may also be used in the future.
  550. *
  551. * NOTE: This key (and a corresponding value) may not be used in the
  552. * filter dictionary passed to TISCreateInputSourceList.
  553. *
  554. * Availability:
  555. * Mac OS X: in version 10.5 and later in Carbon.framework
  556. * CarbonLib: not available
  557. * Non-Carbon CFM: not available
  558. }
  559. var kTISPropertyIconImageURL: CFStringRef; external name '_kTISPropertyIconImageURL'; (* attribute const *)
  560. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  561. {
  562. *===============================================================================
  563. * Property value constants for input source category
  564. *===============================================================================
  565. }
  566. {
  567. * kTISCategoryKeyboardInputSource
  568. *
  569. * Summary:
  570. * The property value constant for one input source category value
  571. * associated with the property key kTISPropertyInputSourceCategory.
  572. *
  573. * Discussion:
  574. * This category includes keyboard layouts, keyboard input methods
  575. * (both with modes and without), and keyboard input modes. At least
  576. * one input source in this category is installed. Of all input
  577. * sources in this category, exactly one is selected; selecting a
  578. * new one deselects the previous one.
  579. *
  580. * Availability:
  581. * Mac OS X: in version 10.5 and later in Carbon.framework
  582. * CarbonLib: not available
  583. * Non-Carbon CFM: not available
  584. }
  585. var kTISCategoryKeyboardInputSource: CFStringRef; external name '_kTISCategoryKeyboardInputSource'; (* attribute const *)
  586. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  587. {
  588. * kTISCategoryPaletteInputSource
  589. *
  590. * Summary:
  591. * The property value constant for one input source category value
  592. * associated with the property key kTISPropertyInputSourceCategory.
  593. *
  594. * Discussion:
  595. * This category includes character palettes and keyboard viewers.
  596. * Zero or more of these can be selected.
  597. *
  598. * Availability:
  599. * Mac OS X: in version 10.5 and later in Carbon.framework
  600. * CarbonLib: not available
  601. * Non-Carbon CFM: not available
  602. }
  603. var kTISCategoryPaletteInputSource: CFStringRef; external name '_kTISCategoryPaletteInputSource'; (* attribute const *)
  604. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  605. {
  606. * kTISCategoryInkInputSource
  607. *
  608. * Summary:
  609. * The property value constant for one input source category value
  610. * associated with the property key kTISPropertyInputSourceCategory.
  611. *
  612. * Discussion:
  613. * Zero or one ink input sources can be installed and selected.
  614. *
  615. * Availability:
  616. * Mac OS X: in version 10.5 and later in Carbon.framework
  617. * CarbonLib: not available
  618. * Non-Carbon CFM: not available
  619. }
  620. var kTISCategoryInkInputSource: CFStringRef; external name '_kTISCategoryInkInputSource'; (* attribute const *)
  621. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  622. {
  623. *===============================================================================
  624. * Property value constants for input source type
  625. *===============================================================================
  626. }
  627. {
  628. * kTISTypeKeyboardLayout
  629. *
  630. * Summary:
  631. * The property value constant for one input source type value
  632. * associated with the property key kTISPropertyInputSourceType.
  633. *
  634. * Discussion:
  635. * This type belongs to the category kTISCategoryKeyboardInputSource.
  636. *
  637. * Availability:
  638. * Mac OS X: in version 10.5 and later in Carbon.framework
  639. * CarbonLib: not available
  640. * Non-Carbon CFM: not available
  641. }
  642. var kTISTypeKeyboardLayout: CFStringRef; external name '_kTISTypeKeyboardLayout'; (* attribute const *)
  643. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  644. {
  645. * kTISTypeKeyboardInputMethodWithoutModes
  646. *
  647. * Summary:
  648. * The property value constant for one input source type value
  649. * associated with the property key kTISPropertyInputSourceType.
  650. *
  651. * Discussion:
  652. * This type belongs to the category kTISCategoryKeyboardInputSource.
  653. *
  654. * Availability:
  655. * Mac OS X: in version 10.5 and later in Carbon.framework
  656. * CarbonLib: not available
  657. * Non-Carbon CFM: not available
  658. }
  659. var kTISTypeKeyboardInputMethodWithoutModes: CFStringRef; external name '_kTISTypeKeyboardInputMethodWithoutModes'; (* attribute const *)
  660. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  661. {
  662. * kTISTypeKeyboardInputMethodModeEnabled
  663. *
  664. * Summary:
  665. * The property value constant for one input source type value
  666. * associated with the property key kTISPropertyInputSourceType.
  667. *
  668. * Discussion:
  669. * This type belongs to the category kTISCategoryKeyboardInputSource.
  670. *
  671. * Availability:
  672. * Mac OS X: in version 10.5 and later in Carbon.framework
  673. * CarbonLib: not available
  674. * Non-Carbon CFM: not available
  675. }
  676. var kTISTypeKeyboardInputMethodModeEnabled: CFStringRef; external name '_kTISTypeKeyboardInputMethodModeEnabled'; (* attribute const *)
  677. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  678. {
  679. * kTISTypeKeyboardInputMode
  680. *
  681. * Summary:
  682. * The property value constant for one input source type value
  683. * associated with the property key kTISPropertyInputSourceType.
  684. *
  685. * Discussion:
  686. * This type belongs to the category kTISCategoryKeyboardInputSource.
  687. *
  688. * Availability:
  689. * Mac OS X: in version 10.5 and later in Carbon.framework
  690. * CarbonLib: not available
  691. * Non-Carbon CFM: not available
  692. }
  693. var kTISTypeKeyboardInputMode: CFStringRef; external name '_kTISTypeKeyboardInputMode'; (* attribute const *)
  694. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  695. {
  696. * kTISTypeCharacterPalette
  697. *
  698. * Summary:
  699. * The property value constant for one input source type value
  700. * associated with the property key kTISPropertyInputSourceType.
  701. *
  702. * Discussion:
  703. * This type belongs to the category kTISCategoryPaletteInputSource.
  704. *
  705. * Availability:
  706. * Mac OS X: in version 10.5 and later in Carbon.framework
  707. * CarbonLib: not available
  708. * Non-Carbon CFM: not available
  709. }
  710. var kTISTypeCharacterPalette: CFStringRef; external name '_kTISTypeCharacterPalette'; (* attribute const *)
  711. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  712. {
  713. * kTISTypeKeyboardViewer
  714. *
  715. * Summary:
  716. * The property value constant for one input source type value
  717. * associated with the property key kTISPropertyInputSourceType.
  718. *
  719. * Discussion:
  720. * This type belongs to the category kTISCategoryPaletteInputSource.
  721. *
  722. * Availability:
  723. * Mac OS X: in version 10.5 and later in Carbon.framework
  724. * CarbonLib: not available
  725. * Non-Carbon CFM: not available
  726. }
  727. var kTISTypeKeyboardViewer: CFStringRef; external name '_kTISTypeKeyboardViewer'; (* attribute const *)
  728. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  729. {
  730. * kTISTypeInk
  731. *
  732. * Summary:
  733. * The property value constant for one input source type value
  734. * associated with the property key kTISPropertyInputSourceType.
  735. *
  736. * Discussion:
  737. * This type belongs to the category kTISCategoryInkInputSource.
  738. * Even though it is the only type in that category, a type is
  739. * provided so that clients who donÕt need category information can
  740. * just check input source type.
  741. *
  742. * Availability:
  743. * Mac OS X: in version 10.5 and later in Carbon.framework
  744. * CarbonLib: not available
  745. * Non-Carbon CFM: not available
  746. }
  747. var kTISTypeInk: CFStringRef; external name '_kTISTypeInk'; (* attribute const *)
  748. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  749. {
  750. *===============================================================================
  751. * Find out information about text input sources
  752. *===============================================================================
  753. }
  754. {
  755. * TISGetInputSourceProperty()
  756. *
  757. * Summary:
  758. * Gets value of specified property for specified input source.
  759. *
  760. * Parameters:
  761. *
  762. * inputSource:
  763. * The text input source for which a property value is requested.
  764. *
  765. * propertyKey:
  766. * The property key constant specifying the desired property value.
  767. *
  768. * Result:
  769. * Returns a pointer type appropriate for value object associated
  770. * with the property key. The specific pointer type is specified for
  771. * each key. Typically it is a CFTypeRef of some sort, but in one
  772. * case it is IconRef. The function may return NULL if the specified
  773. * property is missing or invalid for the specified input source.
  774. * The objects referred to by the pointer follow the "Get" rule and
  775. * should not be be released by the caller (unless first retained by
  776. * the caller).
  777. *
  778. * Availability:
  779. * Mac OS X: in version 10.5 and later in Carbon.framework
  780. * CarbonLib: not available
  781. * Non-Carbon CFM: not available
  782. }
  783. function TISGetInputSourceProperty( inputSource: TISInputSourceRef; propertyKey: CFStringRef ): UnivPtr; external name '_TISGetInputSourceProperty';
  784. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  785. {
  786. * TISCreateInputSourceList()
  787. *
  788. * Summary:
  789. * Creates a list of input sources that match specified properties.
  790. *
  791. * Discussion:
  792. * This list represents a snapshot of input sources that matched the
  793. * specified properties at the time the call was made. If the caller
  794. * desires to include input sources that are installed but not
  795. * currently enabled, the includeAllInstalled parameter may be set
  796. * true. Typically this is done in order to obtain a
  797. * TISInputSourceRef for a newly-installed input source; in this
  798. * case the properties parameter would include very specific
  799. * criteria limiting the matching input sources.
  800. *
  801. * Warning: Calling this with includeAllInstalled true can have
  802. * significant memory impact on the calling application if the
  803. * properties parameter is NULL (match all) or if it specifies
  804. * criteria that may match many installed input sources, since this
  805. * may force caching of data for all matching input sources (which
  806. * can result in allocation of up to 120K). If
  807. * TISCreateInputSourceList is being called in order to find a
  808. * specific input source or sources from among the sources included
  809. * in the list, then it is best to first call
  810. * TISCreateInputSourceList with includeAllInstalled = false and
  811. * check whether the returned array includes the desired input
  812. * source(s); if not, then call TISCreateInputSourceList again with
  813. * includeAllInstalled = true.
  814. *
  815. * Parameters:
  816. *
  817. * properties:
  818. * Dictionary of property keys and corresponding values to filter
  819. * the input source list. May be NULL, in which case no filtering
  820. * is performed.
  821. *
  822. * includeAllInstalled:
  823. * Normally false so that only enabled input sources will be
  824. * included; set true to include all installed input sources that
  825. * match the filter (see discussion).
  826. *
  827. * Result:
  828. * Returns a CFArrayRef for a list of TISInputSourceRefs that match
  829. * the specified properties.
  830. *
  831. * Availability:
  832. * Mac OS X: in version 10.5 and later in Carbon.framework
  833. * CarbonLib: not available
  834. * Non-Carbon CFM: not available
  835. }
  836. function TISCreateInputSourceList( properties: CFDictionaryRef; includeAllInstalled: Boolean ): CFArrayRef; external name '_TISCreateInputSourceList';
  837. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  838. {
  839. *===============================================================================
  840. * Get specific input sources
  841. *===============================================================================
  842. }
  843. {
  844. * TISCopyCurrentKeyboardInputSource()
  845. *
  846. * Summary:
  847. * Copies a TISInputSourceRef for the currently-selected keyboard
  848. * input source; convenience function.
  849. *
  850. * Availability:
  851. * Mac OS X: in version 10.5 and later in Carbon.framework
  852. * CarbonLib: not available
  853. * Non-Carbon CFM: not available
  854. }
  855. function TISCopyCurrentKeyboardInputSource: TISInputSourceRef; external name '_TISCopyCurrentKeyboardInputSource';
  856. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  857. {
  858. * TISCopyCurrentKeyboardLayoutInputSource()
  859. *
  860. * Summary:
  861. * Copies a TISInputSourceRef for the keyboard layout currently
  862. * being used. If the currently-selected keyboard input source is a
  863. * keyboard layout, the TISInputSourceRef refers to that layout; if
  864. * the currently-selected keyboard input source is an input method
  865. * or mode, the TISInputSourceRef refers to the keyboard layout
  866. * being used by that input method or mode.
  867. *
  868. * Availability:
  869. * Mac OS X: in version 10.5 and later in Carbon.framework
  870. * CarbonLib: not available
  871. * Non-Carbon CFM: not available
  872. }
  873. function TISCopyCurrentKeyboardLayoutInputSource: TISInputSourceRef; external name '_TISCopyCurrentKeyboardLayoutInputSource';
  874. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  875. {
  876. * TISCopyCurrentASCIICapableKeyboardInputSource()
  877. *
  878. * Summary:
  879. * Copies a TISInputSourceRef for the most-recently-used
  880. * ASCII-capable keyboard input source.
  881. *
  882. * Discussion:
  883. * If no ASCII-capable keyboard input source has been used yet,
  884. * returns the default ASCII-capable keyboard layout (chosen by
  885. * Setup Assistant).
  886. *
  887. * Availability:
  888. * Mac OS X: in version 10.5 and later in Carbon.framework
  889. * CarbonLib: not available
  890. * Non-Carbon CFM: not available
  891. }
  892. function TISCopyCurrentASCIICapableKeyboardInputSource: TISInputSourceRef; external name '_TISCopyCurrentASCIICapableKeyboardInputSource';
  893. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  894. {
  895. * TISCopyCurrentASCIICapableKeyboardLayoutInputSource()
  896. *
  897. * Summary:
  898. * Copies a TISInputSourceRef for the most-recently-used
  899. * ASCII-capable keyboard layout.
  900. *
  901. * Discussion:
  902. * If no ASCII-capable keyboard input source has been used yet,
  903. * returns the default ASCII-capable keyboard layout (chosen by
  904. * Setup Assistant).
  905. *
  906. * This is used by input methods to get the keyboard layout that
  907. * will be used for key translation if there is no specific keyboard
  908. * layout override.
  909. *
  910. * Note the similar TISCopyCurrentASCIICapableKeyboardInputSource,
  911. * which can return input sources that are not keyboard layouts.
  912. *
  913. * Availability:
  914. * Mac OS X: in version 10.5 and later in Carbon.framework
  915. * CarbonLib: not available
  916. * Non-Carbon CFM: not available
  917. }
  918. function TISCopyCurrentASCIICapableKeyboardLayoutInputSource: TISInputSourceRef; external name '_TISCopyCurrentASCIICapableKeyboardLayoutInputSource';
  919. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  920. {
  921. * TISCopyInputSourceForLanguage()
  922. *
  923. * Summary:
  924. * Copies a TISInputSourceRef for the input source that should be
  925. * used to input the specified language.
  926. *
  927. * Discussion:
  928. * Sample usage: If a text field is expected to have input in a
  929. * particular language, an application can call
  930. * TISCopyInputSourceForLanguage and then TISSelectInputSource to
  931. * select an input source that would be appropriate for that
  932. * language.
  933. *
  934. * This is intended to provide a replacement for one way in which
  935. * the now-deprecated KeyScript API was used: Selection of the
  936. * default input source associated with a particular ScriptCode.
  937. *
  938. * Parameters:
  939. *
  940. * language:
  941. * A language tag in BCP 47 format (i.e. in the same form as
  942. * returned by
  943. * CFLocaleCreateCanonicalLanguageIdentifierFromString) that
  944. * represents the language for which an input source should be
  945. * returned.
  946. *
  947. * Result:
  948. * TISInputSourceRef for an enabled input source that can input the
  949. * specified language. If there is more than one such input source
  950. * and at least one has previously been used, then the
  951. * most-recently-used one will be chosen. If none of them has
  952. * previously been used, one will be chosen based on the intended
  953. * languages of the input sources. If there is no enabled input
  954. * source that can input the specified language, the function will
  955. * return NULL.
  956. *
  957. * Availability:
  958. * Mac OS X: in version 10.5 and later in Carbon.framework
  959. * CarbonLib: not available
  960. * Non-Carbon CFM: not available
  961. }
  962. function TISCopyInputSourceForLanguage( language: CFStringRef ): TISInputSourceRef; external name '_TISCopyInputSourceForLanguage';
  963. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  964. {
  965. * TISCreateASCIICapableInputSourceList()
  966. *
  967. * Summary:
  968. * Creates a list of ASCII capable keyboard input sources.
  969. *
  970. * Discussion:
  971. * This list represents a snapshot of ASCII capable keyboard input
  972. * sources that were enabled at the time the call was made.
  973. * Successive calls to TISCreateASCIICapableInputSourceList may
  974. * return different results because, for example, in between the
  975. * calls the user may enable or disable an input source in the
  976. * International Preferences pane. When a keyboard input source is
  977. * enabled or disabled, whether by the user or programmatically, the
  978. * kTISNotifyEnabledKeyboardInputSourcesChanged CF distributed
  979. * notification is posted.
  980. *
  981. * Result:
  982. * Returns a CFArrayRef containing a list of TISInputSourceRefs.
  983. *
  984. * Availability:
  985. * Mac OS X: in version 10.5 and later in Carbon.framework
  986. * CarbonLib: not available
  987. * Non-Carbon CFM: not available
  988. }
  989. function TISCreateASCIICapableInputSourceList: CFArrayRef; external name '_TISCreateASCIICapableInputSourceList';
  990. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  991. {
  992. *===============================================================================
  993. * Manipulate input sources
  994. *===============================================================================
  995. }
  996. {
  997. * TISSelectInputSource()
  998. *
  999. * Summary:
  1000. * Selects the specified input source.
  1001. *
  1002. * Discussion:
  1003. * Calling TISSelectInputSource on a keyboard input source that can
  1004. * be selected makes the specified input source the new current
  1005. * keyboard input source, and deselects the previous one. Calling
  1006. * TISSelectInputSource on a palette input source usually results in
  1007. * the palette being displayed and available for input. Ink input
  1008. * sources are typically enabled and selected at the same time.
  1009. * Calling TISSelectInputSource on a palette or ink input source has
  1010. * no effect on other input sources. Calling TISSelectInputSource
  1011. * for an already-selected input source has no effect.
  1012. *
  1013. * For TISSelectInputSource to succeed, the input source must be
  1014. * capable of being selected (kTISPropertyInputSourceIsSelectCapable
  1015. * must be true) and the input source must be enabled
  1016. * (kTISPropertyInputSourceIsEnabled must be true). Furthermore, if
  1017. * if the input source is an input mode, its parent must be enabled
  1018. * for it to be selected.
  1019. *
  1020. * Result:
  1021. * Returns an error code: paramErr if the input source is not
  1022. * selectable, else noErr.
  1023. *
  1024. * Availability:
  1025. * Mac OS X: in version 10.5 and later in Carbon.framework
  1026. * CarbonLib: not available
  1027. * Non-Carbon CFM: not available
  1028. }
  1029. function TISSelectInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISSelectInputSource';
  1030. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1031. {
  1032. * TISDeselectInputSource()
  1033. *
  1034. * Summary:
  1035. * Deselects the specified input source.
  1036. *
  1037. * Discussion:
  1038. * TISDeselectInputSource is only intended for use with palette or
  1039. * ink input sources; calling it has no effect on other input
  1040. * sources. When palette input sources are disabled, the palette
  1041. * disappears. Ink input sources are usually deselected and disabled
  1042. * at the same time.
  1043. *
  1044. * Result:
  1045. * Returns an error code: paramErr if the input source is not
  1046. * deselectable, else noErr.
  1047. *
  1048. * Availability:
  1049. * Mac OS X: in version 10.5 and later in Carbon.framework
  1050. * CarbonLib: not available
  1051. * Non-Carbon CFM: not available
  1052. }
  1053. function TISDeselectInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISDeselectInputSource';
  1054. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1055. {
  1056. * TISEnableInputSource()
  1057. *
  1058. * Summary:
  1059. * Enables the specified input source.
  1060. *
  1061. * Discussion:
  1062. * TISEnableInputSource is mainly intended for input methods, or for
  1063. * applications that supply their own input sources (e.g.
  1064. * applications that provide keyboard layouts or palette input
  1065. * methods, and keyboard input methods that provide their own
  1066. * keyboard layouts and/or input modes). It makes the specified
  1067. * input source available in UI for selection.
  1068. *
  1069. * For TISEnableInputSource to succeed, the input source must be
  1070. * capable of being enabled (kTISPropertyInputSourceIsEnableCapable
  1071. * must be true). Furthermore, if the input source is an input mode,
  1072. * its parent must already be enabled for the mode to become enabled.
  1073. *
  1074. * Result:
  1075. * Returns an error code: paramErr if the input source cannot be
  1076. * enabled, else noErr.
  1077. *
  1078. * Availability:
  1079. * Mac OS X: in version 10.5 and later in Carbon.framework
  1080. * CarbonLib: not available
  1081. * Non-Carbon CFM: not available
  1082. }
  1083. function TISEnableInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISEnableInputSource';
  1084. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1085. {
  1086. * TISDisableInputSource()
  1087. *
  1088. * Summary:
  1089. * Disables the specified input source.
  1090. *
  1091. * Discussion:
  1092. * TISDisableInputSource is mainly intended for input methods, or
  1093. * for applications that supply their own input sources (e.g.
  1094. * applications that provide keyboard layouts or palette input
  1095. * methods, and keyboard input methods that provide their own
  1096. * keyboard layouts and/or input modes). It makes the specified
  1097. * input source unavailable for selection, and removes it from
  1098. * system UI.
  1099. *
  1100. * Result:
  1101. * Returns an error code: paramErr if the input source cannot be
  1102. * disabled, else noErr.
  1103. *
  1104. * Availability:
  1105. * Mac OS X: in version 10.5 and later in Carbon.framework
  1106. * CarbonLib: not available
  1107. * Non-Carbon CFM: not available
  1108. }
  1109. function TISDisableInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISDisableInputSource';
  1110. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1111. {
  1112. *===============================================================================
  1113. * Notification constants
  1114. *===============================================================================
  1115. }
  1116. {
  1117. * kTISNotifySelectedKeyboardInputSourceChanged
  1118. *
  1119. * Summary:
  1120. * The name of the CF distributed notification for a change to the
  1121. * selected keyboard input source.
  1122. *
  1123. * Availability:
  1124. * Mac OS X: in version 10.5 and later in Carbon.framework
  1125. * CarbonLib: not available
  1126. * Non-Carbon CFM: not available
  1127. }
  1128. var kTISNotifySelectedKeyboardInputSourceChanged: CFStringRef; external name '_kTISNotifySelectedKeyboardInputSourceChanged'; (* attribute const *)
  1129. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1130. {
  1131. * kTISNotifyEnabledKeyboardInputSourcesChanged
  1132. *
  1133. * Summary:
  1134. * The name of the CF distributed notification for a change to the
  1135. * set of enabled keyboard input sources.
  1136. *
  1137. * Availability:
  1138. * Mac OS X: in version 10.5 and later in Carbon.framework
  1139. * CarbonLib: not available
  1140. * Non-Carbon CFM: not available
  1141. }
  1142. var kTISNotifyEnabledKeyboardInputSourcesChanged: CFStringRef; external name '_kTISNotifyEnabledKeyboardInputSourcesChanged'; (* attribute const *)
  1143. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1144. {
  1145. *===============================================================================
  1146. * Allow input method to override keyboard layout
  1147. *===============================================================================
  1148. }
  1149. {
  1150. * TISSetInputMethodKeyboardLayoutOverride()
  1151. *
  1152. * Summary:
  1153. * Sets the keyboard layout override for an input method or mode.
  1154. *
  1155. * Discussion:
  1156. * When an input method or mode is the selected input source, TSM
  1157. * will by default use the most-recently-used ASCII-capable keyboard
  1158. * layout to translate key events* (this keyboard layout is also the
  1159. * one that will appear in Keyboard Viewer); an input source for
  1160. * this keyboard layout is returned by
  1161. * TISCopyCurrentASCIICapableKeyboardLayout. If a different keyboard
  1162. * layout should be used for a particular input method or mode, then
  1163. * when that input method/mode is activated it should call
  1164. * TISSetInputMethodKeyboardLayoutOverride to specify the desired
  1165. * keyboard layout.
  1166. *
  1167. * For example, when a Kotoeri user selects kana layout for kana
  1168. * input, Kotoeri should call
  1169. * TISSetInputMethodKeyboardLayoutOverride to set the kana keyboard
  1170. * as the override for the appropriate input modes.
  1171. *
  1172. * The keyboard layout set in this way will be used for the final
  1173. * stage of key translation in the Window Server - the connection or
  1174. * application-specific key translation.
  1175. *
  1176. * The override setting is lost when the input method that set it is
  1177. * deactivated.
  1178. *
  1179. * The keyboardLayout to be used for overriding need not be enabled
  1180. * or explicitly selectable. It can be a non-selectable layout that
  1181. * is included in an input method bundle and automatically
  1182. * registered.
  1183. *
  1184. * *The default behavior is new for Mac OS X 10.5, and is meant to
  1185. * eliminate the necessity for input methods to have UI for setting
  1186. * which ASCII- capable keyboard to use for latin-character-based
  1187. * phonetic input.
  1188. *
  1189. * Parameters:
  1190. *
  1191. * keyboardLayout:
  1192. * TISInputSourceRef for the keyboard layout that should be used
  1193. * until the current input method is deactivated (if it should be
  1194. * something other than the most-recently-used ASCII-capable
  1195. * keyboard layout).
  1196. *
  1197. * Result:
  1198. * Returns an error code: paramErr if the current keyboard input
  1199. * source is not an input method/mode or if keyboardLayout does not
  1200. * designate a keyboard layout, else noErr.
  1201. *
  1202. * Availability:
  1203. * Mac OS X: in version 10.5 and later in Carbon.framework
  1204. * CarbonLib: not available
  1205. * Non-Carbon CFM: not available
  1206. }
  1207. function TISSetInputMethodKeyboardLayoutOverride( keyboardLayout: TISInputSourceRef ): OSStatus; external name '_TISSetInputMethodKeyboardLayoutOverride';
  1208. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1209. {
  1210. * TISCopyInputMethodKeyboardLayoutOverride()
  1211. *
  1212. * Summary:
  1213. * Copies a TISInputSourceRef for the currently-selected input
  1214. * method's keyboard layout override, if any.
  1215. *
  1216. * Result:
  1217. * If the current keyboard input source is an input method or mode
  1218. * that has a keyboard layout override, then a TISInputSourceRef for
  1219. * that keyboard layout is returned; otherwise, NULL is returned.
  1220. *
  1221. * Availability:
  1222. * Mac OS X: in version 10.5 and later in Carbon.framework
  1223. * CarbonLib: not available
  1224. * Non-Carbon CFM: not available
  1225. }
  1226. function TISCopyInputMethodKeyboardLayoutOverride: TISInputSourceRef; external name '_TISCopyInputMethodKeyboardLayoutOverride';
  1227. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1228. {
  1229. *===============================================================================
  1230. * Install/register an input source
  1231. *===============================================================================
  1232. }
  1233. {
  1234. * TISRegisterInputSource()
  1235. *
  1236. * Summary:
  1237. * Registers the new input source(s) in a file or bundle so that a
  1238. * TISInputSourceRef can immediately be obtained for each of the new
  1239. * input source(s).
  1240. *
  1241. * Discussion:
  1242. * This allows an installer for an input method bundle or a keyboard
  1243. * layout file or bundle to notify the system that these new input
  1244. * sources should be registered. The system can then locate the
  1245. * specified file or bundle and perform any necessary cache rebuilds
  1246. * so that the installer can immediately call
  1247. * TISCreateInputSourceList with appropriate properties (e.g.
  1248. * BundleID or InputSourceID) in order to get TISInputSourceRefs for
  1249. * one or more of the newly registered input sources.
  1250. *
  1251. * This can only be used to register the following:
  1252. *
  1253. * - Keyboard layout files or bundles in "/Library/Keyboard
  1254. * Layouts/" or "~/Library/Keyboard Layouts/" (available to all
  1255. * users or current user, respectively). Such keyboard layouts, once
  1256. * enabled, are selectable.
  1257. *
  1258. * - Input method bundles in the new "/Library/Input Methods/" or
  1259. * "~/Library/Input Methods/" directories (available to all users or
  1260. * current user, respectively).
  1261. *
  1262. * Note: Input method bundles can include private non-selectable
  1263. * keyboard layouts for use with
  1264. * TISSetInputMethodKeyboardLayoutOverride. These are registered
  1265. * automatically when the input method is registered, and do not
  1266. * need to be separately registered.
  1267. *
  1268. * Security: Any code that calls TISRegisterInputSource is part of
  1269. * an application or service that has already been validated in some
  1270. * way (e.g. by the user).
  1271. *
  1272. * Parameters:
  1273. *
  1274. * location:
  1275. * CFURLRef for the location of the input source(s), a file or
  1276. * bundle.
  1277. *
  1278. * Result:
  1279. * Error code: paramErr if location is invalid or the input
  1280. * source(s) in the specified location cannot be registered;
  1281. * otherwise noErr.
  1282. *
  1283. * Availability:
  1284. * Mac OS X: in version 10.5 and later in Carbon.framework
  1285. * CarbonLib: not available
  1286. * Non-Carbon CFM: not available
  1287. }
  1288. function TISRegisterInputSource( location: CFURLRef ): OSStatus; external name '_TISRegisterInputSource';
  1289. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1290. {
  1291. *===============================================================================
  1292. * Text Input Sources properties and bundle-packaged text input sources
  1293. *===============================================================================
  1294. *
  1295. * For Leopard, there are two new keys for use in plists to provide information
  1296. * that supports the Text Input Sources functions above (these keys will be
  1297. * ignored in earlier systems):
  1298. *
  1299. * "TISInputSourceID" - a key to specify the InputSourceID, a reverse-DNS-style
  1300. * string meant to uniquely identify any input source. If this key is not
  1301. * specified, the Text Input Sources functions will attempt to construct an
  1302. * InputSourceID from other information.
  1303. *
  1304. * "TISIntendedLanguage" - a key to specify the primary language which the
  1305. * input source is intended to input. If there is none - as with the Unicode
  1306. * Hex Input key layout, for example - this key need not be specified. The
  1307. * language is indicated by a string in in the format described by BCP 47
  1308. * (the successor to RFC 3066).
  1309. *
  1310. * How these keys are used depends on the type of input source, as described
  1311. * below.
  1312. *
  1313. * 1. Keyboard layouts ( in <domain>/Library/Keyboard Layouts/ )
  1314. *
  1315. * Keyboard layouts packaged in bundles use either a resource file or a set of
  1316. * xml keylayout files together with optional icns files. The following example
  1317. * shows the two methods of packaging a set of two key layouts in Unicode 'uchr'
  1318. * format with key layout names "MyLayoutOne" and "MyLayoutTwo" and corresponding
  1319. * numeric IDs -9001 and -9002 (see Tech Note 2056).
  1320. *
  1321. * MyKeyboardLayouts.bundle/
  1322. * Contents/
  1323. * Info.plist
  1324. * version.plist
  1325. * Resources/
  1326. * MyKeyboardLayouts.rsrc, containing the following resources:
  1327. * resources 'uchr' (-9001, "MyLayoutOne"), 'kcs#' (-9001), 'kcs4' (-9001)
  1328. * resources 'uchr' (-9002, "MyLayoutTwo"), 'kcs#' (-9002), 'kcs4' (-9002)
  1329. * en.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
  1330. * ja.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
  1331. * ...
  1332. *
  1333. * MyKeyboardLayouts.bundle/
  1334. * Contents/
  1335. * Info.plist
  1336. * version.plist
  1337. * Resources/
  1338. * MyLayoutOne.keylayout, specifying name="MyLayoutOne" and id=-9001
  1339. * MyLayoutOne.icns (optional)
  1340. * MyLayoutTwo.keylayout, specifying name="MyLayoutTwo" and id=-9002
  1341. * MyLayoutTwo.icns (optional)
  1342. * en.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
  1343. * ja.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
  1344. * ...
  1345. *
  1346. * In the Info.plist file, the value for the CFBundleIdentifier key must be a
  1347. * string that includes ".keyboardlayout."; typically this might be something
  1348. * like "com.companyname.keyboardlayout.MyKeyboardLayouts" (Before Leopard,
  1349. * it was required to be a string that began "com.apple.keyboardlayout", even
  1350. * for keyboard layouts not supplied by Apple).
  1351. *
  1352. * A dictionary of properties for each key layout in the bundle should be
  1353. * provided using a key of the form "KLInfo_keylayoutname" (even if
  1354. * keylayoutname includes spaces or punctuation). This dictionary is where to
  1355. * specify the keys "TISInputSourceID" and "TISIntendedLanguage" and their
  1356. * associated values.
  1357. *
  1358. * "TISInputSourceID" note: For keyboard layouts this should typically be
  1359. * something like "com.companyname.keylayout.keylayoutname". If this key is
  1360. * not specified, an InputSourceID will be constructed by combining
  1361. * bundleID + ". keylayout." + keylayoutname.
  1362. *
  1363. * If the keyboard layouts in the above example were intended to input
  1364. * Azerbaijani in Latin script, then the Info.plist entries could be:
  1365. *
  1366. * <key>KLInfo_MyLayoutOne</key>
  1367. * <dict>
  1368. * <key>TISInputSourceID</key>
  1369. * <string>com.companyname.keylayout.MyLayoutOne</string>
  1370. * <key>TISIntendedLanguage</key>
  1371. * <string>az-Latn</string>
  1372. * </dict>
  1373. * <key>KLInfo_MyLayoutTwo</key>
  1374. * <dict>
  1375. * <key>TISInputSourceID</key>
  1376. * <string>com.companyname.keylayout.MyLayoutTwo</string>
  1377. * <key>TISIntendedLanguage</key>
  1378. * <string>az-Latn</string>
  1379. * </dict>
  1380. *
  1381. * 2. Input methods
  1382. *
  1383. * Input methods are always packaged as bundles, either as Component bundles
  1384. * in "<domain>/Library/Components/" (the old way, still supported in Leopard)
  1385. * or as application bundles in "<domain>/Library/Input Methods/" (new for
  1386. * Leopard).
  1387. *
  1388. * The new keys keys "TISInputSourceID" and "TISIntendedLanguage" and their
  1389. * associated values are added at the top level of the Info.plist file.
  1390. *
  1391. * "TISInputSourceID" note: For input methods this is typically the same as
  1392. * the BundleID, and if this key is not specified the BundleID will be used
  1393. * as the InputSourceID.
  1394. *
  1395. * 3. Input modes
  1396. *
  1397. * An input method's input modes are defined using the "ComponentInputModeDict"
  1398. * key at the top level of the input method's Info.plist file (even for
  1399. * non-component application-based input methods). The value of this key is a
  1400. * dictionary, one of whose keys is "tsInputModeListKey"; the value of this
  1401. * key is also a dictionary of input modes, with the InputModeID as the key
  1402. * and the input mode's dictionary as the value (see TextServices.h).
  1403. *
  1404. * The new keys keys "TISInputSourceID" and "TISIntendedLanguage" and their
  1405. * associated values are added to the input mode's dictionary.
  1406. *
  1407. * "TISInputSourceID" note: For input modes this is a string that begins with
  1408. * the parent input method's InputSourceID or BundleID, followed by something
  1409. * that identifies the mode. For example, "com.apple.Kotoeri.Japanese.Katakana".
  1410. * In general it is not necessarily the same as the InputModeID, since a
  1411. * particular InputModeID such as "com.apple.inputmethod.Japanese.Katakana"
  1412. * may be used by multiple input methods. If this key is not specified, an
  1413. * InputSourceID will be constructed by combining the BundleID with an
  1414. * InputModeID suffix formed by deleting any prefix that matches the BundleID
  1415. * or that ends in ".inputmethod."
  1416. }
  1417. {
  1418. *===============================================================================
  1419. }
  1420. end.