CTParagraphStyle.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. {
  2. * CTParagraphStyle.h
  3. * CoreText
  4. *
  5. * Copyright (c) 2004-2012 Apple Inc. All rights reserved.
  6. *
  7. }
  8. { Initial Pascal Translation: Jonas Maebe, <[email protected]>, October 2009 }
  9. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  10. {
  11. Modified for use with Free Pascal
  12. Version 308
  13. Please report any bugs to <[email protected]>
  14. }
  15. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$calling mwpascal}
  21. unit CTParagraphStyle;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  24. {$setc GAP_INTERFACES_VERSION := $0308}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  40. {$setc __ppc64__ := 1}
  41. {$elsec}
  42. {$setc __ppc64__ := 0}
  43. {$endc}
  44. {$ifc not defined __i386__ and defined CPUI386}
  45. {$setc __i386__ := 1}
  46. {$elsec}
  47. {$setc __i386__ := 0}
  48. {$endc}
  49. {$ifc not defined __x86_64__ and defined CPUX86_64}
  50. {$setc __x86_64__ := 1}
  51. {$elsec}
  52. {$setc __x86_64__ := 0}
  53. {$endc}
  54. {$ifc not defined __arm__ and defined CPUARM}
  55. {$setc __arm__ := 1}
  56. {$elsec}
  57. {$setc __arm__ := 0}
  58. {$endc}
  59. {$ifc defined cpu64}
  60. {$setc __LP64__ := 1}
  61. {$elsec}
  62. {$setc __LP64__ := 0}
  63. {$endc}
  64. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  65. {$error Conflicting definitions for __ppc__ and __i386__}
  66. {$endc}
  67. {$ifc defined __ppc__ and __ppc__}
  68. {$setc TARGET_CPU_PPC := TRUE}
  69. {$setc TARGET_CPU_PPC64 := FALSE}
  70. {$setc TARGET_CPU_X86 := FALSE}
  71. {$setc TARGET_CPU_X86_64 := FALSE}
  72. {$setc TARGET_CPU_ARM := FALSE}
  73. {$setc TARGET_OS_MAC := TRUE}
  74. {$setc TARGET_OS_IPHONE := FALSE}
  75. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  76. {$setc TARGET_OS_EMBEDDED := FALSE}
  77. {$elifc defined __ppc64__ and __ppc64__}
  78. {$setc TARGET_CPU_PPC := FALSE}
  79. {$setc TARGET_CPU_PPC64 := TRUE}
  80. {$setc TARGET_CPU_X86 := FALSE}
  81. {$setc TARGET_CPU_X86_64 := FALSE}
  82. {$setc TARGET_CPU_ARM := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$setc TARGET_OS_EMBEDDED := FALSE}
  87. {$elifc defined __i386__ and __i386__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := FALSE}
  90. {$setc TARGET_CPU_X86 := TRUE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$ifc defined(iphonesim)}
  94. {$setc TARGET_OS_MAC := FALSE}
  95. {$setc TARGET_OS_IPHONE := TRUE}
  96. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  97. {$elsec}
  98. {$setc TARGET_OS_MAC := TRUE}
  99. {$setc TARGET_OS_IPHONE := FALSE}
  100. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  101. {$endc}
  102. {$setc TARGET_OS_EMBEDDED := FALSE}
  103. {$elifc defined __x86_64__ and __x86_64__}
  104. {$setc TARGET_CPU_PPC := FALSE}
  105. {$setc TARGET_CPU_PPC64 := FALSE}
  106. {$setc TARGET_CPU_X86 := FALSE}
  107. {$setc TARGET_CPU_X86_64 := TRUE}
  108. {$setc TARGET_CPU_ARM := FALSE}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$setc TARGET_OS_EMBEDDED := FALSE}
  113. {$elifc defined __arm__ and __arm__}
  114. {$setc TARGET_CPU_PPC := FALSE}
  115. {$setc TARGET_CPU_PPC64 := FALSE}
  116. {$setc TARGET_CPU_X86 := FALSE}
  117. {$setc TARGET_CPU_X86_64 := FALSE}
  118. {$setc TARGET_CPU_ARM := TRUE}
  119. { will require compiler define when/if other Apple devices with ARM cpus ship }
  120. {$setc TARGET_OS_MAC := FALSE}
  121. {$setc TARGET_OS_IPHONE := TRUE}
  122. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  123. {$setc TARGET_OS_EMBEDDED := TRUE}
  124. {$elsec}
  125. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  126. {$endc}
  127. {$ifc defined __LP64__ and __LP64__ }
  128. {$setc TARGET_CPU_64 := TRUE}
  129. {$elsec}
  130. {$setc TARGET_CPU_64 := FALSE}
  131. {$endc}
  132. {$ifc defined FPC_BIG_ENDIAN}
  133. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  134. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  135. {$elifc defined FPC_LITTLE_ENDIAN}
  136. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  137. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  138. {$elsec}
  139. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  140. {$endc}
  141. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  142. {$setc CALL_NOT_IN_CARBON := FALSE}
  143. {$setc OLDROUTINENAMES := FALSE}
  144. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  145. {$setc OPAQUE_UPP_TYPES := TRUE}
  146. {$setc OTCARBONAPPLICATION := TRUE}
  147. {$setc OTKERNEL := FALSE}
  148. {$setc PM_USE_SESSION_APIS := TRUE}
  149. {$setc TARGET_API_MAC_CARBON := TRUE}
  150. {$setc TARGET_API_MAC_OS8 := FALSE}
  151. {$setc TARGET_API_MAC_OSX := TRUE}
  152. {$setc TARGET_CARBON := TRUE}
  153. {$setc TARGET_CPU_68K := FALSE}
  154. {$setc TARGET_CPU_MIPS := FALSE}
  155. {$setc TARGET_CPU_SPARC := FALSE}
  156. {$setc TARGET_OS_UNIX := FALSE}
  157. {$setc TARGET_OS_WIN32 := FALSE}
  158. {$setc TARGET_RT_MAC_68881 := FALSE}
  159. {$setc TARGET_RT_MAC_CFM := FALSE}
  160. {$setc TARGET_RT_MAC_MACHO := TRUE}
  161. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  162. {$setc TYPE_BOOL := FALSE}
  163. {$setc TYPE_EXTENDED := FALSE}
  164. {$setc TYPE_LONGLONG := TRUE}
  165. uses MacTypes,CFArray,CGBase,CFBase;
  166. {$endc} {not MACOSALLINCLUDE}
  167. {$ALIGN POWER}
  168. {!
  169. @header
  170. Thread Safety Information
  171. All functions in this header are thread safe unless otherwise specified.
  172. }
  173. { --------------------------------------------------------------------------- }
  174. { Paragraph Style Types }
  175. { --------------------------------------------------------------------------- }
  176. type
  177. CTParagraphStyleRef = ^__CTParagraphStyle; { an opaque type }
  178. __CTParagraphStyle = record end;
  179. {!
  180. @function CTParagraphStyleGetTypeID
  181. @abstract Returns the CFType of the paragraph style object
  182. }
  183. function CTParagraphStyleGetTypeID: CFTypeID; external name '_CTParagraphStyleGetTypeID';
  184. (* CT_AVAILABLE_STARTING( __MAC_10_5, __IPHONE_3_2) *)
  185. { --------------------------------------------------------------------------- }
  186. { Paragraph Style Values }
  187. { --------------------------------------------------------------------------- }
  188. {!
  189. @enum CTTextAlignment
  190. @abstract These constants specify text alignment.
  191. @constant kCTTextAlignmentLeft
  192. Text is visually left-aligned.
  193. @constant kCTTextAlignmentRight
  194. Text is visually right-aligned.
  195. @constant kCTTextAlignmentCenter
  196. Text is visually center-aligned.
  197. @constant kCTTextAlignmentJustified
  198. Text is fully justified. The last line in a paragraph is
  199. naturally aligned.
  200. @constant kCTTextAlignmentNatural
  201. Use the natural alignment of the text's script.
  202. }
  203. const
  204. kCTTextAlignmentLeft = 0;
  205. kCTTextAlignmentRight = 1;
  206. kCTTextAlignmentCenter = 2;
  207. kCTTextAlignmentJustified = 3;
  208. kCTTextAlignmentNatural = 4;
  209. kCTLeftTextAlignment = kCTTextAlignmentLeft;
  210. kCTRightTextAlignment = kCTTextAlignmentRight;
  211. kCTCenterTextAlignment = kCTTextAlignmentCenter;
  212. kCTJustifiedTextAlignment = kCTTextAlignmentJustified;
  213. kCTNaturalTextAlignment = kCTTextAlignmentNatural;
  214. type
  215. CTTextAlignment = UInt8;
  216. {!
  217. @enum CTLineBreakMode
  218. @abstract These constants specify what happens when a line is too long for
  219. its frame.
  220. @constant kCTLineBreakByWordWrapping
  221. Wrapping occurs at word boundaries, unless the word itself doesn't
  222. fit on a single line.
  223. @constant kCTLineBreakByCharWrapping
  224. Wrapping occurs before the first character that doesn't fit.
  225. @constant kCTLineBreakByClipping
  226. Lines are simply not drawn past the edge of the frame.
  227. @constant kCTLineBreakByTruncatingHead
  228. Each line is displayed so that the end fits in the frame and the
  229. missing text is indicated by some kind of ellipsis glyph.
  230. @constant kCTLineBreakByTruncatingTail
  231. Each line is displayed so that the beginning fits in the
  232. container and the missing text is indicated by some kind of
  233. ellipsis glyph.
  234. @constant kCTLineBreakByTruncatingMiddle
  235. Each line is displayed so that the beginning and end fit in the
  236. container and the missing text is indicated by some kind of
  237. ellipsis glyph in the middle.
  238. }
  239. const
  240. kCTLineBreakByWordWrapping = 0;
  241. kCTLineBreakByCharWrapping = 1;
  242. kCTLineBreakByClipping = 2;
  243. kCTLineBreakByTruncatingHead = 3;
  244. kCTLineBreakByTruncatingTail = 4;
  245. kCTLineBreakByTruncatingMiddle = 5;
  246. type
  247. CTLineBreakMode = UInt8;
  248. {!
  249. @enum CTWritingDirection
  250. @abstract These constants specify the writing direction
  251. @constant kCTWritingDirectionNatural
  252. The writing direction is algorithmically determined
  253. using the Unicode Bidirectional Algorithm rules P2 and P3.
  254. @constant kCTWritingDirectionLeftToRight
  255. The writing direction is left to right.
  256. @constant kCTWritingDirectionRightToLeft
  257. The writing direction is right to left.
  258. }
  259. const
  260. kCTWritingDirectionNatural = -1;
  261. kCTWritingDirectionLeftToRight = 0;
  262. kCTWritingDirectionRightToLeft = 1;
  263. type
  264. CTWritingDirection = SInt8;
  265. {!
  266. @enum CTParagraphStyleSpecifier
  267. @abstract These constants are used to query and modify the CTParagraphStyle
  268. object.
  269. @discussion Each specifier has a type and a default value associated with it.
  270. The type must always be observed when setting or fetching the
  271. value from the CTParagraphStyle object. In addition, some
  272. specifiers affect the behavior of both the framesetter and
  273. the typesetter, and others only affect the behavior of the
  274. framesetter; this is also noted below.
  275. @constant kCTParagraphStyleSpecifierAlignment
  276. The text alignment. Natural text alignment is realized as
  277. left or right alignment, depending on the line sweep direction
  278. of the first script contained in the paragraph.
  279. Type: CTTextAlignment
  280. Default: kCTNaturalTextAlignment
  281. Application: CTFramesetter
  282. @constant kCTParagraphStyleSpecifierFirstLineHeadIndent
  283. The distance in points from the leading margin of a frame to
  284. the beginning of the paragraph's first line. This value is always
  285. nonnegative.
  286. Type: CGFloat
  287. Default: 0.0
  288. Application: CTFramesetter
  289. @constant kCTParagraphStyleSpecifierHeadIndent
  290. The distance in points from the leading margin of a text
  291. container to the beginning of lines other than the first.
  292. This value is always nonnegative.
  293. Type: CGFloat
  294. Default: 0.0
  295. Application: CTFramesetter
  296. @constant kCTParagraphStyleSpecifierTailIndent
  297. The distance in points from the margin of a frame to the end of
  298. lines. If positive, this value is the distance from the leading
  299. margin (for example, the left margin in left-to-right text).
  300. If 0 or negative, it's the distance from the trailing margin.
  301. Type: CGFloat
  302. Default: 0.0
  303. Application: CTFramesetter
  304. @constant kCTParagraphStyleSpecifierTabStops
  305. The CTTextTab objects, sorted by location, that define the tab
  306. stops for the paragraph style.
  307. Type: CFArray of CTTextTabRef
  308. Default: 12 left-aligned tabs, spaced by 28.0 points
  309. Application: CTFramesetter, CTTypesetter
  310. @constant kCTParagraphStyleSpecifierDefaultTabInterval
  311. The document-wide default tab interval. Tabs after the last
  312. specified by kCTParagraphStyleSpecifierTabStops are placed at
  313. integer multiples of this distance (if positive).
  314. Type: CGFloat
  315. Default: 0.0
  316. Application: CTFramesetter, CTTypesetter
  317. @constant kCTParagraphStyleSpecifierLineBreakMode
  318. The mode that should be used to break lines when laying out
  319. the paragraph's text.
  320. Type: CTLineBreakMode
  321. Default: kCTLineBreakByWordWrapping
  322. Application: CTFramesetter
  323. @constant kCTParagraphStyleSpecifierLineHeightMultiple
  324. The line height multiple. The natural line height of the
  325. receiver is multiplied by this factor (if positive) before
  326. being constrained by minimum and maximum line height.
  327. Type: CGFloat
  328. Default: 0.0
  329. Application: CTFramesetter
  330. @constant kCTParagraphStyleSpecifierMaximumLineHeight
  331. The maximum height that any line in the frame will occupy,
  332. regardless of the font size or size of any attached graphic.
  333. Glyphs and graphics exceeding this height will overlap
  334. neighboring lines. A maximum height of 0 implies
  335. no line height limit. This value is always nonnegative.
  336. Type: CGFloat
  337. Default: 0.0
  338. Application: CTFramesetter
  339. @constant kCTParagraphStyleSpecifierMinimumLineHeight
  340. The minimum height that any line in the frame will occupy,
  341. regardless of the font size or size of any attached graphic.
  342. This value is always nonnegative.
  343. Type: CGFloat
  344. Default: 0.0
  345. Application: CTFramesetter
  346. @constant kCTParagraphStyleSpecifierLineSpacing
  347. Deprecated.
  348. Use kCTParagraphStyleSpecifierMaximumLineSpacing, kCTParagraphStyleSpecifierMinimumLineSpacing,
  349. and kCTParagraphStyleSpecifierLineSpacingAdjustment to control
  350. space between lines.
  351. @constant kCTParagraphStyleSpecifierParagraphSpacing
  352. The space added at the end of the paragraph to separate it from
  353. the following paragraph. This value is always nonnegative and is
  354. determined by adding the previous paragraph's
  355. kCTParagraphStyleSpecifierParagraphSpacing setting and the
  356. current paragraph's kCTParagraphStyleSpecifierParagraphSpacingBefore
  357. setting.
  358. Type: CGFloat
  359. Default: 0.0
  360. Application: CTFramesetter
  361. @constant kCTParagraphStyleSpecifierParagraphSpacingBefore
  362. The distance between the paragraph's top and the beginning of
  363. its text content.
  364. Type: CGFloat
  365. Default: 0.0
  366. Application: CTFramesetter
  367. @constant kCTParagraphStyleSpecifierBaseWritingDirection
  368. The base writing direction of the lines.
  369. Type: CTWritingDirection
  370. Default: kCTWritingDirectionNatural
  371. Application: CTFramesetter, CTTypesetter
  372. @constant kCTParagraphStyleSpecifierMaximumLineSpacing
  373. The maximum space in points between lines within the paragraph
  374. (commonly known as leading). This value is always
  375. nonnegative.
  376. Type: CGFloat
  377. Default: some large number.
  378. Application: CTFramesetter
  379. @constant kCTParagraphStyleSpecifierMinimumLineSpacing
  380. The minimum space in points between lines within the paragraph
  381. (commonly known as leading). This value is always
  382. nonnegative.
  383. Type: CGFloat
  384. Default: 0.0
  385. Application: CTFramesetter
  386. @constant kCTParagraphStyleSpecifierLineSpacingAdjustment
  387. The space in points added between lines within the paragraph
  388. (commonly known as leading).
  389. Type: CGFloat
  390. Default: 0.0
  391. Application: CTFramesetter
  392. @constant kCTParagraphStyleSpecifierLineBoundsOptions
  393. The options controlling the alignment of the line edges with
  394. the leading and trailing margins.
  395. Type: CTLineBoundsOptions
  396. Default: 0 (no options)
  397. Application: CTTypesetter
  398. }
  399. const
  400. kCTParagraphStyleSpecifierAlignment = 0;
  401. kCTParagraphStyleSpecifierFirstLineHeadIndent = 1;
  402. kCTParagraphStyleSpecifierHeadIndent = 2;
  403. kCTParagraphStyleSpecifierTailIndent = 3;
  404. kCTParagraphStyleSpecifierTabStops = 4;
  405. kCTParagraphStyleSpecifierDefaultTabInterval = 5;
  406. kCTParagraphStyleSpecifierLineBreakMode = 6;
  407. kCTParagraphStyleSpecifierLineHeightMultiple = 7;
  408. kCTParagraphStyleSpecifierMaximumLineHeight = 8;
  409. kCTParagraphStyleSpecifierMinimumLineHeight = 9;
  410. kCTParagraphStyleSpecifierLineSpacing = 10;
  411. kCTParagraphStyleSpecifierParagraphSpacing = 11;
  412. kCTParagraphStyleSpecifierParagraphSpacingBefore = 12;
  413. kCTParagraphStyleSpecifierBaseWritingDirection = 13;
  414. kCTParagraphStyleSpecifierCount = 14;
  415. kCTParagraphStyleSpecifierMinimumLineSpacing = 15;
  416. kCTParagraphStyleSpecifierLineSpacingAdjustment = 16;
  417. kCTParagraphStyleSpecifierLineBoundsOptions = 17;
  418. type
  419. CTParagraphStyleSpecifier = UInt32;
  420. {!
  421. @struct CTParagraphStyleSetting
  422. @abstract This structure is used to alter the paragraph style.
  423. @field spec
  424. The specifier of the setting.
  425. @field valueSize
  426. The size of the value pointed to by the "value" field. This
  427. must match the size of the value required by the
  428. CTParagraphStyleSpecifier set in the "spec" field.
  429. @field value
  430. A reference to the value of the setting specified by the
  431. "spec" field. The value must be in the proper range for the
  432. spec value. The value must also be at least valueSize.
  433. }
  434. type
  435. CTParagraphStyleSettingPtr = ^CTParagraphStyleSetting;
  436. CTParagraphStyleSetting = record
  437. spec: CTParagraphStyleSpecifier;
  438. {$ifc TARGET_CPU_64}
  439. __alignment_dummy: UInt32;
  440. {$endc}
  441. valueSize: size_t;
  442. value: {const} UnivPtr;
  443. end;
  444. { --------------------------------------------------------------------------- }
  445. { Paragraph Style Creation }
  446. { --------------------------------------------------------------------------- }
  447. {!
  448. @function CTParagraphStyleCreate
  449. @abstract Creates an immutable paragraph style.
  450. @discussion Using this function is the easiest and most efficient way to
  451. create a paragraph style. Paragraph styles should be kept
  452. immutable for totally lock-free operation.
  453. If an invalid paragraph style setting specifier is passed into
  454. the "settings" parameter, nothing bad will happen but just don't
  455. expect to be able to query for this value. This is to allow
  456. backwards compatibility with style setting specifiers that may
  457. be introduced in future versions.
  458. @param settings
  459. The settings that you wish to pre-load the paragraph style
  460. with. If you wish to specify the default set of settings,
  461. then this parameter may be set to NULL.
  462. @param settingCount
  463. The number of settings that you have specified in the
  464. "settings" parameter. This must be greater than or equal
  465. to zero.
  466. @result If the paragraph style creation was successful, this function
  467. will return a valid reference to an immutable CTParagraphStyle
  468. object. Otherwise, this function will return NULL.
  469. }
  470. function CTParagraphStyleCreate( settings: {const} CTParagraphStyleSettingPtr {can be null}; settingCount: size_t ): CTParagraphStyleRef; external name '_CTParagraphStyleCreate';
  471. (* CT_AVAILABLE_STARTING( __MAC_10_5, __IPHONE_3_2) *)
  472. {!
  473. @function CTParagraphStyleCreateCopy
  474. @abstract Creates an immutable copy of a paragraph style.
  475. @param paragraphStyle
  476. The style that you wish to copy. This parameter may not be
  477. set to NULL.
  478. @result If the "paragraphStyle" reference is valid, then this
  479. function will return valid reference to an immutable
  480. CTParagraphStyle object that is a copy of the one passed into
  481. "paragraphStyle".
  482. }
  483. function CTParagraphStyleCreateCopy( paragraphStyle: CTParagraphStyleRef ): CTParagraphStyleRef; external name '_CTParagraphStyleCreateCopy';
  484. (* CT_AVAILABLE_STARTING( __MAC_10_5, __IPHONE_3_2) *)
  485. { --------------------------------------------------------------------------- }
  486. { Paragraph Style Access }
  487. { --------------------------------------------------------------------------- }
  488. {!
  489. @function CTParagraphStyleGetValueForSpecifier
  490. @abstract Obtains the current value for a single setting specifier.
  491. @discussion This function will return the current value of the specifier
  492. whether or not the user had actually set it. If the user has
  493. not set it, this function will return the default value.
  494. If an invalid paragraph style setting specifier is passed into
  495. the "spec" parameter, nothing bad will happen and the buffer
  496. value will simply be zeroed out. This is to allow backwards
  497. compatibility with style setting specifier that may be introduced
  498. in future versions.
  499. @param paragraphStyle
  500. The paragraph style that you wish to get the value from. This
  501. parameter may not be set to NULL.
  502. @param spec
  503. The setting specifier that you want to get the value for.
  504. @param valueBufferSize
  505. The size of the buffer pointed to by the "valueBuffer" parameter.
  506. This value must be at least as large as the size the required by
  507. the CTParagraphSpecifier value set in the "spec" parameter.
  508. @param valueBuffer
  509. The buffer where the requested setting value will be written
  510. upon successful completion. The buffer's size needs to be at least
  511. as large as the value passed into "valueBufferSize". This parameter
  512. is required and may not be set to NULL.
  513. @result This function will return "true" if the valueBuffer had been
  514. successfully filled. Otherwise, this function will return false,
  515. indicating that one or more of the parameters is not valid.
  516. }
  517. function CTParagraphStyleGetValueForSpecifier( paragraphStyle: CTParagraphStyleRef; spec: CTParagraphStyleSpecifier; valueBufferSize: size_t; valueBuffer: UnivPtr ): CBool; external name '_CTParagraphStyleGetValueForSpecifier';
  518. (* CT_AVAILABLE_STARTING( __MAC_10_5, __IPHONE_3_2) *)
  519. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  520. end.
  521. {$endc} {not MACOSALLINCLUDE}