Adobe FDK Programmer’s Reference Frame Maker 11.0 Framemaker11 Fdkref
User Manual: adobe FrameMaker - 11.0 - FDK Programmer’s Reference Free User Guide for Adobe FrameMaker Software, Manual
Open the PDF directly: View PDF
.
Page Count: 1049
| Download | |
| Open PDF In Browser | View PDF |
FDK Programmer’s Reference
VERSION 11
Frame Developer’s Kit,
November 2012
Adobe Systems Incorporated
Corporate Headquarters
345 Park Avenue
San Jose, CA 95110-2704
(408) 536-6000
© 2012 Adobe Systems Incorporated and its licensors. All rights reserved.
Adobe® FrameMaker® 11 for Windows® Frame Developer’s Kit for Windows
This manual is protected under copyright law, furnished for informational use only, is subject to change without notice, and should not be construed as a
commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that may
appear in the informational content contained in this manual.
This manual is licensed for use under the terms of the Creative Commons Attribution Non-Commercial 3.0 License. This License allows users to copy,
distribute, and transmit the manual for noncommercial purposes only so long as (1) proper attribution to Adobe is given as the owner of the manual; and (2)
any reuse or distribution of the manual contains a notice that use of the manual is governed by these terms. The best way to provide notice is to include the
following link. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/us/
Adobe, the Adobe logo, Adobe AIR, Adobe Captivate, Adobe Type Manager, Acrobat, AIR, Creative Suite, Distiller, Flash, FrameMaker, Illustrator,
PageMaker, Photoshop, PostScript, Reader, RoboHelp, and RoboScreenCapture are trademarks of Adobe Systems Incorporated in the United States and/or
other countries.
Microsoft, Windows, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other
countries. Solaris is a trademark or registered trademark of Oracle and/or its affiliate. SVG is a trademark of the World Wide Web Consortium; marks
of the W3C are registered and held by its host institutions MIT, INRIA, and Keio.
Updated Information/Additional Third Party Code Information available at http://www.adobe.com/go/thirdparty.
Portions include software under the following terms:
This product includes software developed by the Apache Software Foundation (http://www.apache.org/).
This Program was written with MacApp®: ©1985-1988 Apple Computer, Inc. APPLE COMPUTER, INC. MAKES NO WARRANTIES WHATSOEVER,
EITHER EXPRESS OR IMPLIED, REGARDING THIS PRODUCT, INCLUDING WARRANTIES WITH RESPECT TO ITS MERCHANTABILITY OR ITS
FITNESS FOR ANY PARTICULAR PURPOSE. The MacApp software is proprietary to Apple Computer, Inc. and is licensed to Adobe for distribution only
fors use in combination with Adobe FrameMaker.
Portions copyright 1984-1998 Faircom Corporation. "FairCom" and "c-tree Plus" are trademarks of Faircom Corporation and are registered in the United States
and other countries. All Rights Reserved.
MPEG Layer-3 audio compression technology licensed by Fraunhofer IIS and THOMSON multimedia (http://www.iis.fhg.de/amm).
ImageStream Graphics Filters and ImageStream are registered trademarks of Inso Corporation.
Portions utilize code licensed from Nellymoser (www.nellymoser.com)
Adobe Flash Player 10 video compression and decompression is powered by On2 TrueMotion video technology. © 1992-2005 On2 Technologies, Inc. All Rights
Reserved. http://www.on2.com.
Certain trademarks are owned by The Proximity Division of Franklin Electronic Publishers, Inc., and are used by permission. Merriam-Webster is a
trademark of Merriam-Webster, Inc.
This product contains either BSAFE and/or TIPEM software by RSA Data Security, Inc.
Sorenson Spark™ video compression and decompression technology licensed from Sorenson Media, Inc.
Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA.
Notice to U.S. government end users. The software and documentation are “Commercial Items,” as that term is defined at 48 C.F.R. §2.101, consisting of
“Commercial Computer Software” and “Commercial Computer Software Documentation,” as such terms are used in 48 C.F.R. §12.212 or 48 C.F.R.
§227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48 C.F.R. §§227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software
and Commercial Computer Software Documentation are being licensed to U.S. Government end users (a) only as Commercial items and (b) with only those
rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright laws of the United
States. For U.S. Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the provisions of
Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of the
Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR Parts 60-1 through 60-60, 60-250, and 60-741. The affirmative action clause and
regulations contained in the preceding sentence shall be incorporated by reference.
.....
The latest version of this document is available online at
http://www.adobe.com/devnet/framemaker.html
I M P O R TA N T N O T I C E
Contents
.....
..................................
1
What’s New in FDK 11 ............................................................................................... 17
Key catalogs for key-based (indirect) referencing ........................................................ 17
New APIs for key catalog functionality...................................................................... 18
New FDK APIs to update DITA references ................................................................. 18
Support for object styles ............................................................................................... 19
Support for multiple views ........................................................................................... 19
Support for hotspots in objects ..................................................................................... 19
Interactive multimedia links for 3D objects ................................................................. 20
Support for referring to content using line numbers ..................................................... 21
Support for guided structured authoring with banner text ............................................ 21
New APIs, notifications, error codes, objects, and properties ...................................... 21
New APIs .................................................................................................................... 21
New notifications ........................................................................................................ 22
New error codes .......................................................................................................... 22
New objects................................................................................................................. 23
New properties ............................................................................................................ 23
CMS Connector Framework ......................................................................................... 26
2
Function Summary ..................................................................................................... 27
Client-defined callback functions ............................................................................... 28
Books .......................................................................................................................... 28
Characters.................................................................................................................... 30
Clipboard..................................................................................................................... 31
Commands and menus ................................................................................................ 31
Data structures: copying.............................................................................................. 33
Debugging................................................................................................................... 33
DITA references: updating.......................................................................................... 35
Dialog boxes: predefined ............................................................................................ 35
Dialog boxes: client-defined ....................................................................................... 35
Documents: comparing ............................................................................................... 37
Documents: file operations ......................................................................................... 37
Documents: formatting ............................................................................................... 38
Documents: updating .................................................................................................. 38
F-codes ........................................................................................................................ 39
Files, directories, and filepaths ................................................................................... 39
Fonts............................................................................................................................ 41
Graphic insets.............................................................................................................. 41
Hash tables .................................................................................................................. 42
Hypertext..................................................................................................................... 42
FDK Programmer’s Reference
1
Contents
I/O ............................................................................................................................... 42
Insets ........................................................................................................................... 43
Key Catalogs ............................................................................................................... 44
Memory: allocating and deallocating structures ......................................................... 44
Memory: manipulating with handles .......................................................................... 46
Memory: manipulating with pointers.......................................................................... 46
Menus.......................................................................................................................... 47
Metrics ........................................................................................................................ 48
Maker Interchange Format (MIF) ............................................................................... 48
Objects: creating and deleting..................................................................................... 50
Objects: getting IDs .................................................................................................... 52
Printing........................................................................................................................ 52
Properties .................................................................................................................... 52
Selection...................................................................................................................... 54
Sessions....................................................................................................................... 54
Sleep............................................................................................................................ 54
String lists.................................................................................................................... 54
Strings: allocating, copying, and deallocating ............................................................ 56
Strings: comparing and parsing................................................................................... 56
Strings: concatenating ................................................................................................. 58
Strings: miscellaneous................................................................................................. 58
Strings: encoded ......................................................................................................... 59
Structure: manipulating elements................................................................................ 59
Structure: manipulating element definitions and format rules.................................... 61
Tables .......................................................................................................................... 61
Text.............................................................................................................................. 63
Text: find and replace.................................................................................................. 63
Text insets ................................................................................................................... 64
Unicode ...................................................................................................................... 64
Undo/Redo .................................................................................................................. 64
Utility .......................................................................................................................... 66
3
2
FDK Programmer’s Reference
FDK Function Reference ............................................................................................ 67
F_Alloc()......................................................................................................................... 68
F_AllocHandle() ............................................................................................................. 69
F_ApiAddCols() ............................................................................................................. 70
F_ApiAddCommandToMenu() ...................................................................................... 72
F_ApiAddMenuToMenu().............................................................................................. 74
F_ApiAddRows()............................................................................................................ 78
F_ApiAddText() ............................................................................................................. 80
F_ApiAlert() ................................................................................................................... 82
F_ApiAlive()................................................................................................................... 85
F_ApiAllocatePropVals() ............................................................................................... 85
F_ApiAllocateTextItems().............................................................................................. 86
F_ApiApplyAttributeExpression() ................................................................................. 88
F_ApiApplyAttributeExpressionAsCondition()............................................................. 89
F_ApiApplyPageLayout() .............................................................................................. 90
F_ApiBailOut()............................................................................................................... 92
...
Contents
F_ApiCallClient() ........................................................................................................... 93
F_ApiCenterOnText()..................................................................................................... 94
F_ApiCheckStatus()........................................................................................................ 96
F_ApiChooseFile() ......................................................................................................... 97
F_ApiClear()................................................................................................................. 100
F_ApiClearAllChangebars()......................................................................................... 102
F_ApiClientDir() .......................................................................................................... 103
F_ApiClientName() ...................................................................................................... 104
F_ApiClientPath()......................................................................................................... 106
F_ApiClose() ................................................................................................................ 107
F_ApiCombinedFamilyFonts()..................................................................................... 109
F_ApiCommand()......................................................................................................... 111
F_ApiCompare()........................................................................................................... 112
F_ApiConnectToSession()............................................................................................ 115
F_ApiCopy()................................................................................................................. 115
F_ApiCopyStructureType() .......................................................................................... 118
F_ApiCustomDoc() ...................................................................................................... 119
F_ApiCut().................................................................................................................... 123
F_ApiDeallocateStructureType().................................................................................. 125
F_ApiDefineAndAddCommand() ................................................................................ 126
F_ApiDefineAndAddCommandEx()............................................................................ 129
F_ApiDefineAndAddMenu()........................................................................................ 134
F_ApiDefineCommand() .............................................................................................. 137
F_ApiDefineCommandEx().......................................................................................... 139
F_ApiDefineMenu() ..................................................................................................... 141
F_ApiDelete() ............................................................................................................... 143
F_ApiDeleteAllKeyDefinitions() ................................................................................. 144
F_ApiDeleteCols()........................................................................................................ 145
F_ApiDeletePropByName() ......................................................................................... 147
F_ApiDeleteRows() ...................................................................................................... 148
F_ApiDeleteText()........................................................................................................ 151
F_ApiDeleteTextInsetContents().................................................................................. 152
F_ApiDialogEvent() ..................................................................................................... 155
F_ApiDialogItemId() .................................................................................................... 158
F_ApiDisconnectFromSession()................................................................................... 159
F_ApiEnableUnicode()................................................................................................. 162
F_ApiErr() .................................................................................................................... 164
F_ApiFamilyFonts() ..................................................................................................... 165
F_ApiFcodes() .............................................................................................................. 167
F_ApiFind() .................................................................................................................. 168
F_ApiGetAllKeyDefinitions() ...................................................................................... 175
F_ApiGetAllKeys() ...................................................................................................... 185
F_ApiGetEncodingForFamily().................................................................................... 187
F_ApiGetEncodingForFont()........................................................................................ 189
F_ApiGetId() ................................................................................................................ 191
F_ApiGetImportDefaultParams() ................................................................................. 193
F_ApiGetInt() ............................................................................................................... 201
F_ApiGetIntByName() ................................................................................................. 203
FDK Programmer’s Reference
3
Contents
F_ApiGetInts().............................................................................................................. 204
F_ApiGetKeyCatalog()................................................................................................. 206
F_ApiGetKeyDefinition()............................................................................................. 207
F_ApiGetMetric() ......................................................................................................... 209
F_ApiGetMetricByName()........................................................................................... 210
F_ApiGetMetrics()........................................................................................................ 212
F_ApiGetNamedObject().............................................................................................. 214
F_ApiGetNewXMLDefaultParams()............................................................................ 215
F_ApiGetObjectType()................................................................................................. 218
F_ApiGetOpenDefaultParams() ................................................................................... 219
F_ApiGetPoints().......................................................................................................... 228
F_ApiGetPropIndex() ................................................................................................... 230
F_ApiGetProps()........................................................................................................... 231
F_ApiGetPropVal() ...................................................................................................... 232
F_ApiGetSaveDefaultParams() .................................................................................... 234
F_ApiGetString() .......................................................................................................... 241
F_ApiGetStrings() ........................................................................................................ 242
F_ApiGetSupportedEncodings() .................................................................................. 244
F_ApiGetTabs() ............................................................................................................ 245
F_ApiGetText() ............................................................................................................ 249
F_ApiGetText2() .......................................................................................................... 256
F_ApiGetTextForRange()............................................................................................. 260
F_ApiGetTextForRange2()........................................................................................... 261
F_ApiGetTextLoc() ...................................................................................................... 264
F_ApiGetTextProps() ................................................................................................... 265
F_ApiGetTextPropVal() ............................................................................................... 267
F_ApiGetTextRange() .................................................................................................. 269
F_ApiGetTextVal()....................................................................................................... 271
F_ApiGetUBytesByName().......................................................................................... 273
F_ApiGetUniqueObject() ............................................................................................. 275
F_ApiGetUpdateBookDefaultParams()........................................................................ 278
F_ApiGetVal() .............................................................................................................. 282
F_ApiHypertextCommand()......................................................................................... 285
F_ApiImport()............................................................................................................... 286
F_ApiInitialize() ........................................................................................................... 293
F_ApiIsEncodingSupported()....................................................................................... 295
F_ApiLoadMenuCustomizationFile() .......................................................................... 296
F_ApiMakeTblSelection() ............................................................................................ 297
F_ApiMenuItemInMenu() ............................................................................................ 298
F_ApiMessage()............................................................................................................ 303
F_ApiModalDialog() .................................................................................................... 303
F_ApiModelessDialog() ............................................................................................... 305
F_ApiMoveComponent().............................................................................................. 306
F_ApiNetLibSetAuthFunction()................................................................................... 307
F_ApiNewAnchoredFormattedObject() ....................................................................... 310
F_ApiNewAnchoredObject()........................................................................................ 312
F_ApiNewBookComponentOfTypeInHierarchy()....................................................... 316
F_ApiNewGraphicObject() .......................................................................................... 322
4
FDK Programmer’s Reference
...
Contents
F_ApiNewKeyCatalog()............................................................................................... 324
F_ApiNewKeyDefinition()........................................................................................... 325
F_ApiNewNamedObject()............................................................................................ 327
F_ApiNewSeriesObject().............................................................................................. 329
F_ApiNewTable()......................................................................................................... 336
F_ApiNewXML() ......................................................................................................... 338
F_ApiNotification() ...................................................................................................... 339
F_ApiNotify() ............................................................................................................... 349
F_ApiObjectValid() ...................................................................................................... 354
F_ApiOpen()................................................................................................................. 355
F_ApiOpenResource() .................................................................................................. 363
F_ApiPaste() ................................................................................................................. 364
F_ApiPopClipboard() ................................................................................................... 366
F_ApiPrintFAErrno().................................................................................................... 367
F_ApiPrintImportStatus() ............................................................................................. 369
F_ApiPrintOpenStatus() ............................................................................................... 370
F_ApiPrintPropVal() .................................................................................................... 370
F_ApiPrintPropVals()................................................................................................... 371
F_ApiPrintSaveStatus() ................................................................................................ 372
F_ApiPrintTextItem() ................................................................................................... 373
F_ApiPrintTextItems().................................................................................................. 374
F_ApiPrintUpdateBookStatus().................................................................................... 375
F_ApiProgressBarEx().................................................................................................. 376
F_ApiPromptInt() ......................................................................................................... 379
F_ApiPromptMetric() ................................................................................................... 381
F_ApiPromptString() .................................................................................................... 382
F_ApiPushClipboard().................................................................................................. 384
F_ApiQuickSelect() ...................................................................................................... 385
F_ApiRedisplay().......................................................................................................... 386
F_ApiReformat() .......................................................................................................... 388
F_ApiRehyphenate()..................................................................................................... 389
F_ApiResetEqnSettings() ............................................................................................. 390
F_ApiResetReferenceFrames()..................................................................................... 391
F_ApiRestartPgfNumbering() ...................................................................................... 392
F_ApiReturnValue() ..................................................................................................... 393
F_ApiSave().................................................................................................................. 399
F_ApiScrollBox() ......................................................................................................... 402
F_ApiScrollToText() .................................................................................................... 404
F_ApiService().............................................................................................................. 405
F_ApiSetAttributeSimple()........................................................................................... 411
F_ApiSetClientDir() ..................................................................................................... 412
F_ApiSetId() ................................................................................................................. 414
F_ApiSetInt() ................................................................................................................ 417
F_ApiSetIntByName().................................................................................................. 419
F_ApiSetInts() .............................................................................................................. 421
F_ApiSetMetric().......................................................................................................... 423
F_ApiSetMetricByName()............................................................................................ 425
F_ApiSetMetrics() ........................................................................................................ 426
FDK Programmer’s Reference
5
Contents
F_ApiSetPoints() .......................................................................................................... 429
F_ApiSetProps() ........................................................................................................... 432
F_ApiSetPropVal() ....................................................................................................... 434
F_ApiSetString()........................................................................................................... 436
F_ApiSetStrings() ......................................................................................................... 438
F_ApiSetTabs()............................................................................................................. 441
F_ApiSetTextLoc()....................................................................................................... 444
F_ApiSetTextProps() .................................................................................................... 445
F_ApiSetTextPropVal()................................................................................................ 447
F_ApiSetTextRange()................................................................................................... 450
F_ApiSetTextVal() ....................................................................................................... 452
F_ApiSetUBytesByName() .......................................................................................... 454
F_ApiShutDown() ........................................................................................................ 455
F_ApiSilentPrintDoc().................................................................................................. 456
F_ApiSimpleGenerate()................................................................................................ 459
F_ApiSimpleImportFormats() ...................................................................................... 462
F_ApiSimpleNewDoc() ................................................................................................ 464
F_ApiSimpleOpen()...................................................................................................... 465
F_ApiSimpleSave() ...................................................................................................... 466
F_ApiSleep()................................................................................................................. 468
F_ApiStraddleCells() .................................................................................................... 470
F_ApiStringLen().......................................................................................................... 471
F_ApiUndoCancel()...................................................................................................... 474
F_ApiUndoEndCheckPoint()........................................................................................ 475
F_ApiUndoStartCheckPoint() ...................................................................................... 476
.F_ApiUnStraddleCells() .............................................................................................. 477
F_ApiUpdateBook() ..................................................................................................... 480
F_ApiUpdateDITAReference() .................................................................................... 483
F_ApiUpdateDITAReferences()................................................................................... 485
F_ApiUpdateKeyDefinition()....................................................................................... 487
F_ApiUpdateTextInset()............................................................................................... 488
F_ApiUpdateVariables()............................................................................................... 489
F_ApiUpdateXRef() ..................................................................................................... 490
F_ApiUpdateXRefs().................................................................................................... 492
F_ApiUserCancel()....................................................................................................... 494
F_ApiUSleep().............................................................................................................. 494
F_ApiWinConnectSession() ......................................................................................... 495
F_ApiWinInstallDefaultMessageFilter() ...................................................................... 496
F_Assert() ..................................................................................................................... 498
F_Calloc() ..................................................................................................................... 499
F_ChannelAppend()...................................................................................................... 500
F_ChannelClose() ......................................................................................................... 501
F_ChannelCloseTmp().................................................................................................. 502
F_ChannelEof() ............................................................................................................ 502
F_ChannelFlush() ......................................................................................................... 503
F_ChannelMakeTmp().................................................................................................. 503
F_ChannelOpen().......................................................................................................... 504
F_ChannelPeek() .......................................................................................................... 506
6
FDK Programmer’s Reference
...
Contents
F_ChannelRead() .......................................................................................................... 506
F_ChannelSeek() .......................................................................................................... 508
F_ChannelSize() ........................................................................................................... 509
F_ChannelTell()............................................................................................................ 510
F_ChannelWrite() ......................................................................................................... 511
F_CharIsAlphabetic() ................................................................................................... 512
F_CharIsAlphaUTF8().................................................................................................. 513
F_CharIsAlphaNumeric() ............................................................................................. 514
F_CharIsAlphaNumericUTF8().................................................................................... 515
F_CharIsControl()......................................................................................................... 515
F_CharIsControlUTF8() ............................................................................................... 516
F_CharIsDoubleByte().................................................................................................. 517
F_CharIsDoubleByteFirst() .......................................................................................... 518
F_CharIsDoubleByteSecond()...................................................................................... 520
F_CharIsEol() ............................................................................................................... 521
F_CharIsEolUTF8()...................................................................................................... 522
F_CharIsHexadecimal()................................................................................................ 523
F_CharIsHexadecimalUTF8() ...................................................................................... 524
F_CharIsLower() .......................................................................................................... 525
F_CharIsLowerUTF8()................................................................................................. 525
F_CharIsNumeric()....................................................................................................... 526
F_CharIsNumericUTF8() ............................................................................................. 527
F_CharIsUpper()........................................................................................................... 528
F_CharIsUpperUTF8() ................................................................................................. 528
F_CharToLower()......................................................................................................... 529
F_CharToLowerUTF8() ............................................................................................... 530
F_CharToUpper() ......................................................................................................... 531
F_CharToUpperUTF8()................................................................................................ 532
F_CharUTF16ToUTF8() .............................................................................................. 533
F_CharUTF32ToUTF8() .............................................................................................. 534
F_CharUTF8ToUTF16() .............................................................................................. 535
F_CharUTF8ToUTF32() .............................................................................................. 536
F_ClearHandle() ........................................................................................................... 537
F_ClearPtr() .................................................................................................................. 537
F_CopyPtr() .................................................................................................................. 538
F_DeleteFile()............................................................................................................... 539
F_DigitValue().............................................................................................................. 540
F_DuplicateHandle() .................................................................................................... 541
F_DuplicatePtr() ........................................................................................................... 542
F_Exit()......................................................................................................................... 543
F_FdeEncodingsInitialized() ........................................................................................ 544
F_FdeInit() .................................................................................................................... 544
F_FdeInitFontEncs()..................................................................................................... 545
F_FilePathBaseName()................................................................................................. 547
F_FilePathCloseDir().................................................................................................... 548
F_FilePathCopy().......................................................................................................... 548
F_FilePathFree() ........................................................................................................... 549
F_FilePathGetNext()..................................................................................................... 550
FDK Programmer’s Reference
7
Contents
F_FilePathOpenDir() .................................................................................................... 551
F_FilePathParent() ........................................................................................................ 552
F_FilePathProperty() .................................................................................................... 553
F_FilePathToPathName() ............................................................................................. 554
F_FontEncId()............................................................................................................... 556
F_FontEncName() ........................................................................................................ 557
F_FontEncToTextEnc() ................................................................................................ 558
F_Free() ........................................................................................................................ 559
F_FreeHandle()............................................................................................................. 560
F_GetFilePath() ............................................................................................................ 561
F_GetICUDataDir() ...................................................................................................... 561
F_GetHandleSize() ....................................................................................................... 562
F_HandleEqual()........................................................................................................... 563
F_HashCreate()............................................................................................................. 564
F_HashDestroy()........................................................................................................... 568
F_HashEnumerate() ...................................................................................................... 568
F_HashGet().................................................................................................................. 570
F_HashRemove() .......................................................................................................... 570
F_HashReportOnData() ................................................................................................ 571
F_HashSet() .................................................................................................................. 573
F_IsValidUTF8() .......................................................................................................... 573
F_LanguageNumber()................................................................................................... 574
F_LanguageString() ...................................................................................................... 576
F_LockHandle()............................................................................................................ 577
F_MakeDir() ................................................................................................................. 579
F_MetricApproxEqual() ............................................................................................... 579
F_MetricConstrainAngle()............................................................................................ 580
F_MetricDiv()............................................................................................................... 582
F_MetricFloat()............................................................................................................. 582
F_MetricFractMul() ...................................................................................................... 583
F_MetricMake()............................................................................................................ 584
F_MetricMul() .............................................................................................................. 585
F_MetricNormalizeAngle() .......................................................................................... 585
F_MetricSqrt() .............................................................................................................. 587
F_MetricSquare().......................................................................................................... 587
F_MetricToFloat() ........................................................................................................ 588
F_MifBegin() ................................................................................................................ 589
F_MifComment().......................................................................................................... 589
F_MifDecimal() ............................................................................................................ 590
F_MifEnd() ................................................................................................................... 591
F_MifGetIndent().......................................................................................................... 593
F_MifIndent() ............................................................................................................... 593
F_MifIndentDec()......................................................................................................... 594
F_MifIndentInc() .......................................................................................................... 595
F_MifInteger() .............................................................................................................. 595
F_MifNewLine()........................................................................................................... 596
F_MifSetIndent() .......................................................................................................... 597
F_MifSetOutputChannel() ............................................................................................ 598
8
FDK Programmer’s Reference
...
Contents
F_MifSpace() ................................................................................................................ 599
F_MifTab() ................................................................................................................... 599
F_MifText() .................................................................................................................. 600
F_MifTextString() ........................................................................................................ 601
Simple MIF library ....................................................................................................... 601
F_PathNameToFilePath() ............................................................................................. 606
F_PathNameType()....................................................................................................... 608
F_Printf() ...................................................................................................................... 608
F_Progress().................................................................................................................. 610
F_PtrEqual().................................................................................................................. 611
F_ReadBytes() .............................................................................................................. 613
F_ReadLongs() ............................................................................................................. 614
F_ReadShorts() ............................................................................................................. 615
F_Realloc() ................................................................................................................... 616
F_ReallocHandle()........................................................................................................ 618
F_RenameFile() ............................................................................................................ 620
F_ResetByteOrder()...................................................................................................... 620
F_ResetDirHandle()...................................................................................................... 622
F_Scanf() ...................................................................................................................... 623
F_SetAssert() ................................................................................................................ 624
F_SetByteOrder().......................................................................................................... 625
F_SetDSExit()............................................................................................................... 625
F_SetICUDataDir()....................................................................................................... 626
F_Sprintf() .................................................................................................................... 628
F_Sscanf()..................................................................................................................... 630
F_StrAlphaToInt() ........................................................................................................ 631
F_StrAlphaToIntUnicode()........................................................................................... 631
F_StrAlphaToReal() ..................................................................................................... 633
F_StrAlphaToRealUnicode()........................................................................................ 633
F_StrBrk()..................................................................................................................... 635
F_StrBrkUTF8 () .......................................................................................................... 635
F_StrCat() ..................................................................................................................... 637
F_StrCatCharN()........................................................................................................... 638
F_StrCatDblCharNEnc() .............................................................................................. 639
F_StrCatIntN() .............................................................................................................. 640
F_StrCatN() .................................................................................................................. 642
F_StrCatNEnc() ............................................................................................................ 643
F_StrCatUTF8CharNByte ()......................................................................................... 644
F_StrChr()..................................................................................................................... 645
F_StrChrEnc()............................................................................................................... 646
F_StrChrUTF8() ........................................................................................................... 648
F_StrCmp() ................................................................................................................... 649
F_StrCmpN() ................................................................................................................ 650
F_StrCmpNEnc() .......................................................................................................... 650
F_StrICmpNUTF8Char ................................................................................................ 651
F_StrCmpUTF8().......................................................................................................... 652
F_StrCmpUTF8Locale()............................................................................................... 654
F_StrICmpUTF8Locale() ............................................................................................. 655
FDK Programmer’s Reference
9
Contents
F_StrConvertEnc(), F_StrConvertEnc_IgnoreControlChars(), F_StrConvertEnc_ConvertControlChars() .............................................................................................................. 655
F_StrCopyString() ........................................................................................................ 658
F_StrCpy() .................................................................................................................... 659
F_StrCpyN() ................................................................................................................. 660
F_StrCpyNEnc() ........................................................................................................... 661
F_StrCpyNUTF8Char () ............................................................................................... 662
F_StrEqual().................................................................................................................. 663
F_StrEqualN()............................................................................................................... 664
F_StrICmp().................................................................................................................. 664
F_StrICmpEnc()............................................................................................................ 665
F_StrICmpN()............................................................................................................... 666
F_StrICmpNEnc()......................................................................................................... 667
F_StrIEqual() ................................................................................................................ 668
F_StrIEqualEnc() .......................................................................................................... 669
F_StrIEqualN() ............................................................................................................. 670
F_StrIEqualNEnc() ....................................................................................................... 671
F_StrIEqualNUTF8Char () ........................................................................................... 672
F_StrIPrefixEnc().......................................................................................................... 673
F_StrIsEmpty() ............................................................................................................. 674
F_StrISuffixEnc() ......................................................................................................... 675
F_StrLen()..................................................................................................................... 676
F_StrLenEnc() .............................................................................................................. 676
F_StrLenUTF16() ......................................................................................................... 677
F_StrListAppend() ........................................................................................................ 678
F_StrListCat() ............................................................................................................... 679
F_StrListCopy() ............................................................................................................ 679
F_StrListCopyList()...................................................................................................... 681
F_StrListFirst() ............................................................................................................. 682
F_StrListFree().............................................................................................................. 683
F_StrListGet()............................................................................................................... 684
F_StrListIIndex() .......................................................................................................... 684
F_StrListIndex()............................................................................................................ 686
F_StrListInsert()............................................................................................................ 687
F_StrListLast().............................................................................................................. 687
F_StrListLen() .............................................................................................................. 688
F_StrListNew() ............................................................................................................. 689
F_StrListRemove() ....................................................................................................... 690
F_StrListSetString()...................................................................................................... 690
F_StrListSort() .............................................................................................................. 691
F_StrNew() ................................................................................................................... 693
F_StrPrefix() ................................................................................................................. 694
F_StrPrefixN() .............................................................................................................. 695
F_StrRChr() .................................................................................................................. 695
F_StrRChrEnc() ............................................................................................................ 696
F_StrReverse() .............................................................................................................. 698
F_StrReverseUTF8Char ()............................................................................................ 698
F_StrStrip() ................................................................................................................... 701
10
FDK Programmer’s Reference
...
Contents
F_StrStripLeadingSpaces()........................................................................................... 701
F_StrStripTrailingSpaces() ........................................................................................... 702
F_StrStripUTF8Chars () ............................................................................................... 703
F_StrStripUTF8String ()............................................................................................... 704
F_StrStripUTF8Strings () ............................................................................................. 705
F_StrSubString()........................................................................................................... 706
F_StrSuffix()................................................................................................................. 707
F_StrTok() .................................................................................................................... 708
F_StrTokUTF8 ().......................................................................................................... 709
F_StrTrunc() ................................................................................................................. 710
F_StrTruncEnc() ........................................................................................................... 711
F_TextEncToFontEnc() ................................................................................................ 712
F_UnlockHandle() ........................................................................................................ 714
F_UTF16CharSize() ..................................................................................................... 714
F_UTF16NextChar() .................................................................................................... 715
F_UTF8CharSize() ....................................................................................................... 716
F_UTF8NextChar() ...................................................................................................... 717
F_Warning().................................................................................................................. 719
F_WriteBytes() ............................................................................................................. 719
F_WriteLongs() ............................................................................................................ 720
F_WriteShorts() ............................................................................................................ 721
4
Object Reference ....................................................................................................... 723
Books .......................................................................................................................... 723
FO_Book................................................................................................................... 723
FO_BookComponent ................................................................................................ 739
Character formats ........................................................................................................ 750
FO_CharFmt ............................................................................................................. 750
Colors .......................................................................................................................... 755
FO_Color .................................................................................................................. 755
Columns ...................................................................................................................... 757
Combined font definitions .......................................................................................... 758
FO_CombinedFontDefn............................................................................................ 759
Commands, menus, menu items, and menu item separators ...................................... 760
Common command, menu, and menu item separator properties.............................. 760
FO_Command........................................................................................................... 761
FO_MenuItemSeparator............................................................................................ 766
FO_Menu .................................................................................................................. 766
Conditions ................................................................................................................... 767
FO_AttrCondExpr..................................................................................................... 767
FO_CondFmt ............................................................................................................ 767
Cross-references .......................................................................................................... 769
FO_XRef................................................................................................................... 769
FO_XRefFmt ............................................................................................................ 770
Dialog boxes ............................................................................................................... 770
FO_DialogResource.................................................................................................. 771
FO_DlgBox............................................................................................................... 774
FO_DlgButton........................................................................................................... 775
FDK Programmer’s Reference 11
Contents
FO_DlgCheckBox..................................................................................................... 775
FO_DlgEditBox ........................................................................................................ 776
FO_DlgImage............................................................................................................ 776
FO_DlgLabel ............................................................................................................ 776
FO_DlgPopUp .......................................................................................................... 777
FO_DlgRadioButton ................................................................................................. 777
FO_DlgScrollBar ...................................................................................................... 778
FO_DlgScrollBox ..................................................................................................... 779
FO_DlgTriBox .......................................................................................................... 780
Documents .................................................................................................................. 780
FO_Doc..................................................................................................................... 780
Elements ...................................................................................................................... 829
Flows ........................................................................................................................... 829
FO_Flow ................................................................................................................... 829
Footnotes ..................................................................................................................... 830
FO_Fn ....................................................................................................................... 830
Format change lists ..................................................................................................... 831
FO_FmtChangeList................................................................................................... 831
Format rules ................................................................................................................ 841
FO_FmtRule.............................................................................................................. 841
FO_FmtRuleClause................................................................................................... 842
Frames ......................................................................................................................... 844
Graphics ...................................................................................................................... 844
FO_AFrame .............................................................................................................. 849
FO_Arc...................................................................................................................... 851
FO_Ellipse ................................................................................................................ 852
FO_Group ................................................................................................................. 852
FO_Inset.................................................................................................................... 852
FO_Iterator................................................................................................................ 858
FO_KeyCatalog ........................................................................................................ 859
FO_Line .................................................................................................................... 860
FO_Math ................................................................................................................... 860
FO_Polygon .............................................................................................................. 861
FO_Polyline .............................................................................................................. 861
FO_Rectangle............................................................................................................ 862
FO_RoundRect.......................................................................................................... 862
FO_TextFrame .......................................................................................................... 863
FO_TextLine ............................................................................................................. 865
FO_UnanchoredFrame.............................................................................................. 867
FO_Graphicsfmt........................................................................................................ 868
Insets ........................................................................................................................... 872
Markers ....................................................................................................................... 872
FO_Marker................................................................................................................ 872
Marker types ............................................................................................................... 873
FO_MarkerType........................................................................................................ 873
Menus .......................................................................................................................... 873
Menu items ................................................................................................................. 874
Pages ........................................................................................................................... 874
12
FDK Programmer’s Reference
...
Contents
FO_BodyPage ........................................................................................................... 874
FO_HiddenPage ........................................................................................................ 875
FO_MasterPage......................................................................................................... 875
FO_RefPage .............................................................................................................. 876
Paragraphs ................................................................................................................... 877
FO_Pgf ...................................................................................................................... 877
FO_PgfFmt................................................................................................................ 887
Rubi composites .......................................................................................................... 898
FO_Rubi.................................................................................................................... 898
Table ruling formats .................................................................................................... 899
FO_RulingFmt .......................................................................................................... 899
Separators .................................................................................................................... 899
Session ........................................................................................................................ 899
FO_Session ............................................................................................................... 900
Structural elements ..................................................................................................... 909
FO_Element .............................................................................................................. 909
FO_ElementDef ........................................................................................................ 917
Tables .......................................................................................................................... 920
FO_Cell..................................................................................................................... 921
FO_Row .................................................................................................................... 924
FO_Tbl ...................................................................................................................... 926
Table formats .............................................................................................................. 933
FO_TblFmt................................................................................................................ 933
Text columns ............................................................................................................... 937
Text frames ................................................................................................................. 937
Text insets ................................................................................................................... 937
Common text inset properties ................................................................................... 938
FO_TiApiClient properties ....................................................................................... 942
FO_TiFlow properties ............................................................................................... 942
FO_TiText properties ................................................................................................ 943
FO_TiTextTable properties ....................................................................................... 944
Text properties ............................................................................................................ 944
Variables ...................................................................................................................... 949
FO_Var ...................................................................................................................... 949
FO_VarFmt................................................................................................................ 949
5
Data Types and Structures Reference ..................................................................... 953
Data types ................................................................................................................... 953
MetricT values .......................................................................................................... 954
Data structures ............................................................................................................ 955
ChannelT................................................................................................................... 955
DirHandleT ............................................................................................................... 956
FilePathT................................................................................................................... 956
HandleT..................................................................................................................... 956
HashT ........................................................................................................................ 956
StringListT ................................................................................................................ 956
F_AttributeDefsT ...................................................................................................... 956
F_AttributeDefT........................................................................................................ 957
FDK Programmer’s Reference
13
Contents
F_AttributesT ............................................................................................................ 958
F_AttributeT.............................................................................................................. 958
F_CombinedFontsT .................................................................................................. 958
F_CombinedFontT .................................................................................................... 959
F_CompareRetT........................................................................................................ 959
F_ElementLocT ........................................................................................................ 959
F_ElementRangeT .................................................................................................... 960
F_FontEncT .............................................................................................................. 960
F_FontsT ................................................................................................................... 960
F_FontT..................................................................................................................... 961
F_ElementCatalogEntryT ......................................................................................... 961
F_ElementCatalogEntriesT....................................................................................... 962
F_IntsT ...................................................................................................................... 962
F_MetricsT................................................................................................................ 962
F_PointT.................................................................................................................... 962
F_PointsT .................................................................................................................. 962
F_PropIdentT ............................................................................................................ 963
F_PropValT ............................................................................................................... 963
F_PropValsT.............................................................................................................. 963
F_StringsT................................................................................................................. 963
F_TabT ...................................................................................................................... 964
F_TabsT .................................................................................................................... 964
F_TextItemT.............................................................................................................. 964
F_TextItemsT ............................................................................................................ 968
F_TextLocT............................................................................................................... 968
F_TextRangeT........................................................................................................... 968
F_TypedValT............................................................................................................. 969
F_UBytesT ................................................................................................................ 970
F_UIntsT ................................................................................................................... 970
14
6
Error Codes .............................................................................................................. 971
7
Calling Clients Shipped with FrameMaker ............................................................ 977
Calls to work with structured documents ................................................................... 977
Calls to Sort Tables ..................................................................................................... 984
Calls for WebDAV workgroup management .............................................................. 986
Call to work with book error logs ............................................................................... 990
8
CMS Connector FrameWork .................................................................................. 993
CMS API Data Structures and Enum Constants ......................................................... 993
F_CMSResultT ......................................................................................................... 993
F_CMSOpResultT .................................................................................................... 993
F_CMSPropertyT...................................................................................................... 994
F_CMSItemPropertyT .............................................................................................. 994
F_CMSItemTypeValueT ........................................................................................... 995
F_CMSItemFileTypeValueT ..................................................................................... 996
F_CMSPropertiesT ................................................................................................... 996
FDK Programmer’s Reference
...
Contents
F_CMSMenuItemT................................................................................................... 997
F_CMSMenuTypeT .................................................................................................. 997
F_CMSVersioningStrategyT ..................................................................................... 998
F_CMSDeleteParamT............................................................................................... 998
F_CMSInfoT............................................................................................................. 999
F_CMSInfosT ........................................................................................................... 999
Error Codes ............................................................................................................... 1000
CMS API Functions .................................................................................................. 1001
F_ApiAllocateCMSInfos ............................................................................................ 1001
F_ ApiDeallocateCMSInfos ....................................................................................... 1002
F_ ApiAllocateCMSProperties ................................................................................... 1002
F_ApiDeallocateCMSProperties ................................................................................ 1003
F_ApiCMSCommand ................................................................................................. 1004
F_CMSCommandsT ............................................................................................... 1005
F_CMSCommandArgsIdT...................................................................................... 1007
F_ApiCMSRegister .................................................................................................... 1010
F_ApiCMSCreateObject............................................................................................. 1011
F_ApiCMSEnableCommand ...................................................................................... 1012
F_ApiCMSDisableCommand..................................................................................... 1013
F_ApiCMSAddMenuEntry......................................................................................... 1014
F_ApiCMSGetProperties............................................................................................ 1015
F_ApiCMSGetProperty .............................................................................................. 1016
F_ApiCMSSetProperties ............................................................................................ 1017
F_ApiCMSSetProperty............................................................................................... 1019
F_ApiCMSConfigLoginUI......................................................................................... 1021
F_ApiCMSShowCheckoutUI ..................................................................................... 1022
F_CMSCustomizeCheckoutUI ............................................................................... 1022
F_ApiCMSShowCheckinUI ....................................................................................... 1023
F_ApiCMSShowCancelCheckoutUI .......................................................................... 1024
F_ApiCMSShowDeleteUI .......................................................................................... 1025
F_ApiCMSShowCommonListUI ............................................................................... 1026
F_ApiCMSShowPropertyUI....................................................................................... 1028
F_ApiCMSShowBrowseRepositoryUI....................................................................... 1029
F_ApiCMSGetCmsIdFromName ............................................................................... 1030
F_ApiCMSGetCMSInfo............................................................................................. 1031
F_ApiCMSGetCmsIdFromSession ............................................................................ 1032
F_ApiCMSGetCmsInfoList........................................................................................ 1032
9
APIs to automate the CMS connectors functionality .......................................... 1035
F_ApiCMSLogin ........................................................................................................ 1035
F_ApiCMSLogout ...................................................................................................... 1036
F_ApiCMSCheckout .................................................................................................. 1037
F_ApiCMSCheckin .................................................................................................... 1038
F_ApiCMSCancelCheckout ....................................................................................... 1039
F_ApiCMSDelete ....................................................................................................... 1040
F_ApiCMSOpenFile................................................................................................... 1041
F_ApiCMSUploadObject ........................................................................................... 1042
F_ApiCMSDownloadObject ...................................................................................... 1043
FDK Programmer’s Reference
15
Contents
F_ApiGetCMSObjectFromPath.................................................................................. 1044
16
FDK Programmer’s Reference
1
What’s New in FDK 11
..................................
.....
1
This chapter provides an overview of the new features in FDK 11.
Key catalogs for key-based (indirect) referencing
FDK 11 supports key catalogs for indirect referencing. You can define a key for a file
or resource in your project; updating the key will update the references to the file or
resource everywhere.
A key catalog is a collection of all the keys in your project—you can manage all the
keys from the key catalog. A key catalog is represented by the FO_KeyCatalog object.
The key mapping consists of:
Key name
Referenced file
Type of the source file containing the key definition
Source file containing the key definition
Information for using the key as a text variable
The key catalog consists of:
A unique key catalog tag
A hash-based list of key mappings
Count of key mappings (including duplicate ones)
Type of the source file containing the key catalog (KEYDEFSRC_NONE,
KEYDEFSRC_DITAMAP)
Source of key catalog. (DITA Map or other document holding the key catalog)
Name of the client owning the key catalog.
Appropriate Flags
FDK Programmer’s Reference
17
1
W h a t ’ s N e w i n F D K 11
New FDK APIs to update DITA references
New APIs for key catalog functionality
The following new APIs support the key catalog functionality
F_ApiNewKeyCatalog()
Creates a new key catalog with the specified tag.
F_ApiGetKeyCatalog()
Finds a key catalog with the specified tag.
F_ApiNewKeyDefinition()
Adds a new key definition to the specified key catalog.
F_ApiUpdateKeyDefinition()
Updates the specified key definition field for the specified key in the specified key
catalog.
F_ApiGetKeyDefinition()
Gets the specified key definition field for the specified key from the specified key
catalog.
F_ApiGetAllKeyDefinitions()
Gets all the key definitions from the specified key catalog.
F_ApiDeleteAllKeyDefinitions()
Deletes all the key definitions in the specified key catalog.
F_ApiGetAllKeys()
Gets all the key tags from the specified key catalog.
New FDK APIs to update DITA references
The following new APIs have been provided to update DITA references:
F_ApiUpdateDITAReference()
Updates the DITA object represented by the specified element.
F_ApiUpdateDITAReferences()
Updates all DITA references of the specified type. For example, you can use this API
to update all conrefs, all xrefs, or all conrefs as well as xrefs.
18
FDK Programmer’s Reference
Support for object styles
...
W h a t ’ s N e w i n F D K 11
Support for object styles
Object styles work similar to Paragraph and Character formats but work on objects.
Users can save frequently used object properties as a style and can apply these object
styles to various objects, such as images, anchored frames, and text frames for
consistent size and appearance.
Object styles are controlled through the new FO_GraphicsFmt object.
Support for multiple views
To support the FrameMaker 11 feature of multiple views, FDK 11 provides a new
session property FP_ActiveView, which can be set to one of the following:
WYSIWYG View
Author View
XML View
Support for hotspots in objects
FDK 11 supports hotspots through the following properties:
FP_ViewHotspotIndicators
A document-level property that turns on hotspot indicators. A hotspot indicator is a
square box at the centre of an object to indicate that the object is a hotspot.
FP_IsHotspot
An object-level property that specifies whether an object is a hotspot. If this property
is turned off, the object is no longer considered a hotspot.
FP_HotspotCmdStr
The command string for the hotspot, similar to the hypertext command string. This
is an object-level property.
FP_HotspotTitle
The tooltip for the hotspot. Applicable for the output formats that support it (for
example HTML). This is an object-level property and is optional.
FDK Programmer’s Reference
19
1
W h a t ’ s N e w i n F D K 11
Interactive multimedia links for 3D objects
Interactive multimedia links for 3D objects
FDK 11 provides the following properties to manage links to embedded U3D
(Universal 3D), FLV files, and SWF files in the PDF output.
FP_InsetGfxPlayWindowInPdf
If this property is set, on publishing a document to PDF, inset objects that have facets
of type FLV, U3D, or SWF will be activated in a new Window in a PDF.
FP_InsetGfxActiveInPdf
If this property is set, on publishing a document to PDF, inset objects that have facets
of type FLV, U3D, or SWF will be activated as soon as the page containing the
graphic object is visible.
FP_InsetGfxName
This property assigns a name to inset objects that have facets of type FLV, U3D, or
SWF.
FP_InsetJavaScriptAttached
Indicates whether Javascript is attached with the graphic object that has a U3D facet.
FP_InsetJavaScriptFile
Use this property to attach a Javascript file to a graphic object that has a U3D facet.
If the value of the file path sepecified is null, the Javascript file attached to the inset
is removed.
FP_InsetSaveFacetToFile
Saves the given facet of an inset to a given file.
FP_InsetU3dViewList
Returns the list of views defined in the U3D facet of an inset object.
FP_InsetU3dAnimationList
Returns the list of animations defined in the U3D facet of an inset object.
FP_InsetU3dPartList
Returns the list of parts defined in the U3D facet of an inset object.
FP_InsetMonikerFilePath
Returns the file path of the moniker of an inset object that has an OLE2 facet.
20
FDK Programmer’s Reference
Support for referring to content using line numbers
...
W h a t ’ s N e w i n F D K 11
Support for referring to content using line numbers
FDK 11 supports the setting of line numbers. The line numbers are set at a document
level and appear before the line. The following properties are provided for managing
line numbers:
FP_LineNumRestart
If set, restarts line number display on each page.
FP_LineNumShow
If set, enables the line number display.
FP_LineNumDistance
Sets the line number display width, that is the space in which the line numbers are
displayed.
Support for guided structured authoring with banner text
Banner text in a FrameMaker file instructs you about what to enter in an element. You
can control the instructional text you want to display for each of the elements.The
following properties are used to handle banner text:
FP_BannerText
Property of element definition object, FO_ElementDef. Users can set, change, or
query the banner text associated with an element definition object.
FP_BannerTextDisplay
Boolean property of document specifying whether banner text should be displayed in
a document.
New APIs, notifications, error codes, objects, and properties
The following new API, notifications, error codes, objects, and properties are added in
this release:
New APIs
F_ApiClientPath()
F_ApiDefineAndAddCommandEx()
F_ApiDefineCommandEx()
FDK Programmer’s Reference
21
1
W h a t ’ s N e w i n F D K 11
New APIs, notifications, error codes, objects, and properties
F_ApiDeleteAllKeyDefinitions()
F_ApiDeleteCondTag()
F_ApiGetAllKeyDefinitions()
F_ApiGetAllKeys()
F_ApiGetKeyCatalog()
F_ApiGetKeyDefinition()
F_ApiGetNewXMLDefaultParams()
F_ApiNewKeyCatalog()
F_ApiNewKeyDefinition()
F_ApiNewXML()
F_ApiProgressBarEx()
F_ApiSetAttributeSimple()
F_ApiUpdateDITAReference()
F_ApiUpdateDITAReferences()
F_ApiUpdateKeyDefinition()
New notifications
FA_Note_IsCommandEnabled
FA_Note_LoadKeyCatalog
FA_Note_PostSwitchView
FA_Note_PreSwitchView
FA_Note_ReLoadKeyCatalog
FA_Note_UpdateDITAReference
FA_Note_UpdateDITAReferences
New error codes
22
FE_BadKey
FE_BadKeyField
FE_KeyCatalogIsStale
FE_KeyCatalogNotLoaded
FDK Programmer’s Reference
New APIs, notifications, error codes, objects, and properties
FE_KeyDefinitionDoesNotExist
FE_NonDITADocument
FE_UpdateDITAReferenceFailed
FE_UpdateDITAReferenceFailedCannotConvertToFMObject
FE_UpdateDITAReferenceFailedCannotFindReferencedFile
FE_UpdateDITAReferenceFailedCannotOpenReferencedFile
FE_UpdateDITAReferenceFailedCannotResolveReference
FE_UpdateDITAReferenceFailedInvalidElementType
...
W h a t ’ s N e w i n F D K 11
New objects
FO_GraphicsFmt
FO_KeyCatalog
New properties
FP_ActiveView
FP_DefaultKeyCatalog
FP_FirstDITAConrefElementInDoc
FP_FirstDITALinkElementInDoc
FP_FirstDITATopicrefElementInDoc
FP_FirstDITATopicsetrefElementInDoc
FP_FirstDITAXrefElementInDoc
FP_FirstGraphicsFmtInDoc
FP_FirstKeyCatalogInSession
FP_FMConsoleString
FP_Focus
FP_GroupDialog
FP_HotspotCmdStr
FP_HotspotTitle
FP_InsetMonikerFilePath
FP_InsetMonikerPath
FDK Programmer’s Reference
23
1
24
W h a t ’ s N e w i n F D K 11
New APIs, notifications, error codes, objects, and properties
FP_InsetU3dAnimationList
FP_InsetU3dPartList
FP_InsetU3dViewList
FP_IsHotspot
FP_IsTempOpenSave
FP_KeyCatalog
FP_KeyCatalogType
FP_KeyCatalogWorkflow
FP_LineNumDistance
FP_LineNumRestart
FP_LineNumShow
FP_MaxSize
FP_MinSize
FP_NextDITAConrefElementInDoc
FP_NextDITALinkElementInDoc
FP_NextDITATopicrefElementInDoc
FP_NextDITATopicsetrefElementInDoc
FP_NextDITAXrefElementInDoc
FP_NextGraphicsFmtInDoc
FP_SpecifiedKeyCatalog
FP_UseAFrameIsCropped
FP_UseAFrameIsFloating
FP_UseAlignment
FP_UseAnchorType
FP_UseAngle
FP_UseBaselineOffset
FP_UseBorderWidth
FP_UseColGapWidth
FP_UseColumnsAreBalanced
FP_UseDTheta
FDK Programmer’s Reference
New APIs, notifications, error codes, objects, and properties
FP_UseFill
FP_UseFlowIsAutoConnect
FP_UseFlowIsPostScript
FP_UseHeight
FP_UseInsetDpi
FP_UseLocX
FP_UseLocY
FP_UseMathSize
FP_UseNumColumns
FP_UseOverprint
FP_UsePen
FP_UseRadius
FP_UseRunaround
FP_UseRunaroundGap
FP_UseSideHeadGap
FP_UseSideHeadPlacement
FP_UseSideHeadWidth
FP_UseSideOffset
FP_UseTextLineType
FP_UseTheta
FP_UseTintPercent
FP_UseWidth
FP_ViewHotspotIndicators
FP_XSLTTransformationScenarioFile
FDK Programmer’s Reference
...
W h a t ’ s N e w i n F D K 11
25
1
W h a t ’ s N e w i n F D K 11
CMS Connector Framework
CMS Connector Framework
FrameMaker extends the support to any standard content management system (CMS)
by providing a set of full-featured APIs.
With CMS APIs, you can implement additional authoring and content management
capabilities beyond the ones provided by the CMS.
In addition, you can create your own user interface or extend the existing user interface
features.
New CMS API, structures, enums, error codes, enums, and properties added in this
release:
26
“CMS API Data Structures and Enum Constants” on page 993
“Error Codes” on page 1000
“CMS API Functions” on page 1001
“APIs to automate the CMS connectors functionality” on
page 1035
FDK Programmer’s Reference
2
Function Summary
..................................
.....
1
This chapter lists the FDK functions by topic. If you know what you want to do, but
don’t know which function to use, look it up in this chapter. If you know the name of a
function and want a complete description of it, look it up in Chapter 2, “FDK Function
Reference.”
The functions are listed under all the topics to which they apply, so some functions
appear more than once.
FDK Programmer’s Reference
27
1
Function Summary
Client-defined callback functions
To
Use this function
Respond to the user choosing a menu item
created by your client
F_ApiCommand()
Respond to the FrameMaker product’s
initialization message
F_ApiInitialize()
Respond to the user clicking a hypertext
marker or inset
F_ApiMessage()
Respond to the user or another client executing
operations such as Open or Save
F_ApiNotify()
Turn a notification on or off
F_ApiNotification()
Respond to the user interacting with a clientdefined dialog box
F_ApiDialogEvent()
Set a callback function that is called for setting
the username/password information before
performing the NetLib related authentication.
F_ApiNetLibSetAuthFunction()
Set a return value for a client-defined callback
function
F_ApiReturnValue()
Books
28
To
Use this function
Close a book
F_ApiClose()
Compare two books
F_ApiCompare()
Create a book
F_ApiNewNamedObject()
Generate/update files for a book
F_ApiSimpleGenerate()
F_ApiUpdateBook()
Import element definitions to a book
F_ApiSimpleImportElementDefs()
Import formats from a document to a book
F_ApiSimpleImportFormats()
Insert a book component of a specified
type at a specified position in a structured
FrameMaker book.
F_ApiNewBookComponentOfTypeInHierarchy()
Move a book component within the book.
F_ApiMoveComponent()
Open a book (the easy way)
F_ApiSimpleOpen()
FDK Programmer’s Reference
To
Use this function
Open a book (with a script)
F_ApiOpen()
Print a book
F_ApiSilentPrintDoc()
Save a book (the easy way)
F_ApiSimpleSave()
Save a book (with a script)
F_ApiSave()
Write entries to the book error log
F_ApiCallClient()
FDK Programmer’s Reference
...
Function Summary
29
1
Function Summary
Characters
30
To
Use this function
Convert a character to lowercase
F_CharToLower()
Convert a character to uppercase
F_CharToUpper()
Convert a UTF-8 character to lowercase
F_CharToLowerUTF8()
Determine whether a character is alphabetic
F_CharIsAlphabetic()
Determine whether a character is
alphanumeric
F_CharIsAlphaNumeric()
Determine whether a character is a
FrameMaker product control character
F_CharIsControl()
Determine whether a character is alphabetic
F_CharIsEol()
Determine whether a character is hexadecimal
F_CharIsHexadecimal()
Determine whether a character is lowercase
F_CharIsLower()
Determine whether a character is numeric
F_CharIsNumeric()
Determine whether a character is uppercase
F_CharIsUpper()
Determine whether a specified UTF-8
character is an alphanumeric character
F_CharIsAlphaNumericUTF8()
Determine whether a specified character is a
FrameMaker control character.
F_CharIsControlUTF8()
Determine whether a specified character is a
FrameMaker end-of-line (EOL) character.
F_CharIsEolUTF8()
Determine whether a specified UTF-8
character is a hexadecimal digit
F_CharIsHexadecimalUTF8()
Determine whether a specified UTF-8
character is a lowercase character
F_CharIsLowerUTF8()
Determine whether a specified UTF-8
character is a numeric character in a decimal
system.
F_CharIsNumericUTF8()
Determine whether a specified UTF-8
character is an uppercase character
F_CharIsUpperUTF8()
FDK Programmer’s Reference
...
Function Summary
Clipboard
To
Use this function
Copy selection to the Clipboard
F_ApiCopy()
Clear selection
F_ApiClear()
Cut selection to the Clipboard
F_ApiCut()
Paste contents of the Clipboard
F_ApiPaste()
Pop the entry at the top of the Clipboard stack to
the Clipboard
F_ApiPopClipboard()
Push the Clipboard contents onto the Clipboard
stack
F_ApiPushClipboard()
Commands and menus
To
Use this function
Add a command to a menu
F_ApiAddCommandToMenu()
Add a menu to a menu or menu bar
F_ApiAddMenuToMenu()
Add a menu item separator to a menu
F_ApiAddCommandToMenu()
Allow user to choose a command by typing in
the document window Tag area
F_ApiQuickSelect()
Arrange the menu items on a menu
F_ApiSetId()
Arrange the menus on a menu or menu bar
F_ApiSetId()
Create a command
F_ApiDefineCommand()
Create a command and specify the views in
which this command is valid
F_ApiDefineCommandEx()
Create a command and add it to a menu
F_ApiDefineAndAddCommand()
Create a menu
F_ApiDefineMenu()
Create a menu and add it to a menu or menu bar
F_ApiDefineAndAddMenu()
Determine if a menu or command exists
F_ApiGetNamedObject()
Determine if a menu or menu item is on a menu
or menu bar
F_ApiMenuItemInMenu()
Get the ID of a menu, command or menu item
separator with a specified name
F_ApiGetNamedObject()
FDK Programmer’s Reference
31
1
32
Function Summary
To
Use this function
Respond to the user executing a command
created by your client
F_ApiCommand()
Load a menu customization file
F_ApiLoadMenuCustomizationFil
e()
Remove amenu item, menu item separator,
menu, or command
F_ApiDelete()
FDK Programmer’s Reference
...
Function Summary
Data structures: copying
To
Use this function
Copy an F_AttributesT structure
F_ApiCopyAttributes()
Copy an F_AttributeDefsT structure
F_ApiCopyAttributeDefs()
Copy an F_ElementCatalogEntriesT structure
F_ApiCopyElementCatalog
Entries()
Copy an F_AttributesT structure
F_ApiCopyAttributes()
Copy an F_IntsT structure
F_ApiCopyInts()
Copy an F_MetricsT structure
F_ApiCopyMetrics()
Copy an F_PointsT structure
F_ApiCopyPoints()
Copy an F_PropValT structure
F_ApiCopyPropVal()
Copy an F_PropValsT structure
F_ApiCopyPropVals()
Copy a StringT variable
F_ApiCopyString()
Copy an F_StringsT structure
F_ApiCopyStrings()
Copy an F_TabT structure
F_ApiCopyTab()
Copy an F_TabsT structure
F_ApiCopyTabs()
Copy an F_TextItemT structure
F_ApiCopyTextItem()
Copy an F_TextItemsT structure
F_ApiCopyTextItems()
Copy an F_UBytesT structure
F_ApiCopyUBytes()
Copy an F_UIntsT structure
F_ApiCopyUInts()
Copy an F_ValT structure
F_ApiCopyVal()
Debugging
To
Use this function
Print the current API error status
F_ApiPrintFAErrno()
Print status flags returned by a call to
F_ApiImport()
F_ApiPrintImportStatus()
Print status flags returned by a call to F_ApiOpen()
F_ApiPrintOpenStatus()
FDK Programmer’s Reference
33
1
34
Function Summary
To
Use this function
Print the status flags returned by a call to
F_ApiSave()
F_ApiPrintSaveStatus()
Print the status flags returned by a call to
F_ApiUpdateBook()
F_ApiPrintUpdateBookStatu
s()
Print a property-value pair
F_ApiPrintPropVal()
Print the property-value pairs in a property list
F_ApiPrintPropVals()
Print the text in a single text item
F_ApiPrintTextItem()
Print the text in a set of text items (F_TextItemsT
structure)
F_ApiPrintTextItems()
FDK Programmer’s Reference
...
Function Summary
DITA references: updating
To
Use this function
Update the DITA object represented by the
specified element.
F_ApiUpdateDITAReference()
Update all DITA references of the specified
type. For example, you can use this API to
update all conrefs, all xrefs, or all
conrefs as well as xrefs.
F_ApiUpdateDITAReferences()
Dialog boxes: predefined
To
Use this function
Display an OK/Cancel or Continue dialog box
with a specified message
F_ApiAlert()
Display a dialog box that allows the user to
select a file or directory
F_ApiChooseFile()
Display a dialog box that prompts the user for
an integer value
F_ApiPromptInt()
Display a dialog box that prompts the user for a
metric value
F_ApiPromptMetric()
Display a dialog box that prompts the user for a
string
F_ApiPromptString()
Display dialog boxes similar to FrameMaker’s
Open and Save dialog boxes
F_ApiChooseFileExEx ()
Display a scroll list that allows the user to
choose from a list of items you provide
F_ApiScrollBox()
Dialog boxes: client-defined
To
Use this function
Close a dialog box
F_ApiClose()
Display a dialog resource as a modal dialog box
F_ApiModalDialog()
Display a dialog resource as a modeless dialog
box
F_ApiModelessDialog()
FDK Programmer’s Reference
35
1
36
Function Summary
To
Use this function
Get the ID of an item in a dialog box from its
item number
F_ApiDialogItemId()
Get the string entered in a text field
F_ApiGetString()
Get the state of a button, checkbox,
radio button, text box, pop-up menu,
or scroll list
F_ApiGetInt()
Keep a client-defined modal dialog box on the
screen after the user has clicked an item in it
F_ApiReturnValue()
Open a dialog resource
F_ApiOpenResource()
Respond to the user interacting with a clientdefined dialog box
F_ApiDialogEvent()
Set the string entered in a text field
F_ApiSetString()
Set the list of strings that appears in a scroll list
or pop-up menu
F_ApiSetStrings()
Set the state of a button, checkbox,
radio button, text box, pop-up menu, or scroll
list
F_ApiSetInt()
FDK Programmer’s Reference
...
Function Summary
Documents: comparing
To
Use this function
Compare two documents
F_ApiCompare()
Documents: file operations
To
Use this function
Check status bit in status scripts returned by
F_ApiOpen() or F_ApiSave()
F_ApiCheckStatus()
Close (quit) a document
F_ApiClose()
Create a new custom document
F_ApiCustomDoc()
Create a new document from a template
F_ApiSimpleNewDoc()
Create a new document using a script
F_ApiOpen()
Get a default property list for use with
F_ApiOpen()
F_ApiGetOpenDefaultParams()
Get a default property list for use with
F_ApiSave()
F_ApiGetSaveDefaultParams()
Get a default property list for use with
F_ApiImport()
F_ApiGetImportDefaultParams()
Import a text or graphics file
F_ApiImport()
Open a document (the easy way)
F_ApiSimpleOpen()
Open a document (with a script)
F_ApiOpen()
Print a document
F_ApiSilentPrintDoc()
Save a document (the easy way)
F_ApiSimpleSave()
Save a document (with a script)
F_ApiSave()
Apply an attribute expression to a document
to perform attribute-based-filtering.
F_ApiApplyAttributeExpression()
Apply an attribute-based expression to the
document and the filtered text is displayed in
the specified color.
F_ApiPreviewAttributeExpression
()
Apply an attribute-based expression to the
document where the filtered text is converted
to conditional text.
F_ApiApplyAttributeExpressionAs
Condition()
FDK Programmer’s Reference
37
1
Function Summary
Documents: formatting
To
Use this function
Accept all the tracked changes in the specified
document
F_ApiTrackChangesAcceptAll
()
Apply a page’s layout to another page
F_ApiApplyPageLayout()
Clear the change bars for a document
F_ApiClearAllChangeBars()
Redisplay a document after FP_Displaying
has been turned off
F_ApiRedisplay()
Reformat a document after FP_Reformatting
has been turned off
F_ApiReformat()
Rehyphenate words in a document
F_ApiRehyphenate()
Reject all the tracked changes in the specified
document
F_ApiTrackChangesRejectAll
()
Reset equation settings for a document
F_ApiResetEqnSettings()
Reset reference frames
F_ApiResetReferenceFrames()
Restart paragraph numbering for a document
F_ApiRestartPgfNumbering()
Documents: updating
38
To
Use this function
Import formats from another document
F_ApiSimpleImportFormats()
Import element definitions to a document
F_ApiSimpleImportElementDefs()
Updates a specified cross-reference in the
document.
F_ApiUpdateXRef()
Update the cross-references in a document
F_ApiUpdateXRefs()
Update a text inset
F_ApiUpdateTextInset()
Update the variables in a document
F_ApiUpdateVariables()
FDK Programmer’s Reference
...
Function Summary
F-codes
To
Use this function
Execute a set of f-codes
F_ApiFcodes()
Files, directories, and filepaths
To
Use this function
Copy a filepath (platform-independent representation
of a pathname)
F_FilePathCopy()
Convert a filepath to a platform-specific or platformindependent pathname
F_FilePathToPathName()
Convert a platform-specific or platform-independent
pathname to a filepath
F_PathNameToFilePath()
Close a directory handle opened with
F_FilePathOpenDir()
F_FilePathCloseDir()
Create a directory
F_MakeDir()
Delete a file specified by a filepath
F_DeleteFile()
Determine which platform naming conventions a
pathname uses
F_PathNameType()
Free the memory used by a filepath
F_FilePathFree()
Get the basename (base directory name or filename)
specified by a filepath
F_FilePathBaseName()
Get the filepath associated with a specified channel
F_GetFilePath()
Get the next file in a directory specified by a handle
opened with F_FilePathOpenDir()
F_FilePathGetNext()
Get the parent directory of a specified file or directory
F_FilePathParent()
Get the permissions and other information for a
specified file or directory
F_FilePathProperty()
Open and return a handle that can be used to obtain the
file and subdirectory entries in a specified directory
F_FilePathOpenDir()
Rename a file
F_RenameFile()
F_NewMacFilePath()
F_GetMacFilePathInfo()
FDK Programmer’s Reference
39
1
40
Function Summary
To
Use this function
Reset a directory’s handle so that the next call to
F_FilePathGetNext() returns the first file or
directory entry in the directory
F_ResetDirHandle()
FDK Programmer’s Reference
...
Function Summary
Fonts
To
Use this function
Get the angles, variations, and weights
available for a specified font or combined font
F_ApiFamilyFonts()
Get the character encoding for a specified font
or font family
F_ApiGetEncodingForFamily()
Get and set character encoding data for a
session
F_ApiGetSupportedEncodings()
F_ApiCombinedFamilyFonts()
F_ApiGetEncodingForFont()
F_ApiIsEncodingSupported()
F_FontEncId()
F_FontEncName()
Graphic insets
To
Use this function
Create a graphic inset
F_ApiImport()
F_ApiNewGraphicObject()
Delete a facet
F_ApiDeletePropByName()
Query an integer (IntT) facet
F_ApiGetIntByName()
Query a metric (MetricT) facet
F_ApiGetMetricByName()
Query an unsigned bytes
(F_UBytesT) facet
F_ApiGetUBytesByName()
Respond to the user clicking an inset
F_ApiMessage()
Set an integer (IntT) facet
F_ApiSetIntByName()
Set a metric (MetricT) facet
F_ApiSetMetricByName()
Set an unsigned bytes (F_UBytesT) facet
F_ApiSetUBytesByName()
FDK Programmer’s Reference
41
1
Function Summary
Hash tables
To
Use this function
Add an entry to a hash table
F_HashSet()
Call a specified function with the key and
datum of each entry in a hash table
F_HashEnumerate()
Create a hash table
F_HashCreate()
Delete a hash table and all its entries
F_HashDestroy()
Get an entry from a hash table
F_HashGet()
Remove an entry from a hash table
F_HashRemove()
Create a hash table
F_HashReportOnData()
Hypertext
To
Use this function
Execute a hypertext command
F_ApiHypertextCommand()
I/O
42
To
Use this function
Append the contents of one channel to another
F_ChannelAppend()
Close a channel
F_ChannelClose()
Close a temporary channel
F_ChannelCloseTmp()
Create a temporary channel
F_ChannelMakeTmp()
Determine whether the end of a channel has been read
F_ChannelEof()
Flush buffered output to a channel
F_ChannelFlush()
Get the size of a channel
F_ChannelSize()
Get the byte after the current position in a channel
F_ChannelPeek()
Get the offset of the current byte relative to the
beginning of an input channel
F_ChannelTell()
Open a channel
F_ChannelOpen()
FDK Programmer’s Reference
To
Use this function
Read from a channel
F_ChannelRead()
...
Function Summary
F_ReadBytes()
F_ReadLongs()
F_ReadShorts()
Read formatted input
F_Scanf()
F_Sscanf()
Set the position for the next input operation in a
channel
F_ChannelSeek()
Set the byte order of a channel so that subsequent I/O
calls will swap bytes if the platform is big endian
F_SetByteOrder()
Set the byte order of a channel so that subsequent I/O
calls will swap bytes if the platform is little endian
F_ResetByteOrder()
Write to a channel
F_ChannelWrite()
F_WriteBytes()
F_WriteLongs()
F_WriteShorts()
Write formatted output
F_Printf()
F_Sprintf()
Insets
See “Graphic insets” on page 41 and “Text insets” on page 64.
FDK Programmer’s Reference
43
1
Function Summary
Key Catalogs
To
Use this function
Create a new key catalog
F_ApiNewKeyCatalog()
Find a key catalog with the specified
tag.
F_ApiGetKeyCatalog()
Add a new key definition to the specified
key catalog.
F_ApiNewKeyDefinition()
Update the specified key definition field
for the specified key in the specified key
catalog.
F_ApiUpdateKeyDefinition()
Get the specified key definition field for
the specified key from the specified key
catalog.
F_ApiGetKeyDefinition()
Get all the key definitions from the
specified key catalog.
F_ApiGetAllKeyDefinitions()
Delete all the key definitions in the
specified key catalog.
F_ApiDeleteAllKeyDefinitions()
Get all the key tags from the specified
key catalog.
F_ApiGetAllKeys()
Memory: allocating and deallocating structures
44
To
Use this function
Allocate memory for a property list
F_ApiAllocatePropVals()
Allocate memory for text items (an
F_TextItemsT structure)
F_ApiAllocateTextItems()
Exit and free all resources used by client
F_ApiBailOut()
Deallocate memory for a property (an
F_PropValT structure)
F_ApiDeallocateProp()
Deallocate memory for a property list (an
F_PropValsT structure)
F_ApiDeallocatePropVals()
Deallocate memory for text items (an
F_TextItemsT structure)
F_ApiDeallocateTextItems()
Deallocate memory for an F_FontsT
strcture
F_ApiDeallocateFonts()
FDK Programmer’s Reference
To
Use this function
Deallocate memory for an F_IntsT
structure
F_ApiDeallocateInts()
Deallocate memory for an F_MetricsT
structure
F_ApiDeallocateMetrics()
Deallocate memory for an F_PointsT
structure
F_ApiDeallocatePoints()
Deallocate memory for a StringT
variable
F_ApiDeallocateString()
Deallocate memory for an F_StringsT
structure
F_ApiDeallocateStrings()
Deallocate memory for an F_TabT
structure
F_ApiDeallocateTab()
Deallocate memory for an F_TabsT
structure
F_ApiDeallocateTabs()
Deallocate memory for an F_UbytesT
structure
F_ApiDeallocateUBytes()
Deallocate memory for an F_UIntsT
structure
F_ApiDeallocateUInts()
FDK Programmer’s Reference
...
Function Summary
45
1
Function Summary
Memory: manipulating with handles
To
Use this function
Allocate a block of memory to a handle
F_AllocHandle()
Allocate a new block of memory to a handle
and copy the contents of a specified block of
memory to it
F_DuplicateHandle()
Compare two blocks of memory specified by
handles
F_HandleEqual()
Free a block of memory specified by a handle
F_FreeHandle()
Get the size of a handle’s block of data
F_GetHandleSize()
Initialize a block of memory specified by a
handle to 0
F_ClearHandle()
Lock a handle and return the address of the
data block of the handle
F_LockHandle()
Reallocate a block of memory
F_ReallocHandle()
Specify a direct straight exit function for the
FDE to call when memory allocation fails
F_SetDSExit()
Unlock a handle
F_UnlockHandle()
Memory: manipulating with pointers
To
Use this function
Allocate a block of memory to a pointer
F_Alloc()
F_Calloc()
46
Allocate a new block of memory to a pointer
and copy the contents of a specified block of
memory to it
F_DuplicatePtr()
Compare two blocks of memory specified by
pointers
F_PtrEqual()
Copy the contents of a block of memory to
another block of memory
F_CopyPtr()
Free a block of memory specified by a pointer
F_Free()
Initialize a block of memory specified by a
pointer to 0
F_ClearPtr()
FDK Programmer’s Reference
To
Use this function
Reallocate a block of memory to a pointer
F_Realloc()
Specify a direct straight exit function for the
FDE to call when memory allocation fails
F_SetDSExit()
...
Function Summary
Menus
See “Commands and menus” on page 31.
FDK Programmer’s Reference
47
1
Function Summary
Metrics
To
Use this function
Compare two metric numbers
F_MetricApproxEqual()
Compute the square root of a metric number
F_MetricSqrt()
Compute the square of a metric number
F_MetricSquare()
Constrain a specified angle to a specified range of
degrees
F_MetricConstrainAngle()
Construct a metric number from a fraction
F_MetricMake()
Convert a metric number to a real number
F_MetricToFloat()
Convert a real number to a metric number
F_MetricFloat()
Divide two metric numbers
F_MetricDiv()
Multiply a metric value by a fraction
F_MetricFractMul()
Multiply two metric numbers
F_MetricMul()
Normalize a specified angle between 0 and 360
degrees
F_MetricNormalizeAngle()
Maker Interchange Format (MIF)
48
To
Use this function
Indent and start a new MIF statement and
automatically increase the indent level
F_MifBegin()
Write a comment string to the MIF write channel
F_MifComment()
Write a real number with n digits after the decimal
point
F_MifDecimal()
Indent and finish a MIF statement
F_MifEnd()
Return the current indent level of the MIF write
channel
F_MifGetIndent()
Indent the output channel according to the indent
level
F_MifIndent()
Decrease the indent level
F_MifIndentDec()
Increase the indent level
F_MifIndentInc()
Write an integer to the MIF write channel
F_MifInteger()
FDK Programmer’s Reference
To
Use this function
Write a new line to the MIF write channel
F_MifNewLine()
Set the indent level of the MIF write channel
F_MifSetIndent()
Set a channel to receive MIF output
F_MifSetOutputChannel()
Write a blank space to the MIF output channel
F_MifSpace()
Write a tab to the MIF channel
F_MifTab()
Write a simple text string to the MIF output channel
F_MifText()
Write a text string enclosed in single quotes (`') to
the MIF channel
F_MifTextString()
FDK Programmer’s Reference
...
Function Summary
49
1
Function Summary
Objects: creating and deleting
50
To
Use this function
Add a Boolean conditional expression to
the document
F_ApiAddNewBuildExpr()
F_ApiDeleteBuildExpr()
Apply the Boolean conditional
expression to the document.
F_ApiSetActiveBuildExpr()
Pre-register a given server with the
provided username and password, so that
instead of prompting the user for
authentication, the server uses the login
information when required.
F_ApiNetLibAuthenticateServer()
Return the name of the active expression
in the document
F_ApiGetActiveBuildExpr()
Return the Boolean conditional
expression in the document with the
given name
F_ApiGetBuildExpr()
Return an array of all Boolean
conditional expression names in the
document
F_ApiGetBuildExprCatalog()
Upload a folder and subfolders to the
server.
F_ApiNetLibUploadFolder()
Create an anchored object, such as a
marker or an anchored frame
F_ApiNewAnchoredObject()
Create a book component in a structured
book
F_ApiNewBookComponentInHierarchy()
Create a column in a table
F_ApiAddCols()
Create a client text inset
F_ApiNewAnchoredObject()
Create a format rule, format rule clause,
or format change list
F_ApiNewSubObject()
Create a formatted anchored object, such
as a table, variable, or cross-reference
F_ApiNewAnchoredFormattedObject()
Create a graphic object, such as a text
column or an oval
F_ApiNewGraphicObject()
Create a named object, such as a
reference page
F_ApiNewNamedObject()
Create a row in a table
F_ApiAddRows()
FDK Programmer’s Reference
To
Use this function
Create a series object, such as a
paragraph, body page, or book
component
F_ApiNewSeriesObject()
Create a structural element in a
Structured document
F_ApiNewElement()
Create a table with a specified number of
rows and columns
F_ApiNewTable()
Create a structural element in a
Structured document
or book
F_ApiNewElementInHierarchy()
Create a text or graphic inset
F_ApiImport()
Delete unused formats (character,
paragraph, or table) from the document
F_ApiDeleteUnusedFmts()
Delete an object
F_ApiDelete()
FDK Programmer’s Reference
...
Function Summary
51
1
Function Summary
Objects: getting IDs
To
Use this function
Get the ID of an object with a specified
persistent identifier
F_ApiGetUniqueObject()
Get the ID of an object that has a specified
name
F_ApiGetNamedObject()
Query an ID (F_ObjHandleT) property
F_ApiGetId()
Printing
To
Use this function
Print a document
F_ApiSilentPrintDoc()
Specify the number of copies of a document to
print and other integer print properties
F_ApiSetInt()
Specify the printer to which to print a document
and other string print properties
F_ApiSetString()
Properties
52
To
Use this function
Get an element definition’s attribute definitions
F_ApiGetAttributeDefs()
Get an element’s attributes
F_ApiGetAttributes()
Get a document’s element catalog
F_ApiGetElementCatalog()
Query a property of any type
F_ApiGetPropVal()
Query an array of integers (F_IntsT) property
F_ApiGetInts()
Query an ID (F_ObjHandleT) property
F_ApiGetId()
Query an integer (IntT) property
F_ApiGetInt()
Query a metric (MetricT) property
F_ApiGetMetric()
Query a metrics (F_MetricsT) property
F_ApiGetMetrics()
Query an array of points (F_PointsT) property for
a polygon or polyline
F_ApiGetPoints()
FDK Programmer’s Reference
To
Use this function
Query a string (StringT) property
F_ApiGetString()
Query a strings (F_StringsT) property
F_ApiGetStrings()
Query a text location (F_TextLocT) property
F_ApiGetTextLoc()
Query a text range (F_TextRangeT) property
F_ApiGetTextRange()
Query the text properties (for example, character
tag, font family, font weight) for a text range
F_ApiGetTextProps()
...
Function Summary
F_ApiGetTextPropVal()
F_ApiGetTextVal()
Retrieve the array of tabs (F_TabsT) for a
paragraph or paragraph format
F_ApiGetTabs()
Retrieve the entire property list (F_PropValsT) for
an object
F_ApiGetProps()
Set an element definition’s attribute definitions
F_ApiSetAttributeDefs()
Set an element’s attributes
F_ApiSetAttributes()
Set a property of any type
F_ApiSetPropVal()
Set an array of integers (F_IntsT) property
F_ApiSetInts()
Set an ID (F_ObjHandleT) property
F_ApiSetId()
Set an integer (IntT) property
F_ApiSetInt()
Set a metric (MetricT) property
F_ApiSetMetric()
Set a metrics (F_MetricsT) property
F_ApiSetMetrics()
Set a text location (F_TextLocT) property
F_ApiSetTextLoc()
Set the entire property list (F_PropValsT) for an
object
F_ApiSetProps()
Set an array of points (F_PointsT) property
F_ApiSetPoints()
Set a string (StringT) property
F_ApiSetString()
Set a strings (F_StringsT) property
F_ApiSetStrings()
Set a tabs (F_TabsT) property
F_ApiSetTabs()
Set the text properties (for example, character tag,
font family, font weight) for a text range
F_ApiSetTextProps()
F_ApiSetTextPropVal()
F_ApiSetTextVal()
Set a text range (F_TextRangeT) property
F_ApiSetTextRange()
FDK Programmer’s Reference
53
Selection
To
Use this function
Determine where the insertion point or selected text
is
F_ApiGetTextRange()
Get the element selection in a Structured document
F_ApiGetElementRange()
Set the text selection or insertion point by setting the
property that specifies the text selection
(FP_TextSelection)
F_ApiSetTextRange()
Select cells in a table
F_ApiMakeTblSelection()
Get the IDs of selected graphic objects
F_ApiGetId()
Set the element selection in a Structured document
F_ApiSetElementRange()
Scroll the document to display the currenttrext
range
F_ApiScrollToText()
Sessions
To
Use this function
Quit a session
F_ApiClose()
Sleep
To
Use this function
Suspend FrameMaker product and client operation
for specified number of seconds
F_ApiSleep()
Suspend FrameMaker product and client operation
for specified number of microseconds
F_ApiUSleep()
String lists
To
Use this function
Append a string to a string list
F_StrListAppend()
Concatenate two string lists
F_StrListCat()
To
Use this function
Copy a string from a string list to a string of a
specified size
F_StrListCopy()
Copy an entire string list
F_StrListCopyList()
Create a string list
F_StrListNew()
Free a string list
F_StrListFree()
Get the th string in a string list
F_StrListGet()
Get the first string in a string list
F_StrListFirst()
Get the last string in a string list
F_StrListLast()
Get the position of a specified string in a string list
F_StrListIndex()
Get the position of a specified string in a string list,
ignoring case
F_StrListIIndex()
Get the length of a string list
F_StrListLen()
Insert a string in a string list
F_StrListInsert()
Remove a specified string from a string list
F_StrListRemove()
Copy a string to a specified position in a string list
F_StrListSetString()
Sort a string list using a specified comparison
function
F_StrListSort()
FDK Programmer’s Reference
...
Function Summary
55
1
Function Summary
Strings: allocating, copying, and deallocating
To
Use this function
Allocate a new string
F_StrNew()
Copy a string, allocating memory for the new string
F_StrCopyString()
Copy a string to memory that is already allocated
F_StrCpy()
Copy a specified number of characters of
a string
F_StrCpyN()
Deallocate a string
F_Free()
Strings: comparing and parsing
To
Use this function
Compare two strings
F_StrCmp()
F_StrEqual()
Compare two strings, ignoring case
F_StrICmp()
F_StrIEqual()
56
Compare two strings up to a specified number of
characters
F_StrEqualN()
Compare two strings up to a specified number of
characters, ignoring case
F_StrICmpN()
Determine whether a string is a prefix of another string
F_StrPrefix()
Determine whether a string is a prefix of another string,
up to a specified number of characters
F_StrPrefixN()
Determine whether a string is a prefix of another string,
ignoring case
F_StrIPrefix()
Determine whether a string is a substring of another
string
F_StrSubString()
Determine whether a string is a suffix of another string
F_StrSuffix()
Parse a string into tokens
F_StrTok()
Return a pointer to the first occurrence in a string of any
of a specified set of characters
F_StrBrk()
FDK Programmer’s Reference
F_StrCmpN()
F_StrIEqualN()
To
Use this function
Return a pointer to the first occurrence of a character in
a string
F_StrChr()
Return a pointer to the first occurrence of a character in
a string, starting from the end of the string
F_StrRChr()
FDK Programmer’s Reference
...
Function Summary
57
1
Function Summary
Strings: concatenating
To
Use this function
Concatenate two strings
F_StrCat()
Concatenate two strings, limiting the result to a specified
number of characters
F_StrCatN()
Concatenate a string and an integer, limiting the result to a
specified number of characters
F_StrCatIntN()
Concatenate a string and a character, limiting the result to a
specified number of characters
F_StrCatCharN()
Strings: miscellaneous
58
To
Use this function
Convert a string to an integer
F_StrAlphaToInt()
Convert a string to a real number
F_StrAlphaToReal()
Get the length of a string
F_StrLen()
Reverse a string
F_StrReverse()
Strip a specified set of characters from
a string
F_StrStrip()
Strip leading spaces from a string
F_StrStripLeadingSpaces()
Strip trailing spaces from a string
F_StrStripTrailingSpaces()
Truncate a string at a specified position
F_StrTrunc()
FDK Programmer’s Reference
...
Function Summary
Strings: encoded
To
Use this function
Perform string operations on double-byte text that
similar to the operations you can perform on
single-byte text
F_StrCatDblCharNEnc()
F_StrCatNEnc()
F_StrChrEnc()
F_StrCmpNEnc()
F_StrConvertEnc()
F_StrCpyNEnc()
F_StrICmpEnc()
F_StrICmpNEnc()
F_StrIEqualEnc()
F_StrIEqualNEnc()
F_StrIPrefixEnc()
F_StrISuffixEnc()
F_StrLenEnc()
F_StrRChrEnc()
F_StrTruncEnc()
Get encoding information for a font or font family
F_ApiGetEncodingForFamily()
F_ApiGetEncodingForFont()
Get and set encoding data for a session
F_ApiGetSupportedEncodings()
F_ApiIsEncodingSupported()
F_FontEncId()
F_FontEncName()
Initialize encoding data for a session
F_FdeInitFontEncs()
Structure: manipulating elements
To
Use this function
Add an element to a location in the
structural hierarchy of a Structured
document or book
F_ApiNewElementInHierarchy()
Copy attributes
F_ApiCopyAttribute()
F_ApiCopyAttributes()
FDK Programmer’s Reference
59
1
Function Summary
To
Use this function
Copy newly added structures—perform a
deep copy and copy any arrays or strings
referenced by the structure.
F_ApiCopyStructureTypes
Create a book component in a structured
book
F_ApiNewBookComponentIn
Hierarchy()
Create an element in a document
F_ApiNewElement()
Deallocate attributes
F_ApiDeallocateAttributes()
Deallocate memory referenced by the
newly added structures—perform a deep
deallocation and deallocates any arrays or
strings referenced by the structure.
F_ApiDeallocateStructureType()
Delete an element, but leave its contents in
the document
F_ApiUnWrapElement()
Demote an element
F_ApiDemoteElement()
Get an element’s attributes
F_ApiGetAttributes()
Get current valid elements for the insertion
point
F_ApiGetElementCatalog()
Get the element selection
F_ApiGetElementRange()
Insert an element around the selected text
and elements
F_ApiWrapElement()
Insert a book component of a specified type
at a specified position in a structured
F_ApiNewBookComponentOfTypeInHierarchy()
Merge selected elements into the first
element
F_ApiMergeIntoFirst()
Merge selected elements into the last
element
F_ApiMergeIntoLast()
Promote an element
F_ApiPromoteElement()
Set the element selection in a Structured
document or book
F_ApiSetElementRange()
Set an element’s attributes
F_ApiSetAttributes()
Split one element into two
F_ApiSplitElement()
FrameMaker book.
60
FDK Programmer’s Reference
...
Function Summary
Structure: manipulating element definitions and format rules
To
Use this function
Check the value of an element definition to
determine that the element is text and not a
real element
F_ApiElementDefIsText()
Copy attribute definitions
F_ApiCopyAttributeDef()
F_ApiCopyAttributeDefs()
Create a format change list
(FO_FmtChangeList object)
F_ApiNewNamedObject()
Create a format rule (FO_FmtRule object)
F_ApiNewSubObject()
Create a format rule clause
(FO_FmtRuleClause object)
F_ApiNewSubObject()
Deallocate attribute definitions
F_ApiDeallocateAttributeDefs()
Delete a format change list from the format
change list catalog
F_ApiDelete()
Delete a format rule or format rule clause
F_ApiDelete()
Get an element definition’s attribute
definitions
F_ApiGetAttributeDefs()
Get the ID of a format change list
F_ApiGetNamedObject()
Import element definitions to a document
F_ApiSimpleImportElementDefs()
Set an element definition’s attribute
definitions
F_ApiSetAttributeDefs()
F_ApiNewSubObject()
Tables
To
Use this function
Add columns to a table
F_ApiAddCols()
Add rows to a table
F_ApiAddRows()
Create a new table
F_ApiNewTable()
Delete columns from a table
F_ApiDeleteCols()
Delete rows from a table
F_ApiDeleteRows()
F_ApiDelete()
Delete a table
F_ApiDelete()
FDK Programmer’s Reference
61
1
62
Function Summary
To
Use this function
Select cells in a table
F_ApiMakeTblSelection()
Straddle cells in a table
F_ApiStraddleCells()
Unstraddle cells in a table
F_ApiUnStraddleCells()
FDK Programmer’s Reference
...
Function Summary
Text
To
Use this function
Clear text selection from a document
F_ApiClear()
Copy text selection from a document to the
Clipboard
F_ApiCopy()
Cut text selection from a document to the
Clipboard
F_ApiCut()
Delete text from a paragraph or graphic text line
F_ApiDeleteText()
Get the text (array of text items) that an object
contains
F_ApiGetText()
Get the text (array of text items) that an text range
contains
F_ApiGetTextForRange()
Get a text property (for example, character tag,
font family, font weight) for a text location
F_ApiGetTextPropVal()
F_ApiGetTextVal()
Get all the text properties for a text location
F_ApiGetTextProps()
Insert text in a paragraph, graphic text line, or
client text inset
F_ApiAddText()
Paste Clipboard contents at insertion point in a
document
F_ApiPaste()
Query a text range property
F_ApiGetTextRange()
Set a text property for a text range
F_ApiSetTextPropVal()
F_ApiSetTextVal()
Set all the text properties for a text range
F_ApiSetTextProps()
Set a text range property
F_ApiSetTextRange()
Text: find and replace
To
Use this function
Execute the find and replace command from an
API client
F_ApiFind()
FDK Programmer’s Reference
63
1
Function Summary
Text insets
To
Use this function
Add text to a client text inset
(FO_TiApiClient object)
F_ApiAddText()
Convert a locked text inset range to text
F_ApiConvertToText()
Create a Frame product text inset
(FO_TiFlow, FO_TiText, or
FO_TiTextTable object)
F_ApiImport()
Create a client text inset
F_ApiNewAnchoredObject()
Delete a text inset
F_ApiDelete()
Delete text from a client text inset
(FO_TiApiClient object)
F_ApiDeleteTextInsetContents()
Get a default property list for use with
F_ApiImport()
F_ApiGetImportDefaultParams()
Get text from a text inset
F_ApiGetText()
Update stale text insets
F_ApiUpdateTextInset()
Unicode
To
Use this function
Enable Unicode Mode or Compatibility Mode
F_ApiEnableUnicode()
Undo/Redo
64
To
Use this function
Clear both the undo and redo stacks in the
document specified by docId.
F_ApiUndoCancel()
Mark the starting point of a series of API calls
that are to be treated as a single undoable
operation in the document specified by docId.
F_ApiUndoStartCheckPoint()
FDK Programmer’s Reference
To
Use this function
Mark the ending point of a series of API calls
that are to be treated as a single undoable
operation for the docid specified in the call to
F_ApiUndoStartCheckpoint
F_ApiUndoEndCheckPoint()
FDK Programmer’s Reference
...
Function Summary
65
1
Function Summary
Utility
66
To
Use this function
Allow the user to cancel a client operation
F_ApiUserCancel()
Call another FDK client
F_ApiCallClient()
Determine if an ID represents a valid object in a
specified document
F_ApiObjectValid()
Exit and free memory
F_ApiBailOut()
Get a default property list for use with
F_ApiImport()
F_ApiGetImportDefaultParams()
Get a default property list for use with
F_ApiOpen()
F_ApiGetOpenDefaultParams()
Get a default property list for use with
F_ApiSave()
F_ApiGetSaveDefaultParams()
Get an object’s type
F_ApiGetObjectType()
Get the index for a property-value pair
(PropValT) in a property list
F_ApiGetPropIndex()
Get the directory containing the current client
F_ApiClientDir()
Get the registered name of the current client
F_ApiClientName()
Reformat a document
F_ApiReformat()
Request notification for specific events from the
Frame product
F_ApiNotification()
Suspend Frame product and client operation for
specified number of seconds
F_ApiSleep()
Set the default directory for the client
F_ApiSetClientDir()
Suspend Frame product and client operation for
specified number of microseconds
F_ApiUSleep()
FDK Programmer’s Reference
3
FDK Function Reference
..................................
.....
2
This chapter lists the FDK functions alphabetically. If you know the name of a function
and want a complete description of it, look it up in this chapter. If you know what you
want to do, but don’t know which function to use, see Chapter 1, “Function Summary.”
Some examples in this chapter use FDE functions, such as F_Alloc() and
F_Sprintf(). For more information on using FDE and FDE functions, see Part III,
“Frame Development Environment (FDE),” in the FDK Programmer’s Guide.
..............................................................................
IMPORTANT: The examples in this chapter assume that your client includes the
fapi.h and fdetypes.h header files in addition to the header files listed in the
function synopsis.
..............................................................................
FDK Programmer’s Reference
67
3
FDK Function Reference
F_Alloc()
F_ A l l o c ( )
F_Alloc() allocates a block of memory.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
PtrT F_Alloc(UIntT n,
PUCharT flags);
Arguments
n
The number of bytes of memory to allocate
flags
Specifies whether to bail out (DSE) or return NULL (NO_DSE) if the
requested memory isn’t available
Returns
A pointer to the allocated block of memory, or NULL if the requested memory isn’t
available.
Example
The following code allocates memory to a pointer, clears it, and then frees it:
. . .
UCharT *ptr = NULL;
ptr = F_Alloc(65535, NO_DSE);
if(ptr == NULL)
{
F_Printf(NULL, "Couldn't Allocate memory.\n");
return;
}
else
F_ClearPtr(ptr, 65535);
. . .
F_Free(ptr);
. . .
See also
“F_AllocHandle()” on page 69.
68
FDK Programmer’s Reference
F_AllocHandle()
...
FDK Function Reference
F_AllocHandle()
F_AllocHandle() allocates a new handle to a block of memory. Use
F_FreeHandle() to free the memory when you are done with it.
After you have allocated a handle, call F_LockHandle() to get the address of the
handle’s block of memory.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
HandleT F_AllocHandle(UIntT n,
PUCharT flags);
Arguments
n
The number of bytes of memory to allocate
flags
Specifies whether to bail out (DSE) or return NULL (NO_DSE) if the
requested memory isn’t available
Returns
A handle to the allocated block of memory, or NULL if the requested memory isn’t
available.
FDK Programmer’s Reference
69
3
FDK Function Reference
F_ApiAddCols()
Example
The following code allocates a block of memory to a handle, clears the memory, and
then stores some data to it. After storing data to the memory, it unlocks and frees the
handle.
. . .
HandleT hndl = NULL;
UCharT *ptr;
UIntT i;
hndl = F_AllocHandle(66000, NO_DSE);
if(hndl == NULL)
{
F_Printf(NULL, "Couldn't allocate handle.\n");
return;
}
F_ClearHandle(hndl);
ptr = F_LockHandle(hndl);
/* Stuff the block of memory with a bunch of 9s. */
for(i= 0; i < 66000; i++)
ptr[i] = '9';
F_FreeHandle(hndl);
. . .
See also
“F_Alloc()” on page 68, “F_LockHandle()” on page 577, and “F_UnlockHandle()” on
page 714.
F_ApiAdd Cols()
F_ApiAddCols() adds columns to a table.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiAddCols(F_ObjHandleT docId,
F_ObjHandleT tableId,
IntT refColNum,
IntT direction,
IntT numNewCols);
70
FDK Programmer’s Reference
F_ApiAddCols()
...
FDK Function Reference
Arguments
docId
The ID of the document containing the table.
tableId
The ID of the table.
refColNum
The column at which to start adding columns. The columns are numbered
from left to right starting with column 0.
direction
The direction from the reference column in which to add columns. To add
columns to the left of the reference column, specify FV_Left. To add them
to the right, specify FV_Right.
numNewCols
The number of columns to add.
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiAddCols() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadParameter
The function call specified an invalid parameter
FE_BadObjId
Invalid object ID
FE_BadOperation
The function call specified an illegal operation
Example
The following code adds a column to the right of the first column in the selected table:
. . .
F_ObjHandleT docId, tblId;
/* Get the document and table IDs. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tblId = F_ApiGetId(FV_SessionId, docId, FP_SelectedTbl);
/* Add the column. */
F_ApiAddCols(docId, tblId, 0, FV_Right, 1);
. . .
See also
“F_ApiAddRows()” on page 78.
FDK Programmer’s Reference
71
3
FDK Function Reference
F_ApiAddCommandToMenu()
F_ApiAddCommandToMenu()
F_ApiAddCommandToMenu() adds a FrameMaker product command or a clientdefined command to a menu.
F_ApiAddCommandToMenu() adds the command at the bottom of the specified
menu. To change a command’s position on a menu, set its
FP_PrevMenuItemInMenu and FP_NextMenuItemInMenu properties. For more
information on arranging menus and menu items, see “Arranging menus and menu
items” on page 388 of the FDK Programmer’s Guide.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiAddCommandToMenu(F_ObjHandleT toMenuId,
F_ObjHandleT commandId);
Arguments
toMenuId
The ID of the menu to which to add the command
commandId
The ID of the command
To add a command that you have created, set commandId to the ID returned by the
F_ApiDefineCommand() or F_ApiDefineCommandEx() call that created the
command.
To add a FrameMaker product command, you must get its ID. To get its ID, call
F_ApiGetNamedObject() with the objectName parameter set to its name. For
example, to get the ID of the Copy command, use the following code:
. . .
F_ObjHandleT copyCmdId;
copyCmdId = F_ApiGetNamedObject(FV_SessionId, FO_Command,
"Copy");
. . .
To add a command to a menu that you have created, set toMenuId to the ID returned
by F_ApiDefineMenu() or F_ApiDefineAndAddMenu() when you created the
menu.
To add a menu item to a FrameMaker product menu, you must get the menu’s ID by
calling F_ApiGetNamedObject() with the objectName parameter set to the
menu’s name.
72
FDK Programmer’s Reference
F_ApiAddCommandToMenu()
...
FDK Function Reference
The [Files] section of the maker.ini file specifies the location of the menu and
command configuration files that list FrameMaker’s menus and commands.
Users can create custom menu files that override the default menus and commands. For
more information, see your FrameMaker product installation documentation.
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiAddCommandToMenu() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_NotCommand
commandId doesn’t specify a command
FE_NotMenu
toMenuId doesn’t specify a menu
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
Example
The following code creates a command named MyCommand and adds it to the File
menu. It also adds the FrameMaker product command UpperCaseText to the File
menu. It then rearranges the commands on the menu so that the two newly added
commands appear first:
FDK Programmer’s Reference
73
3
FDK Function Reference
F_ApiAddMenuToMenu()
. . .
#define MY_CMD 1
F_ObjHandleT cmdId, ucCmdId, menuId;
/* Create the command. */
cmdId = F_ApiDefineCommand(MY_CMD, "MyCommand",
"My Command", "\\!MC");
/* Get the ID of the file menu and the UpperCaseText command. */
menuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu, "FileMenu");
ucCmdId = F_ApiGetNamedObject(FV_SessionId,
FO_Command, "UpperCaseText");
/* Add the two commands to the File menu. */
F_ApiAddCommandToMenu(menuId, cmdId);
F_ApiAddCommandToMenu(menuId, ucCmdId);
/* Set command object properties to rearrange menu items. */
F_ApiSetId(FV_SessionId, menuId, FP_FirstMenuItemInMenu, cmdId);
F_ApiSetId(menuId, ucCmdId, FP_PrevMenuItemInMenu, cmdId);
. . .
See also
“F_ApiDefineCommand()” on page 137, “F_ApiDefineAndAddCommand()” on
page 126, and “F_ApiGetNamedObject()” on page 214.
F_ApiAddMenuToMenu()
F_ApiAddMenuToMenu() adds a FrameMaker product menu or a menu that you have
created to another menu or menu bar.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiAddMenuToMenu(F_ObjHandleT toMenuId,
F_ObjHandleT menuId);
74
FDK Programmer’s Reference
F_ApiAddMenuToMenu()
...
FDK Function Reference
Arguments
toMenuId
The ID of the menu to which the new menu is to be added
menuId
The ID of the new menu
To add a menu to a menu or menu bar that you have created, set
toMenuId to the ID returned by the F_ApiDefineMenu() or
F_ApiDefineAndAddMenu() call that created the menu or menu bar.
To add a menu to one of the FrameMaker product’s menus or menu bars, you must get
the menu or menu bar’s ID. To get its ID, call F_ApiGetNamedObject() with the
objectName parameter set to its name. For example, to get the ID of the Book main
menu bar, use the following code:
. . .
F_ObjHandleT mainMenuId;
mainMenuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"!BookMainMenu");
. . .
The [Files] section of the maker.ini file specifies the location of the menu and command
configuration files that list FrameMaker’s menus and commands.
..............................................................................
IMPORTANT: Your menu appears only on the menu bar you specify. For example, if you
only add a menu to the !MakerMainMenu menu bar, the menu will not appear if the
user switches to quick menus. For your menu to appear after the user has switched to
quick menus, you must also add it to !QuickMakerMainMenu.
..............................................................................
The following table lists the types of menus you can add a menu to and how the
FrameMaker product implements the added menu.
Type of menu or menu
bar you are adding a
menu to
How the FrameMaker product
implements the added menu
Where the FrameMaker
product adds the menu
Menu bar
Pull-down menu
At the right of the menu
bar
Pull-down menu
Pull-right menu
At the bottom of the pulldown menu
FDK Programmer’s Reference
75
3
FDK Function Reference
F_ApiAddMenuToMenu()
Type of menu or menu
bar you are adding a
menu to
How the FrameMaker product
implements the added menu
Where the FrameMaker
product adds the menu
Pop-up menu
Pull-right menu
At the bottom of the popup menu
Pull-right menu
Pull-right menu
At the bottom of the pullright menu
To change a menu’s position on a menu or menu bar after you add it, set its
FP_PrevMenuItemInMenu and FP_NextMenuItemInMenu properties. For more
information on arranging menus and menu items, see “Arranging menus and menu
items” on page 388 of the FDK Programmer’s Guide.
76
FDK Programmer’s Reference
F_ApiAddMenuToMenu()
...
FDK Function Reference
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiAddMenuToMenu() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_NotMenu
toMenuId and menuId don’t specify menus
FE_BadOperation
Parameters specify an invalid operation
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
Example
The following code creates a menu with one command and adds it to the FrameMaker
main menu bar (for both complete and quick menus):
. . .
#define MY_CMD 1
F_ObjHandleT quickMenuBarId, menubarId, menuId, cmdId;
/* Create the menu, then create a command and add it. */
menuId = F_ApiDefineMenu("APIMenu", "API Menu");
cmdId = F_ApiDefineAndAddCommand(MY_CMD, menuId, "MyCmd",
"My Cmd", "");
/* Get ID of FrameMaker main menu (complete menus). */
menubarId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"!MakerMainMenu");
/* Get ID of FrameMaker main menu (quick menus). */
quickMenuBarId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"!QuickMakerMainMenu");
/* Add the menu to the menu bars. */
F_ApiAddMenuToMenu(menubarId, menuId);
F_ApiAddMenuToMenu(quickMenuBarId, menuId);
. . .
FDK Programmer’s Reference
77
3
FDK Function Reference
F_ApiAddRows()
See also
“F_ApiDefineMenu()” on page 141, “F_ApiDefineAndAddMenu()” on page 134, and
“F_ApiGetNamedObject()” on page 214.
F_ApiAdd Rows()
F_ApiAddRows() adds one or more rows to a table.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiAddRows(F_ObjHandleT docId,
F_ObjHandleT refRowId,
IntT direction,
IntT numNewRows);
Arguments
docId
The ID of the document containing the table.
refRowId
The ID of the row at which to starting adding rows.
direction
The direction from the reference row in which to add rows. For a list of the
constants you can specify, see the table below.
numNewRows
The number of rows to add.
The following table lists the constants you can specify for direction.
Direction constant
78
Meaning
FV_Above
Add rows above the row specified by refRowId. The added rows
are the same type as the row specified by refRowId.
FV_Below
Add rows below the row specified by refRowId. The added rows
are the same type as the row specified by refRowId.
FV_Body
Add body rows at the bottom of the existing body rows (refRowId
is used to determine which table to add rows to).
FV_Footing
Add footing rows at the bottom of the existing footing rows
(refRowId is ignored).
FV_Heading
Add heading rows at the bottom of the existing heading rows
(refRowId is ignored).
FDK Programmer’s Reference
F_ApiAddRows()
...
FDK Function Reference
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiAddRows() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this operation
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid row ID
FE_BadOperation
Parameters specify an invalid operation
FE_BadParameter
Parameter has an invalid value
Example
The following code adds two rows after the first row of the selected table:
. . .
F_ObjHandleT docId, tblId, row1Id;
/* Get the document and table IDs. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tblId = F_ApiGetId(FV_SessionId, docId, FP_SelectedTbl);
/* Get the ID for row 1. */
row1Id = F_ApiGetId(docId, tblId, FP_FirstRowInTbl);
/* Add the rows. */
F_ApiAddRows(docId, row1Id, FV_Below, 2);
. . .
See also
“F_ApiAddCols()” on page 70.
FDK Programmer’s Reference
79
3
FDK Function Reference
F_ApiAddText()
F_ApiAddTe xt()
F_ApiAddText() inserts text into a paragraph or a text line.
Synopsis
#include "fapi.h"
. . .
F_TextLocT F_ApiAddText(F_ObjHandleT docId,
F_TextLocT *textLocp,
StringT text);
Arguments
docId
The ID of the document
textLocp
The text location at which to add the text
text
The text to add
The text you specify for text must use the FrameMaker product character set. To add
special characters, you must specify octal (\) or hexadecimal (\x) sequences. The
following table lists some of these sequences.
80
Special character
Hexadecimal
representation
Octal
representation
>
\x3e
\76
" (straight double quotation mark)
\x22
\42
“ (left double quotation mark)
\xd2
\322
” (right double quotation mark)
\xd3
\323
FDK Programmer’s Reference
F_ApiAddText()
...
FDK Function Reference
For a complete list of the characters in the FrameMaker product character set and the
corresponding hexadecimal codes, see your Frame product user’s manual. If you are not
using ANSI C, you must specify octal (\) sequences instead of hexadecimal codes. If
you are using ANSI C, you can specify either octal or hexadecimal sequences.
Returns
The text location of the end of the text that was added. If it fails, the returned text
location is invalid.
If F_ApiAddText() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID.
FE_BadObjId
Invalid object ID.
FE_NotTextObject
The object that textLocp specifies is not a
paragraph (FO_Pgf) or a text line
(FO_TextLine).
FE_OffsetNotFound
The offset specified for the text location couldn’t be
found in the specified text object.
FE_ReadOnly
The specified document is read-only.
FE_BadSelectionForOperation
The location that textLocp specifies is invalid.
For example, it is inside a variable or outside the
highest level element in a structured document.
FDK Programmer’s Reference
81
3
FDK Function Reference
F_ApiAlert()
Example
To add the following text at the insertion point (or the end of the current text selection),
The new CoffeeTool
is now on sale.
use the following code:
. . .
F_TextLocT trm;
F_TextRangeT tr;
F_ObjHandleT docId;
/* Get current text selection. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId,docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
/* Add text. Use octal 011 for Return (end of paragraph). */
trm = F_ApiAddText(docId, &tr.end, "The new CoffeeTool\011");
/* Add more text to the end of the text that was just added. */
F_ApiAddText(docId, &trm, "is now on sale.");
. . .
See also
“F_ApiGetText()” on page 249 and “F_ApiDeleteText()” on page 151.
F_ApiAlert ()
F_ApiAlert() displays an alert box with a message. Depending on the constant you
specify for type, it displays either OK and Cancel buttons, Yes and No buttons, or a
Continue button.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiAlert(StringT message, IntT type);
82
FDK Programmer’s Reference
F_ApiAlert()
...
FDK Function Reference
Arguments
message
The message that appears in the dialog box. If the message is longer than 255
characters, it is truncated.
type
The dialog box type. See below for dialog types.
Specify one of the following constants for the type argument:
type constant
Type of dialog box displayed
FF_ALERT_OK_DEFAULT
Displays OK and Cancel buttons; OK is the default
FF_ALERT_CANCEL_DEFAULT
Displays OK and Cancel buttons; Cancel is the default
FF_ALERT_CONTINUE_NOTE
Displays Ok button
FF_ALERT_CONTINUE_WARN
Displays Ok button with a warning indication
FF_ALERT_YES_DEFAULT
Displays Yes and No buttons; Yes is the default
FF_ALERT_NO_DEFAULT
Displays Yes and No buttons; No is the default
Returns
0 if the user clicked OK, Continue, or Yes; -1 if the user clicked
Cancel or No.
Example
Use the code shown in Figure 2-1 and Figure 2-2 to produce the following alert boxes.
F_ApiAlert("This alert is an OK_DEFAULT.", FF_ALERT_OK_DEFAULT);
FDK Programmer’s Reference
83
3
FDK Function Reference
F_ApiAlert()
F_ApiAlert("This alert is a CANCEL_DEFAULT.", FF_ALERT_CANCEL_DEFAULT);
F_ApiAlert("This alert is a CONTINUE_NOTE.", FF_ALERT_CONTINUE_NOTE);
F_ApiAlert("This alert is a CONTINUE_WARN.", FF_ALERT_CONTINUE_WARN);
Figure 2-1 Sample code for alert boxes
F_ApiAlert("This alert is a YES_DEFAULT.", FF_ALERT_YES_DEFAULT);
84
FDK Programmer’s Reference
F_ApiAlive()
...
FDK Function Reference
F_ApiAlert("This alert is a NO_DEFAULT.", FF_ALERT_NO_DEFAULT);
Figure 2-2 Sample code for alert boxes
F_ A p i A l i v e ( )
Checks whether the current asynchronous client has a connection with a FrameMaker
process. Use it after registering the asynchronous client via
F_ApiWinConnectSession().
Synopsis
#include "f_stdio.h"
. . .
IntT F_ApiAlive (VoidT);
Returns
If there is a current connection to a FrameMaker process, this function returns a positive
integer. Otherwise it returns 0.
See also
F_ApiWinConnectSession()
F_ApiAllocatePropVals()
F_ApiAllocatePropVals() allocates memory for a property list.
Synopsis
#include "fapi.h"
. . .
F_PropValsT F_ApiAllocatePropVals(IntT numProps);
FDK Programmer’s Reference
85
3
FDK Function Reference
F_ApiAllocateTextItems()
Arguments
numProps
The number of properties in the property list
Returns
A property list (an F_PropValsT data structure).
The returned F_PropValsT structure references memory that is allocated by the API.
Use F_ApiDeallocatePropVals() to free this memory when you are done with it.
If F_ApiAllocatePropVals() fails, the API sets the len field of the returned
structure to 0.
Example
The following code allocates memory for an Open script (property list):
. . .
F_PropValsT openParams;
openParams = F_ApiAllocatePropVals(FS_NumOpenParams);
if(openParams.len == 0) return;
/* Use property list here. */
/* We’re done with the property list, so we deallocate it. */
F_ApiDeallocatePropVals(&openParams);
. . .
See also
“F_ApiDeallocateStructureType()” on page 125.
F _ A p i A l l o c a t eTe x t It e ms ()
F_ApiAllocateTextItems() allocates memory for an F_TextItemsT structure
and the array of text items that it references.
Synopsis
#include "fapi.h"
. . .
F_TextItemsT F_ApiAllocateTextItems(IntT numTextItems);
86
FDK Programmer’s Reference
F_ApiAllocateTextItems()
...
FDK Function Reference
Arguments
numTextItems
The number of text items to allocate
FDK Programmer’s Reference
87
3
FDK Function Reference
F_ApiApplyAttributeExpression()
Returns
An F_TextItemsT structure.
The returned F_TextItemsT structure references memory that is allocated by the
API. Use F_ApiDeallocateTextItems() to free this memory when you are done
with it.
If F_ApiAllocateTextItems() fails, the API sets the len field of the returned
structure to 0.
Example
The following code allocates ten text items:
. . .
F_TextItemsT tis;
tis = F_ApiAllocateTextItems(10);
. . .
See also
“F_ApiGetText()” on page 249.
F_ApiApplyAttributeExpre ssion()
Applies an attribute expression to a document to perform attribute-based-filtering.
Synopsis
#include "fapi.h"
...
IntT F_ApiApplyAttributeExpression(F_ObjHandleT docId,
F_ObjHandleT attrExprId);
Arguments
88
docId
The ID of the document to which the attribute
expression is to be applied.
attrExprId
The ID of the attribute expression to be applied to
the document.
FDK Programmer’s Reference
F_ApiApplyAttributeExpressionAsCondition()
...
FDK Function Reference
Returns
FE_Success if it succeeds, or an error code if an error occurs. If
F_ApiApplyAttributeExpression() fails, the API assigns one of the following
values to FA_errno.
FA_errno Value
Meaning
FE_BadDocId
FE_BadObjId
FE_InvalidAttrExpr
Invalid document ID.
FE_WrongProduct
The current FrameMaker product doesn't support
the operation.
FE_SystemError .
Couldn't allocate memory
Invalid expression ID.
The attribute expression being invalid cannot be
applied to the document
Example
The following code applies the expression named 'WebOutput' to the document.
. . .
F_ObjHandleT attrExprId = F_ApiGetNamedObject(docId,
FO_AttrCondExpr,"WebOutput");
F_ApiApplyAttributeExpression(docId, attrExprId);
...
F_ApiApplyAttributeExpre ssionAsCondition()
Applies an attribute-based expression to the document where the filtered text is
converted to conditional text.
Synopsis
#include "fapi.h"
...
StatusT F_ApiApplyAttributeExpressionAsCondition(
F_ObjHandleT docId,
F_ObjHandleT attrExpId,
F_ObjHandleT condId,
BoolT removePreviouslyApplied);
FDK Programmer’s Reference
89
3
FDK Function Reference
F_ApiApplyPageLayout()
Arguments
docId
The ID of the document on which attrExpId is to be
applied
attrExpId
The ID of the attribute expression to be applied on the
document
condId
The ID of the conditional text format that will be
applied on the filtered text
removePreviouslyApplied
If true, then remove the conditional text settings at all
locations in the document, whereever condId is
applied.
Returns
If succeeds: FE_Success
If an error occurs: An error code
If API fails, the API assigns one of the following values to FA_errno:
FA_errno value
Meaning
FE_Success
Operation is successful
FE_BadDocId
Invalid document ID
FE_InvalidAttrExpr
The expression string set in the attrExpId's object is
invalid
FE_WrongProduct
Current product interface isn’t Structured FrameMaker
FE_BadObjId
Invalid object ID
F_ApiApplyPageLayout()
F_ApiApplyPageLayout() applies a page’s layout to another page.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiApplyPageLayout(F_ObjHandleT docId,
F_ObjHandleT destPage,
F_ObjHandleT srcPage);
90
FDK Programmer’s Reference
F_ApiApplyPageLayout()
...
FDK Function Reference
Arguments
docId
The document containing the pages
destPage
The page with the layout to apply
srcPage
The page to which to apply the layout
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiApplyPageLayout() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
Example
The following code applies the layout of the Right master page to the
current page:
. . .
F_ObjHandleT docId, curPageId, rtPageId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
curPageId = F_ApiGetId(FV_SessionId, docId, FP_CurrentPage);
rtPageId = F_ApiGetId(FV_SessionId, docId, FP_RightMasterPage);
F_ApiApplyPageLayout(docId, curPageId, rtPageId);
. . .
See also
“F_ApiSimpleImportFormats()” on page 462.
FDK Programmer’s Reference
91
3
FDK Function Reference
F_ApiBailOut()
F_ApiBailOut()
F_ApiBailOut() allows your client to bail out. When your client calls
F_ApiBailOut(), the FrameMaker product waits until it returns control from the
current callback, and then exits it, saving system resources.
After your client has bailed out, the FrameMaker product still processes events that
affect it. Menus your client created are still valid. If your client has requested
notification for particular events, the FrameMaker product continues to monitor those
events. It also monitors apiclient hypertext commands that specify your client’s
name. If these events occur, the FrameMaker product restarts your client by calling its
F_ApiInitialize() function with initialization set to
FA_Init_Subsequent.
..............................................................................
IMPORTANT: If your client bails out, it loses all its global variable settings.
..............................................................................
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiBailOut();
Arguments
None.
Returns
VoidT.
If F_ApiBailOut() fails, the API assigns the following value to FA_errno.
92
FA_errno value
Meaning
FE_Transport
A transport error occurred
FDK Programmer’s Reference
F_ApiCallClient()
...
FDK Function Reference
Example
The following code bails out if the FrameMaker product currently running is not
FrameMaker:
. . .
StringT product;
product = F_ApiGetString(0, FV_SessionId, FP_ProductName);
if (!F_StrEqual(product, "FrameMaker"))
{
F_ApiAlert ("FDK client requires FrameMaker to run.",
FF_ALERT_CONTINUE_WARN);
F_ApiBailOut();
/* Bail out is not effective until return. */
return;
}
. . .
F_ApiCallC lient()
F_ApiCallClient() allows a client to call another client. It is useful for calling
Structured FrameMaker clients, such as the structure generator and the element catalog
manager.
F_ApiCallClient() calls the F_ApiNotify() function of the target client, with
notification set to FA_Note_ClientCall, docId set to 0, and sparm set
to the string specified by arg. To receive the notification sent by
F_ApiCallClient(), the target client must be registered and must have requested
the FA_Note_ClientCall notification, as shown in the
following code:
. . .
F_ApiNotification(FA_Note_ClientCall, True);
. . .
FDK Programmer’s Reference
93
3
FDK Function Reference
F_ApiCenterOnText()
Synopsis
#include "fapi.h"
. . .
IntT F_ApiCallClient(StringT clname,
StringT arg);
Arguments
clname
The registered name of the target client. For the names of FrameMakwe
clients, see the table below.
arg
A string that is passed to the target client.
Returns
FE_Success if it succeeds, or the value specified by the target client’s last call to
F_ApiReturnValue(). Note that calls to the structure generator always return
FE_Success no matter what string is passed to it as an argument.
If F_ApiCallClient() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_NameNotFound
There is no client with the specified name in the current
FrameMaker product session
FE_BadParameter
For the TableSort client only:
One of the arguments is invalid. For example, you gave a value for
the sort key that is greater than the number of columns or rows in
the current table selection, or you have no table cells selected.
F_ApiCenterOnText()
F_ApiCenterOnText() centers a range of text so the middle of the text appears in
the middle of the document window.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiCenterOnText(F_ObjHandleT docId,
F_TextRangeT *textRangep);
94
FDK Programmer’s Reference
F_ApiCenterOnText()
...
FDK Function Reference
Arguments
docId
The ID of the document containing the text range
textRangep
The range of text to center
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiCenterOnText() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadRange
The specified text range is invalid
FE_NotTextObject
One of the objects specified for textRangep isn’t a paragraph
(FO_Pgf) or a text line (FO_TextLine)
FE_OffsetNotFound
The offset specified for the text location couldn’t be found in the
specified paragraph or text line
Example
The following code centers the text selection or insertion point:
. . .
F_ObjHandleT docId;
F_TextRangeT tr;
/* Get current text selection */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
F_ApiCenterOnText(docId, &tr);
. . .
See also
“F_ApiScrollToText()” on page 404.
FDK Programmer’s Reference
95
3
FDK Function Reference
F_ApiCheckStatus()
F_ApiCheckStatus()
F_ApiCheckStatus() checks the scripts returned by F_ApiOpen(),
F_ApiImport(), F_ApiSave(), and F_ApiUpdateBook() to determine if a
specified status bit is set.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiCheckStatus(F_PropValsT *p,
IntT statusBit);
Arguments
p
The property list returned by F_ApiOpen(), F_ApiSave(),
F_ApiImport(), or F_ApiUpdateBook()
statusBit
The status bit to test
Returns
True if the bit is set; otherwise, False.
Example
The following code determines whether fonts were mapped after a document is opened
successfully:
. . .
F_PropValsT returnParams;
returnParams = F_ApiAllocatePropVals(FS_NumOpenReturnParams);
. . .
/* Call to F_ApiOpen() goes here. */
if (F_ApiCheckStatus(&returnParams, FV_FontsWereMapped))
F_ApiAlert("Unavailable fonts were mapped.",
FF_ALERT_CONTINUE_NOTE);
. . .
See also
“F_ApiAddRows()” on page 78, “F_ApiOpen()” on page 355, “F_ApiSave()” on
page 399, and “F_ApiUpdateBook()” on page 480.
96
FDK Programmer’s Reference
F_ApiChooseFile()
...
FDK Function Reference
F_ApiChooseFile()
F_ApiChooseFile() displays dialog boxes similar to a Frame product’s Open and
Save dialog boxes. It displays directories and files in a scroll list and allows the user to
choose a file or directory.
Depending on the platform you are running your client on and the constant you specify
for mode, the dialog box can provide Select, Open, Save, Use, or Cancel buttons. If the
user clicks Select, Open, Save, or Use, F_ApiChooseFile() stores the selected file
or directory’s pathname to *choice. If the user clicks Cancel,
F_ApiChooseFile() does not assign a value to *choice.
..............................................................................
IMPORTANT: F_ApiChooseFile() allocates memory for the string referenced by
*choice. Use F_Free() to free the string when you are done with it.
..............................................................................
Synopsis
#include "fapi.h"
. . .
IntT F_ApiChooseFile(StringT *choice,
StringT title,
StringT directory,
StringT stuffVal,
IntT mode,
StringT helpLink);
FDK Programmer’s Reference
97
3
FDK Function Reference
F_ApiChooseFile()
Arguments
choice
The selected pathname when the user clicks OK.
title
The message that appears in the dialog box.
directory
The default directory when the dialog box is first displayed. If you specify an
empty string, the last directory used by an FDK client is used. If no FDK
client has used a directory, the directory specified by the session property,
FP_OpenDir, is used.
stuffVal
The default value that appears in the input field when the dialog box first
appears. If the dialog box type specified by mode doesn’t have an input
field, this string is ignored.
mode
A constant specifying the type of dialog box. See the table below for possible
values.
helpLink
Obsolete for versions 6.0 and later; pass an empty string.
The name of a document containing help information for the dialog box or an
empty string ("") if there is no help document.
You can specify the following values for mode.
mode constant
Dialog box type
FV_ChooseSelect
Dialog box that allows the user to choose a file by
clicking Select. It provides an input field that the user
can type a filename in.
FV_ChooseOpen
Dialog box that allows the user to choose a file by
clicking Open. It provides an input field that the user
can type a filename in.
FV_ChooseSave
Dialog box that allows the user to select a file. It
provides Save and Cancel buttons and an input field.
FV_ChooseOpenDir
Dialog box that allows the user to choose a directory.
Returns
0 if the user clicked Open, Select, Use, or Save; a nonzero value if the user clicked
Cancel or an error occurred.
If F_ApiChooseFile() fails, the API assigns the following value to FA_errno.
98
FA_errno value
Meaning
FE_Transport
A transport error occurred
FDK Programmer’s Reference
F_ApiChooseFile()
...
FDK Function Reference
Example
The following code displays the dialog boxes shown in Figure 2-3, Figure 2-4, and
Figure 2-5
. . .
IntT err;
StringT sres;
err = F_ApiChooseFile(&sres, "Choose a file to open.",
"", "", FV_ChooseOpen, "");
if (!err) F_ApiDeallocateString(&sres);
err = F_ApiChooseFile(&sres, "Select a file.",
"", "", FV_ChooseSelect, "");
if (!err) F_ApiDeallocateString(&sres);
err = F_ApiChooseFile(&sres, "Choose a file to save.", "",
"myfile.doc", FV_ChooseSave, "");
if (!err) F_ApiDeallocateString(&sres);
. . .
Figure 2-3 FV_ChooseFile dialog box
FDK Programmer’s Reference
99
3
FDK Function Reference
F_ApiClear()
Figure 2-4 FV_ChooseSelect dialog box
Figure 2-5 FV_ChooseSave dialog box
See also
“F_ApiScrollBox()” on page 402.
F _ A p i C l e a r( )
F_ApiClear() deletes the current selection from a document.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiClear(F_ObjHandleT docId
IntT flags);
100
FDK Programmer’s Reference
F_ApiClear()
...
FDK Function Reference
Arguments
docId
The ID of the document from which to clear the selection.
flags
Bit field that specifies how to clear the text and how to handle interactive alerts. For
default settings, specify 0.
If you specify 0 for flags, F_ApiClear() suppresses any interactive alerts or
warnings that arise, leaves the selected table cells empty, and deletes hidden text. You
can also OR the following values into flags.
flags constant
Meaning
FF_INTERACTIVE
Prompt user with dialog or alert boxes that arise
FF_CUT_TBL_CELLS
Remove cleared table cells
FF_VISIBLE_ONLY
Clear only the visible portion of the selection
FF_DONT_DELETE_HIDDEN_TEXT
Don’t delete hidden text
The FF_INTERACTIVE flag takes precedence over other flags. So, if you specify
FF_INTERACTIVE | FF_DONT_DELETE_HIDDEN_TEXT and the selection contains
hidden text, the Frame product allows the user to choose whether to delete the hidden
text.
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiClear() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadSelectionForOperation
Current selection is invalid for this operation
FE_Canceled
User or parameters canceled the operation
FE_WrongProduct
Current Frame product doesn’t support requested
operation
FDK Programmer’s Reference 101
3
FDK Function Reference
F_ApiClearAllChangebars()
Example
The following code extends the text selection to the end of the paragraph, and then
deletes it:
. . .
F_TextRangeT tr;
F_ObjHandleT docId, pgfId, nextpgfId;
/* Get current text selection. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
/* Get ID of next paragraph and extend selection to it. */
nextpgfId = F_ApiGetId(docId, tr.end.objId, FP_NextPgfInFlow);
if (nextpgfId)
{
tr.end.objId = nextpgfId;
tr.end.offset = 0;
F_ApiSetTextRange(FV_SessionId, docId, FP_TextSelection,&tr);
}
F_ApiClear(docId, 0);
. . .
See also
“F_ApiCopy()” on page 115, “F_ApiCut()” on page 123, and “F_ApiPaste()” on
page 364.
F_ A p i C l e a rA llC h an gebars()
F_ApiClearAllChangebars() clears change bars from a specified document. It
executes the same command as clicking the Clear All Change Bars box in the Change
Bars dialog box.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiClearAllChangebars(F_ObjHandleT docId);
102
FDK Programmer’s Reference
F_ApiClientDir()
...
FDK Function Reference
Arguments
docId
The ID of the document for which to clear the change bars
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiClearAllChangebars() fails, the API assigns one of the following values
to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Bad document ID
FE_WrongProduct
Current Frame product doesn’t support this operation
FE_SystemError
System error
Example
The following code removes the change bars from the current document:
. . .
F_ObjHandleT docId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
F_ApiClearAllChangebars(docId);
. . .
F _ A p i C l i e n t D i r( )
F_ApiClientDir() returns the name of the current FDK client’s directory, which is
the directory that contains the client’s DLL.
Synopsis
#include "fapi.h"
. . .
StringT F_ApiClientDir(VoidT);
Arguments
None.
FDK Programmer’s Reference 103
3
FDK Function Reference
F_ApiClientName()
Returns
The name of the current FDK client’s directory if it succeeds, or NULL if an error
occurs. If you get a NULL string, you should check FA_errno; if it is set to
FE_Success, then there is no statement in the apiclients file. To
provide a client directory, use F_ApiSetClientDir(). For more information, see
“F_ApiSetClientDir()” on page 412.
If F_ApiClientDir() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
..............................................................................
IMPORTANT: Use F_Free() to free the string returned by F_ApiClientDir()
when you are done with it.
..............................................................................
Example
The following code displays the name of the directory containing the current FDK client
in an alert box:
. . .
#include "fmemory.h"
StringT clientDir;
clientDir = F_ApiClientDir();
F_ApiAlert(clientDir, FF_ALERT_CONTINUE_NOTE);
F_Free(clientDir);
. . .
See also
“F_ApiSetClientDir()” on page 412 and “F_ApiClientName()” on page 104.
F_ApiClientName( )
F_ApiClientName() returns the registered name of the current client (the client that
calls F_ApiClientName()). For more information on registering FDK clients, see
the FDK Platform Guide for your platform.
104
FDK Programmer’s Reference
F_ApiClientName()
...
FDK Function Reference
Synopsis
#include "fapi.h"
. . .
StringT F_ApiClientName(VoidT);
Arguments
None.
Returns
The registered name of the current client if it succeeds, or NULL if an error occurs.
If F_ApiClientName() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
..............................................................................
IMPORTANT: Use F_Free() to free the string returned by F_ApiClientName()
when you are done with it.
..............................................................................
Example
The following code displays the registered name of the current FDK client in an alert
box:
. . .
#include "fmemory.h"
StringT clientName;
clientName = F_ApiClientName();
F_ApiAlert(clientName, FF_ALERT_CONTINUE_NOTE);
F_Free(clientName);
. . .
See also
“F_ApiClientDir()” on page 103.
FDK Programmer’s Reference 105
3
FDK Function Reference
F_ApiClientPath()
F _ A p i C l i e n t P a th ()
F_ApiClientPath() returns the name of the current FDK client’s path, which is the
path that contains the client’s DLL.
Synopsis
#include "fapi.h"
. . .
StringT F_ApiClientPath(ConStringT clientName);
Arguments
None.
Returns
The name of the current FDK client’s path if it succeeds, or NULL if an error occurs..
If F_ApiClientPath() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
..............................................................................
IMPORTANT: Use F_Free() to free the string returned by F_ApiClientPath()
when you are done with it.
..............................................................................
Example
The following code displays the name of the path containing the current FDK client in
an alert box:
. . .
#include "fmemory.h"
StringT clientPath;
clientDir = F_ApiClientPath();
F_ApiAlert(clientDir, FF_ALERT_CONTINUE_NOTE);
F_Free(clientPath);
. . .
See also
“F_ApiClientDir()” on page 103 and “F_ApiClientName()” on page 104.
106
FDK Programmer’s Reference
F_ApiClose()
...
FDK Function Reference
F _ A p i C l o s e( )
F_ApiClose() closes a document, book, dialog box, or Frame session.
If there are unsaved changes in a file and you set FF_CLOSE_MODIFIED for the
flags argument, F_ApiClose() abandons the changes and closes the file anyway.
If you set flags to 0, F_ApiClose() aborts the Close operation and returns
FE_DocModified.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiClose(F_ObjHandleT Id,
IntT flags);
Arguments
Id
The ID of the document, book, dialog box, or session to close.
flags
Specifies whether to abort or to close open documents or books if they have unsaved
changes. Set the FF_CLOSE_MODIFIED flag to close open documents and books
regardless of their state.
To quit a Frame session, set Id to FV_SessionId.
..............................................................................
IMPORTANT: If you are closing an individual document or a dialog box, make sure Id
specifies an object ID and not 0. If Id is set to 0, F_ApiClose() quits the Frame
session, because the value of the FV_SessionId constant is 0. If you call
F_ApiClose() in the F_ApiDialogEvent() callback, call it only to close custom
modeless dialog boxes. Calling it for any other reason, such as ending the Frame
product session or closing a modal dialog box, will cause unexpected results.
..............................................................................
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiClose() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_DocModified
The document was modified and flags was set to 0
FDK Programmer’s Reference 107
3
FDK Function Reference
F_ApiClose()
Example
The following code closes the active document:
. . .
F_ObjHandleT docId;
IntT resp;
/* Get ID of active document. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
/* See whether document has been modified. */
if (F_ApiGetInt(FV_SessionId, docId, FP_DocIsModified))
resp = F_ApiAlert("Document changed. Close it anyway?",
FF_ALERT_OK_DEFAULT);
if (!resp) F_ApiClose (docId, FF_CLOSE_MODIFIED);
. . .
See also
“F_ApiSave()” on page 399.
108
FDK Programmer’s Reference
F_ApiCombinedFamilyFonts()
...
FDK Function Reference
F_ApiCombinedFamilyFonts()
F_ApiCombinedFamilyFonts() returns the permutations of angles, variations, and
weights available for a specified combined font definition.
..............................................................................
IMPORTANT: To return the permutations of a combined font family, you must use
F_ApiFamilyFonts(). For more information, see “F_ApiFamilyFonts()” on
page 165.
..............................................................................
Synopsis
#include "fapi.h"
. . .
F_CombinedFontsT F_ApiCombinedFamilyFonts
(F_ObjHandleT combinedFont);
Arguments
combinedFont
The object ID of a combined font definition
To get a list of combined font definitions, use FP_FirstCombinedFontDefnInDoc to
get the first combined font definition in the document. From that you can build a list of
combined font definitions using FP_NextCombinedFontDefnInDoc.
Returns
An F_CombinedFontsT structure provides a list of the permutations of angles,
variations, and weights available for the specified combined font definition.
F_CombinedFontsT is defined as:
typedef struct {
UIntT len;
F_CombinedFontT *val;
} F_CombinedFontsT;
F_CombinedFontT is defined as:
typedef struct {
F_ObjHandelT combinedFont; /* Combined font ID */
UIntT variation; /* Index of the font variation. */
UIntT weight; /* Index of the font weight. */
UIntT angle; /* Index of the font angle. */
} F_CombinedFontT;
FDK Programmer’s Reference 109
3
FDK Function Reference
F_ApiCombinedFamilyFonts()
Example
The following code loops through the combined fonts in a document and prints the
combined font name, the base and Western font family names, and the permutations for
the combined font:
. . .
#include "fapi.h"
#include "futils.h"
#include "fstrings.h"
. . .
UIntT i, base, west;
F_StringsT families, weights, variations, angles;
StringT cFontName;
F_CombinedFontsT perms;
F_ObjHandleT docId, cFontId;
. . .
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
/*Get lists of families, vars, weights, and angles for session*/
families = F_ApiGetStrings(0, FV_SessionId, FP_FontFamilyNames);
weights = F_ApiGetStrings(0, FV_SessionId, FP_FontWeightNames);
variations = F_ApiGetStrings(0, FV_SessionId,
FP_FontVariationNames);
angles = F_ApiGetStrings(0, FV_SessionId, FP_FontAngleNames);
/* Loop through combined font definitions for the doc */
cFontId = F_ApiGetId(FV_SessionId, docId,
FP_FirstCombinedFontDefnInDoc);
while (cFontId) {
/* Print combined font name, and base and Western family names
*/
cFontName = F_ApiGetString(docId, cFontId, FP_Name);
base = F_ApiGetInt(docId, cFontId, FP_BaseFamily);
west = F_ApiGetInt(docId, cFontId, FP_WesternFamily);
F_Printf(NULL, (StringT)
"\n%s is composed of the %s and %s font families.\n",
cFontName, families.val[base], families.val[west]);
110
FDK Programmer’s Reference
F_ApiCommand()
...
FDK Function Reference
/* Print the permutations of the combined font */
perms = F_ApiCombinedFamilyFonts(cFontId);
for (i = 0; i < perms.len; i++) {
F_Printf(NULL, (StringT)
"Variation: %s, Weight: %s, Angle: %s\n",
variations.val[perms.val[i].variation],
weights.val[perms.val[i].weight],
angles.val[perms.val[i].angle]);
}
/* Free the array of F_CombinedFontT structures and */
/* get the next combined font definition in the document. */
F_Free(perms.val);
cFontId = F_ApiGetId(docId, cFontId,
FP_NextCombinedFontDefnInDoc);
}
. . .
/* Free the string list structures. */
F_ApiDeallocateStrings(&families);
F_ApiDeallocateStrings(&weights);
F_ApiDeallocateStrings(&variations);
F_ApiDeallocateStrings(&angles);
F_ApiCommand()
F_ApiCommand() is a callback that you must define to respond to the user choosing
a menu item added by your client.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiCommand(command)
IntT command;
{
/* Code to respond to menu item choices goes here. */
}
FDK Programmer’s Reference
111
3
FDK Function Reference
F_ApiCompare()
Arguments
command
The cmd parameter from the
F_ApiDefineCommand(),F_ApiDefineCommandEx()or
F_ApiDefineAndAddCommand() call that created the menu item that the user
chose
Returns
VoidT.
Example
See “Responding to the user choosing a command” on page 209 of the FDK
Programmer’s Guide.
F_ApiCompare ()
F_ApiCompare() compares two documents or two books.
Synopsis
#include "fapi.h"
. . .
F_CompareRetT F_ApiCompare(F_ObjHandleT olderId,
F_ObjHandleT newerId,
IntT flags,
StringT insertCondTag,
StringT deleteCondTag,
StringT replaceText,
IntT compareThreshold);
112
FDK Programmer’s Reference
F_ApiCompare()
...
FDK Function Reference
Arguments
olderId
The ID of the older version of the document or book.
newerId
The ID of the newer version of the document or book.
flags
Bit flags that specify how to generate the summary and composite
documents. Specify 0 for the default flags.
insertCondTag
The condition tag to apply to insertions shown in the composite
document. For no insert condition tag,
specify NULL.
deleteCondTag
The condition tag to apply to deletions shown in the composite
document. For no delete condition tag,
specify NULL.
replaceText
Text to appear in place of the deleted text. For no replacement text,
specify NULL.
compareThreshold
Percentage of words that can change before paragraphs are
considered not equal. If two paragraphs are equal, word differences
between them are shown within a paragraph in the composite
document. If a paragraph is not equal to another, it is marked
inserted or deleted. To specify an 85% threshold, set
compareThreshold to 85. The default value is 75.
You can OR the values shown in the following table into the flags argument.
flags constant
Meaning
FF_CMP_SUMMARY_ONLY
Generate a summary document, but not a composite document
FF_CMP_CHANGE_BARS
Turn on change bars in the composite document
FF_CMP_HYPERLINKS
Put hypertext links in the summary document
FF_CMP_SUMKIT
Open the summary document
FF_CMP_COMPKIT
Open the composite document
FDK Programmer’s Reference
113
3
FDK Function Reference
F_ApiCompare()
Returns
An F_CompareRetT data structure. F_CompareRetT is defined as:
typedef struct {
F_ObjHandleT sumId; /* The ID of the summary document */
F_ObjHandleT compId; /* The ID of the composite document */
} F_CompareRetT;
If you use F_ApiCompare() to compare two books, it sets compId to 0.
If F_ApiCompare() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID.
FE_BadCompare
olderId and newerId don’t specify the same types of files.
FE_CompareTypes
One of the files isn’t a FrameMaker product document or book or one
file is a book and the other is a document.
FE_WrongProduct
Current FrameMaker product doesn’t support the operation.
Example
The following code opens two documents and compares them:
. . .
F_ObjHandleT oldId, newId;
IntT flags;
F_CompareRetT cmp;
oldId = F_ApiSimpleOpen("/tmp/old.doc", False);
newId = F_ApiSimpleOpen("/tmp/new.doc", False);
flags = FF_CMP_CHANGE_BARS | FF_CMP_COMPKIT;
cmp = F_ApiCompare(oldId, newId, flags, "Comment",
"", "REPLACED TEXT", 75);
if (!cmp.compId)
F_ApiAlert("Couldn’t compare", FF_ALERT_CONTINUE_NOTE);
. . .
114
FDK Programmer’s Reference
F_ApiConnectToSession()
...
FDK Function Reference
F_ApiConnectToSession()
F_ApiConnectToSession() connects the calling process to an existing
FrameMaker product session process.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiConnectToSession(ConStringT clientName,
ConStringT hostname,
IntT prognum);
Arguments
clientName
The registered name of the client
hostname
The host running the FrameMaker product session
prognum
The RPC number of the FrameMaker product session
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiConnectToSession() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_DupName
The client attempted to connect to the same session
FE_ReadOnly
The client attempted to connect to a session started with the
-noapi option
FE_OutOfRange
The client attempted to connect to a session of a
FrameMaker product version that doesn’t support this
function
FE_NameNotFound
There is no FrameMaker product session
See also
“F_ApiDisconnectFromSession()” on page 159
F_ApiCopy()
F_ApiCopy() copies the current selection to the FrameMaker product Clipboard.
FDK Programmer’s Reference
115
3
FDK Function Reference
F_ApiCopy()
Synopsis
#include "fapi.h"
. . .
IntT F_ApiCopy(F_ObjHandleT docId,
IntT flags);
Arguments
docId
The ID of the document from which to copy the selection.
flags
Bit field that specifies how to copy the text and how to handle interactive alerts. For
default settings, specify 0.
If you specify 0 for flags, F_ApiCopy() suppresses any interactive alerts or
warnings that arise. You can also OR the following values into flags.
flags constant
Meaning
FF_INTERACTIVE
Prompt user with dialog or alert boxes that arise
FF_STRIP_HYPERTEXT
Do not copy any hypertext markers in the selection
FF_VISIBLE_ONLY
Copy only the visible portion of the selection
The FF_INTERACTIVE flag takes precedence over other flags. So, if you specify
FF_INTERACTIVE | FF_VISIBLE_ONLY and the selection is not visible, the
FrameMaker product allows the user to choose whether to copy the selection.
116
FDK Programmer’s Reference
F_ApiCopy()
...
FDK Function Reference
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiCopy() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_WrongProduct
Current FrameMaker product doesn’t support
operation
FE_BadSelectionForOperation
Selection doesn’t support operation
FE_Canceled
User or parameters canceled the operation
FE_BadOperation
Parameters specified an invalid operation
Example
The following code selects the first 10 characters of the paragraph containing the
insertion point and copies them to the FrameMaker product Clipboard:
. . .
F_TextRangeT tr;
F_ObjHandleT docId, pgfId, nextpgfId;
/* Get current text selection. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId,docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
/* Set text selection. */
tr.beg.offset = 0;
tr.end.offset = 10;
F_ApiSetTextRange(FV_SessionId,docId, FP_TextSelection, &tr);
F_ApiCopy(docId, 0);
. . .
See also
“F_ApiClear()” on page 100, “F_ApiCut()” on page 123, and “F_ApiPaste()” on
page 364.
FDK Programmer’s Reference
117
3
FDK Function Reference
F_ApiCopyStructureType()
F_ApiCopy Str u c t u re Ty p e( )
The following functions copy frequently used API structures. These functions perform
a complete copy, copying any arrays or strings referenced by the structures.
Synopsis
#include "fapi.h"
. . .
F_AttributeT F_ApiCopyAttribute(F_AttributeT *fromattribute);
F_AttributeDefT F_ApiCopyAttributeDef(
F_AttributeDefT *fromattributedef);
F_AttributeDefsT F_ApiCopyAttributeDefs(
F_AttributeDefsT *fromattributedefs);
F_AttributesT F_ApiCopyAttributes(
F_AttributesT *fromattributes);
F_ElementCatalogEntriesT F_ApiCopyElementCatalogEntries(
F_ElementCatalogEntriesT *fromelementcatents);
F_FontsT F_ApiCopyFonts(F_FontsT *fonts);
F_IntsT F_ApiCopyInts(F_IntsT *fromints);
F_MetricsT F_ApiCopyMetrics(F_MetricsT *frommetrics);
F_PointsT F_ApiCopyPoints(F_PointsT *frompoints);
F_PropValT F_ApiCopyProp(F_PropValT *frompropp);
F_PropValsT F_ApiCopyPropVals(F_PropValsT *frompvp);
StringT F_ApiCopyString(ConStringT s);
F_StringsT F_ApiCopyStrings(F_StringsT *fromstrings);
F_TabT F_ApiCopyTab(F_TabT *fromtab);
F_TabsT F_ApiCopyTabs(F_TabsT *fromtabs);
F_TextItemT F_ApiCopyTextItem(F_TextItemT *fromtip);
F_TextItemsT F_ApiCopyTextItems(F_TextItemsT *fromip);
F_UBytesT F_ApiCopyUBytes(F_UBytesT *fromubytes);
F_UIntsT F_ApiCopyUInts(F_UIntsT *fromuints);
F_TypedValT F_ApiCopyVal(F_TypedValT *fromvalp);
Arguments
fromStructureType
The structure to copy
Returns
A copy of the specified structure.
118
FDK Programmer’s Reference
F_ApiCustomDoc()
...
FDK Function Reference
Example
The following code copies the list of font family names available in the current session:
. . .
F_StringsT familyNames, strs;
familyNames = F_ApiGetStrings(0, FV_SessionId,
FP_FontFamilyNames);
strs = F_ApiCopyStrings(&familyNames);
F_ApiDeallocateStrings(&familyNames);
. . .
F_ApiCustomDoc()
F_ApiCustomDoc() creates a new custom document using the FrameMaker
product’s default new document template. For more information on default new
document templates, see “Documents” on page 73 of the FDK Programmer’s Guide.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiCustomDoc(MetricT width,
MetricT height,
IntT numCols,
MetricT columnGap,
MetricT topMargin,
MetricT botMargin,
MetricT leftinsideMargin,
MetricT rightoutsideMargin,
IntT sidedness,
BoolT makeVisible);
Arguments
width
The document page width.
height
The document page height.
numCols
The default number of columns.
columnGap
The default column spacing.
FDK Programmer’s Reference
119
3
120
FDK Function Reference
F_ApiCustomDoc()
topMargin
The document page top margin.
botMargin
The document page bottom margin.
leftinsideMargin
The left margin for single-sided documents, or the inside margin
for double-sided documents.
rightoutsideMargin
The right margin for single-sided documents, or the outside
margin for double-sided documents.
sidedness
A constant that specifies whether the document is single-sided or
double-sided and on which side the document starts. See the
following table for the list of constants.
makeVisible
Specifies whether the document is visible after it is created. Set
to True to make the document visible.
FDK Programmer’s Reference
F_ApiCustomDoc()
...
FDK Function Reference
The sidedness argument can have the values shown in the following table.
sidedness constant
New document page characteristics
FF_Custom_SingleSided
Single-sided
FF_Custom_FirstPageRight
Double-sided, starting with a right page
FF_Custom_FirstPageLeft
Double-sided, starting with a left page
Returns
The ID of the new document if it is successful, or 0 if it fails.
If F_ApiCustomDoc() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this operation
FE_BadParameter
Parameter has an invalid value
Example
The following code creates a custom document with the properties specified in the
dialog box in Figure 2-6:
. . .
#define in ((MetricT) 65536*72) /* A Frame metric inch. */
F_ObjHandleT docId;
docId = F_ApiCustomDoc(F_MetricFractMul(in,17,2), 11*in, 1,
F_MetricFractMul(in,1,4), in, in, in, in,
FF_Custom_SingleSided, True);
. . .
FDK Programmer’s Reference 121
3
FDK Function Reference
F_ApiCustomDoc()
Figure 2-6 Custom document dialog box
See also
“F_ApiSimpleNewDoc()” on page 464 and “F_ApiOpen()” on page 355.
122
FDK Programmer’s Reference
F_ApiCut()
...
FDK Function Reference
F_ApiCut()
F_ApiCut() cuts the current selection to the FrameMaker product Clipboard.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiCut(F_ObjHandleT docId,
IntT flags);
Arguments
docId
The ID of the document from which to cut the current selection.
flags
Bit field that specifies how to cut the text and how to handle interactive alerts. For
default settings, specify 0.
If you specify 0 for flags, F_ApiCut() suppresses any interactive alerts or warnings
that arise, leaves selected table cells empty, and deletes hidden text. You can also OR
the following values into flags.
flags constant
Meaning
FF_INTERACTIVE
Prompt user with dialog or alert boxes that arise
FF_CUT_TBL_CELLS
Remove cut table cells
FF_VISIBLE_ONLY
Cut only the visible portion of the selection
FF_DONT_DELETE_HIDDEN_TEXT
Don’t cut hidden text
The FF_INTERACTIVE flag takes precedence over other flags. So, if you specify
FF_INTERACTIVE | FF_DONT_DELETE_HIDDEN_TEXT and the selection contains
hidden text, the FrameMaker product allows the user to choose whether to delete the
hidden text.
FDK Programmer’s Reference 123
3
FDK Function Reference
F_ApiCut()
Returns
FE_Success if it succeeds, or an error code if an error occurs
If F_ApiCut() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_WrongProduct
Current FrameMaker product doesn’t support
requested operation
FE_BadSelectionForOperation
Selection doesn’t support operation
FE_Canceled
User or parameters canceled the operation
FE_BadOperation
Parameters specified an invalid operation
Example
The following code cuts the selected text from a document:
. . .
F_ApiCut(docId, 0);
. . .
See also
“F_ApiClear()” on page 100, “F_ApiCopy()” on page 115, “F_ApiPaste()” on
page 364, “F_ApiPopClipboard()” on page 366, and “F_ApiPushClipboard()” on
page 384.
124
FDK Programmer’s Reference
F_ApiDeallocateStructureType()
...
FDK Function Reference
F_ApiDeallocate St ructureType( )
The following functions deallocate memory referenced by frequently used API
structures. These functions perform a deep deallocation, deallocating any arrays or
strings referenced by the structures.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiDeallocateAttribute(F_AttributeT *attribute);
VoidT F_ApiDeallocateAttributeDef(
F_AttributeDefT *attributedef);
VoidT F_ApiDeallocateAttributeDefs(
F_AttributeDefsT *attributedefs);
VoidT F_ApiDeallocateAttributes(F_AttributesT *attributes);
VoidT F_ApiDeallocateElementCatalogEntries(
F_ElementCatalogEntriesT *elementcatents);
VoidT F_ApiDeallocateFonts(F_FontsT *fonts);
VoidT F_ApiDeallocateInts(F_IntsT *ints);
VoidT F_ApiDeallocateMetrics(F_MetricsT *metrics);
VoidT F_ApiDeallocatePoints(F_PointsT *points);
VoidT F_ApiDeallocatePropVal(F_PropValT *prop);
VoidT F_ApiDeallocatePropVals(F_PropValsT *pvp);
VoidT F_ApiDeallocateString(StringT s);
VoidT F_ApiDeallocateStrings(F_StringsT *strings);
VoidT F_ApiDeallocateTab(F_TabT *tab);
VoidT F_ApiDeallocateTabs(F_TabsT *tabs);
VoidT F_ApiDeallocateTextItem(F_TextItemT *tip);
VoidT F_ApiDeallocateTextItems(F_TextItemsT *ip);
VoidT F_ApiDeallocateUBytes(F_UBytesT *ubytes);
VoidT F_ApiDeallocateUInts(F_UIntsT *uints);
VoidT F_ApiDeallocateVal(F_TypedValT *valp);
Arguments
StructureType
The structure referencing memory that needs to be deallocated
Returns
VoidT.
FDK Programmer’s Reference 125
3
FDK Function Reference
F_ApiDefineAndAddCommand()
Example
The following code deallocates a property list:
. . .
F_PropValsT props;
. . .
F_ApiDeallocatePropVals(&props);
. . .
F_ApiDefineAndAddCommand()
F_ApiDefineAndAddCommand() defines a command (FO_Command object) and
adds it to a menu or menu bar.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiDefineAndAddCommand(IntT cmd,
F_ObjHandleT toMenuId,
StringT name,
StringT label,
StringT shortcut);
Arguments
cmd
The integer that the FrameMaker product passes to your client’s
F_ApiCommand() function when the user chooses the menu item or types the
keyboard shortcut for the command. It must be unique for each command in
your client, but it need not be unique for different clients.
toMenuId
The ID of the menu to which to add the command.
name
A unique name for the command. If the user or a client has already defined a
command or menu with this name, the new command replaces it.
label
The title of the command as it appears on the menu.
shortcut
The keyboard shortcut sequence. Many FrameMaker product commands use
shortcuts beginning with Escape (\!). To specify Escape when you create a
command, use \\! in the string you pass to shortcut.
To add the new command to a menu that you have created, set toMenuId to the ID
returned by the F_ApiDefineMenu() or F_ApiDefineAndAddMenu() call that
created the menu.
126
FDK Programmer’s Reference
F_ApiDefineAndAddCommand()
...
FDK Function Reference
To add a command to a FrameMaker product menu, you must first get the menu’s ID.
To get its ID, call F_ApiGetNamedObject() with the objectName parameter set
to its name. For example, to get the ID of the Edit menu, use the following code:
. . .
F_ObjHandleT editMenuId;
editMenuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"EditMenu");
. . .
The [Files] section of the maker.ini file specifies the location of the menu and command
configuration files that list FrameMaker’s menus and commands.
The following table lists some FrameMaker product menus and the names you use to
specify them:
Menu title
Menu name
Edit
EditMenu
File
FileMenu
Format
FormatMenu
Graphics
GraphicsMenu
Special
SpecialMenu
Table
TableMenu
View
ViewMenu
Help
!HelpMenu
If you call F_ApiDefineAndAddCommand() and specify the name of a command
that is already defined in the user’s menu configuration files, the FrameMaker product
gives precedence to the definition in the configuration files. If the configuration files
assign a label or a shortcut to the command, the FrameMaker product uses it instead of
the one you specify. If the command is already a menu item, the FrameMaker product
ignores the menu that you specify and leaves the menu item where it is.
If the user has already put the menu item specified by name on the menus,
F_ApiDefineAndAddCommand() ignores the toMenuId parameter and connects
the command to the existing menu item. If the menu item is not already on a menu,
F_ApiDefineAndAddCommand() adds it to the bottom of the menu specified by
toMenuId.
FDK Programmer’s Reference 127
3
FDK Function Reference
F_ApiDefineAndAddCommand()
..............................................................................
IMPORTANT: If you want to add a command to more than one menu, do not call
F_ApiDefineAndAddCommand() repeatedly to add the command to the menus. This
does not work, because if a command already exists,
F_ApiDefineAndAddCommand() ignores the toMenuId argument and just
replaces the existing command with the new command. To add a command to multiple
menus, define the command first by calling F_ApiDefineCommand() or
F_ApiDefineCommandEx()—or call F_ApiDefineAndAddCommand(), if you
want to define and add the command to a menu at the same time—and then call
F_ApiAddCommandToMenu() to add the command to other menus.
..............................................................................
128
FDK Programmer’s Reference
F_ApiDefineAndAddCommandEx()
...
FDK Function Reference
Returns
The ID of the new command (FO_Command object), or 0 if an error occurs.
If F_ApiDefineAndAddCommand() fails, the API assigns one of the following
values to FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_NotMenu
The menu specified by toMenuId
doesn’t exist
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
Example
The following code creates a command named MyCmd and adds it to the Utilities
menu:
. . .
#define MY_CMD 1
F_ObjHandleT menuId, cmdId;
menuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"UtilitiesMenu");
cmdId = F_ApiDefineAndAddCommand(MY_CMD, menuId, "MyCmd",
"My Cmd", "\\!MC");
. . .
See also
“F_ApiAddCommandToMenu()” on page 72, “F_ApiDefineCommand()” on page 137,
and “F_ApiGetNamedObject()” on page 214.
F_ApiDefineAndAddCommandEx()
F_ApiDefineAndAddCommandEx() is similar to
F_ApiDefineAndAddCommand() with an extra parameter to specify the views in
which this command is valid.
FDK Programmer’s Reference 129
3
FDK Function Reference
F_ApiDefineAndAddCommandEx()
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiDefineAndAddCommandEx (IntT cmd,
F_ObjHandleT toMenuId,
ConStringT tag,
ConStringT label,
ConStringT shortcut,
const F_StringsT *validViewsList);
Arguments
cmd
The integer that the FrameMaker product passes to the client’s
F_ApiCommand() function when the user chooses the menu item
or types the keyboard shortcut for the command. It must be unique
for each command in your client, but it need not be unique for
different clients.
toMenuId
The ID of the menu to which to add the command.
tag
A unique name for the command. If the user or a client has already
defined a command or menu with this name, the new command
replaces it.
label
The title of the command as it appears on the menu.
shortcut
The keyboard shortcut sequence. Many FrameMaker commands
use shortcuts beginning with Escape (\!). To specify Escape when
you create a command, use \\! in the string you pass to
shortcut.
validViewsList
The view(s) for which this command is valid. The view(s) can be:
WYSIWYG View
XML View
Author View
corresponding to the views supported by FrameMaker.
To add the new command to a menu that you have created, set toMenuId to the ID
returned by the F_ApiDefineMenu() or F_ApiDefineAndAddMenu() call that
created the menu.
130
FDK Programmer’s Reference
F_ApiDefineAndAddCommandEx()
...
FDK Function Reference
To add a command to a FrameMaker product menu, you must first get the menu’s ID.
To get its ID, call F_ApiGetNamedObject() with the objectName parameter set
to its name. For example, to get the ID of the Edit menu, use the following code:
. . .
F_ObjHandleT editMenuId;
editMenuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"EditMenu");
. . .
The [Files] section of the maker.ini file specifies the location of the menu and command
configuration files that list FrameMaker’s menus and commands.
The following table lists some FrameMaker product menus and the names you use to
specify them:
Menu title
Menu name
Edit
EditMenu
File
FileMenu
Format
FormatMenu
Graphics
GraphicsMenu
Special
SpecialMenu
Table
TableMenu
View
ViewMenu
Help
!HelpMenu
If you call F_ApiDefineAndAddCommandEx() and specify the name of a command
that is already defined in the user’s menu configuration files, the FrameMaker product
gives precedence to the definition in the configuration files. If the configuration files
assign a label or a shortcut to the command, the FrameMaker product uses it instead of
the one you specify. If the command is already a menu item, the FrameMaker product
ignores the menu that you specify and leaves the menu item where it is.
If the user has already put the menu item specified by name on the menus,
F_ApiDefineAndAddCommandEx() ignores the toMenuId parameter and
connects the command to the existing menu item. If the menu item is not already on a
menu, F_ApiDefineAndAddCommandEx() adds it to the bottom of the menu
specified by toMenuId.
FDK Programmer’s Reference 131
3
FDK Function Reference
F_ApiDefineAndAddCommandEx()
..............................................................................
IMPORTANT: If you want to add a command to more than one menu, do not call
F_ApiDefineAndAddCommandEx() repeatedly to add the command to the menus.
This does not work, because if a command already exists,
F_ApiDefineAndAddCommandEx() ignores the toMenuId argument and just
replaces the existing command with the new command. To add a command to multiple
menus, define the command first by calling F_ApiDefineCommand() or
F_ApiDefineCommandEx()—or call F_ApiDefineAndAddCommandEx(), if
you want to define and add the command to a menu at the same time—and then call
F_ApiAddCommandToMenu() to add the command to other menus.
..............................................................................
132
FDK Programmer’s Reference
F_ApiDefineAndAddCommandEx()
...
FDK Function Reference
Returns
The ID of the new command (FO_Command object), or 0 if an error occurs.
If F_ApiDefineAndAddCommandEx() fails, the API assigns one of the following
values to FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_NotMenu
The menu specified by toMenuId
doesn’t exist
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
Example
The following code makes the command valid in WYSIWYG View and Author View:
StringT validViews[2] = {(StringT)"WYSIWYG
View",(StringT)"Author View"};
F_StringsT validViewsList = {2, validViews};
F_ObjHandleT cmdId = F_ApiDefineAndAddCommandEx (CMD_NUM,
menuId, "api_command", "API Command", !ac", &validViewsList);
The following code makes the command valid in all views:
StringT validViews = {(StringT)"All"};
F_StringsT validViewsList = {1, &validViews};
F_ObjHandleT cmdId = F_ApiDefineAndAddCommandEx (CMD_NUM,
menuId, "api_command", "API Command", !ac", &validViewsList)
FDK Programmer’s Reference 133
3
FDK Function Reference
F_ApiDefineAndAddMenu()
F_ApiDefineAndAddMenu()
F_ApiDefineAndAddMenu() defines a menu (FO_Menu object) and adds it to
another menu.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiDefineAndAddMenu(F_ObjHandleT toMenuId,
StringT name,
StringT label);
Arguments
toMenuId
The name of the menu or menu bar to which to add the new menu.
name
A unique name for the new menu. If the user or an FDK client has already
defined a command or menu with this name, the new menu replaces it.
label
The title of the menu as it appears on the menu bar or menu.
To add a menu to a menu or menu bar created by your client, set toMenuId to the ID
returned by the F_ApiDefineMenu() or F_ApiDefineAndAddMenu() call that
created the menu or menu bar.
To add a menu to one of a FrameMaker product’s menus or menu bars, you must get the
menu or menu bar’s ID. To get its ID, call F_ApiGetNamedObject() with the
objectName parameter set to its name. For example, to get the ID of the FrameMaker
main menu bar, use the following code:
. . .
F_ObjHandleT mainMenuId;
mainMenuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"!MakerMainMenu");
. . .
134
FDK Programmer’s Reference
F_ApiDefineAndAddMenu()
...
FDK Function Reference
The following table lists some of the menu bars that you can add menus to and the
strings that specify them. Menu bar names preceded by an exclamation mark (!) can’t
be removed by the user.
FrameMaker product menu bar
toMenuBar string
Menu bar for documents (complete menus)
!MakerMainMenu
Menu bar for documents (quick menus)
!QuickMakerMainMenu
Menu bar for documents (custom menus)
!CustomMakerMainMenu
Menu bar for books (complete menus)
!BookMainMenu
Menu bar for books (quick menus)
!QuickBookMainMenu
Structure menu bar (structured product interface only)
!StructureViewMainMenu
View-only menu bar
!ViewOnlyMainMenu
The [Files] section of the maker.ini file specifies the location of the menu and command
configuration files that list FrameMaker’s menus and commands.
..............................................................................
IMPORTANT: The menu you add appears only on the menu bar you specify. For
example, if you add a menu only to the !MakerMainMenu menu bar, the menu does
not appear if the user switches to quick menus. For your menu to appear after the user
has switched to quick menus, you must also add it to !QuickMakerMainMenu.
..............................................................................
If you call F_ApiDefineAndAddMenu() and specify the name of a menu that is
already defined in the user’s menu configuration files, the FrameMaker product gives
precedence to the definition in the configuration files. If the configuration files assign a
label to the menu, the FrameMaker product uses it instead of the one you specify. If the
menu is already on a menu or menu bar, the FrameMaker product ignores the menu that
you specify and leaves the menu where it is.
If the menu specified by name is not already on a menu or menu bar,
F_ApiDefineAndAddMenu() adds it. How the FrameMaker product adds it depends
FDK Programmer’s Reference 135
3
FDK Function Reference
F_ApiDefineAndAddMenu()
on the type of menu you are adding it to. The following table lists the types of menus
you can add another menu to and how the FrameMaker product adds the menu.
Type of menu or menu bar
you are adding a menu to
How the FrameMaker product
implements the added menu
Where the FrameMaker
product adds the menu
Menu bar
Pull-down menu
At the right of the menu
bar
Pull-down menu
Pull-right menu
At the bottom of the pulldown menu
Pop-up menu
Pull-right menu
At the bottom of the popup menu
Pull-right menu
Pull-right menu
At the bottom of the pullright menu
Returns
The ID of the new menu (FO_Menu object), or 0 if an error occurs.
If F_ApiDefineAndAddMenu() fails, the API assigns one of the following values to
FA_errno.
136
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_NotMenu
The menu specified by toMenuId doesn’t exist or
isn’t a menu; tag specifies an existing command
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
FDK Programmer’s Reference
F_ApiDefineCommand()
...
FDK Function Reference
Example
The following code defines and adds a menu named APIMenu to the FrameMaker main
menu:
. . .
#define MY_CMD 1
F_ObjHandleT menubarId, menuId, cmdId;
/* Get ID of FrameMaker main menu. */
menubarId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"!MakerMainMenu");
/* Define and add a menu to the main menu. */
menuId = F_ApiDefineAndAddMenu(menubarId, "APIMenu",
"API Menu");
/* Add a command to the menu. */
cmdId = F_ApiDefineAndAddCommand(MY_CMD, menuId, "MyCmd",
"My Cmd", "");
. . .
See also
“F_ApiAddMenuToMenu()” on page 74, “F_ApiDefineMenu()” on page 141, and
“F_ApiGetNamedObject()” on page 214.
F_ApiDefineCommand()
F_ApiDefineCommand() defines a command (FO_Command object). After you
define a command, you can add it to a menu with F_ApiAddCommandToMenu().
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiDefineCommand(IntT cmd,
StringT name,
StringT label,
StringT shortcut);
FDK Programmer’s Reference 137
3
FDK Function Reference
F_ApiDefineCommand()
Arguments
cmd
The integer that the FrameMaker product passes to your client’s
F_ApiCommand() function when the user executes the command. It must be
unique for each menu item in your client, but it need not be unique for different
clients.
name
A unique name for the command. If the user or a client has already defined a
command or menu with this name, the new command replaces it.
label
The title of the menu item as it appears on the menu.
shortcut
The keyboard shortcut sequence. Many FrameMaker product commands use
shortcuts beginning with Escape (\!). To specify Escape when you create a
command, use \\! in the string you pass to shortcut.
If you call F_ApiDefineCommand() and specify the name of a command that is
already defined in the user’s menu configuration files, the FrameMaker product gives
precedence to the definition in the configuration files. If the configuration files assign a
label or a shortcut to the command, the FrameMaker product uses it instead of the one
you specify.
Returns
The ID of the new command (FO_Command object), or 0 if an error occurs.
If F_ApiDefineCommand() fails, the API assigns one of the following values to
FA_errno.
138
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_BadParameter
Parameter has an invalid value
FE_NotCommand
tag specifies a menu; can’t redefine a menu as a
command
FE_SystemError
System error
FDK Programmer’s Reference
F_ApiDefineCommandEx()
...
FDK Function Reference
Example
The following code defines a command named CheckGrammar that has a keyboard
shortcut of Esc C G:
. . .
#define CHECK_GRAMMAR 1
F_ObjHandleT cmdId;
cmdId = F_ApiDefineCommand(CHECK_GRAMMAR, "CheckGrammar",
"Check Grammar", "\\!CG");
. . .
See also
“F_ApiDefineCommandEx()” on page 139, “F_ApiAddCommandToMenu()” on
page 72, “F_ApiDefineAndAddCommand()” on page 126, and
“F_ApiGetNamedObject()” on page 214.
F_ApiDefineCommandEx()
F_ApiDefineCommandEx() is similar to F_ApiDefineCommand() with an extra
parameter to specify views in which this command is valid. After you define a
command, you can add it to a menu with F_ApiAddCommandToMenu().
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiDefineCommandEx(IntT cmd,
ConStringT name,
ConStringT label,
ConStringT shortcut,
const F_StringsT *validViewsList);
FDK Programmer’s Reference 139
3
FDK Function Reference
F_ApiDefineCommandEx()
Arguments
cmd
The integer that the FrameMaker product passes to your client’s
F_ApiCommand() function when the user executes the command. It
must be unique for each menu item in your client, but it need not be
unique for different clients.
name
A unique name for the command. If the user or a client has already
defined a command or menu with this name, the new command
replaces it.
label
The title of the menu item as it appears on the menu.
shortcut
The keyboard shortcut sequence. Many FrameMaker product
commands use shortcuts beginning with Escape (\!). To specify
Escape when you create a command, use \\! in the string you pass
to shortcut.
validViewsList
The views for which this command is valid. The view(s) can be:
WYSIWYG View
Code View
Author View
corresponding to the views supported by FrameMaker.
If you call F_ApiDefineCommandEx() and specify the name of a command that is
already defined in the user’s menu configuration files, the FrameMaker product gives
precedence to the definition in the configuration files. If the configuration files assign a
label or a shortcut to the command, the FrameMaker product uses it instead of the one
you specify.
Returns
The ID of the new command (FO_Command object), or 0 if an error occurs.
If F_ApiDefineCommandEx() fails, the API assigns one of the following values to
FA_errno.
140
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_BadParameter
Parameter has an invalid value
FE_NotCommand
tag specifies a menu; can’t redefine a menu as a
command
FE_SystemError
System error
FDK Programmer’s Reference
F_ApiDefineMenu()
...
FDK Function Reference
Example
The following code makes the comman valid in WYSIWYG view and Author view:
. . .
StringT validViews[2] = {(StringT)"WYSIWYG iew",(StringT)"Author
View"};
F_StringsT validViewsList = {2, validViews};
F_ObjHandleT cmdId = F_ApiDefineCommandEx (CMD_NUM,
"api_command", "API Command", "!ac", &validViewsList);
. . .
See also
“F_ApiAddCommandToMenu()” on page 72, “F_ApiDefineAndAddCommand()” on
page 126, and “F_ApiGetNamedObject()” on page 214.
F_ApiDefineMenu()
F_ApiDefineMenu() defines a menu (FO_Menu object). After you define a menu,
you can add it to a menu or a menu bar with F_ApiAddMenuToMenu().
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiDefineMenu(StringT name,
StringT label);
Arguments
name
A unique name for the menu. If the user or an FDK client has
already defined a command or menu with this name, the new menu replaces it.
label
The title of the menu as it appears on the menu bar or menu.
If you call F_ApiDefineMenu() and specify the name of a menu that is already
defined in the user’s menu configuration files, the FrameMaker product gives
precedence to the definition in the configuration files. If the configuration files assign a
label to the menu, the FrameMaker product uses it instead of the one you specify.
If the user has already defined a menu with the name specified by name,
F_ApiDefineMenu() ignores the label parameter and uses the label specified by
the user.
FDK Programmer’s Reference 141
3
FDK Function Reference
F_ApiDefineMenu()
Returns
The ID of the new menu (FO_Menu object), or 0 if an error occurs.
If F_ApiDefineMenu() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this
operation or fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_NotMenu
tag specifies a command; can’t redefine a
command as a menu
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
Example
The following code adds a menu named Search to the menu bar for books. It also adds
a command labeled Find and Replace to the Search menu.
. . .
#define FIND_REPLACE 1
F_ObjHandleT menubarId, menuId;
/* Define menu and add a command to it. */
menuId = F_ApiDefineMenu("SearchMenu", "Search");
F_ApiDefineAndAddCommand(FIND_REPLACE, menuId, "FindReplace",
"Find and Replace", "\\!fR");
/* Put the menu on the menu bar for books. */
menubarId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"!BookMainMenu");
F_ApiAddMenuToMenu(menubarId, menuId);
. . .
See also
“F_ApiAddMenuToMenu()” on page 74, “F_ApiDefineAndAddMenu()” on page 134,
and “F_ApiGetNamedObject()” on page 214.
142
FDK Programmer’s Reference
F_ApiDelete()
...
FDK Function Reference
F_ApiDelete()
F_ApiDelete() deletes an object from a document. Be careful about possible side
effects when you use F_ApiDelete(). When you delete some objects, the API
deletes any objects they contain. For example, when you delete a table, the API deletes
all the FO_Row and FO_Cell objects that it contains. When you delete a frame, the
API deletes all the objects in it.
The following types of objects can’t be deleted with F_ApiDelete():
FO_Book
FO_Doc
FO_HiddenPage
FO_Cell
FO_MasterPage (Left and Right master pages only)
FO_UnanchoredFrame (page frames only)
FO_Color (predefined colors only)
FO_Session
FO_VarFmt (system variables only)
To delete table rows and columns, use F_ApiDeleteCols() and
F_ApiDeleteRows() instead of F_ApiDelete(). To delete a page frame, delete
the page that contains it. To delete text, see “F_ApiDeleteText()” on page 151.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiDelete(F_ObjHandleT docId,
F_ObjHandleT objId);
Arguments
docId
The ID of the document, book, or menu containing the object
objId
The ID of the object to remove
Returns
FE_Success if it succeeds, or an error code if an error occurs.
FDK Programmer’s Reference 143
3
FDK Function Reference
F_ApiDeleteAllKeyDefinitions()
If F_ApiDelete() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_BadDelete
Specified object couldn’t be deleted
FE_BadOperation
Function call specified an illegal operation
FE_BadParameter
Function call specified an invalid parameter
FE_NotMenu
objId is a menu item (FO_Menu, FO_Command, or
FO_MenuItemSeparator), but docId is not the ID of the menu
containig it
Example
The following code deletes all the markers in the current document:
. . .
F_ObjHandleT docId, mrkrId, prvmrkrId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
/* Get first marker, then traverse markers and delete them. */
mrkrId = F_ApiGetId(FV_SessionId, docId, FP_FirstMarkerInDoc);
while (mrkrId)
{
/* As each marker is deleted, its FP_NextMarkerInDoc property
** becomes invalid, so it is necessary to get the next marker
** before deleting the current one.
*/
prvmrkrId = mrkrId;
mrkrId = F_ApiGetId(docId, prvmrkrId, FP_NextMarkerInDoc);
F_ApiDelete(docId, prvmrkrId);
}
. . .
F _ A p i D e l et e A l l K ey D ef i n i t i o n s ( )
Deletes all the key definitions in the specified key catalog.
144
FDK Programmer’s Reference
F_ApiDeleteCols()
...
FDK Function Reference
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiDeleteAllKeyDefinitions(F_ObjHandleT keyCatalogId)
Arguments
keyCatalogId
The ID of the key catalog from which to delete all key definitions.
Returns
If F_ApiDeleteAllKeyDefinitions() fails, the API assigns the following value
to FA_errno.
FA_errno value
Meaning
FE_BadObjId
The ID provided does not specify a key catalog.
F_ApiDeleteCols()
F_ApiDeleteCols() deletes columns from a table. To delete an entire table, use
F_ApiDelete().
Synopsis
#include "fapi.h"
. . .
IntT F_ApiDeleteCols(F_ObjHandleT docId,
F_ObjHandleT tableId,
IntT delColNum,
IntT numDelCols);
Arguments
docId
The ID of the document containing the table.
tableId
The ID of the table containing the columns.
delColNum
The first column to delete. Columns are numbered from left to right, starting
with 0.
numDelCols
The number of columns to delete.
F_ApiDeleteCols() deletes the column specified by delColNum and
(numDelCols-1) columns to the right of it.
FDK Programmer’s Reference 145
3
FDK Function Reference
F_ApiDeleteCols()
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiDeleteCols() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support requested operation
FE_BadOperation
Parameter specifies an invalid operation
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid table ID
Example
The following code deletes the first two columns in the selected table in the active
document:
. . .
F_ObjHandleT docId, tblId;
/* Get the document and table IDs. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tblId = F_ApiGetId(FV_SessionId, docId, FP_SelectedTbl);
F_ApiDeleteCols(docId, tblId, 0, 2);
. . .
See also
“F_ApiDelete()” on page 143 and “F_ApiDeleteRows()” on page 148.
St ru cture d
F_ApiDeleteCondTag()
F_ApiDeleteCondTag() deletes a conditional tag from a document.
Synopsis
#include "fapi.h"
StatusT F_ApiDeleteCondTag(F_ObjHandleT docId, F_ObjHandleT
condTagId, IntT action);
146
FDK Programmer’s Reference
F_ApiDeletePropByName()
...
FDK Function Reference
Arguments
docId
The ID of the document containing the conditional tag to be deleted
condTagId
The ID of the conditional tag object (type: FO_CondFmt) in the doc
action
One of the following:
FF_UNTAGGED_ASK: Prompt the user
FF_UNTAGGED_UNCOND: Make text unconditional
FF_UNTAGGED_DELETE: Delete text
Returns
Returns one of the following
FE_BadDocId
Document id is invalid
FE_BadObjId
Conditional tag object id is invalid.
FE_ReadOnly
Document is read only.
FE_BadValue
Action is not one of the specified values
FE_Success
Deletion was successful
F_ApiDeletePropByName()
F_ApiDeletePropByName() deletes an inset facet.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiDeletePropByName(F_ObjHandleT docId,
F_ObjHandleT objId,
StringT propName);
Arguments
docId
The ID of the document containing the inset whose facet you want to delete
objId
The ID of the inset
propName
The name of the facet you want to delete
Returns
VoidT.
FDK Programmer’s Reference 147
3
FDK Function Reference
F_ApiDeleteRows()
If F_ApiDeletePropByName() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadPropNum
Specified property number is invalid
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_BadPropType
Incorrect property type for this function
Example
The following code deletes a facet called wks.facet:
. . .
F_ObjHandleT docId, insetId;
F_ApiDeletePropByName(docId, insetId, "wks.facet");
. . .
F_ApiDeleteRows()
F_ApiDeleteRows() deletes rows from a table. Like the Delete command in the
FrameMaker product user interface, F_ApiDeleteRows() does not allow you to
delete more than one type of row at time. The range of rows you specify must be all
body rows, all header rows, or all footer rows.
To delete an entire table, use F_ApiDelete().
Synopsis
#include "fapi.h"
. . .
IntT F_ApiDeleteRows(F_ObjHandleT docId,
F_ObjHandleT tableId,
F_ObjHandleT refRowId,
IntT numDelRows);
148
FDK Programmer’s Reference
F_ApiDeleteRows()
...
FDK Function Reference
Arguments
docId
The ID of the document containing the table
tableId
The ID of the table containing the rows
refRowId
The ID of the first row to delete
numDelRows
The number of rows to delete, including refRowId
F_ApiDeleteRows() deletes refRowId and (numDelRows - 1) rows below it.
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiDeleteRows() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support the requested operation.
FE_BadOperation
Parameter specifies an invalid operation.
FE_BadDocId
Invalid document ID.
FE_BadObjId
Invalid table or row ID.
FE_OutOfRange
The refRowId parameter does not specify a row in the table, or the
specified range includes more than one type of row (for example,
header rows and body rows).
Example
The following code deletes the first row of the selected table:
. . .
F_ObjHandleT docId, tblId, rowId;
/* Get the document and selected table IDs. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tblId = F_ApiGetId(FV_SessionId, docId, FP_SelectedTbl);
/* Get the ID for the first row, then delete it. */
rowId = F_ApiGetId(docId, tblId, FP_FirstRowInTbl);
F_ApiDeleteRows(docId, tblId, rowId, 1);
. . .
FDK Programmer’s Reference 149
3
FDK Function Reference
F_ApiDeleteRows()
See also
“F_ApiDelete()” on page 143 and “F_ApiDeleteCols()” on page 145.
150
FDK Programmer’s Reference
F_ApiDeleteText()
...
FDK Function Reference
F_ApiDeleteText()
F_ApiDeleteText() deletes a specified text range from a document.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiDeleteText(F_ObjHandleT docId,
F_TextRangeT *textRangep);
Arguments
docId
The ID of the document from which to delete the text
textRangep
The text range to delete
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiDeleteText() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDelete
Specified text couldn’t be deleted
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_BadRange
Specified text range is invalid
FE_NotTextObject
Object specified for the text range isn’t an object that
contains text, for example, a text frame (FO_TextFrame),
a paragraph (FO_Pgf) or a text line (FO_TextLine)
FE_OffsetNotFound
Offset specified for the text range couldn’t be found in the
specified paragraph or text line
FE_BadSelectionForOpe
ration
Selection is within a locked text range.
FDK Programmer’s Reference 151
3
FDK Function Reference
F_ApiDeleteTextInsetContents()
Example
The following code gets the text selection from the active document and deletes it:
. . .
F_TextRangeT tr;
F_ObjHandleT docId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId,docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
F_ApiDeleteText(docId, &tr);
. . .
See also
“F_ApiClear()” on page 100 and “F_ApiAddText()” on page 80.
F_ A p i D e l e t e TextInsetC onten ts()
F_ApiDeleteTextInsetContents() deletes the text in a text inset. You must
unlock a text inset before you call F_ApiDeleteTextInsetContents() to delete
its contents. After you are done, you must relock the text inset.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiDeleteTextInsetContents(F_ObjHandleT docId,
F_ObjHandleT insetId);
Arguments
docId
The ID of the document containing the inset
insetId
The text inset containing the text to be deleted
Returns
FE_Success if it succeeds, or an error code if an error occurs.
152
FDK Programmer’s Reference
F_ApiDeleteTextInsetContents()
...
FDK Function Reference
If F_ApiDeleteTextInsetContents() fails, the API assigns one of the
following values to FA_errno.
FA_errno value
Meaning
FE_BadDelete
Specified text couldn’t be deleted
FE_BadDocId
Invalid document ID
FE_BadObjId
The ID does not specify a text inset
FE_BadSelectionForOperation
The specified text inset is locked
Example
See “Updating a client text inset” on page 469 of the FDK Programmer’s Guide.
See also
“F_ApiDelete()” on page 143.
St ru cture d
F_ApiDeleteUndefinedAttribute()
F_ApiDeleteUndefinedAttribute() deletes from structural elements, an
attribute for which no value is assigned. You can delete undefined attributes for a given
element, all elements of a specific type, or all elements in the document.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiDeleteUndefinedAttribute(F_ObjHandleT docId,
StringT attrName, IntT scope, F_ObjHandleT objId);
Arguments
docId
The ID of the document containing the element or elements whose attributes
you want to delete
attrName
The name of the attribute you want to delete
scope
One of FV_Element, FV_ElementsOfType, or FV_AllElements
objId
The element or element definition from which to delete the undefined attributes
The value for objId indicates a different type of object, depending on the value of
scope, as indicated by the following table:
FDK Programmer’s Reference 153
3
FDK Function Reference
F_ApiDeleteTextInsetContents()
If scope is:
objId must be:
FV_Element
The ID of the element from which you want to delete the
undefined attribute
FV_ElementsOfType
The element definition for the type of element from which you
want to delete the undefined attributes
FV_AllElements
0
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiDeleteUndefinedAttribute() fails, the API assigns one of the
following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_AttributeNot
Undefined
Specified attribute in specified element contains a value
Example
The following code deletes all undefined instances of the attribute named “author” in
the document:
. . .
F_ObjHandleT docId;
ErrorT err;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
err = F_ApiDeleteUndefinedAttribute(docId, (StringT)"author",
FV_AllElements, 0);
. . .
St ru cture d
F_ApiDemoteElement()
F_ApiDemoteElement() demotes the selected structural element or elements. The
element becomes a child of the sibling element before it.
154
FDK Programmer’s Reference
F_ApiDialogEvent()
...
FDK Function Reference
..............................................................................
IMPORTANT: At least one structural element must be selected when
F_ApiDemoteElement() is called.
..............................................................................
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiDemoteElement(F_ObjHandleT docId);
Arguments
docId
The document that contains the element selection
Returns
VoidT.
If F_ApiDemoteElement() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product isn’t Structured
FrameMaker
FE_BadDocId
Invalid document ID
FE_BadSelectionForOperation
Current text selection is invalid for this operation
Example
The following code demotes the selected elements in the active document:
. . .
F_ApiDemoteElement(F_ApiGetId(0, FV_SessionId, FP_ActiveDoc));
. . .
See also
“F_ApiPromoteElement()” on page 377.
F _ A p i D i a l o g E ve n t ( )
F_ApiDialogEvent() is a callback that you can define in your client. The
FrameMaker product calls F_ApiDialogEvent() when an event occurs in a dialog
box opened by your client.
FDK Programmer’s Reference 155
3
FDK Function Reference
F_ApiDialogEvent()
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiDialogEvent(IntT dlgNum,
IntT itemNum,
IntT modifiers);
Arguments
dlgNum
The number of the dialog in which the event occurred (the number you
specified when you called F_ApiModalDialog() or
F_ApiModelessDialog() to display the dialog)
itemNum
If an event occurred in a specific dialog item, the number (a nonnegative
integer) of the dialog item.
If the event doesn’t apply to a specific dialog item, a negative integer
constant specifying the event. See the table below for a list of constants.
modifiers
Bit flags specifying which modifier keys the user was holding down when
the event occurred. See the table below for a list of possible flags.
The API can set the itemNum parameter function to the ID of a dialog item or to one
of the following negative constants:
156
Constant
Meaning
FV_DlgClose
The user closed the dialog box.
FV_DlgEnter
The user moved input focus to the dialog box.
FV_DlgNoChange
The user pressed Shift-F8 to set the dialog box to As Is settings.
FDK Programmer’s Reference
F_ApiDialogEvent()
Constant
Meaning
FV_DlgReset
The user pressed Shift-F9 to reset the dialog box.
FV_DlgResize
A modeless dialog was resized. Here is a usage example:
...
FDK Function Reference
VoidT F_ApiDialogEvent(IntT dlgNum, IntT itemNum,
IntT modifiers)
{
switch(dlgNum)
{
case DLG_NUM1:
{
If
(itemNum == FV_DlgResize)
{
/* 'dlgNum' dialog has been resized - do something
if needed */
}
}
break;
}
}
The modifiers parameter can have the following bit flags set:
Flag
Meaning
FV_EvCaps
The Caps Lock key is on
FV_EvControl
The user was holding down the Control key
FV_EvMeta
The user was holding down the the Alt key (on Windows)
FV_EvShift
The user was holding down the Shift key
Returns
VoidT.
FDK Programmer’s Reference 157
3
FDK Function Reference
F_ApiDialogItemId()
Example
See “Handling user actions in dialog boxes” on page 448 of the FDK Programmer’s
Guide.
See also
“F_ApiDialogItemId()” on page 158.
F_ A p i D i a l o g ItemId()
F_ApiDialogItemId() returns the ID of a dialog item with a specified item number.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiDialogItemId(F_ObjHandleT dialogId,
IntT itemNum);
Arguments
dialogId
The ID of the dialog box containing the item
itemNum
The item number of the item
Returns
The ID of the item with the specified number or 0 if there is no item with the specified
number.
Example
The following code gets the ID of the dialog with the number APPLY_BUTTON.
. . .
#define APPLY_BUTTON 1
F_ObjHandleT dlgId, dlgItemId;
. . .
dlgItemId = F_ApiDialogItemId(dlgId, APPLY_BUTTON);
. . .
See also
“F_ApiDialogEvent()” on page 155.
158
FDK Programmer’s Reference
F_ApiDisconnectFromSession()
...
FDK Function Reference
F_Api Di s conn ect FromS ession( )
F_ApiDisconnectFromSession() ends communication with a FrameMaker
product process.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiDisconnectFromSession();
Arguments
None.
Returns
FE_Success if it succeeds, or a system error code if an error occurs.
See also
“” on page 173, “F_ApiConnectToSession()” on page 115
St ru cture d
F _ A p i E l e me n tD e fI s Tex t ()
Some structural elements in FrameMaker documents are placeholders for text. For
example, when a Para element contains text with a cross-reference element embedded
in it, the ranges of text that surround the cross-reference element are treated as elements
themselves. These elements are called text nodes.
When you are traversing the elements in a container, it is often useful to know if a given
element is a text node. F_ApiElementDefIsText() checks the value of an element
definition to determine whether the element it is applied to is a text node.
F_ApiElementDefIsText() is implemented as a macro.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiElementDefIsText(F_ObjHandleT docId,
F_ObjHandleT objId);
FDK Programmer’s Reference 159
3
FDK Function Reference
F_ApiDisconnectFromSession()
Arguments
docId
The ID of the document containing the element definition
objId
The ID of the element definition (FO_ElementDef)
Returns
True if the element definition corresponds to that of a text node, or False if it
doesn’t.
Example
The following code displays an alert if an element is a text node:
. . .
F_ObjHandleT edefId, objId;
. . .
if (F_ApiElementDefIsText(docId, edefId))
F_ApiAlert("Element is text node.", FF_ALERT_CONTINUE_NOTE);
. . .
St ru cture d
F _ A p i E l e me n tL o c To Te x t L o c ()
F_ApiElementLocToTextLoc() returns the text location structure that corresponds
with the current element location.
Synopsis
#include "fapi.h"
. . .
F_TextLocT F_ApiElementLocToTextLoc (F_ObjHandleT docId,
const F_ElementLocT *elocp);
160
FDK Programmer’s Reference
F_ApiDisconnectFromSession()
...
FDK Function Reference
Arguments
docId
The ID of the document containing the element
elocp
The element location structure to convert
Returns
An F_TextLocT structure specifying a text location. The F_TextLocT structure is
defined as:
typedef struct{
F_ObjHandleT objId; /* Object containing text */
IntT offset; /* Characters from start of object */
} F_TextLocT;
If F_ApiElementLocToTextLoc() fails, the API assigns one of the following
values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadParameter
elocp was empty or a parameter was improperly specified
FE_WrongProduct
Current FrameMaker product doesn’t support the operation
FDK Programmer’s Reference 161
3
FDK Function Reference
F_ApiEnableUnicode()
Example
The following code converts an element location to a text location and gets the name of
the paragraph format for the text location:
. . .
F_ObjHandleT docId;
F_ElementRangeT eRange;
F_ElementLocT eloc;
F_TextLocT textLoc;
StringT paraTag;
. . .
eRange = F_ApiGetElementRange(FV_SessionId, docId,
FP_ElementSelection);
eloc = eRange.beg;
textLoc = F_ApiElementLocToTextLoc (docId, &eloc);
if (F_ApiGetObjectType(docId, textLoc.objId) == FO_Pgf)
paraTag = F_ApiGetString(docId, textLoc.objId, FP_Name);
. . .
See also
“F_ApiTextLocToElementLoc()” on page 473.
F_ApiEnableUnicode()
Used to enable Unicode Mode or Compatibility Mode.
Synopsis
#include "fapi.h"
...
VoidT F_ApiEnableUnicode(BoolT enable);
Arguments
enable
True enables Unicode Mode, False enables Compatibility Mode.
Default: False
Returns
VoidT
162
FDK Programmer’s Reference
F_ApiEnableUnicode()
...
FDK Function Reference
Example
The following example creates two alerts.
The first one shows the string "This will be treated as FrameRoman on
English locale: Ч ÎÆ§ ÿ¥" on an English locale.
The second one shows the string "This will be treated as Unicode on
every locale: ä 뮤 ش." on any locale.
#include "fencode.h"
. . .
F_ApiAlert("This will be treated as FrameRoman on English
locale:
\xC3\xA4 \xEB\xAE\xA4 \xD8\xB4",
FF_ALERT_CONTINUE_NOTE);
F_ApiEnableUnicode(True);
F_ApiAlert("This will be treated as Unicode on every locale:
\xC3\xA4
\xEB\xAE\xA4 \xD8\xB4",
FF_ALERT_CONTINUE_NOTE);
. . .
FDK Programmer’s Reference 163
3
FDK Function Reference
F_ApiErr()
F_ApiErr()
F_ApiErr() prints your client’s name and a message to the console.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiErr(StringT message);
Arguments
message
The message to print
Returns
VoidT.
Example
The following code prints the message Frame API client "myclient":
There’s been a problem with this client. when a problem occurs with
the client:
. . .
F_ApiErr("There’s been a problem with this client.\n");
. . .
164
FDK Programmer’s Reference
F_ApiFamilyFonts()
...
FDK Function Reference
F_ApiFamilyFonts()
F_ApiFamilyFonts() returns the permutations of angles, variations, and weights
available for a specified font family.
..............................................................................
IMPORTANT: To return the permutations of a combined font, you must use
F_ApiCombinedFamilyFonts(). For more information, see
“F_ApiCombinedFamilyFonts()” on page 109.
..............................................................................
Synopsis
#include "fapi.h"
. . .
F_FontsT F_ApiFamilyFonts(IntT family);
Arguments
family
The index of the font family (in the list of fonts in the session)
To get the list of font families, angles, variations, or weights in the current FrameMaker
product session, use F_ApiGetStrings(). For more information, see
“F_ApiGetStrings()” on page 242.
Returns
An F_FontsT structure providing a list of the permutations of angles, variations, and
weights available for the specified font family.
F_FontsT is defined as:
typedef struct {
UIntT len; /* The number of structures referenced by val.*/
F_FontT *val; /* Structures listing the permutations. */
} F_FontsT;
F_FontT is defined as:
typedef struct {
UIntT family; /* The index of the font family name. */
UIntT variation; /* The index of the variation name. */
UIntT weight; /* The index of the weight name. */
UIntT angle; /* The index of the angle name. */
} F_FontT;
FDK Programmer’s Reference 165
3
FDK Function Reference
F_ApiFamilyFonts()
Example
The following code prints the variations, weights, and angles available for Helvetica in
the current session:
. . .
#include "futils.h"
#include "fstrings.h"
. . .
UIntT i, j;
F_StringsT families, weights, variations, angles;
F_FontsT perms;
/* Get lists of families, variations, weights, and angles. */
families = F_ApiGetStrings(0, FV_SessionId, FP_FontFamilyNames);
weights = F_ApiGetStrings(0, FV_SessionId, FP_FontWeightNames);
variations = F_ApiGetStrings(0, FV_SessionId,
FP_FontVariationNames);
angles = F_ApiGetStrings(0, FV_SessionId, FP_FontAngleNames);
/* Get the index for Helvetica. */
for (i=0; i < families.len; i++)
if(F_StrIEqual(families.val[i], "helvetica")) break;
if (i == families.len) return; /* Helvetica not found. */
/* Get the permutations and print them to the console. */
perms = F_ApiFamilyFonts(i);
for (j=0; j < perms.len; j++)
{
F_Printf(NULL, "Variation: %s, Weight: %s, Angle: %s\n",
weights.val[perms.val[j].variation],
variations.val[perms.val[j].weight],
angles.val[perms.val[j].angle]);
}
/* Free the structures and strings. */
F_ApiDeallocateFonts(&perms);
F_ApiDeallocateStrings(&families);
F_ApiDeallocateStrings(&weights);
F_ApiDeallocateStrings(&variations);
F_ApiDeallocateStrings(&angles);
. . .
166
FDK Programmer’s Reference
F_ApiFcodes()
...
FDK Function Reference
F_ApiFcodes()
F_ApiFcodes() sends an array of function codes (f-codes) to the FrameMaker
product. F-codes are hexadecimal codes that specify individual user actions, such as
cursor movement and text entry. When you use F_ApiFcodes() to send an array of
f-codes to the FrameMaker product, it executes each f-code as if the user performed the
action.
F_ApiFcodes() uses the current focus in a dialog box or a visible document. If you
want to execute a set of f-codes in a particular dialog box or document, make sure that
the dialog box or document is active (or has focus).
Synopsis
#include "fapi.h"
. . .
IntT F_ApiFcodes(IntT len,
IntT* vec);
Arguments
len
The length of the array of f-codes
vec
The array of f-codes to send to the FrameMaker product
For a complete list of f-codes, see the fcodes.h file shipped with the FDK. To use
FDK-defined f-code constants, such as KBD_RETURN, include this file in your client.
FDK Programmer’s Reference 167
3
FDK Function Reference
F_ApiFind()
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiFcodes() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
Example
The following code executes f-codes to move the cursor down one line and move the
current document window to the back:
. . .
#include "fm_commands.h"
. . .
static IntT fcodes[] = {CSR_DOWN, KBD_HIDEWIN};
F_ApiFcodes(sizeof(fcodes)/sizeof(IntT), fcodes);
. . .
F_ApiFind()
F_ApiFind() performs the same actions as using the Find dialog box to search a
document for text or other types of content.
Synopsis
#include "fapi.h"
. . .
F_TextRangeT F_ApiFind(F_ObjHandleT docId,
const F_TextLocT *textLocp,
const F_PropValsT *findParamsp);
Arguments
docId
The ID of the document to search.
textLocp
The text location to begin searching from.
findParamsp
A property list that specifies what to search for.
The findParamsp parameter points to a property list that contains:
168
FDK Programmer’s Reference
F_ApiFind()
...
FDK Function Reference
FS_FindCustomizationFlags, an optional property you can use to customize
the search.
One of a list of a list of properties that specify what type of content to search for; text,
elements, character formats, etc. You must specify one of these properties.
The properties you can assign to findParamsp are:
Property
Meaning and possible values
FS_FindCustomizationFlags
An optional parameter of type FT_Integer that may
be any of the following bit flags OR’ed together:
FF_FIND_CONSIDER_CASE,
FF_FIND_WHOLE_WORD,
FF_FIND_USE_WILDCARDS,
FF_FIND_BACKWARDS
If no customization flags are specified the default is to
search forward, to not use wildcards, to not consider
case, and to not use whole words.
FS_FindWrap
A BoolT flag that determines whether the find
operation will wrap when it reaches the location
where the search began. Default is True; the find
operations wraps.
If False, after reaching the location where the search
began, the find operation returns an empty
F_TextRangeT and FA_errno is set to
FE_NotFound.
FS_FindText
FT_String search text
FS_FindElementTag
FT_Strings as follows:
propVal.u.ssval.len =
FV_NumFindElementItems;
propVal.u.ssval.val[FV_FindElemTag
] = [an_element_tag];
propVal.u.ssval.val[FV_FindAttrNam
e]= [an_attribute_name];
propVal.u.ssval.val[FV_FindAttrVal
ue] = [an_attribute_value];
All of the strings must be present, but any or all may
be empty
FDK Programmer’s Reference 169
3
FDK Function Reference
F_ApiFind()
Property
FS_FindCharFmt
Meaning and possible values
No associated propertya. One or more of the
following additional properties should be specified to
tailor the search
FP_FontFamily
FP_CombinedFont
FP_FontSize
FP_FontAngle
FP_FontWeight
FP_FontVariation
FP_Color
FP_Spread
FP_Stretch
FP_Language
FP_Underline
FP_Overline
FP_Strikethrough
FP_ChangeBar
FP_Capitalization
FP_Position
FP_Tsumeb
170
FS_FindPgfTag
FT_String paragraph tag
FS_FindCharTag
FT_String character tag
FS_FindTableTag
FT_String table tag
FS_FindObject
FV_FindAnyMarker
FV_FindAnyXRef
FV_FindUnresolvedXRef
FV_FindAnyTextInset
FV_FindUnresolvedTextInset
FV_FindAnyPub
FV_FindAnyVariable
FV_FindAnchoredFrame
FV_FindFootnote
FV_FindAnyTable
FV_FindAutomaticHyphen
FV_FindAnyRubi
FS_FindMarkerOfType
FT_String marker type
FS_FindMarkerText
FT_String marker text
FS_FindXRefWithFormat
FT_String format
FS_FindNamedVariable
FT_String variable name
FDK Programmer’s Reference
F_ApiFind()
Property
Meaning and possible values
FS_FindCondTextInCondTags
FT_Strings condition tags
FS_FindCondTextNotInCond
Tags
FT_Strings condition tag
...
FDK Function Reference
a. Actually including a FS_FindCharFmt property is not required; when
FrameMaker sees one of the text properties it assumes the client is
searching for a character format.
b. See the FDK Programmer’s Reference for a description of these properties
and their values.
Whenever this function finds something that corresponds to a text range (a word, object
anchor, marker, etc.), it returns an F_TextRangeT structure for that range. However,
when searching for structure elements, you can find elements that have no
corresponding text range.
Structure elements for the following table parts have no corresponding text range:
Table title
Table head
Table foot
Table body
Table row
Table cell
When you find a structure element for one of these objects, F_ApiFind() returns an
empty F_TextRangeT structure and FA_errno is set to FE_Success. In this case,
you can get the document’s FP_ElementSelection property to return a
corresponding F_ElementRangeT structure for the table part structure element.
Returns
When it finds anything other than structure elements for table parts, an F_TextRangeT
structure. When it finds structure elements for table parts, an empty F_TextRangeT
structure, and FA_errno is set to FE_Success.
FDK Programmer’s Reference 171
3
FDK Function Reference
F_ApiFind()
If F_ApiFind() fails, an empty text range is returned and FA_errno is set to one of
the following values.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadParameter
findParamsp was empty or a parameter was
improperly specified
172
FE_BadInsertPos
The textLocp was not valid
FE_NotTextObject
The textLocp was not a text location
FDK Programmer’s Reference
F_ApiFind()
...
FDK Function Reference
Example
The following code searches the specified document from the beginning of the current
selection for the first occurrence of a text string:
. . .
F_ObjHandleT docId;
F_PropValsT findParams;
F_TextRangeT trSel, trFound;
StringT searchString = (StringT)"findme";
/* Assuming a document has been attached to a window... */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
if (docId == 0)
return;
/* Set ‘trSel’ to the text range of the selection */
trSel = F_ApiGetTextRange(FV_SessionId, docId,
FP_TextSelection);
if (trSel.beg.objId == 0 && trSel.end.objId == 0)
return;
/* Allocate and initialize ‘findParams’ */
findParams = F_ApiAllocatePropVals(1);
findParams.val[0].propIdent.num = FS_FindText;
findParams.val[0].propVal.valType = FT_String;
findParams.val[0].propVal.u.sval =
F_StrCopyString(searchString);
/* Perform the text string search */
trFound = F_ApiFind(docId, &trSel.beg, &findParams);
/* Free the F_PropValsT structures */
F_ApiDeallocatePropVals(&findParams);
. . .
FDK Programmer’s Reference 173
3
174
FDK Function Reference
F_ApiFind()
FDK Programmer’s Reference
F_ApiGetAllKeyDefinitions()
2
...
FDK Function Reference
FDK Function Reference
F_ApiGetAllKeyDefinition s()
F_ApiGetAllKeyDefinitions() gets all the key definitions from the specified key
catalog.
Synopsis
#include "fapi.h"
. . .
F_TypedValsT F_ApiGetAllKeyDefinitions(F_ObjHandleT
keyCatalogId, IntT filterType)
Arguments
keyCatalogId
The ID of the key catalog from which to get the key definitons.
filterType
Specifies the type of key fields to get for each key definition.
flterType can have the following values:
FV_KeyDefFieldsTypePrimary:
Gets only the primary key fields (Tag, Target, SrcFile, and
Duplicate)
FV_KeyDefFieldsTypeAll:
Gets all key fields.
Returns
Returns the information in an F_TypedValsT structure as follows: FieldTag is of
type FT_Integer. FieldValue is of type as specified in the table below. .
FieldTag value
FieldValue type
FV_KeydefKeyAttrs
FT_AttributesEx
FV_KeydefKeyDefaultText
FT_String
FV_KeydefKeyDuplicate
FT_Integer
FV_KeydefKeyFoundInRefFile
FT_Integer
FV_KeydefKeyInValid
FT_Integer
FV_KeydefKeySrcFile
FT_String
FV_KeydefKeySrcType
FT_Integer
FV_KeydefKeyTag
FT_String
FV_KeydefKeyTarget
FT_String
FV_KeydefKeyVarList
FT_Vals
FDK Programmer’s Reference 175
4
FDK Function Reference
F_ApiGetAllKeyDefinitions()
If F_ApiGetAllKeyDefinitions() fails, the API assigns one of the following
values to FA_errno.
St ru cture d
FA_errno value
Meaning
FE_BadObjId
The ID provided does not specify a key catalog.
FE_KeyCatalogNotLoaded
The key catalog provided is currently not loaded.
FE_KeyCatalogIsStale
The key catalog provided is currently marked as stale
and needs to be re-loaded before using.
FE_BadFilterType
The filter type provided is not valid.
F_ApiGetAttributeDefs( )
F_ApiGetAttributeDefs() gets an element definition’s attribute definitions.
Synopsis
#include "fapi.h"
. . .
F_AttributeDefsT F_ApiGetAttributeDefs(
F_ObjHandleT docId,
F_ObjHandleT elemDefId);
Arguments
docId
The ID of the document or book containing the element definition
elemDefId
The ID of the element definition for which to get attribute definitions
Returns
An F_AttributeDefsT structure specifying the attribute definitions. The
F_AttributeDefsT structure is defined as:
typedef struct {
UIntT len;
F_AttributeDefT *val;
} F_AttributeDefsT;
176
FDK Programmer’s Reference
F_ApiGetAllKeyDefinitions()
...
FDK Function Reference
The F_AttributeDefT structure describes an attribute definition. It is defined as:
typedef struct {
StringT name; /* The attribute name. */
BoolT required; /* True if the attribute is required. */
BoolT readOnly; /* True if the attribute is read only. */
IntT attrType; /* The attribute type. See following table. */
F_StringsT choices;/* Choices if attrType is FV_AT_CHOICES.*/
F_StringsT defValues;/* The default if the attribute is not
** required. If attrType is
** FV_AT_REALS, FV_AT_STRINGS, etc,
** the default can have multiple strings.
*/
StringT rangeMin; /* The minimum allowed value (if any). */
StringT rangeMax; /* The maximum allowed value (if any). */
} F_AttributeDefT;
The F_AttributeDefT.attrType field identifies the attribute value’s type. It can
specify one of the following constants.
attrType constant
Attribute value type
FV_AT_STRING
Any arbitrary text string
FV_AT_STRINGS
One or more arbitrary text strings
FV_AT_CHOICES
A value from a list of choices
FV_AT_INTEGER
A signed whole number (optionally restricted to a range of
values)
FV_AT_INTEGERS
One or more integers (optionally restricted to a range of
values)
FV_AT_REAL
A real number (optionally restricted to a range of values)
FV_AT_REALS
One or more real numbers (optionally restricted to a range of
values)
FV_AT_UNIQUE_ID
A string that uniquely identifies the element
FV_AT_UNIQUE_IDREF
A reference to a UniqueID attribute
FV_AT_UNIQUE_IDREFS
One or more references to UniqueID attributes
FDK Programmer’s Reference 177
4
FDK Function Reference
F_ApiGetAllKeyDefinitions()
If F_ApiGetAttributeDefs() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_WrongProduct
The current FrameMaker product doesn’t support the
requested operation.
FE_BadObjId
Invalid object ID
Example
The following code gets the attribute definitions from the Chapter element definition
and prints the names of the required attributes:
. . .
F_ObjHandleT docId, edefId;
F_AttributeDefsT attributeDefs;
UIntT i;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
edefId = F_ApiGetNamedObject(docId, FO_ElementDef, "Chapter");
attributeDefs = F_ApiGetAttributeDefs(docId, edefId);
for(i=0; i0)
{
/* Code to do something with aUBytes goes here. */
}
} while (n > 0);
F_ApiGetIntByName(docId, insetId, ""); /* Commit transaction. */
F_ApiDeallocateUBytes(&aUBytes);
. . .
See also
F_ApiSetUBytesByName().
F_ApiGetUniqueObject()
F_ApiGetUniqueObject() gets the ID of an object from its persistent unique
identifier (UID). FrameMaker products assign a UID to each object in a document or
book that isn’t identified by a name. The UID, unlike the object’s ID, does not change
from one session to another.
..............................................................................
IMPORTANT: When you copy an object to the clipboard and paste it, the FrameMaker
product changes the UID. This also happens when you hide and show conditional text.
..............................................................................
Synopsis
F_ObjHandleT F_ApiGetUniqueObject(F_ObjHandleT docId,
IntT objType,
IntT unique);
FDK Programmer’s Reference 275
4
FDK Function Reference
F_ApiGetUniqueObject()
Arguments
docId
The ID of the document containing the object
objType
The type of object (for example, FO_Pgf)
unique
The object’s UID
Returns
The ID of the object, or 0 if an error occurs.
If F_ApiGetUniqueObject() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_TypeUnNamed
Objects of the specified type aren’t identified by UIDs
FE_NameNotFound
Object with specified UID couldn’t be found
Example
The following code will build a client gets and saves the location of the current insertion
point (or the beginning of the current text selection) when the user chooses a menu item
named Save Position. If the user subsequently chooses the Return to Previous Position
menu item, the client scrolls to the saved insertion point, even if the document has been
exited and reopened in the meantime.
276
FDK Programmer’s Reference
F_ApiGetUniqueObject()
...
FDK Function Reference
#include "fapi.h"
#define SAVE 1
#define LAST 2
IntT pgfUID;
F_TextRangeT tr;
VoidT F_ApiInitialize(initialization)
IntT initialization;
{
F_ObjHandleT menuBarId, menuId;
menuBarId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"!MakerMainMenu");
menuId = F_ApiDefineAndAddMenu(menuBarId, "APIMenu", "API");
F_ApiDefineAndAddCommand(SAVE, menuId,"SaveLastPosCmd",
"Save position","");
F_ApiDefineAndAddCommand(LAST, menuId,"ReturnToLastPosCmd",
"Return to previous position","");
}
VoidT F_ApiCommand(command)
IntT command;
{
F_ObjHandleT docId, pgfId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
switch(command)
{
case SAVE: /* Get and save the insertion point. */
tr = F_ApiGetTextRange(FV_SessionId, docId,
FP_TextSelection);
if (!tr.beg.objId) return;
/* Get UID of paragraph containing insertion point.*/
pgfUID = F_ApiGetInt(docId, tr.beg.objId, FP_Unique);
break;
FDK Programmer’s Reference 277
4
FDK Function Reference
F_ApiGetUpdateBookDefaultParams()
case LAST: /* Scroll to saved insertion point. */
if (!pgfUID) break; /* Break if no insertion point. */
/* Get paragraph ID from its UID. Then scroll to it. */
pgfId = F_ApiGetUniqueObject(docId, FO_Pgf, pgfUID);
tr.beg.objId = tr.end.objId = pgfId;
F_ApiScrollToText(docId, &tr);
}
}
See also
F_ApiGetNamedObject().
F_ApiGetUpdateBookDefaultParams()
F_ApiGetUpdateBookDefaultParams() gets a default property list that you can
use to call F_ApiUpdateBook().
Synopsis
#include "fapi.h"
. . .
F_PropValsT F_ApiGetUpdateBookDefaultParams();
Arguments
None.
Returns
A property list (an F_PropValsT data structure) with the properties shown in the
following table. The first value listed by each property is the value that
F_ApiGetUpdateBookDefaultParams() assigns to the property. The other
values are values you can set the property to.
F_ApiGetUpdateBookDefault
Params() property
Instruction or situation and possible values
FS_AlertUserAboutFailure
Alert user with warnings and messages if necessary.
False: don’t notify user when unexpected conditions
occur.
True: notify user when unexpected conditions occur.
278
FDK Programmer’s Reference
F_ApiGetUpdateBookDefaultParams()
F_ApiGetUpdateBookDefault
Params() property
FS_AllowInconsistentNum
Props
...
FDK Function Reference
Instruction or situation and possible values
Allow the FrameMaker product to update numbering,
text insets, etc. of all the FrameMaker documents in
the book, even if there are documents in the book with
numbering properties that don’t match the properties
specified in the book.
FV_DoOK: update numbering even if there are
inconsistent properties in the book
FV_DoCancel: cancel the update operation when it
encounters a document with inconsistent numbering
properties
FV_DoShowDialog: show dialog box and let user
decide
FS_AllowNonFMFiles
Allow the FrameMaker product to update numbering,
text insets, etc. of all the FrameMaker documents in
the book, even if there are documents in the book that
were not created by a FrameMaker product.
FV_DoOK: update the book even if the book contains
files not created by a FrameMaker product
FV_DoCancel: cancel the update operation when it
encounters a document not created by a FrameMaker
product
FV_DoShowDialog: show dialog box and let user
decide
FS_AllowViewOnlyFiles
Allow the FrameMaker product to update view-only
documents in the book.
FV_DoOK: update the view-only documents
FV_DoCancel: cancel the entire update operation
when it encounters a view-only document
FV_DoShowDialog: show dialog box and let user
decide
FS_MakeVisible
Make newly generated files (lists and indexes) visible.
True: make visible
False: don’t make visible
FS_NumExportParams
The available number of properties in the export script
that user can set.
FS_NumExportReturnParams
The number of parameters returned by the export
script.
FDK Programmer’s Reference 279
4
FDK Function Reference
F_ApiGetUpdateBookDefaultParams()
F_ApiGetUpdateBookDefault
Params() property
Instruction or situation and possible values
FS_ShowBookErrorLog
Display the book error log for this update operation.
False: don’t display the error log; all warnings and
errors go to the console
True: display the error log
FS_UpdateBookGenerated
Files
Update generated files such as TOC, lists, and indexes.
Only update those generated files that have
FP_GenerateInclude set to True in their
associated FO_BookComponent objects.
True: update generated files
False: don’t update generated files
FS_UpdateBookNumbering
Update numbering in all the book’s documents.
True: update numbering
False: don’t update numbering
FS_UpdateBookOleLinks
Update OLE links in all the book’s documents.
True: update OLE links
False: don’t update OLE links
FS_UpdateBookText
References
Update text insets in all the book’s documents.
True: update text insets
False: don’t update text insets
FS_UpdateBookXRefs
Update cross-references in all the book’s documents.
True: update cross-references
False: don’t update cross-references
..............................................................................
IMPORTANT: The returned F_PropValsT structure references memory that is
allocated by the API. Use F_ApiDeallocatePropVals() to free this memory when
you are done with it.
..............................................................................
If F_ApiGetOpenDefaultParams() fails, the API sets the len field of the
returned structure to 0.
280
FDK Programmer’s Reference
F_ApiGetUpdateBookDefaultParams()
...
FDK Function Reference
Example
The following code gets a default Update Book script with
F_ApiGetUpdateBookDefaultParams(). It modifies the script to instruct the
FrameMaker product to prompt the user if the book contains non-FrameMaker files. It
then uses the script to call F_ApiUpdateBook().
. . .
IntT i;
F_PropValsT script, *returnp = NULL;
F_ObjHandleT bookId;
bookId = F_ApiGetId(0, FV_SessionId, FP_ActiveBook);
if(!bookId)
return;
/* Get default property list. */
script = F_ApiGetUpdateBookDefaultParams();
/* Get indexes of properties and change them. */
i = F_ApiGetPropIndex(&script, FS_AlertUserAboutFailure);
script.val[i].propVal.u.ival = True;
i = F_ApiGetPropIndex(&script, FS_AllowNonFMFiles);
script.val[i].propVal.u.ival = FV_DoShowDialog;
/* Update the book */
F_ApiUpdateBook(bookId, &script, &returnp);
/* Free memory used by Update Book scripts. */
F_ApiDeallocatePropVals(&script);
F_ApiDeallocatePropVals(returnp);
. . .
See also
F_ApiUpdateBook().
FDK Programmer’s Reference 281
4
FDK Function Reference
F_ApiGetVal()
F_ApiGetVal()
F_ApiGetVal() queries a property of any type. If you know a property’s type, it is
normally easier to get its value by calling an F_ApiGet
() function,
such as F_ApiGetInt().
Synopsis
F_TypedValT F_ApiGetVal(F_ObjHandleT docId,
F_ObjHandleT objId,
IntT propNum);
Arguments
docId
The ID of the document, book, or session containing the object whose property
you want to query. If the object is a session, specify 0.
objId
The ID of the object whose property you want to query.
propNum
The property to query. Specify an API-defined constant, such as FP_FnNum.
Returns
The F_TypedValT structure for the specified property.
If F_ApiGetVal() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_BadPropNum
Specified property number is invalid
FE_BadPropType
Incorrect property type for this function
FE_WrongProduct
Current FrameMaker product doesn’t support the operation
Example
The following code prints the name of the current FrameMaker product:
. . .
F_TypedValT val;
val = F_ApiGetVal(FV_SessionId, FV_SessionId, FP_ProductName);
F_Printf(NULL,"The product name is %s.\n", val.u.sval);
. . .
282
FDK Programmer’s Reference
F_ApiGetVal()
...
FDK Function Reference
See also
F_ApiDeallocateStructureType() and F_ApiGetProps().
FDK Programmer’s Reference 283
4
284
FDK Function Reference
F_ApiGetVal()
FDK Programmer’s Reference
F_ApiHypertextCommand()
2
...
FDK Function Reference
FDK Function Reference
F_ApiHypertextCommand()
F_ApiHypertextCommand() simulates a user-invoked hypertext command. Calling
F_ApiHypertextCommand() has the same effect as a user clicking on a hypertext
marker containing the specified text.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiHypertextCommand(F_ObjHandleT docId,
StringT hypertext);
Arguments
docId
The ID of the document that you want to act as the source of the hypertext
command.
hypertext
A hypertext command to execute, such as gotolink or previouslink.
You can specify any command that would be valid in a hypertext marker in
the document specified by docId.
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiHypertextCommand() fails, the API assigns the following value to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
Example
The following code executes a hypertext command to return to the previous hypertext
link:
. . .
F_ObjHandleT docId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
F_ApiHypertextCommand(docId, "previouslink");
. . .
FDK Programmer’s Reference 285
2
FDK Function Reference
F_ApiImport()
F_ApiImport()
F_ApiImport() imports text or graphics into a document.
F_ApiImport() allows you to specify a script (property list) telling the FrameMaker
product how to import text or graphics and how to deal with error and warning
conditions. For example, you can specify whether to import a file by reference or by
copy.
If you import a file by reference, F_ApiImport() creates an inset. The following
table summarizes the types of files you can import with F_ApiImport() and the
types of inset objects it creates when you import them by reference.
File type
Type of inset object F_ApiImport() creates
Graphics
FO_Inset
Text
FO_TiText
FO_TiTextTable
Frame binary document
FO_TiFlow
MIF
FO_TiFlow
When importing a graphic, you can specify that it be imported at its default resolution
by setting the FS_GraphicDpi property to 0 and setting the
FS_FitGraphicInSelectedRect property to False. If the graphic has no default
resolution, it is imported at 72 dpi.
For graphic objects, FrameMaker automatically determines whether the object-path is a
local path or an HTTP path and acts accordingly.For example, if the path is an HTTP
path, the object is downloaded before importing it in the file.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiImport(F_ObjHandleT enclosingDocId,
F_TextLocT *textLocP,
StringT filename,
F_PropValsT *importParamsp,
F_PropValsT **importReturnParamspp);
286
FDK Programmer’s Reference
F_ApiImport()
...
FDK Function Reference
Arguments
enclosingDocId
The ID of the document into which to import the file.
textLocP
The text location at which to import the file.
fileName
The full pathname of the file to import. For information on
how to specify pathnames on different platforms, see the FDK
Platform Guide for your platform.
importParamsp
A property list telling the FrameMaker product how to import
the file and how to respond to errors and other conditions. To
use the default list, specify NULL.
importReturnParamspp
A property list that provides information about how the
FrameMaker product imported the file. It must be initialized
before you call F_ApiImport().
..............................................................................
IMPORTANT: Always initialize the pointer to the property list that you specify for
importReturnParamspp to NULL before you call F_ApiImport().
..............................................................................
To get a property list to specify for the importParamsp parameter, use
F_ApiGetImportDefaultParams() or create the list from scratch. For a list of all
the properties an Import script property list can include, see
“F_ApiGetImportDefaultParams()” on page 193.
Returns
The ID of the inset that F_ApiImport() creates. Or 0 if F_ApiImport() imports
by copy or creates a graphic inset.
If F_ApiImport() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_SystemError
System error, such as an unreadable file or
insufficient memory
FE_BadParameter
The property list contained an invalid parameter
FE_BadFileType
The specified file exists, but it does not have the
correct file type
FE_MissingFile
The specified file does not exist
FE_NoSuchFlow
The script specifies an import flow that does not
exist
FE_FailedState
Internal error
FDK Programmer’s Reference 287
2
FDK Function Reference
F_ApiImport()
FA_errno value
Meaning
FE_CircularReference
Importing the specified file causes a circular
reference
FE_FileClosedByClients
The file was closed by a client before it could be
imported
The property list returned to importReturnParamspp has the properties shown in
the following table.
Property
Meaning and Possible Values
FS_ImportedFileName
A string specifying the source file’s pathname. If you scripted
FS_ShowBrowser, this pathname can be different from the
one you specified in the Import script.
FS_ImportNativeError
The error condition; normally the same value as FA_errno.
If the file is imported successfully, it is set to FE_Success.
See the table below for a list of possible values.
FS_ImportStatus
A bit field indicating what happened when the file was
imported. See the table below for a list of possible flags.
Both the FS_ImportNativeError property and the FA_errno global variable
indicate the result of a call to F_ApiImport(). The following table lists the possible
288
FDK Programmer’s Reference
F_ApiImport()
...
FDK Function Reference
status flags and the FA_errno and FS_ImportNativeError values associated
with them.
FS_ImportNativeError and
FA_errno values
FE_BadParameter,
FE_BadFileType,
FE_MissingFile,
FE_FailedState, or
FE_CanceledByClient
(file was not imported)
Possible FS_ImportStatus flags
FV_BadImportFileName: the specified source filename is
invalid
FV_BadImportFileType: the Import script specified a file
type different from the source file’s actual type
FV_BadImportScriptValue: the Import script contained an
invalid property value
FV_BadTextFileTypeHint: The file was a text file, and the string
in FS_FileTypeHint was not a valid import hint string. For
information on the syntax of this string, see “Syntax of
FP_ImportHint strings” on page 939.
FV_MissingScript: F_ApiImport() was called without a
script.
FV_DisallowedImportType: source file’s type disallowed
by script.
FV_NoMainFlow: script specified to import the main flow, but
the source file does not have a main flow.
FV_NoFlowWithSpecifiedName: script specified a flow
name that does not exist
FV_InsertionPointNotInText: the insertion point in the
enclosing document is not in text
FV_InsufficientMemory: there is insufficient memory to
import the source file
FV_BadEnclosingDocId: there is no open document with the
specified ID
FV_ImportFileNotReadable: the specified source file is
unreadable
FDK Programmer’s Reference 289
2
FDK Function Reference
F_ApiImport()
FS_ImportNativeError and
FA_errno values
FE_Success
Possible FS_ImportStatus flags
FV_ImportedByCopy: the source file was imported
by copy
FV_ImportedText: the source file is a text file
FV_ImportTextTable: the source file is a text file, which
was imported into a table.
FV_ImportedMIF: the source file is a MIF file
FV_ImportedMakerDoc: the source file is a FASL file.
FV_ImportedFilteredFile: the source file was filtered
FV_ImportedGraphicFile: the source file is a
graphics file
FV_ImportedSgmlDoc: the source file is an SGML document
FV_ImportedXmlDoc: the source file is an XML
document
290
FDK Programmer’s Reference
F_ApiImport()
FS_ImportNativeError and
FA_errno values
FE_Cancel
...
FDK Function Reference
Possible FS_ImportStatus flags
FV_CancelFileText: the file is text, so the user or the Import
script canceled the Import operation
FV_CancelFileGraphic: the source file is a graphic, so the
user or the Import script canceled the Import operation
FV_CancelFileMacEdition: the source file is a Macintosh
Edition, so the Import script canceled the Import operation
FV_CancelFileDoc: the file is a FASL file, so the user or the
script canceled the Import operation
FV_CancelFileSgml: the file is an SGML document, so the
user or the script canceled the Import operation
FV_CancelFileXML: the file is an XML document, so the user
or the script canceled the Import operation
FV_CancelFileMIF: the source file is a MIF file, so the user or
the script canceled the Import operation
FV_CancelFileFilterable: the source file is a filterable
file, so the user or the script canceled the Import operation
FV_InsertionPointInFootnote: the insertion point was
in a footnote and the import script specified to import the file as
a table, so the file could not be imported
FV_InsertionPointInTableCell: the insertion point was
in a table cell and the import script specified to import the file as
a table, so the file could not be imported
FV_UserCanceledImport: the user canceled the Import
operation
FV_UserCanceledImportBrowser: the user canceled the
Import browser
To determine whether a particular FS_ImportStatus bit is set, use
F_ApiCheckStatus(). For more information, see “F_ApiCheckStatus()” on
page 96.
After you are done with the property lists you use to call F_ApiImport(), use
F_ApiDeallocatePropVals() to deallocate the memory they use. Calling
F_ApiImport() again also deallocates the memory.
FDK Programmer’s Reference 291
2
FDK Function Reference
F_ApiImport()
Example
The following code imports a graphic file, named agraphic.xwd, by reference.
. . .
F_PropValsT params, *returnParamsp = NULL;
F_ObjHandleT docId;
F_TextRangeT tr;
IntT i;
/* Get default import list. Return if it can’t be allocated. */
params = F_ApiGetImportDefaultParams();
if(params.len == 0) return;
/* Get current insertion point. Return if there isn’t one. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(0, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
/* Change properties to disallow nongraphic files. */
i = F_ApiGetPropIndex(¶ms, FS_DisallowDoc);
params.val[i].propVal.u.ival = True;
i = F_ApiGetPropIndex(¶ms, FS_DisallowMIF);
params.val[i].propVal.u.ival = True;
i = F_ApiGetPropIndex(¶ms, FS_DisallowPlainText);
params.val[i].propVal.u.ival = True;
/* Set properties to import graphic at default resolution*/
i = F_ApiGetPropIndex(¶ms, FS_GraphicDpi);
params.val[i].propVal.u.ival = 0;
i = F_ApiGetPropIndex(¶ms, FS_FitGraphicInSelectedRect);
params.val[i].propVal.u.ival = False;
F_ApiImport(docId, &tr.beg, "/tmp/agraphic.xwd",
¶ms, &returnParamsp);
if (F_ApiCheckStatus(returnParamsp, FV_BadImportFileType))
F_ApiAlert("File isn’t a graphic.", FF_ALERT_CONTINUE_NOTE);
/* Deallocate property lists. */
F_ApiDeallocatePropVals(¶ms);
F_ApiDeallocatePropVals(returnParamsp);
. . .
292
FDK Programmer’s Reference
F_ApiInitialize()
...
FDK Function Reference
See also
“F_ApiCheckStatus()” on page 96, “F_ApiGetOpenDefaultParams()” on page 219,
“F_ApiPrintOpenStatus()” on page 370, and “F_ApiSimpleOpen()” on page 465.
F _ A p i I n i t i al i ze ( )
F_ApiInitialize() is a callback that you define in your client to respond to a
FrameMaker product attempting to initialize your client.
F_ApiInitialize should be called for all APIs clients, including filters and
document reports. This enables filters and document reports to make the
F_ApiEnableUnicode(True) call necessary for enabling Unicode Mode. If
Unicode Mode isn’t enabled, sparm received in F_ApiNotify isn’t in Unicode
because the API runs in Compatibility Mode. For more information on Unicode Mode
and Compatibility Mode, see Chapter 1, “Working with Unicode.” in the FDK
Programmer’s Reference.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiInitialize(initialization)
IntT initialization;
Arguments
initialization
A constant that indicates the type of initialization
The following table summarizes the different types of initializations and the
initialization constants FrameMaker products can use to call call
F_ApiInitialize().
FDK Programmer’s Reference 293
2
FDK Function Reference
F_ApiInitialize()
When F_ApiInitialize() is
called
Initialization flag
FrameMaker product
starts with no special
options
After starting
FA_Init_First
All except document
reports and filters
FrameMaker product
starts with take-control
client
After starting
FA_Init_First
All except document
reports and filters
After all API clients
have finished processing
the FA_Init_First
initialization
FA_Init_TakeControl
Client that takes
control of the session
Document report chosen
from Document Reports
dialog box
After report is chosen
FA_Init_DocReport
The chosen document
report
Notification, menu
choice, or hypertext
command for a client
that has bailed out
When the menu item is
chosen, the hypertext
command is clicked, or
the notification should
be issued
FA_Init_Subsequent
Clients that have
bailed out and are
waiting for an event, a
menu choice, or a
hypertext command to
occur
Type of initialization
Clients that receive
initialization
Returns
VoidT.
Example
The following code displays a dialog box after the FrameMaker product is started:
. . .
VoidT F_ApiInitialize(initialization)
IntT initialization;
{
if (initialization == FA_Init_First)
F_ApiAlert("API client has started.", FF_ALERT_CONTINUE_NOTE);
}
. . .
See also
“F_ApiNotification()” on page 339.
294
FDK Programmer’s Reference
F_ApiIsEncodingSupported()
...
FDK Function Reference
F_ApiIsEncodingSupported()
F_ApiIsEncodingSupported() checks whether the specified encoding is
supported for the current session. For example, unless FrameMaker is running on a
system that supports Japanese text, Japanese encoding is not supported.
Synopsis
#include "fapi.h"
. . .
BoolT F_ApiIsEncodingSupported(ConStringT encodingName);
Arguments
encodingName
The encoding you want to test.
Allowed values for encodingName are:
Value
Means
FrameRoman
Roman text
JISX0208.ShiftJIS
Japanese text
BIG5
Traditional Chinese text
GB2312-80.EUC
Simplified Chinese text
KSC5601-1992
Korean text
Returns
True if the specified encoding is supported for the current session; otherwise returns
False.
Example
The following code checks to see whether Japanese text is supported for the current
session:
. . .
BoolT isSupported;
isSupported = F_ApiIsEncodingSupported(
(ConString) "JISX0208.ShiftJIS");
. . .
FDK Programmer’s Reference 295
2
FDK Function Reference
F_ApiLoadMenuCustomizationFile()
F_Api LoadMenuCustomi zati onFil e ()
F_ApiLoadMenuCustomizationFile() loads a menu customization file. A menu
customization file is a text file containing statements that change the menus and
commands the user sees in the FrameMaker product. For example, a menu
customization file can change the name of a command or move a command from one
menu to another.
For information on writing menu customization files, see the online manual
Customizing FrameMaker products.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiLoadMenuCustomizationFile(StringT pathname,
BoolT silent);
Arguments
pathname
The pathname of the menu customization file to load. If you specify only a
filename, the function looks in the client directory. If silent is set to False,
the pathname specified by pathname is used as the default in the Menu
Customization File dialog box.
silent
Specifies whether to display the Menu Customization File dialog box and allow
the user to choose the file. To display the dialog box and allow the user to choose
the file, specify False. To use the file specified by pathname without asking
the user, specify True.
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiLoadMenuCustomizationFile() fails, the API assigns one of the
following values to FA_errno.
296
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this operation or
fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_BadParameter
Parameter has an invalid value
FE_SystemError
System error
FDK Programmer’s Reference
F_ApiMakeTblSelection()
...
FDK Function Reference
Example
The following code loads a menu customization file named mymenus.cfg, without
notifying the user:
. . .
F_ApiLoadMenuCustomizationFile("c:\\maker\\fmint\\mymenus.cfg",
True);
. . .
F _ A p i M a k eT b l S el e ct i o n ()
F_ApiMakeTblSelection() selects a range of cells in a table.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiMakeTblSelection(F_ObjHandleT docId,
F_ObjHandleT tableId,
IntT topRow,
IntT bottomRow,
IntT leftCol,
IntT rightCol);
Arguments
docId
The ID of the document containing the table.
tableId
The ID of the table containing the rows to select.
topRow
The number of the first row in the selection. The rows are numbered from top
to bottom, starting with 0 (including heading rows). To select the entire table,
specify FF_SELECT_WHOLE_TABLE.
bottomRow
The number of the last row in the selection.
leftCol
The number of the leftmost column in the selection. The columns are
numbered from left to right, starting with 0.
rightCol
The number of the rightmost column in the selection.
To select an entire table, including the table title, set topRow to
FF_SELECT_WHOLE_TABLE. F_ApiMakeTblSelection() ignores the values for
the other parameters.
FDK Programmer’s Reference 297
2
FDK Function Reference
F_ApiMenuItemInMenu()
..............................................................................
IMPORTANT: F_ApiMakeTblSelection() can’t select different types of rows at
the same time, unless you set topRow to FF_SELECT_WHOLE_TABLE or you set
topRow and bottomRow to select one or more entire columns.
..............................................................................
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiMakeTblSelection() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid table ID
FE_BadOperation
Parameters specify an action that is invalid
FE_OutOfRange
Row or column specification not in table
FE_BadParameter
Parameter has an invalid value
Example
The following code selects the cells R1-C1 to R2-C2 in a table:
. . .
F_ObjHandleT docId, tblId;
/* Get the document and table IDs. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tblId = F_ApiGetId(FV_SessionId, docId, FP_FirstTblInDoc);
/* Select the cells. If row 0 is a heading row and
** row 1 is a body row, this call won’t work.
*/
F_ApiMakeTblSelection(docId, tblId, 0, 1, 0, 1);
. . .
F_ApiMenuItemInMenu()
F_ApiMenuItemInMenu() determines if a menu item or menu is on a menu or menu
bar.
298
FDK Programmer’s Reference
F_ApiMenuItemInMenu()
...
FDK Function Reference
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiMenuItemInMenu (F_ObjHandleT menuId,
F_ObjHandleT menuitemId,
BoolT recursive);
Arguments
menuId
The menu or menu bar to search.
menuitemId
The ID of the menu item or menu to search for.
recursive
Specifies whether to search the submenus of the menu or menu bar
specified by menuId. Specify True to search them.
Returns
The ID of the menu on which F_ApiMenuItemInMenu() found the object specified
by menuitemId, or 0 if it did not find the object.
If F_ApiMenuItemInMenu() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this operation or
fmbatch is running
FE_BadOperation
Parameters specify an invalid operation
FE_BadParameter
Parameter has an invalid value
FDK Programmer’s Reference 299
2
FDK Function Reference
F_ApiMenuItemInMenu()
Example
The following code searches the Edit menu and its submenus for the Copy menu item:
. . .
F_ObjHandleT copyCmdId, menuId, returnId;
menuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu,
"EditMenu");
copyCmdId = F_ApiGetNamedObject(FV_SessionId, FO_Command,
"Copy");
returnId = F_ApiMenuItemInMenu(menuId, copyCmdId, True);
if(returnId == menuId)
F_ApiAlert("Copy is on the Edit menu." ,
FF_ALERT_CONTINUE_NOTE);
else if (!returnId)
F_ApiAlert("Copy is not on the Edit menu." ,
FF_ALERT_CONTINUE_NOTE);
else
F_ApiAlert("Copy is on a pull-right of the Edit menu.",
FF_ALERT_CONTINUE_NOTE);
. . .
See also
“F_ApiGetNamedObject()” on page 214.
St ru cture d
F_ApiMergeIntoFirst()
F_ApiMergeIntoFirst() merges the selected structural elements into the first
element in the selection.
..............................................................................
IMPORTANT: At least two structural elements must be selected when
F_ApiMergeIntoFirst() is called.
..............................................................................
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiMergeIntoFirst(F_ObjHandleT docId);
300
FDK Programmer’s Reference
F_ApiMenuItemInMenu()
...
FDK Function Reference
Arguments
docId
The ID of the document containing the selected elements
Returns
VoidT.
If F_ApiMergeIntoFirst() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product isn’t supported
FE_BadDocId
Invalid document ID
FE_BadSelectionForOperation
Current text selection is invalid for this operation
Example
The following code merges the selected structural elements in the active document:
. . .
F_ObjHandleT docId;
/* Get the document ID. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
/* Merge the elements. */
F_ApiMergeIntoFirst(docId);
. . .
See also
“F_ApiMergeIntoLast()”.
St ru cture d
F_ApiMergeIntoLast()
F_ApiMergeIntoLast() merges the selected structural elements into the last
element in the selection.
..............................................................................
IMPORTANT: At least two structural elements must be selected when
F_ApiMergeIntoLast() is called.
..............................................................................
FDK Programmer’s Reference 301
2
FDK Function Reference
F_ApiMenuItemInMenu()
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiMergeIntoLast(F_ObjHandleT docId);
Arguments
docId
The ID of the document containing the selected elements
Returns
VoidT.
If F_ApiMergeIntoLast() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product isn’t supported
FE_BadDocId
Invalid document ID
FE_BadSelectionForOperation
Current text selection is invalid for this operation
Example
The following code merges the selected structural elements in the active document:
. . .
F_ObjHandleT docId;
/* Get the document ID. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
/* Merge the elements. */
F_ApiMergeIntoLast(docId);
. . .
See also
“F_ApiMergeIntoFirst()” on page 300.
302
FDK Programmer’s Reference
F_ApiMessage()
...
FDK Function Reference
F_ApiMessage()
F_ApiMessage() is a callback that you can define in your client. The FrameMaker
product calls F_ApiMessage() when the user clicks a hypertext marker containing
the text message apiclient, where apiclient is the name under which your
client is registered with the FrameMaker product. For information on creating hypertext
markers that message FDK clients, see “Using hypertext commands in your client’s user
interface” on page 213 of the FDK Programmer’s Guide.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiMessage(StringT message,
F_ObjHandleT docId,
F_ObjHandleT objId);
Arguments
message
The string specified by the hypertext command. It is NULL if the user clicked an
inset.
docId
The ID of the document containing the hypertext marker or the inset.
objId
The ID of the hypertext marker or the inset. If the user chooses your client from
the Inset Editors scroll list, it is 0.
Returns
VoidT.
Example
See “Responding to message apiclient commands” on page 214 and “Responding to the
user launching your inset editor” on page 494 of the FDK Programmer’s Guide.
See also
“F_ApiHypertextCommand()” on page 285 and “F_ApiNotify()” on page 349.
F_ApiModalDialog()
F_ApiModalDialog() displays a dialog resource as a modal dialog box. This is the
most common type of dialog box. The user must close the dialog box before continuing,
usually by clicking OK or Cancel.
FDK Programmer’s Reference 303
2
FDK Function Reference
F_ApiModalDialog()
..............................................................................
IMPORTANT: When you are through with it, you should always close a dialog resource
via F_ApiClose(). Also, in some circumstances you might want a custom dialog box
to be modal, and in others you might want it to be modeless. To do this, you should
create two separate dialog resources. Then you should always call one with
F_ApiModalDialog(), and call the other with F_ApiModelessDialog().
..............................................................................
Synopsis
#include "fapi.h"
. . .
IntT F_ApiModalDialog(IntT dlgNum,
F_ObjHandleT dlgId);
Arguments
dlgNum
A unique number to identify the dialog box. The API passes this number
to your client’s F_ApiDialogEvent() callback when there is a user
action in the dialog box. If you don’t want the API to call your client’s
F_ApiDialogEvent() callback when there is a user action, set
dlgNum to 0.
dlgId
The ID of the dialog resource to display.
After calling F_ApiModalDialog(), you must call F_ApiClose() to free memory.
Returns
FE_Success or a nonzero value if the user requested help.
Example
The following code displays a dialog named mydlg as a modal dialog box:
. . .
#define MY_DLG 1
F_ObjHandleT dlgId;
/* Open the resource and display the dialog box. */
dlgId =
Resource(FO_DialogResource, "mydlg");
F_ApiModalDialog(MY_DLG, dlgId);
. . .
F_ApiClose (dlgId, FF_CLOSE_MODIFIED);
. . .
304
FDK Programmer’s Reference
F_ApiModelessDialog()
...
FDK Function Reference
See also
“F_ApiModelessDialog()” on page 305, “F_ApiDialogEvent()” on page 155, and
“F_ApiOpenResource()” on page 363.
F_ApiModelessDialog()
F_ApiModelessDialog() displays a dialog resource as a modeless
dialog box. Modeless dialog boxes allow the user to switch between the dialog box and
the window that created it. Modeless dialog boxes are preferred when it would be
convenient to keep the dialog box displayed for a while.
..............................................................................
IMPORTANT: When you are through with it, you should always close a dialog resource
via F_ApiClose(). Also, in some circumstances you might want a custom dialog box
to be modal, and in others you might want it to be modeless. To do this, you should
create two separate dialog resources. Then you should always call one with
F_ApiModalDialog(), and call the other with F_ApiModelessDialog().
..............................................................................
Synopsis
#include "fapi.h"
. . .
IntT F_ApiModelessDialog(IntT dlgNum,
F_ObjHandleT dlgId);
Arguments
dlgNum
A unique number to identify the dialog box. The API passes this number
to your client’s F_ApiDialogEvent() callback when there is a user
action in the dialog box.
dlgId
The ID of the dialog resource to display.
After calling F_ApiModelessDialog(), you must call F_ApiClose() to free
memory.
Returns
FE_Success or an error code if the dialog resource couldn’t be displayed.
FDK Programmer’s Reference 305
2
FDK Function Reference
F_ApiMoveComponent()
Example
The following code displays a dialog named mydlg as a modeless dialog box:
. . .
#define MY_DLG 1
F_ObjHandleT dlgId;
/* Open the resource and display the dialog box. */
dlgId = F_ApiOpenResource(FO_DialogResource, "mydlg");
F_ApiModelessDialog(MY_DLG, dlgId);
. . .
F_ApiClose (dlgId, FF_CLOSE_MODIFIED);
. . .
See also
“F_ApiModalDialog()” on page 303, “F_ApiDialogEvent()” on page 155, and
“F_ApiOpenResource()” on page 363.
F_ApiMoveComponent()
Moves a book component within the book.
Synopsis
#include "fapi.h"
...
VoidT F_ApiMoveComponent(F_ObjHandleT bookId,
F_ObjHandleT compId,
IntT moveAction);
Arguments
bookId .
compId
The ID of the book that contains the component
moveAction .
Specifies the action to move the component
The ID of the book component that is to be
moved.
You can specify the following values for moveAction.
306
FDK Programmer’s Reference
F_ApiNetLibSetAuthFunction()
...
FDK Function Reference
moveAction
Meaning
FA_COMPONENT_MOVEUP
Move the component up at the same hierarchical
level.
FA_COMPONENT_MOVEDOWN Move the component down at the same
hierarchical level.
FA_COMPONENT_PROMOTE
Move the component to a higher/outer level in
hierarchy.
FA_COMPONENT_DEMOTE
Move the component to a lower/inner level in
hierarchy.
Returns
VoidT
Example
The following code moves up a book component.
. . .
F_ObjHandleT bookId;
F_ObjHandleT comp1Id, comp2Id;
/* Get ID of active book and its second component. */
bookId = F_ApiGetId(0, FV_SessionId, FP_ActiveBook);
comp1Id = F_ApiGetId(FV_SessionId, bookId,
FP_FirstComponentInBook);
comp2Id = F_ApiGetId(bookId, comp1Id,
FP_NextComponentInBook);
/* Move the component. */
F_ApiMoveComponent(bookId, comp2Id,
FA_COMPONENT_MOVEUP);
...
F_ApiNetLib SetAu thFu nction ()
Sets a callback function that is called for setting the username/password information
before performing the NetLib related authentication.
FDK Programmer’s Reference 307
2
FDK Function Reference
F_ApiNetLibSetAuthFunction()
Synopsis
#include "fapi.h"
...
VoidT F_ApiNetLibSetAuthFunction(VoidT (*p_auth_func)(ConStringT
url,
StringT username, StringT password,
IntT *cancelp) );
Arguments
p_auth_func
Callback function that sets the username and
password information for the NetLib related
authentication.
:
NOTE: After registering the callback function, whenever NetLib needs authentication,
it calls this function with the server’s URL as ‘url’ parameter. This function checks the
URL string and accordingly fills-in the username and password fields and sets *cancelp
to 0. If you want to cancel the authentication request from NetLib, set *cancelp to 1. In
this case, set the username and password to empty strings.
To unregister the callback function, call F_ApiNetLibSetAuthFunction() with
NULL as the parameter. Then, FrameMaker’s standard NetLib authentication dialog is
displayed for the purpose.
The server authentication fails if the strings are set with an invalid username or
password through this callback function. NetLib calls the function again and this time
too, the function sets the wrong authentication information. This process will go on and
FrameMaker will hang. Therefore, use some mechanism (like counters) in the callback
function to avoid such a condition. For example, if the authentication requests for a
particular server reaches a certain number of times (say 3), cancel the later requests for
that server.
Returns
VoidT
Example
The following code sets the authentication callback function as ‘SplAuthFunction()’.
The callback function matches the URL provided and fills in the username & password
308
FDK Programmer’s Reference
F_ApiNetLibSetAuthFunction()
...
FDK Function Reference
accordingly.
. . .
F_ApiNetLibSetAuthFunction(SplAuthFunction);
. . .
. . .
VoidT SplAuthFunction(ConStringT url, StringT username,
StringT password, IntT *cancelp)
{
static int attempts_srv1 = 0;
static int attempts_srv2 = 0;
// send authentication information for first three
attempts only
if (attempts_srv1 < 3 &&
F_StrCmp(url, (ConStringT)"hostname:8080") == 0)
{
F_StrCpy(username, (ConStringT)"user123");
F_StrCpy(password, (ConStringT)"pass234");
*cancelp = 0;
attempts_srv1++;
}
else if (attempts_srv2 < 3 &&
F_StrCmp(url, (ConStringT)"cmsserver") == 0)
{
F_StrCpy(username, (ConStringT)"Admin");
F_StrCpy(password, (ConStringT)"Password");
*cancelp = 0;
attempts_srv2++;
}
else
{
F_StrCpy(username, (ConStringT)"");
F_StrCpy(password, (ConStringT)"");
*cancelp = 1;
attempts_srv1 = 0;
FDK Programmer’s Reference 309
2
FDK Function Reference
F_ApiNewAnchoredFormattedObject()
attempts_srv2 = 0;
}
}
. . .
F_ApiNewAnchoredFormattedObject()
F_ApiNewAnchoredFormattedObject() can create the following types of
anchored objects:
FO_Var
FO_XRef
FO_Tbl
F_ApiNewAnchoredFormattedObject() inserts the object at the specified
location in text. It uses arbitrary default properties for the new object. After you have
created the object, you can use the F_ApiSet
() functions to change
its properties.
If you call F_ApiNewAnchoredFormattedObject() to create a table, it uses the
default numbers of rows and columns from the specified Table Catalog format. To use
the default Table Catalog format for a new table, set format to NULL. To specify the
number of rows and columns when you create a table, use F_ApiNewTable().
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewAnchoredFormattedObject(F_ObjHandleT docId,
IntT objType,
StringT format,
F_TextLocT *textLocp);
310
FDK Programmer’s Reference
F_ApiNewAnchoredFormattedObject()
...
FDK Function Reference
Arguments
docId
The ID of the document to which to add the object
objType
The type of object to create (for example, FO_XRef)
format
The string that specifies the object’s format (for example, Heading & Page
for a cross-reference, Format A for a table, or Current Date (Long)
for a variable)
textLocp
The text location at which to insert the anchored object
The F_TextLocT structure is defined as:
typedef struct {
F_ObjHandleT objId; /* ID of the paragraph or text line */
IntT offset; /* From beginning of paragraph or text line */
} F_TextLocT;
Returns
The ID of the new anchored object, or 0 if an error occurs.
If F_ApiNewAnchoredFormattedObject() fails, the API assigns one of the
following values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_NotTextObject
Object specified for text location is not a paragraph (FO_Pgf)
FE_OffsetNotFound
Offset specified for the text location couldn’t be found in the
specified paragraph or text line
FE_BadNew
Object can’t be created; the format specified by format may not
exist
FDK Programmer’s Reference
311
2
FDK Function Reference
F_ApiNewAnchoredObject()
Example
The following code adds a Current Date (Short) variable at the insertion point
(or the beginning of the text selection) of the active document:
. . .
F_TextRangeT tr;
F_ObjHandleT docId, variableId;
/* Get the insertion point. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if (tr.beg.objId == 0) return;
/* Insert the variable. */
variableId = F_ApiNewAnchoredFormattedObject(docId, FO_Var,
"Current Date (Short)", &tr.beg);
. . .
See also
“F_ApiNewAnchoredObject()”.
F_ApiNewAnchoredObject()
F_ApiNewAnchoredObject() can create any of the following anchored objects:
FO_AFrame
FO_Fn
FO_Marker
FO_TiApiClient
FO_Tbl
F_ApiNewAnchoredObject() inserts the object at the specified location in text. It
uses arbitrary default properties for the new object. After you have created the object,
you can use the F_ApiSet
() functions to change its properties.
Tables created by F_ApiNewAnchoredObject() have a single column and a single
body row. It is usually easier to use F_ApiNewTable() to create tables.
312
FDK Programmer’s Reference
F_ApiNewAnchoredObject()
...
FDK Function Reference
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewAnchoredObject(F_ObjHandleT docId,
IntT objType,
F_TextLocT *textlocp);
Arguments
docId
The ID of the document to which to add the object
objType
The type of object to create (for example, FO_Marker or FO_Fn)
textlocp
The text location at which to insert the anchored object
The F_TextLocT structure is defined as:
typedef struct {
F_ObjHandleT objId; /* ID of the paragraph or text line */
IntT offset; /* From beginning of paragraph or text line */
} F_TextLocT;
Returns
The ID of the new anchored object, or 0 if an error occurs.
If F_ApiNewAnchoredObject() fails, the API assigns one of the following values
to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadNew
Anchored object can’t be created
FE_BadObjId
Invalid object ID
FE_BadOperation
Function call specified an illegal operation
FE_NotTextObject
Object specified for the text location is not a paragraph (FO_Pgf)
FE_OffsetNotFound
Offset specified for the text location couldn’t be found in the
specified paragraph or text line
FDK Programmer’s Reference 313
2
FDK Function Reference
F_ApiNewAnchoredObject()
Example
The following code inserts a new anchored frame at the beginning of a paragraph:
. . .
F_TextRangeT tr;
F_ObjHandleT docId, afrmId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
/* Insert the frame. */
afrmId = F_ApiNewAnchoredObject(docId, FO_AFrame, &tr.beg);
. . .
See also
“F_ApiNewAnchoredFormattedObject()” on page 310.
St ru cture d
F_Api NewB o ok Comp onen tInH ierarch y ()
F_ApiNewBookComponentInHierarchy() inserts a book component at a
specified position in a structured book.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewBookComponentInHierarchy(
F_ObjHandleT bookId;
StringT compName,
F_ElementLocT *elemLocp);
Arguments
bookId
The ID of the book to add the component to
compName
The name of the component
elemLocp
The position at which to add the new element
..............................................................................
IMPORTANT: The book you specify for bookId must already be structured.
..............................................................................
314
FDK Programmer’s Reference
F_ApiNewAnchoredObject()
...
FDK Function Reference
Returns
The ID of the new element that corresponds to the book component, or 0 if an error
occurs.
If F_ApiNewBookComponentInHierarchy() fails, the API assigns one of the
following values to FA_errno.
FA_errno value
Meaning
FE_BadBookId
Invalid book ID
FE_BadCompPath
Component name specified for compName is invalid
FE_BadNew
The object can’t be created
FE_BookUnStructured
Specified book is unstructured
Example
The following code adds a component to a book:
. . .
F_ObjHandleT bookId, elemId;
F_ElementLocT elemLoc;
/* Get ID of active book and its highest level element. */
bookId = F_ApiGetId(0, FV_SessionId, FP_ActiveBook);
elemLoc.childId = F_ApiGetId(FV_SessionId, bookId,
FP_HighestLevelElement);
elemLoc.parentId = 0;
elemLoc.offset = 0;
/* Insert the new element. */
elemId = F_ApiNewBookComponentInHierarchy(bookId, "Chapter1",
&elemLoc);
. . .
FDK Programmer’s Reference 315
2
FDK Function Reference
F_ApiNewBookComponentOfTypeInHierarchy()
See also
“F_ApiNewElementInHierarchy()” on page 320 and “F_ApiNewSeriesObject()” on
page 329.
F_ApiNewBookComponentOfTypeInHierarc hy()
Inserts a book component of a specified type at a specified position in a structured
FrameMaker book.
Synopsis
#include "fapi.h"
...
F_ObjHandleT F_ApiNewBookComponentOfTypeInHierarchy(F_ObjHandleT
bookId,
ConStringT compName,
IntT compType,
const F_ElementLocT *elemLocp);
Arguments
You can specify the following values for compType.
compType
Meaning
FV_BK_FOLDER
Folder type book component.
FV_BK_GROUP
Group type book component.
Returns
The ID of the new element that corresponds to the book component, or 0 if an error
occurs.
If F_ApiNewBookComponentOfTypeInHierarchy() fails, the API assigns one of
the following values to FA_errno
316
FA_errno Value
Meaning
FE_BadBookId
FE_BadParameter
FE_BadNew
FE_BookUnStructured
Invalid book ID.
FDK Programmer’s Reference
Invalid compType.
The object can’t be created.
Specified book is unstructured.
F_ApiNewBookComponentOfTypeInHierarchy()
...
FDK Function Reference
Example
The following code adds a component of type folder to a book.
. . .
F_ObjHandleT bookId, elemId;
F_ElementLocT elemLoc;
/* Get ID of active book and its highest level element. */
bookId = F_ApiGetId(0, FV_SessionId, FP_ActiveBook);
elemLoc.childId = F_ApiGetId(FV_SessionId, bookId,
FP_HighestLevelElement);
elemLoc.parentId = 0;
elemLoc.offset = 0;
/* Insert the new element. */
elemId = F_ApiNewBookComponentOfTypeInHierarchy(bookId,
"TechDoc Folder", FV_BK_FOLDER,
&elemLoc);
. . .
St ru cture d
F_ApiNewElement()
F_ApiNewElement() creates a structural element (FO_Element) in a structured
document.
F_ApiNewElement() inserts the new element at the specified location in text, using
the specified element definition.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewElement(F_ObjHandleT docId,
F_ObjHandleT elemDefId,
F_TextLocT *textLocp);
FDK Programmer’s Reference 317
2
FDK Function Reference
F_ApiNewBookComponentOfTypeInHierarchy()
Arguments
docId
The ID of the document to which to add the element
elemDefId
The ID of the element definition for the new element
textLocp
The text location at which to insert the new element
The F_TextLocT structure is defined as:
typedef struct {
F_ObjHandleT objId; /* ID of the paragraph or text line */
IntT offset; /* From beginning of paragraph or text line */
} F_TextLocT;
For object (noncontainer) elements, F_ApiNewElement() inserts the appropriate
type of object for the element. If there is a matching format rule,
F_ApiNewElement() uses it to format the object. Otherwise, it uses one of the
following default formats:
Object type
Object inserted
Format used if no matching
format rule exists
FV_FO_XREF
Cross-reference
Undefined XRef
FV_FO_EQN
Equation
medium
FV_FO_MARKER
Marker
Type 11
FV_FO_TBL
Table with the format
and number of rows and
columns specified by the
table format
Format A if it exists;
otherwise, a table with a
heading row, 8 body rows, a
footing row, and 5 columns
FV_FO_SYS_VAR
Variable
Filename (Long)
FV_FO_GRAPHIC
A centered 1.0-inch by
1.0-inch anchored frame
below the current
position; cropped is off,
and floating is on
Returns
The ID of the new element, or 0 if an error occurs.
318
FDK Programmer’s Reference
F_ApiNewBookComponentOfTypeInHierarchy()
...
FDK Function Reference
If F_ApiNewElement() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadNew
Object can’t be created
FE_BadObjId
Invalid object ID
FE_NotTextObject
Object specified for the text location isn’t a paragraph (FO_Pgf) or
a text line (FO_TextLine)
FE_OffsetNotFound
Offset specified for the text location couldn’t be found in the
specified paragraph or text line
Example
See “Creating objects” on page 357 of the FDK Programmer’s Guide.
FDK Programmer’s Reference 319
2
FDK Function Reference
F_ApiNewBookComponentOfTypeInHierarchy()
See also
“F_ApiUnWrapElement()” on page 479.
St ru cture d
F_ApiNewElementInHierarc hy()
F_ApiNewElementInHierarchy() creates a structural element (FO_Element
object) at a specified location in the element hierarchy of a structured document or
book.
To create the root element for a book, you must use
F_ApiNewElementInHierarchy(); you can’t use F_ApiNewElement().
However, you can’t use F_ApiNewElementInHierarchy() to add elements to an
unstructured document. You must structure the document first by adding a root element
with F_ApiNewElement().
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewElementInHierarchy(F_ObjHandleT docId,
F_ObjHandleT elemDefId,
F_ElementLocT *elemLocp);
Arguments
docId
The ID of the document or book to add the element to
elemDefId
The ID of the element definition for the new element
elemLocp
The location at which the element is inserted
For object (noncontainer) elements, F_ApiNewElementInHierarchy() inserts the
appropriate type of object for the element. If there is a matching format rule,
F_ApiNewElementInHierarchy() uses it to format the object. Otherwise, it uses
one of the following default formats:
320
Object type
Object inserted
Format used if no matching
format rule exists
FV_FO_XREF
Cross-reference
Undefined XRef
FV_FO_EQN
Equation
medium
FV_FO_MARKER
Marker
Type 11
FDK Programmer’s Reference
F_ApiNewBookComponentOfTypeInHierarchy()
...
FDK Function Reference
Object type
Object inserted
Format used if no matching
format rule exists
FV_FO_TBL
Table with the format
and number of rows and
columns specified by the
table format
Format A if it exists;
otherwise, a table with a
heading row, 8 body rows, a
footing row, and 5 columns
FV_FO_SYS_VAR
Variable
Filename (Long)
FV_FO_GRAPHIC
A centered 1.0-inch by
1.0-inch anchored frame
below the current
position
Returns
The ID of the new element, or 0 if an error occurs.
If F_ApiNewElementInHierarchy() fails, the API assigns one of the following
values to FA_errno.
FA_errno value
Meaning
FE_BadBookId
Invalid book (FO_Book object) ID
FE_BadObjId
Invalid element definition (FO_ElementDef object) ID
FE_BadInsertPos
elemLocP specifies an invalid place to insert the element; for
example, it specifies a position before the highest element in the
flow
FDK Programmer’s Reference 321
2
FDK Function Reference
F_ApiNewGraphicObject()
Example
The following code adds a Para element at the insertion point, or the beginning of the
current element selection:
. . .
F_ElementRangeT elemSelect;
F_ObjHandleT docId, elemId, paraEdefId;
/* Get ID of active document and the Para element definition. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
paraEdefId = F_ApiGetNamedObject(docId, FO_ElementDef, "Para");
/* Get current element selection in active document. */
elemSelect = F_ApiGetElementRange(FV_SessionId, docId,
FP_ElementSelection);
if(elemSelect.beg.parentId == 0 || paraEdefId == 0)return;
/* Insert the new element. */
elemId = F_ApiNewElementInHierarchy(docId, paraEdefId,
&elemSelect.beg);
. . .
F_ApiNewGraphicObject()
F_ApiNewGraphicObject() creates the following types of graphic objects:
FO_Arc
FO_Ellipse
FO_Flow 1
FO_Group
FO_Inset
FO_Line
FO_Math
FO_Polyline
FO_Polygon
.................................
1. To create a flow, you must create a text frame. See “Creating flows” on page 366 of the FDK Programmer’s
Guide.
322
FDK Programmer’s Reference
F_ApiNewGraphicObject()
FO_Rectangle
FO_RoundRect
FO_TextFrame
FO_TextLine
FO_UnanchoredFrame
...
FDK Function Reference
To create an anchored frame, use F_ApiNewAnchoredObject().
If there is more than one object within the parent frame,
F_ApiNewGraphicObject() adds the new API graphic object to the end of the
linked list of child objects. That is, it puts it in the front of the back-to-front draw order.
It automatically takes care of updating the object’s FP_PrevGraphicInFrame and
FP_NextGraphicInFrame properties. F_ApiNewGraphicObject() gives the
new API graphic object a set of arbitrary default properties. For example, FP_LocX
and FP_LocY are both 0. After you have created the object, you can use the
F_ApiSet
() functions to change its properties.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewGraphicObject(F_ObjHandleT docId,
IntT objType,
F_ObjHandleT parentId);
Arguments
docId
The ID of the document in which to create the new object
objType
The type of API graphic object to create (for example, FO_Rectangle or
FO_Line)
parentId
The ID of the parent frame in which to create the object
Returns
The ID of the new graphic object, or 0 if an error occurs.
If F_ApiNewGraphicObject() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FDK Programmer’s Reference 323
2
FDK Function Reference
F_ApiNewKeyCatalog()
FA_errno value
Meaning
FE_NotFrame
Specified parent object is not a frame
FE_BadNew
Object can’t be created
Example
The following code creates an ellipse and a text frame within the selected frame:
. . .
F_ObjHandleT docId, parentId, ellpsId, tFramId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
parentId = F_ApiGetId(FV_SessionId,
docId, FP_FirstSelectedGraphicInDoc);
if ((F_ApiGetObjectType(docId, parentId) != FO_AFrame) &&
(F_ApiGetObjectType(docId, parentId) != FO_UnanchoredFrame))
{
F_ApiAlert("Select a frame first.", FF_ALERT_CONTINUE_WARN);
return;
}
ellpsId = F_ApiNewGraphicObject(docId, FO_Ellipse, parentId);
tFramId = F_ApiNewGraphicObject(docId, FO_TextFrame, parentId);
. . .
For an example of how to create a polygon, see “F_ApiSetPoints()” on page 429.
See also
“F_ApiNewAnchoredObject()” on page 312, “F_ApiNewNamedObject()”, and
“F_ApiNewSeriesObject()” on page 329.
F_ApiNewKeyCatalog()
Creates a new key catalog with the specified tag.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewKeyCatalog(StringT tag)
324
FDK Programmer’s Reference
F_ApiNewKeyDefinition()
...
FDK Function Reference
Arguments
tag
The tag of the new key catalog.
Returns
Returns the handle of the new key catalog.
If F_ApiNewKeyCatalog() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadName
The tag provided is not valid.
FE_DupName
A key catalog for the tag provided already exists.
F_ApiNewKeyDefinition()
Adds a new key definition to the specified key catalog.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiNewKeyDefinition(F_ObjHandleT keyCatalogId, StringT
key, StringT href, IntT srcType, StringT srcFile, IntT flags)
FDK Programmer’s Reference 325
2
FDK Function Reference
F_ApiNewKeyDefinition()
Arguments
keyCatalogId
The ID of the key catalog to which the key definiton is being added.
key
The tag of the key for which the key definition is being added.
href
The complete path of the file that the key refers to.
srcType
The type of the file that contains the key definition. See the following
table for a list of values.
srcFile
The complete path of the file that contains the key definition.
flags
Bit flags specifying information about the key definition. See the
following table for a list of flags.
srcType can have one of the following values:
srcType
Meaning
FV_KeySrcTypeNone
Source file type not specified.
FV_KeySrcTypeDitamap
Source file is a DITA Map.
You can OR the following bit-flags into flags:
326
Bit mask
Meaning
FF_DUPLICATE_KEY_DEFINITION
The specified key definiton is duplicate
(that is, it already exists in the key catalog)
and will not be used as active definition for
resolving keys.
FF_FOUND_IN_REFERENCED_FILE
The specified key definiton is contained in a
file referenced directly or indirectly from
the file that contains the key definition
(srcFile).
FF_INVALID_KEY
The specified key definiton is invalid due to
some reason but will still be retained in the
key catalog.
FDK Programmer’s Reference
F_ApiNewNamedObject()
...
FDK Function Reference
Returns
If F_ApiNewKeyDefinition() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadObjId
The ID provided does not specify a key catalog.
FE_BadKey
The key provided is not valid.
FE_KeyDefinitionAlreadyE
xists
The definition for the specified key is already available
in the key catalog and the key definition provided is not
duplicate.
F_ApiNewNamedObject()
F_ApiNewNamedObject() can create the following named objects:
FO_Book
FO_CharFmt
FO_CombinedFontDefn
FO_Color
FO_Command
FO_CondFmt
FO_ElementDef
FO_FmtChangeList
FO_MasterPage
FO_Menu
FO_MenuItemSeparator
FO_PgfFmt
FO_RefPage
FO_RulingFmt
FO_TblFmt
FO_VarFmt
FO_XRefFmt
FDK Programmer’s Reference 327
2
FDK Function Reference
F_ApiNewNamedObject()
F_ApiNewNamedObject() uses arbitrary default properties for the objects it creates.
After you have created the object, you can use the F_ApiSet
()
functions to change its properties.
..............................................................................
IMPORTANT: When you create a new element definition, it does not appear in the
Element Catalog unless you set FP_ElementInCatalog to True.
..............................................................................
..............................................................................
IMPORTANT: When you create a new book and specify a pathname, you must specify an
absolute pathname for the name argument. To create an untitled book, pass an empty
string for the name argument.
..............................................................................
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewNamedObject(F_ObjHandleT docId,
IntT objType,
StringT name);
Arguments
docId
The ID of the document to which to add the object
objType
The type of object to create (for example, FO_MasterPage or FO_PgfFmt)
name
The name to give to the new object
Returns
The ID of the new named object, or 0 if an error occurs.
If F_ApiNewNamedObject() fails, the API assigns one of the following values to
FA_errno.
328
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadName
Specified name for the new object is invalid
FE_BadNew
Object can’t be created
FE_DupName
Specified name for the new object belongs to an existing object
FDK Programmer’s Reference
F_ApiNewSeriesObject()
...
FDK Function Reference
Example
The following code creates a new paragraph format named MyPgfFormat and a new
master page named MyPg:
. . .
F_ObjHandleT docId, pgfFmtId, mstrpgId;
/* Get ID of active document. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
/* Create the paragraph format and master page. */
pgfFmtId = F_ApiNewNamedObject(docId, FO_PgfFmt, "MyPgfFormat");
mstrpgId = F_ApiNewNamedObject(docId, FO_MasterPage, "MyPg");
. . .
See also
“F_ApiNewAnchoredObject()” on page 312, “F_ApiNewGraphicObject()” on
page 322, and “F_ApiNewSeriesObject()”.
F_ApiNewSeriesObject()
F_ApiNewSeriesObject() creates a series object. Series objects include the
following object types:
FO_BodyPage
FO_BookComponent
FO_Pgf
F_ApiNewSeriesObject() allows you to specify the position in the series at which
to add the new object.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewSeriesObject(F_ObjHandleT docId,
IntT objType,
F_ObjHandleT prevId);
Arguments
docId
The ID of the document to which to add the object.
FDK Programmer’s Reference 329
2
330
FDK Function Reference
F_ApiNewSeriesObject()
objType
The type of object to create (for example, FO_BodyPage or FO_Pgf).
prevId
The ID of the object in the series after which to add the new object. To add a
paragraph at the start of a flow, specify the ID of the flow. To add an object at the
beginning of any other series, specify 0.
FDK Programmer’s Reference
F_ApiNewSeriesObject()
...
FDK Function Reference
Returns
The ID of the new series object, or 0 if an error occurs.
If F_ApiNewSeriesObject() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadNew
Object can’t be created
FE_BadObjId
Invalid object ID
FE_NotBodyPage
prevId must specify the ID of a body page
FE_NotPgf
prevId must specify the ID of a paragraph
FE_NotBookComponent
prevId must specify the ID of a book component
Example
The following code inserts a paragraph after the paragraph containing the insertion
point:
. . .
F_ObjHandleT docId, pgfId;
F_TextRangeT tr;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if (tr.beg.objId == 0) return;
pgfId = F_ApiNewSeriesObject(docId, FO_Pgf, tr.beg.objId);
. . .
See also
“F_ApiNewAnchoredObject()” on page 312 and “F_ApiNewNamedObject()” on
page 327.
St ru cture d
F_ApiNewSubObject()
F_ApiNewSubObject() creates the following types of format rule objects:
FO_FmtRule
FO_FmtRuleClause
FDK Programmer’s Reference 331
2
FDK Function Reference
F_ApiNewSeriesObject()
FO_FmtChangeList
To create a named format change list (FO_FmtChangeList object) in the format
change list catalog, use F_ApiNewNamedObject().
F_ApiNewSubObject() allows you to associate the new object with a specified
property of the parent object. For example, you can create an FO_FmtRule as the text
format rule of an element definition or as a subformat rule of a format rule clause.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewSubObject(F_ObjHandleT docOrBookId,
F_ObjHandleT parentId
IntT property);
Arguments
docOrBookId
The ID of the document or book in which to create the new object
parentId
The ID of the object’s parent object
property
The property of the parent object to associate the new object with
The following table shows the parent objects for which you can create format rule
objects. It also lists the properties with which you can associate the new object, the type
of object you can create, and how many objects of that type of object you can associate
with each property.
Parent object type
Property
Type of new object
Number that
can be
created
FO_ElementDef
FP_TextFmtRules
FO_FmtRule
Multiple
FP_ObjectFmtRules
FO_FmtRule
One
FP_PrefixRules
FO_FmtRule
Multiple
FP_SuffixRules
FO_FmtRule
Multiple
FP_FirstPgfRules
FO_FmtRule
Multiple
FP_LastPgfRules
FO_FmtRule
Multiple
FP_FmtRuleClauses
FO_FmtRule
Clause
Multiple
FO_FmtRule
332
FDK Programmer’s Reference
F_ApiNewSeriesObject()
...
FDK Function Reference
Parent object type
Property
Type of new object
Number that
can be
created
FO_FmtRuleClause
FP_SubFmtRule
FO_FmtRule
One
FO_FmtRuleClause
FP_FmtChangeList
FO_FmtChange
List
One
If you associate a new format rule object with a property that can specify multiple
objects, F_ApiNewSubObject() adds the new object after any existing objects for
that property.
If you attempt to associate a new format rule object with a property that can specify only
one object and that property already has an object associated with it,
F_ApiNewSubObject() fails, returning 0.
FDK Programmer’s Reference 333
2
FDK Function Reference
F_ApiNewSeriesObject()
Returns
The ID of the new format rule object, or 0 if an error occurs.
If F_ApiNewSubObject() fails, the API assigns one of the following values to
FA_errno.
334
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_BadNew
Object can’t be created
FE_BadPropNum
The property number specified for property is invalid
FE_WrongProduct
Current FrameMaker product isn’t supported
FDK Programmer’s Reference
F_ApiNewSeriesObject()
...
FDK Function Reference
Example
The following code adds a format rule to the Section element definition so that the
element definition appears as shown in Figure 2-1:
. . .
#define in (MetricT) 65536*72
F_ObjHandleT docId, sectEdefId, fmtRuleId, clauseId;
F_ObjHandleT changeListId;
/* Get ID of Section element definition. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
sectEdefId = F_ApiGetNamedObject(docId, FO_ElementDef,
"Section");
/* Add the format rule. */
fmtRuleId = F_ApiNewSubObject(docId, sectEdefId,
FP_TextFmtRules);
/* Set rule type and other characteristics. */
F_ApiSetInt(docId, fmtRuleId, FP_FmtRuleType,
FV_CONTEXT_RULE);
/* Add rule clause to format rule. */
clauseId = F_ApiNewSubObject(docId, fmtRuleId,
FP_FmtRuleClauses);
F_ApiSetString(docId, clauseId, FP_ContextLabel,"SubSection");
F_ApiSetString(docId, clauseId, FP_Specification,"Section");
/* Create format change list and add it to rule clause. */
changeListId = F_ApiNewSubObject(docId, clauseId,
FP_FmtChangeList);
F_ApiSetMetric(docId, changeListId, FP_LeftIndentChange, in);
. . .
Element (Container): Section
General rule: Head, (Para | List)+, Section*
Text format rules
1. If context is:
Context label: SubSection
Basic properties
Indents
Move left indent by: 1.0"
FDK Programmer’s Reference 335
2
FDK Function Reference
F_ApiNewTable()
Figure 2-1 Section element definition
See also
“F_ApiNewSeriesObject()” on page 329.
F_ApiNewTable()
F_ApiNewTable() inserts a table (FO_Tbl object).
When you create a table in the user interface, you can specify a Table Catalog format for
the table. The FrameMaker product uses the following properties of the Table Catalog
format as the defaults for the new table:
Number of body rows (FP_TblInitNumBodyRows)
Number of columns (FP_TblInitNumCols)
Number of footer rows (FP_TblInitNumFRows)
Number of header rows (FP_TblInitNumHRows)
Paragraph formats for header, body, and footer cells
For example, if the Table Catalog format’s FP_TblInitNumCols property is set to
8, the FP_NumCols property of the new table is set to 8.
With F_ApiNewTable(), you can use the Table Catalog format properties as defaults
for the number of rows and columns in a new table, or you can provide your own
defaults.
After you have created a table, you can add or remove rows with F_ApiAddRows()
and F_ApiDeleteRows(). You can add or remove columns with
F_ApiAddCols() and F_ApiDeleteCols(). You can also use
F_ApiSet
() functions to change the table’s other properties.
If you use F_ApiNewTable() to create a table in a structured document,
FrameMaker applies default element tags, such as Table, Row, and Cell, to the table
element and its child elements. To make these elements valid, you must add code to
change their tags. In most cases it is easier to add tables to structured documents by
calling F_ApiNewElementInHierarchy() or F_ApiNewElement() to add a
table element.
336
FDK Programmer’s Reference
F_ApiNewTable()
...
FDK Function Reference
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewTable(F_ObjHandleT docId,
StringT format,
IntT numCols,
IntT numBodyRows,
IntT numHeaderRows,
IntT numFooterRows,
F_TextLocT *textLocp);
Arguments
docId
The ID of the document to which to add the table.
format
The table format tag (for example, FormatA or Wide Table). To use
the default format, specify NULL.
numCols
The number of columns in the table. To use the default number of
columns from the Table Catalog format, specify -1.
numBodyRows
The number of rows in the table. To use the default number of body rows
from the Table Catalog format, specify -1.
numHeaderRows
The number of heading rows in the table. To use the default number of
header rows from the Table Catalog format, specify -1.
numFooterRows
The number of footing rows in the table. To use the default number of
footer rows from the Table Catalog format, specify -1.
textLocp
The location at which to insert the new table. The location can’t be
within a footnote or a table.
Returns
The ID of the new table, or 0 if an error occurs.
If F_ApiNewTable() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID.
FE_BadObjId
Invalid object ID.
FE_NotTextObject
Object specified for the text location isn’t a paragraph (FO_Pgf).
FE_OffsetNotFound
Offset specified for the text location couldn’t be found in the
specified paragraph or text line.
FDK Programmer’s Reference 337
2
FDK Function Reference
F_ApiNewXML()
FA_errno value
Meaning
FE_BadOperation
Function call specified an illegal operation.
FE_BadNew
Table can’t be created; the format specified by format may not
exist or the text location specified by textLocp is in a table or a
footnote.
Example
The following code inserts a new table at the insertion point. The new table uses all the
defaults from the Format A Table Catalog format, except the number of heading rows,
which is 0.
. . .
F_ObjHandleT docId, tblId;
F_TextRangeT tr;
/* Get the insertion point. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
/* Insert the table at the insertion point. */
tblId = F_ApiNewTable(docId, "Format A", -1, -1,0, -1, &tr.beg);
. . .
See also
“F_ApiAddCols()” on page 70, “F_ApiAddRows()” on page 78, and
“F_ApiNewAnchoredObject()” on page 312.
F_ApiNewXML()
F_ApiNewXML() creates a new, untitled XML.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiNewXML(const F_PropValsT *newXMLParams,
F_PropValsT **newXMLReturnParamspp);
. . .
338
FDK Programmer’s Reference
F_ApiNotification()
...
FDK Function Reference
Arguments
newXMLParams
A property list that instructs FrameMaker how to open the file
and how to respond to errors and other conditions. To use the
default list, specify NULL.
newXMLReturnParamspp
A property list that returns the filename and provides
information about how the FrameMaker product opened the
file. It must be initialized before you call F_ApiNewXML().
To get a property list to specify for the newXMLParams parameter, use
F_ApiGetNewXMLDefaultParams().
Returns
ID of the new XML document.
Example
The following code demonstrates how to create a new XML file with a specified
structured application.
F_PropValsT params = F_ApiGetNewXMLDefaultParams ();
F_PropValsT *retParams = NULL;
for (UIntT i = 0; i < params.len; i++)
{
switch (params.val[i].propIdent.num)
{
case FS_StructuredApplication:
params.val[i].propVal.u.sval = F_StrCopyString
("My_Strcutured_App");
break;
}
}
F_ApiNewXML (¶ms, &retParams);
F_ApiDeallocatePropVals (¶ms);
F_ApiDeallocatePropVals (retParams);
F_ApiNotification()
F_ApiNotification() requests that the FrameMaker product notify your client
whenever a specified event, or stage of an event, occurs.
FDK Programmer’s Reference 339
2
FDK Function Reference
F_ApiNotification()
..............................................................................
IMPORTANT: If the FrameMaker product encounters an internal error and exits, it
does not send any notification to your client about operations performed after the error
occured. For example, after an error the product allows the user to save changes in
open documents, but it does not notify any clients of the save operations.
..............................................................................
Synopsis
#include "fapi.h"
. . .
IntT F_ApiNotification(IntT notification,
IntT state);
Arguments
notification
Constant that specifies the notification point. See the following table for a
list of available constants.
state
Specifies whether to turn notification on or off. True turns it on, and
False turns it off.
Many events have several notification points or stages that you can request notification
for. The following table lists the notification points and the constants that specify them:
Event or operation
Notification points
Notification constants
Frame binary
document opened
Before checking the
type of the file to be
opened
FA_Note_PreFileType
After checking the type
of the file to be opened
FA_Note_PostFileType
Before opening the file
FA_Note_PreOpenDoc
After opening the file
FA_Note_PostOpenDoc
Before checking the
type of the file to be
opened
FA_Note_PreFileType
After checking the type
of the file to be opened
FA_Note_PostFileType
Before opening the file
FA_Note_PreOpenMIF
After opening the file
FA_Note_PostOpenMIF
MIF document opened
340
FDK Programmer’s Reference
F_ApiNotification()
Event or operation
Notification points
Notification constants
SGML document
opened
Before checking the
type of the file to be
opened
FA_Note_PreFileType
After checking the type
of the file to be opened
FA_Note_PostFileType
Before opening the file
FA_Note_PreOpenSGML
After opening the file
FA_Note_PostOpenSGML
Before checking the
type of the file to be
opened
FA_Note_PreFileType
After checking the type
of the file to be opened
FA_Note_PostFileType
Before opening the file
FA_Note_PreOpenXML
After opening the file
FA_Note_PostOpenXML
Filterable document
opened
Before checking the
type of the file to be
opened
FA_Note_FilterIn
Frame binary book
opened
Before checking the
type of the file to be
opened
FA_Note_PreFileType
After checking the type
of the file to be opened
FA_Note_PostFileType
Before opening the file
FA_Note_PreOpenBook
After opening the file
FA_Note_PostOpenBook
Before checking the
type of the file to be
opened
FA_Note_PreFileType
After checking the type
of the file to be opened
FA_Note_PostFileType
Before opening the file
FA_Note_PreOpenBookMIF
After opening the file
FA_Note_PostOpenBookMIF
Before opening the file
FA_Note_PreBook
ComponentOpen
After opening the file
FA_Note_PostBook
ComponentOpen
XML document
opened
MIF book opened
User double-clicked to
open a document in a
book window
...
FDK Function Reference
FDK Programmer’s Reference 341
2
FDK Function Reference
F_ApiNotification()
Event or operation
Notification points
Notification constants
Generating a list or
TOC for a document or
a book
Before generating the
file
FA_Note_PreGenerate
After generating the file
FA_Note_PostGenerate
Before saving the
document
FA_Note_PreSaveDoc
After saving the
document
FA_Note_PostSaveDoc
Before saving the
MIF file
FA_Note_PreSaveMIF
After saving the
MIF file
FA_Note_PostSaveMIF
Before specifying
Acrobat settings and
generating PostScript
FA_Note_PreSaveAs
PDFDialog
After specifying
Acrobat settings and
generating PostScript
FA_Note_PostSaveAs
PDFDialog
Before distilling the
PostScript
FA_Note_PreDistill
After distilling the
PostScript
FA_Note_PostDistill
Document saved as
filterable type
Before the document is
saved
FA_Note_FilterOut
Document exited
Before exiting the
document
FA_Note_PreQuitDoc
After exiting the
document
FA_Note_PostQuitDoc
Before exiting the book
FA_Note_PreQuitBook
After exiting the book
FA_Note_PostQuitBook
First change made to a
document since it was
opened or saved
After the document is
changed
FA_Note_DirtyDoc
First change made to a
book since it was
opened or saved
After the book is
changed
FA_Note_DirtyBook
Document saved in
Frame binary format
Document saved in
MIF format
Document saved as
PDF
Book exited
342
FDK Programmer’s Reference
F_ApiNotification()
Event or operation
Notification points
Notification constants
Book saved in Frame
binary format
Before saving the book
FA_Note_PreSaveBook
After saving the book
FA_Note_PostSaveBook
Before saving the
MIF file
FA_Note_PreSaveBookMIF
After saving the
MIF file
FA_Note_PostSaveBookMIF
Before saving the
document
FA_Note_PreAutoSaveDoc
After saving the
document
FA_Note_PostAutoSaveDoc
Before reverting the
document
FA_Note_PreRevertDoc
After reverting the
document
FA_Note_PostRevertDoc
Before reverting
the book
FA_Note_PreRevertBook
After reverting
the book
FA_Note_PostRevertBook
Before the OK to Exit
dialog box appears
FA_Note_PreQuitSession
Immediately before
exiting the session
FA_Note_PostQuitSession
Another client calls
F_ApiCallClient(
)
with clname set to the
current client’s name
After
F_ApiCallClient(
) is called
FA_Note_ClientCall
Any user action, such
as a command choice
or text entry
After the FrameMaker
product finishes
processing the user
action
FA_Note_BackToUser
Text inset owned by
current client clicked
After the user clicked
the inset
FA_Note_DisplayClientTi
Dialog
FrameMaker product
updating all text insets
When the client needs
to update insets that
belong to it
FA_Note_UpdateAllClientTi
Book saved in MIF
format
Document saved with
Autosave
Document reverted
Book reverted
FrameMaker product
exited
...
FDK Function Reference
FDK Programmer’s Reference 343
2
FDK Function Reference
F_ApiNotification()
Event or operation
Notification points
Notification constants
FrameMaker product
updating a specific text
inset
When the client needs
to update a specified
inset
FA_Note_UpdateClientTi
Text or graphic
imported
Before importing the
text or graphic
FA_Note_PreImport
After importing the text
or graphic
FA_Note_PostImport
Before the
FrameMaker product
executes command or
adds text to the
document
FA_Note_PreFunction
After the FrameMaker
product executes
command or adds text
to the document
FA_Note_PostFunction
Before the
FrameMaker product
responds to the mouse
click
FA_Note_PreMouseCommand
After the FrameMaker
product responds to the
mouse click
FA_Note_PostMouseCommand
Before the
FrameMaker product
executes the hypertext
command
FA_Note_PreHypertext
After the FrameMaker
product executes the
hypertext command
FA_Note_PostHypertext
Before the
FrameMaker product
goes to the crossreference source
FA_Note_PreGoToXrefSrc
After the FrameMaker
product goes to the
cross-reference source
FA_Note_PostGoToXrefSrc
FrameMaker product
command invoked or
text entered in a
document
Mouse button clicked
Hypertext command
invoked
The user clicked Go To
Source in the crossreference dialog box
344
FDK Programmer’s Reference
F_ApiNotification()
Event or operation
Notification points
Notification constants
Document or book
printed
After the user clicks
OK in the Print dialog
box, but before the
FrameMaker product
prints the document or
book
FA_Note_PrePrint
After the FrameMaker
product prints the
document or book
FA_Note_PostPrint
Body page added to
document
After the FrameMaker
product adds the
body page
FA_Note_BodyPageAdded
Body page deleted
from document
After the FrameMaker
product deletes the
body page
FA_Note_BodyPageDeleted
Structural element
inserteda
Before the element is
inserted
FA_Note_PreInsertElement
After the element is
inserted
FA_Note_PostInsertElement
Before the element is
copied.
FA_Note_PreCopyElement
After the element is
copied.
FA_Note_PostCopyElement
Before the element is
changed
FA_Note_PreChangeElement
After the element is
changed
FA_Note_PostChangeElement
Before the element is
wrapped
FA_Note_PreWrapElement
After the element is
wrapped
FA_Note_PostWrapElement
Before the element is
dragged
FA_Note_PreDragElement
After the element is
dragged
FA_Note_PostDragElement
Before the attribute
value is set
FA_Note_PreSetAttrValue
After the attribute value
is set
FA_Note_PostSetAttrValue
Structural element
copied
Structural element
changed
Structural element
wrapped
Structural element
dragged
An attribute value
is set
...
FDK Function Reference
FDK Programmer’s Reference 345
2
FDK Function Reference
F_ApiNotification()
Event or operation
Notification points
Notification constants
Element definitions are
imported
Before the element
definitions are
imported
FA_Note_PreImportElementDefs
After the element
definitions are
imported
FA_Note_PostImportElementDef
s
Before the text entry
FA_Note_PreInlineTypeIn
After the text entry
FA_Note_PostInlineTypeIn
When the inset is
selected
FA_Note_U3DCommand: if the selected
inset is a u3d object
Inline input of doublebyte text
An inset is selected
FA_Note_Not_U3DCommand: if the
selected inset is not a u3d object
A Robohelp screen
capture is inserted
When the screen
capture is inserted
FA_Note_RSC_Supported_File:
When the file supports Robohelp screen
capture.
FA_Note_Not_RSC_Supported_File
: When the file does not support Robohelp
screen capture.
When the graphic is
clicked
FA_Note_AI_Supported_File
A graphic not
supported by Adobe
Illustrator is clicked.
When the graphic is
clicked
FA_Note_Not_AI_Supported_File
The workspace
launches a particular
client’s modeless
dialog
Before the modeless
dialog is launched
FA_Note_Dialog_Create
A graphic supported by
Adobe Illustrator (AI)
is clicked. Following
format are supported
by AI:
"FrameImage",
"FrameVector", "PDF",
"EPSI", "TIFF",
"SVG", "DIB", "EMF",
"JPEG", "QuickDraw
PICT", "PNG", "PSD",
"WMF", "DXF
346
FDK Programmer’s Reference
F_ApiNotification()
...
FDK Function Reference
Event or operation
Notification points
Notification constants
When a client’s
modeless dialog is
closed because of
workspace-related
events such as
switching workspaces
Before the modeless
dialog is closed
FA_Note_QuitModelessDialog
When a client displays
or updates (in case the
dialog is already
displayed) a crossreference dialog
Before the dialog is
displayed or updated.
FA_Note_DisplayClientXRefDia
log
A particular DITA
reference is updated as
specified using the
element ID and the
reference type string
After the reference is
updated
FA_Note_UpdateDITAReference
All DITA references of
the specified type are
updated.
After the references are
updated
FA_Note_UpdateDITAReferences
A DITA map is
published
Before publishing starts
FA_Note_PrePublishDitamap
A DITA map is
published
After the book or
document has been
generated
FA_Note_PostPublishDitamap
When FrameMaker
wants to determine
whether a command is
enabled or disabled
FA_Note_IsCommandEnabled
When a view is
switched
Before theview is
switched
FA_Note_PreSwitchView
When a view is
switched
After the view is
switched
FA_Note_PostSwitchView
Key catalog
information is not
loaded and hence
cannot be used.
FA_Note_LoadKeyCatalog
Key catalog
information is not upto-date. Hence, the Key
catalog needs to be reloaded before being
used.
FA_Note_ReLoadKeyCatalog
FDK Programmer’s Reference 347
2
FDK Function Reference
F_ApiNotification()
Event or operation
Export
Notification points
Notification constants
FA_Note_PreExport
FA_Note_PostExport
FA_Note_FilterFileToFile
FA_Note_Dialog
FA_Note_Alert
FA_Note_Palette
FA_Note_ToolBar
FA_Note_ConsoleMessage
FA_Note_Help
FA_Note_URL
FA_Note_CursorChange
FA_Note_FontSubstitution
FA_Note_UndoCheckpoint
FA_Note_FileOpen
a. FrameMaker issues the FA_Note_PreInsertElement and FA_Note_PostInsertElement
notifications when the user inserts an element using the element catalog or a menu command or dialog box
which inserts a marker, footnote, cross-reference, equation, anchored frame, or table. FrameMaker does not
issue the FA_Note_PreInsertElement and FA_Note_PostInsertElement notifications when it
automatically inserts elements because the user or a client added rows, columns, or table titles; when the
user or a client imports a graphic; or when a client adds an element programmatically.
The notification constants are numbered sequentially, starting with 0. The API provides
a constant, FA_Note_Num, that specifies the total number of notifications. This makes
it easy to request notification for all notification points, as shown in the following
example code.
Returns
FE_Success if it succeeds, or an error code if it fails.
348
FDK Programmer’s Reference
F_ApiNotify()
...
FDK Function Reference
If F_ApiNotification() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
FE_BadNotificationNum
The specified notification number was invalid
Example
The following code instructs the FrameMaker product to notify your client for all
notification points:
. . .
IntT i;
for (i=0; i < FA_Note_Num; i++)
F_ApiNotification(i, True);
. . .
VoidT F_ApiNotify(notification, docId, sparm, iparm)
IntT notification;
F_ObjHandleT docId;
StringT sparm;
IntT iparm;
{
F_Printf(NULL, "Notification: %d:\n", notification);
}
. . .
See also
“F_ApiNotify()” on page 349.
F_ApiNotify()
F_ApiNotify() is a callback that you can define in your client. The FrameMaker
product calls F_ApiNotify() when the user or another API client initiates an
operation, such as Open or Save, for which your client has requested notification. To
request notification, you must call F_ApiNotification() for each notification
point.
Your client can cancel any command or action for which it receives a
FA_Note_PreNotificationPoint notification. For example, if it receives the
FA_Note_PreQuitDoc notification, it can cancel the Close command and prevent the
user from closing a document. To abort a command, call F_ApiReturnValue(),
FDK Programmer’s Reference 349
2
FDK Function Reference
F_ApiNotify()
with the parameter set to FR_CancelOperation, when your client receives
notification for the command. For more information, see “Canceling commands” on
page 221 of the FDK Programmer’s Guide.
..............................................................................
IMPORTANT: If the FrameMaker product encounters an internal error and exits, it
does not send any notification to your client about operations performed after the error
occured. For example, after an error the product allows the user to save changes in
open documents, but it does not notify any clients of the save operations.
..............................................................................
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiNotify(IntT notification,
F_ObjHandleT docId,
StringT sparm,
IntT iparm);
Arguments
notification
A constant that indicates the event and the notification point. See the table
in “F_ApiNotification()” on page 339 for a list of the constants.
docId
The ID of the active document when the event occurs. For filters, the
document into which the filter should import its data; if this is zero, the
filter must create a new document.
sparm
The string, if any, associated with the notification. For example, if the
notification is for an Open or Save operation, sparm specifies the
pathname of the affected file. If the notification is for text entry, sparm
specifies the text the user typed.
iparm
If notification is FA_NotePreFunction or
FA_NotePostFunction, iparm is the f-code for the command. If
notification is FA_NotePreMouseCommand or
FA_NotePostMouseCommand, iparm specifies bit flags specifying
the number of mouse clicks and the modifier keys the user was holding
down. See the table below for a list of the flags.
..............................................................................
IMPORTANT: For book-wide commands, the FrameMaker product posts an
FA_NotePreFunction and FA_NotePostFunction notification for the book file, and for
each document in the book. When trapping book-wide functions, you should check the
value of docId to determine whether it indicates a document or the active book.
For example, if you search a book with two documents in it, the FrameMaker product
posts the following function notifications:
350
FDK Programmer’s Reference
F_ApiNotify()
...
FDK Function Reference
FA_Note_PreFunction (start searching book)
FA_Note_PreFunction (start searching first document)
FA_Note_PostFunction (stop searching first document)
FA_Note_PreFunction (start searching second document)
FA_Note_PostFunction (stop searching second document))
FA_Note_PostFunction (stop searching book)
..............................................................................
The following table shows the values sparm has for specific notifications.
Notifications
sparm value
All Open, Save, Print, and Close
notifications for documents
and books
The complete pathname of the document
or book.
FA_Note_PreDistill
FA_Note_PostDistill
When this notification occurs as a result of saving
a document or book as PDF, sparm contains the
complete pathname of thePostScript file that was
generated from the document or book
FA_Note_PreFunction
FA_Note_PostFunction
If the user typed text, the text. If the user applied a
paragraph or character format or a font family, the
name of the format or font family.
FA_Note_PreChangeElement
FA_Note_PostChangeElement
The element tag of the changed structural element.
FA_Note_PreGenerate
FA_Note_PostGenerate
The book’s filename. If the book is untitled, NULL.
FA_Note_PreHypertext
The string of the hypertext command.
FA_Note_PostHypertext
Null
FA_Note_PreImport
FA_Note_PostImport
The name of the imported file.
FA_Note_PreInsertElement
The element tag of the inserted structural element.
FA_Note_PostInsertElement
The element tag of the inserted structural element.
FA_Note_PreOpenBook
FA_Note_PostOpenBook
The complete pathname of the book file. If the
book is untitled, NULL.
FA_Note_PreSetAttrValue
FA_Note_PostSetAttrValue
The attribute name.
FA_Note_PreWrapElement
The element tag of the wrapped structural element.
FA_Note_PostWrapElement
The element tag of the wrapped structural element.
FDK Programmer’s Reference 351
2
FDK Function Reference
F_ApiNotify()
Notifications
sparm value
FA_Note_UpdateDITAReference
DITA Reference type string:
DITA_AUTO
DITA_CONREF
DITA_XREF
DITA_LINK
DITA_TOPICREF
DITA_TOPICSETREF
FA_Note_UpdateDITAReference
s
NULL
FA_Note_PreSwitchView
The name of the new view.
FA_Note_PostSwitchView
The name of the old view.
All other notifications
NULL.
The following table shows the values iparm has for specific notifications.
Notifications
iparm value
FA_Note_PreFunction
FA_Note_PostFunction
The f-code for the command the user invoked. For a
list of f-code constants, see the fcodes.h header
file provided with the FDK.
FA_Note_UpdateAllClientTi
One of the following flags to indicate which text
insets are to be updated:
FV_UpdateAllAutomaticClientTi indicates all
insets with the FP_TiAutomaticUpdate property
set to True.
FV_UpdateAllManualClientTi indicates all
insets with the FP_TiAutomaticUpdate property
set to False.
FV_UpdateAllClientTi indicates all insets
regardless of the setting for the
FP_TiAutomaticUpdate property.
352
FA_Note_UpdateClientTi
The ID of the text inset.
FA_Note_PreHypertext
FA_Note_PostHypertext
The ID of the hypertext object that was activated. If
the hypertext message is for an FDK client, iparm
is the same as the ID passed to the objId parameter
of the client’s F_ApiMessage() callback.
FA_Note_PreGoToXrefSrc
FA_Note_PostGoToXrefSrc
The ID of the associated cross-reference
FDK Programmer’s Reference
F_ApiNotify()
...
FDK Function Reference
Notifications
iparm value
FA_Note_PreMouseCommand
FA_Note_PostMouseCommand
The 8 high bits specify the number of mouse clicks
minus one.
The next 8 bits indicate the modifier key
used:FF_SHIFT_KEY, FF_CONTROL_KEY,
FF_ALT_KEY, or FF_CMD_KEY
The 16 low bits specify the mouse action: for
example, FF_TEXT_SEL if the user is selecting text;
FF_TEXT_EXT if the user is extending an existing
selection; or OBJ_SEL if the user is selecting an
object. For a complete list of the constants for mouse
actions, see /* Mouse actions */ in the
fapidefs.h header file provided with the FDK.
FA_Note_PreInsertElement
FA_Note_PostInsertElement
The ID of the inserted structural element.
FA_Note_PreWrapElement
FA_Note_PostWrapElement
The ID of the newly created structural element.
FA_Note_PreDragElement
The ID of the structural element that is cut if the
operation is completed.
FA_Note_PostDragElement
The ID of the structural element that is pasted if the
operation is completed.
FA_Note_PreSetAttrValue
FA_Note_PostSetAttrValue
The ID of the element for which the attribute is set.
FA_Note_PreImportElemDefs
The ID of the document from which element
definitions are imported.
FA_Note_PreSaveAsPDFDialo
g
FA_Note_PostSaveAsPDFDial
og
When this notification occurs as a result of the user
choosing to save as PDF in the Save As dialog box,
the value is non-zero. When this notification is the
result of the API saving as PDF, the value is zero.
FA_Note_UpdateDITAReferen
ce
The ID of the element to be updated
FDK Programmer’s Reference 353
2
FDK Function Reference
F_ApiObjectValid()
Notifications
iparm value
FA_Note_UpdateDITAReferen
ces
The refType for which DITA references will be
updated. The refType value can be one of:
All other notifications
FV_DITAObjTypeConref: Update all references
of type DITA Conref.
FV_DITAObjTypeXref: Update all references of
type DITA Xref.
FV_DITAObjTypeLink: Update all references of
type DITA Link.
FV_DITAObjTypeTopicref: Update all
references of type DITA Topicref.
FV_DITAObjTypeTopicsetref: Update all
references of type DITA Topicsetref.
0.
Returns
VoidT.
Example
See “Adding the F_ApiNotify() callback” on page 220 of the FDK Programmer’s
Guide.
See also
“F_ApiNotification()” on page 339.
F _ A p i O b je c tVa l i d ( )
F_ApiObjectValid() determines if an object ID identifies an object in the specified
document. An object ID is invalid if the object has been deleted. In general, an object ID
is valid for only one document in a session, so F_ApiObjectValid() is useful for
debugging your clients.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiObjectValid(F_ObjHandleT docId,
F_ObjHandleT objId);
354
FDK Programmer’s Reference
F_ApiOpen()
...
FDK Function Reference
Arguments
docId
The ID of the document containing the object
objId
The ID whose validity you want to determine
Returns
True if the ID identifies an object in the current document, or False if it doesn’t.
If F_ApiObjectValid() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
Example
The following code determines if an ID is a valid ID for an object in the current
document, and then removes the object:
. . .
F_ObjHandleT docId, objId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
objId = F_ApiGetNamedObject(docId, FO_PgfFmt, "Body");
/* Code that might remove object or invalidate ID here. */
if (F_ApiObjectValid(docId, objId))
F_ApiDelete(docId, objId);
. . .
F_ApiOpen()
F_ApiOpen() opens a document or book. It can also create a new document.
F_ApiOpen() allows you to specify a script (property list) telling the FrameMaker
product how to open or create the file and how to deal with error and warning
conditions. For example, you can specify whether to abort or to continue opening a
document if it contains fonts that are not available. If the file is already open and
invisible, it will make the file visible. If you are using FileNames that have characters
above ASCII 128 see the FrameMaker FAQ on the Developer Web Page.
FDK Programmer’s Reference 355
2
FDK Function Reference
F_ApiOpen()
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiOpen(StringT fileName,
F_PropValsT *openParamsp,
F_PropValsT **openReturnParamspp);
Arguments
fileName
The full pathname of the file to open. If you are using
F_ApiOpen() to create a document, specify the name of the
template to use. For information on how filenames and paths on
different platforms are expressed, see the FDK Platform Guide
for that platform.
openParamsp
A property list telling the FrameMaker product how to open the
file and how to respond to errors and other conditions. To use the
default list, specify NULL.
openReturnParamspp
A property list that returns the filename and provides information
about how the FrameMaker product opened the file. It must be
initialized before you call F_ApiOpen().
..............................................................................
IMPORTANT: Always initialize the pointer to the property list that you specify for
openReturnParamspp to NULL before you call F_ApiOpen().
..............................................................................
To get a property list to specify for the openParamsp parameter, use
F_ApiGetOpenDefaultParams() or create the list from scratch. For a list of all the
properties an Open script property list can include, see
“F_ApiGetOpenDefaultParams()” on page 219. For an example of how to create a
property list from scratch, see “Example” on page 243 of the FDK Programmer’s
Guide.
To create a new document with F_ApiOpen(), set the FS_NewDoc property in the
openParamsp property list to True.
..............................................................................
IMPORTANT: When creating a new document (FS_NewDoc is True), and you display
the New dialog box (FS_ShowBrowser is True), the user may click Portrait,
Custom, or Landscape. If this occurs, F_ApiOpen() returns 0 and sets FA_errno
to FE_WantsPortrait, FE_WantsCustom, or FE_WantsLandscape. To create
a portrait, custom, or landscape document, use F_ApiCustomDoc() (see
“F_ApiCustomDoc()” on page 119.)
..............................................................................
356
FDK Programmer’s Reference
F_ApiOpen()
...
FDK Function Reference
Returns
The ID of the document or book if it opens it successfully, or 0 if an error occurs.
The property list that openReturnParamspp is set to has the properties shown in the
following table.
Property
Meaning and possible values
FS_OpenedFileName
A string that specifies the opened file’s pathname. If
you scripted FS_ShowBrowser, or the file was
filtered, or you didn’t specify the pathname, this
pathname can be different from the one you
specified in the Open script.
FS_OpenNativeError
The error condition; normally the same value as
FA_errno. If the file is opened successfully, it is set
to FE_Success. See the table below for a list of
possible values.
FS_OpenStatus
A bit field indicating what happened when the file
was opened. See the table below for a list of possible
flags.
Both the FS_OpenNativeError property and the FA_errno global variable
indicate the result of a call to F_ApiOpen(). The following table lists the possible
FDK Programmer’s Reference 357
2
FDK Function Reference
F_ApiOpen()
status flags and the FA_errno and FS_OpenNativeError values associated with
them.
FS_OpenNativeError and
FA_errno values
Possible FS_OpenStatus flags
FE_BadParameter
(file wasn’t opened)
FV_FileHadStructure: file had structured features, but current
FrameMaker product interface is not structured.
FV_FileAlreadyOpenThisSession: file is already open and
script disallowed opening another copy
FV_BadFileType: file was an executable file or other unreadable
type
FV_BadFileName: specified filename was invalid
FV_CantNewBooks: script specified a book that didn’t exist (the
Open operation can’t create a new book)
FV_BadScriptValue: Open script contained an invalid property
value
FV_MissingScript: F_ApiOpen() called without a script
FV_CantForceOpenAsText: Open script attempted to open the
file as text, but file was wrong type
FV_DisallowedType: file was a Frame binary document and the
Open script disallowed it
FV_DocDamagedByTextFilter: file was a text document and
was damaged when it was filtered
FV_DocHeadersDamaged: the document headers were damaged
(probably because of a file system problem)
FV_DocWrongSize: file is the wrong size (probably because of a
file system problem)
FV_ChecksumDamage: bad checksum
FE_SystemError
(file wasn’t opened)
FV_TooManyWindows: too many windows were open
FV_BadTemplate: a bad template was specified
FV_FileNotReadable: don’t have read permission for
the file
358
FDK Programmer’s Reference
F_ApiOpen()
...
FDK Function Reference
FS_OpenNativeError and
FA_errno values
Possible FS_OpenStatus flags
FE_Success
(file was opened)
FV_FileHasNewName: filename was changed from the name
specified in the F_ApiOpen() call
FV_RecoverFileUsed: recover file was present, and it was used
FV_AutoSaveFileUsed: Autosave file was present, and the user
or the Open script chose to use it
FV_FileWasFiltered: file was filterable and it was filtered
FV_FontsWereMapped: the document contained unavailable
fonts, which were mapped to substitute fonts
FV_FontMetricsChanged: the file contained fonts with
changed metrics, but it was opened anyway
FV_FontsMappedInCatalog: the Paragraph or Character
Catalog used unavailable fonts, which were mapped to substitute
fonts
FV_LanguagesWerentFound: the document used some
unavailable languages, but it was opened anyway
FV_FileIsOldVersion: the file was from an old FrameMaker
product version, but the user or the Open script chose to open it
anyway
FV_FileStructureStripped: the file had structured features,
which the user or the Open script chose to strip
FV_FileIsText: the file was a Text Only file, but the user or the
Open script chose to open it anyway
FV_OpenedViewOnly: the user or the Open script chose to open
the file as a View Only file
FV_EditableCopyOpened: the file was in use and the user or
the Open script opened an editable copy
FV_BadFileRefsWereMapped: file reference contained illegal
characters; the illegal characters were converted to something safe
for the current platform
FV_ReferencedFilesWerentFound: imported graphics files
couldn’t be found, but the file was opened anyway
FDK Programmer’s Reference 359
2
FDK Function Reference
F_ApiOpen()
FS_OpenNativeError and
FA_errno values
FE_Success
(file was opened)
Possible FS_OpenStatus flags
FV_UnresolvedXRefs: there were unresolved cross-references,
but the file was opened anyway
FV_UnresolvedTextInsets: there were unresolved text
insets, but the file was opened anyway
FE_Success,
FE_Canceled,
FE_FailedState, or
FE_CanceledByClient
FV_LockWasReset: file lock was reset
FV_LockNotReset: file had lock that wasn’t reset
FV_LockCouldntBeReset: file had lock that couldn’t
be reset
FV_FileWasInUse: file was in use
FV_FileIsViewOnly: file is a View Only file
FV_LockWasInvalid: file had invalid lock
FV_FileIsNotWritable: The file was not writable, and the
user canceled the open via the alert.
FV_FileModDateChanged: The file has changed since the last
time it was opened or saved in the current session.
FE_Canceled
(file wasn’t opened)
FV_CancelUseRecoverFile: a recover file was present, so the
user or the Open script canceled the Open operation
FV_CancelUseAutoSaveFile: an Autosave file was present,
so the user or the Open script canceled the Open operation
FV_CancelFileIsText: the file was text, so the user or the
Open script canceled the Open operation
FV_CancelFileIsInUse: the file was in use, so the user or the
Open script canceled the Open operation
FV_CancelFileHasStructure: the file had structure, so the
user or the script canceled the Open operation
FV_CancelReferencedFilesNotFound: the file contained
referenced files that were not available, so the user or the Open
script canceled the Open operation
FV_CancelLanguagesNotFound: the file contained languages
that weren’t available, so the user or the Open script canceled the
Open operation
360
FDK Programmer’s Reference
F_ApiOpen()
FS_OpenNativeError and
FA_errno values
...
FDK Function Reference
Possible FS_OpenStatus flags
FV_CancelFontsMapped: the document contained fonts that
needed to be mapped to other fonts, so the user or the Open script
canceled the Open operation
FV_CancelFontMetricsChanged: the file contained fonts
with changed metrics, so the user or the Open script canceled the
Open operation
FV_CancelFontsMappedInCatalog: the document’s
Character Catalog or Paragraph Catalog contained fonts that
needed to be mapped to other fonts, so the user or the Open script
canceled the Open operation
FV_CancelFileIsDoc: the file was a document and the Open
script disallowed it
FV_CancelFileIsMIF: the file was a MIF file and the Open
script disallowed it
FV_CancelBook: the file was a book and the Open script
disallowed it
FV_CancelBookMIF: the file was a MIF file and the Open script
disallowed it
FV_CancelFileIsFilterable: the file was a filterable file
and the Open script disallowed it
FV_CancelFileIsOldVersion: the file was from an old
version of a FrameMaker product, so the user or the Open script
canceled the Open operation
FV_CancelFileIsSgml: the file was an SGML document and
the Open script disallowed it
FV_CancelFileIsXML: the file was an XML document and the
Open script disallowed it
FV_CancelFileBrowser: the user canceled the Open operation
from the file browser
FV_CancelTempDiskFull: there was insufficient room on the
disk to cache data while opening the file.
To determine if a particular FS_OpenStatus bit is set, use F_ApiCheckStatus().
For more information, see “F_ApiCheckStatus()” on page 96.
After you are done with the property lists you use to call F_ApiOpen(), use
F_ApiDeallocatePropVals() to deallocate the memory they use.
FDK Programmer’s Reference 361
2
FDK Function Reference
F_ApiOpen()
Example
The following code opens a document named /tmp/my.doc. It creates a property list
that instructs the FrameMaker product to open my.doc in Text Only format,
regardless of its type. If the FrameMaker product opens the file successfully, the client
displays its filename.
. . .
#include "futils.h"
F_PropValsT params, *returnp = NULL;
F_ObjHandleT docId;
IntT i;
UCharT msg[256];
/* Allocate memory for the Open script. */
params = F_ApiAllocatePropVals(1);
if(params.len == 0) return;
/* Open file as Text Only regardless of its type. */
params.val[0].propIdent.num = FS_ForceOpenAsText;
params.val[0].propVal.valType = FT_Integer;
params.val[0].propVal.u.ival = True;
/* Open /tmp/my.doc. */
docId = F_ApiOpen("/tmp/my.doc", ¶ms, &returnp);
/* Get filename of document from return property list. */
if (docId)
{
/* Get index of return property that specifies filename. */
i = F_ApiGetPropIndex(returnp, FS_OpenedFileName);
F_Sprintf(msg, "Opened %s",
returnp->val[i].propVal.u.sval);
F_ApiAlert(msg, FF_ALERT_CONTINUE_NOTE);
}
/* Free memory used by Open scripts. */
F_ApiDeallocatePropVals(¶ms);
F_ApiDeallocatePropVals(returnp);
. . .
362
FDK Programmer’s Reference
F_ApiOpenResource()
...
FDK Function Reference
See also
“F_ApiCheckStatus()” on page 96, “F_ApiGetOpenDefaultParams()” on page 219,
“F_ApiPrintOpenStatus()” on page 370, and “F_ApiSimpleOpen()” on page 465.
F _ A p i O p e n R e so u rce ( )
F_ApiOpenResource() opens a client resource. With this function, you also have
access to FrameMaker cursors.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiOpenResource(IntT resourceType,
StringT resourceName);
Arguments
resourceType
The type of resource to open. To open a dialog resource, specify
FO_DialogResource.
resourceName
The name of the resource to open.
Returns
The ID of the opened resource, or 0 if it can’t open the resource.
If F_ApiOpenResource() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_BadOperation
Function call specified an illegal operation
Example
For two examples, see “F_ApiModalDialog()” on page 303 and
“F_ApiModelessDialog()” on page 305.
See also
“F_ApiModalDialog()” on page 303, “F_ApiModelessDialog()” on page 305, and
“F_ApiSetClientDir()” on page 412.
FDK Programmer’s Reference 363
2
FDK Function Reference
F_ApiPaste()
F_ A p i P a st e ( )
F_ApiPaste() pastes the contents of the FrameMaker product Clipboard into a
specified document at the insertion point. Cutting and Pasting objects will cause
FrameMaker to create a new UID for the pasted object.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiPaste(F_ObjHandleT docId,
IntT flags);
Arguments
docId
The ID of the document to which to paste the selected text.
flags
Bit field that specifies how to paste the text and how to handle interactive alerts. For
default settings, specify 0.
If you specify 0 for flags, F_ApiPaste() suppresses any interactive alerts or
warnings that arise. It also inserts columns to the left of the current columns and rows
above the current row.
You can also OR the following values into flags.
flags constant
Meaning
FF_INTERACTIVE
Prompt user with dialog or alert boxes
that arise.
FF_VISIBLE_ONLY
Cut only the visible portion of the selection.
FF_DONT_DELETE_HIDDEN_TEXT
Don’t replace hidden text.
FF_DONT_APPLY_ALL_ROWS
Don’t apply condition setting on the Clipboard to all
rows. If whole table is selected and the Clipboard
contains condition setting, cancel the paste.
FF_REPLACE_CELLS
Replace selected cells with cells on the Clipboard.
FF_INSERT_BELOW_RIGHT
Add columns to the right of the current column or
below the current row.
When you use F_ApiPaste() to paste table cells into a table, it does not work
exactly like the interactive Paste command. The interactive Paste command
automatically overwrites cells if the Clipboard contains less than an entire row or
column. For example, if the insertion point is in a three-column table and the Clipboard
contains a single cell, the interactive Paste command overwrites the cell containing the
364
FDK Programmer’s Reference
F_ApiPaste()
...
FDK Function Reference
insertion point with the cell on the Clipboard. If two cells in the table are selected, the
Paste command overwrites both of them with the cell on the Clipboard.
By default, F_ApiPaste() does not overwrite any cells. If the Clipboard contains
less than an entire row or column when you call F_ApiPaste(), or of the current
selection is less than an entire row, F_ApiPaste does nothing and returns
FE_BadSelectionForOperation. This ensures that your do not inadvertently
overwrite any cells. To make F_ApiPaste() replace cells with the Clipboard
contents, you must call it with the FF_REPLACE_CELLS flag set.
The FF_INTERACTIVE flag takes precedence over other flags. So, if you specify
FF_INTERACTIVE | FF_DONT_DELETE_HIDDEN_TEXT and the selection contains
hidden text, the FrameMaker product prompts the user and allows the user to choose
whether to delete the hidden text. It is illegal to specify FF_REPLACE_CELLS |
FF_INSERT_BELOW_RIGHT.
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiPaste() fails, the API assigns one of the following values to FA_errno.
FA_errno value
Meaning
FE_BadOperation
Function call specified an illegal operation
FE_BadDocId
Invalid document ID
FE_BadSelectionForOperation
Current text selection is invalid for this operation
FE_Canceled
User canceled the operation
FDK Programmer’s Reference 365
2
FDK Function Reference
F_ApiPopClipboard()
Example
The following code makes sure the insertion point is an insertion point (not a selection),
and then pastes the text on the Clipboard to it.
. . .
F_TextRangeT tr;
F_ObjHandleT docId;
/* Get text selection. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
/* Make sure selection is an insertion point. */
tr.beg.objId = tr.end.objId;
tr.beg.offset = tr.end.offset;
F_ApiSetTextRange(FV_SessionId, docId, FP_TextSelection, &tr);
/* Paste Clipboard contents. */
F_ApiPaste(docId, 0);
. . .
See also
“F_ApiClear()” on page 100, “F_ApiCopy()” on page 115, and “F_ApiCut()” on
page 123.
F_ApiPopClipboard()
F_ApiPopClipboard() pops the Clipboard stack, moving the entry on the top of the
stack to the Clipboard.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiPopClipboard(VoidT);
Arguments
None.
366
FDK Programmer’s Reference
F_ApiPrintFAErrno()
...
FDK Function Reference
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiPopClipboard() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
FE_BadOperation
Clipboard stack is empty
Example
The following code executes Copy and Paste operations and then restores the original
Clipboard contents:
. . .
F_ObjHandleT docId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
F_ApiPushClipboard();
F_ApiCopy(docId, 0);
F_ApiPaste(docId, 0);
F_ApiPopClipboard();
. . .
See also
“F_ApiCopy()” on page 115, “F_ApiCut()” on page 123, “F_ApiPaste()” on page 364,
and “F_ApiPushClipboard()” on page 384.
F_ApiPrintFA Errno()
F_ApiPrintFAErrno() prints the current API error status, represented by the global
variable, FA_errno. It is useful for debugging clients.
When an API function fails, it stores an error code in the global variable, FA_errno.
FA_errno retains the error code until another function fails and sets it or until your
code explicitly sets it. To determine whether a set of API function calls has failed,
initialize FA_errno to FE_Success once before all the calls and check it once after
all the calls.
For example, if you call F_ApiNotification() and specify an invalid notification
constant, the API sets FA_errno to FE_BadNotificationNum. If you
FDK Programmer’s Reference 367
2
FDK Function Reference
F_ApiPrintFAErrno()
subsequently call F_ApiPrintFAErrno(), it prints the string
FE_BadNotificationNum.
For a list of error codes and their meanings, see Chapter 5, “Error Codes.”
F_ApiPrintFAErrno() prints to the Frame console..
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintFAErrno(VoidT);
Arguments
None.
Returns
VoidT.
If F_ApiPrintFAErrno() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
Example
The following code enables automatic change bars for the current document and uses
F_ApiPrintFAErrno() to check for errors.
. . .
F_ObjHandleT docId;
IntT changeBarsOn;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
FA_errno = FE_Success;
changeBarsOn = F_ApiGetInt(FV_SessionId, docId,
FP_AutoChangeBars);
/* If previous call succeeds, this call prints FE_Success. */
F_ApiPrintFAErrno();
. . .
368
FDK Programmer’s Reference
F_ApiPrintImportStatus()
...
FDK Function Reference
F _ A p i P r i n t I m p o r t St a t u s( )
F_ApiPrintImportStatus() prints status flags returned by F_ApiImport(). It
is useful for debugging your clients.
F_ApiPrintImportStatus() prints to Frame console.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintImportStatus(F_PropValsT *p);
Arguments
p
The property list that F_ApiImport() returns in importReturnParamspp
Returns
VoidT.
Example
The following code prints the import status after calling F_ApiImport():
. . .
F_PropValsT params, *returnParamsp = NULL;
F_ObjHandleT docId;
F_TextRangeT tr;
params = F_ApiGetImportDefaultParams();
if(params.len == 0) return;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
F_ApiImport(docId, &tr.beg, "/tmp/frame.doc",
¶ms, &returnParamsp);
F_ApiPrintImportStatus(returnParamsp);
. . .
See also
“F_ApiImport()” on page 286.
FDK Programmer’s Reference 369
2
FDK Function Reference
F_ApiPrintOpenStatus()
F _ A p i P r i n tO p en St a tu s ( )
F_ApiPrintOpenStatus() prints status flags returned by F_ApiOpen(). It is
useful for debugging your clients.
F_ApiPrintOpenStatus() prints to the Frame console..
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintOpenStatus(F_PropValsT *p);
Arguments
p
The property list that F_ApiOpen() returns in openReturnParamspp
Returns
VoidT.
Example
The following code prints the open status after calling F_ApiOpen() to open a
document named /tmp/my.doc:
. . .
F_PropValsT params, *returnParamsp = NULL;
F_ObjHandleT docId = 0;
params = F_ApiGetOpenDefaultParams();
docId = F_ApiOpen("/tmp/my.doc", ¶ms, &returnParamsp);
if (!docId) return;
F_ApiPrintOpenStatus(returnParamsp);
. . .
See also
“F_ApiOpen()” on page 355.
F_ApiPrintPropVal()
F_ApiPrintPropVal() prints the value of a specified property. It is useful for
debugging your clients.
F_ApiPrintPropVal() prints to the Frame console.
370
FDK Programmer’s Reference
F_ApiPrintPropVals()
...
FDK Function Reference
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintPropVal(F_PropValT *p);
Arguments
p
The property to print
Returns
VoidT.
Example
The following code prints the name of the active document:
. . .
F_PropValT prop;
F_ObjHandleT docId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
prop = F_ApiGetPropVal(FV_SessionId, docId, FP_Name);
F_ApiPrintPropVal(&prop);
. . .
See also
“F_ApiGetPropVal()” on page 232.
F_ApiPrintPropVals()
F_ApiPrintPropVals() prints the values in a specified property list. It is useful for
debugging your clients.
F_ApiPrintPropVals() prints to the Frame console.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintPropVals(F_PropValsT *p);
FDK Programmer’s Reference 371
2
FDK Function Reference
F_ApiPrintSaveStatus()
Arguments
p
The property list
Returns
VoidT.
Example
The following code gets the properties for the paragraph containing the insertion point
and prints them to the console:
. . .
F_PropValsT props;
F_TextRangeT tr;
F_ObjHandleT docId, pgfId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
props = F_ApiGetProps(docId, tr.end.objId);
F_ApiPrintPropVals(&props);
. . .
F_ApiPrintSaveSt atus()
F_ApiPrintSaveStatus() prints errors returned by F_ApiSave(). It is useful
for debugging your clients.
F_ApiPrintSaveStatus() prints to the Frame console.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintSaveStatus(F_PropValsT *p);
Arguments
p
The property list that F_ApiSave() returns in saveReturnParamspp
Returns
VoidT.
372
FDK Programmer’s Reference
F_ApiPrintTextItem()
...
FDK Function Reference
Example
The following code prints the save status after calling F_ApiSave() to save the
active document as /tmp/my.doc:
. . .
F_PropValsT params, *returnParamsp = NULL;
F_ObjHandleT mydocId;
/* Allocate Save scripts. */
params = F_ApiGetSaveDefaultParams();
if(params.len == 0) return;
/* Save document. */
mydocId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
F_ApiSave(mydocId, "/tmp/my.doc", ¶ms, &returnParamsp);
/* Print save status. */
F_ApiPrintSaveStatus(returnParamsp);
. . .
See also
“F_ApiSave()” on page 399.
F_ApiPrintTe xtItem()
F_ApiPrintTextItem() prints the text in a specified text item. It is useful for
debugging clients.
F_ApiPrintTextItem() prints to the Frame console.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintTextItem(F_TextItemT *textItem);
Arguments
textItem
The text item to print
Returns
VoidT.
FDK Programmer’s Reference 373
2
FDK Function Reference
F_ApiPrintTextItems()
Example
The following code prints the first string text item in the paragraph containing the
insertion point:
. . .
F_TextItemsT tis;
F_ObjHandleT docId;
F_TextRangeT tr;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if(tr.beg.objId == 0) return;
tis = F_ApiGetText(docId, tr.beg.objId, FTI_String);
if(tis.len == 0) return;
F_ApiPrintTextItem(&tis.val[0]);
F_ApiDeallocateTextItems(&tis);
. . .
See also
“F_ApiGetText()” on page 249 and “F_ApiPrintTextItems()” on page 374.
F_ApiPrintTe xtItems()
F_ApiPrintTextItems() prints the text in a specified set of text items
(F_TextItemsT structure). It is useful for debugging clients.
F_ApiPrintTextItems() prints to the Frame console.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintTextItems(F_TextItemsT *textItems);
Arguments
textItems
Returns
VoidT.
374
FDK Programmer’s Reference
The set of text items to print
F_ApiPrintUpdateBookStatus()
...
FDK Function Reference
Example
The following code prints the string text items in the main flow in the active document:
. . .
F_TextItemsT tis;
F_ObjHandleT docId, flowId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
flowId = F_ApiGetId(FV_SessionId, docId, FP_MainFlowInDoc);
tis = F_ApiGetText(docId, flowId, FTI_String);
if(tis.len == 0) return;
F_ApiPrintTextItems(&tis);
F_ApiDeallocateTextItems(&tis);
. . .
See also
“F_ApiGetText()” on page 249 and “F_ApiPrintTextItem()” on page 373.
F_ApiPrintUpdateBookStatus()
F_ApiPrintUpdateBookStatus() prints errors returned by
F_ApiUpdateBook(). It is useful for debugging your clients.
F_ApiPrintUpdateBookStatus() prints to the Frame console.
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPrintUpdateBookStatus(F_PropValsT *p);
Arguments
p
The property list that F_ApiUpdateBook() returns in updateReturnParamspp
Returns
VoidT.
FDK Programmer’s Reference 375
2
FDK Function Reference
F_ApiProgressBarEx()
Example
The following code prints the update status after calling F_ApiUpdateBook() to
update the active book:
. . .
F_PropValsT params, *returnParamsp = NULL;
F_ObjHandleT bookId;
/* Allocate update scripts. */
params = F_ApiGetUpdateBookDefaultParams();
if(params.len == 0) return;
/* Update book. */
bookId = F_ApiGetId(0, FV_SessionId, FP_ActiveBook;
F_ApiUpdateBook(bookId, ¶ms, &returnParamsp);
/* Print update status. */
F_ApiPrintUpdateBookStatus(returnParamsp);
. . .
See also
“F_ApiSave()” on page 399.
F_ApiProgressBarEx()
F_ApiProgressBarEx() runs a progress bar in a separate thread while the user can
continue working in the background.
Synopsis
#include "fapi.h"
...
StatusT
F_ApiProgressBarEx(BoolT bShow, const F_PropValsT *vals);
376
FDK Programmer’s Reference
F_ApiProgressBarEx()
...
FDK Function Reference
Arguments
One of the following:
bShow
True (Start the progress bar)
False (End the progress bar)
Structure that includes an array of property-value pairs.
vals
Property
FP_DbTitleLabel
Type
Meaning
StringT
Sets the title of the progress bar dialog.
Returns
FE_Success.
St ru cture d
F_ApiPromoteElement()
F_ApiPromoteElement() promotes the selected structural element. The selected
element becomes a sibling of its former parent. It appears immediately after its former
parent. The siblings that follow it become its children.
..............................................................................
IMPORTANT: One structural element must be selected when
F_ApiPromoteElement() is called. The element cannot be the root element or a
child of the root element.
..............................................................................
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPromoteElement(F_ObjHandleT docId);
Arguments
docId
The ID of the document containing the selected structure element
Returns
VoidT.
FDK Programmer’s Reference 377
2
FDK Function Reference
F_ApiProgressBarEx()
If F_ApiPromoteElement() fails, the API assigns one of the following values to
FA_errno.
378
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product isn’t supported
FE_BadDocId
Invalid document ID
FE_BadSelectionForOperation
Current selection is invalid for this operation
FDK Programmer’s Reference
F_ApiPromptInt()
...
FDK Function Reference
Example
The following code promotes the selected structural element in the active document:
. . .
F_ApiPromoteElement(F_ApiGetId(0, FV_SessionId, FP_ActiveDoc));
. . .
See also
“F_ApiDemoteElement()” on page 154.
F_Api Pro mptInt()
F_ApiPromptInt() displays a dialog box that prompts the user for a single integer
value. It allows you to provide a default value, which appears in the entry field when the
dialog box appears. The dialog box has OK and Cancel buttons. F_ApiPromptInt()
does not assign a value to *intp if the user clicks Cancel. If the user types alphabetic
text after a number, the API ignores the text and just returns the value of the number.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiPromptInt(IntT* intp,
StringT message,
StringT stuffVal);
Arguments
intp
The value in the input field when the user clicks OK.
message
The message that appears in the dialog box. It must be 255 characters or less.
stuffVal
The default value that appears in the input field when the dialog box is first
displayed.
FDK Programmer’s Reference 379
2
FDK Function Reference
F_ApiPromptInt()
Returns
0 if the user clicked OK, or a nonzero value if the user clicked Cancel or an error
occurred.
If F_ApiPromptInt() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
Example
The following code displays the dialog box shown in Figure 2-2:
. . .
#include "futils.h"
IntT err;
IntT ires;
UCharT mesg[256];
err = F_ApiPromptInt(&ires, "Integer?", "1234");
if (err)
F_Sprintf(mesg, "Cancel was pressed, ires is undefined");
else F_Sprintf(mesg, "The value of ires is %d.", ires);
F_ApiAlert(mesg, FF_ALERT_CONTINUE_NOTE);
. . .
Figure 2-2 Integer prompt dialog box
See also
“F_ApiPromptMetric()”, and “F_ApiPromptString()” on page 382.
380
FDK Programmer’s Reference
F_ApiPromptMetric()
...
FDK Function Reference
F_ApiPromptMetric()
F_ApiPromptMetric() displays a dialog box that prompts the user for a single
metric value. It allows you to provide a default value, which appears in the entry field
when the dialog box appears. The dialog box has OK and Cancel buttons.
F_ApiPromptMetric() does not assign a value to *metricp if the user clicks
Cancel.
F_ApiPromptMetric() dialog boxes behave like metric dialog boxes in the user
interface. If the user types a number followed by a string that represents a unit (for
example 10pts or 5"), the API converts the number into the equivalent number of
metric units. If the user doesn’t specify a unit, the API uses points (metric 65536).
Synopsis
#include "fapi.h"
. . .
IntT F_ApiPromptMetric(MetricT *metricp,
StringT message,
StringT stuffVal,
MetricT defaultunit);
Arguments
metricp
The value in the input field when the user clicks OK.
message
The message that appears in the dialog box. It must be 255 characters or
less.
stuffVal
The default value that appears in the input field when the dialog box is first
displayed.
defaultunit
The metric unit to use if the user doesn’t specify one.
Returns
0 if the user clicked OK, or a nonzero value if the user clicked Cancel or an error
occurred.
If F_ApiPromptMetric() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
FDK Programmer’s Reference 381
2
FDK Function Reference
F_ApiPromptString()
Example
The following code displays the dialog box shown in Figure 2-3:
. . .
#include "futils.h"
#define in (MetricT)(65536*72)
IntT err;
MetricT mres;
UCharT mesg[256];
err = F_ApiPromptMetric(&mres, "Metric?", "12.34 in", in);
if (err)
F_Sprintf(mesg, "Cancel was pressed, mres is undefined");
else
F_Sprintf(mesg, "The value of mres is %f inches.", mres/in);
F_ApiAlert(mesg, FF_ALERT_CONTINUE_NOTE);
. . .
Figure 2-3 Metric prompt dialog box
See also
“F_ApiPromptInt()” on page 379 and “F_ApiPromptString()”.
F_Api PromptStri ng()
F_ApiPromptString() displays a dialog box that prompts the user for a single
string value. It allows you to provide a default string, which appears in the entry field
when the dialog box appears. The dialog box has OK and Cancel buttons.
F_ApiPromptString() does not assign a value to *stringp if the user clicks
Cancel.
..............................................................................
IMPORTANT: If you are running your client on Windows, do not call
F_ApiPromptString() to prompt the user for a pathname. If the user enters a
pathname as a string, the backslash character (\) is interpreted as a special escape
character. For example, the characters \s represent a space. If the user enters the
382
FDK Programmer’s Reference
F_ApiPromptString()
...
FDK Function Reference
pathname c:\sample, this string is interpreted as c: ample. To prompt the user for
a pathname, use F_ApiChooseFile() to display a file selection dialog box.
..............................................................................
Synopsis
#include "fapi.h"
. . .
IntT F_ApiPromptString(StringT *stringp,
StringT message,
StringT stuffVal);
Arguments
stringp
The string in the input field when the user clicks OK.
message
The message that appears in the dialog box. It must be 255 characters or less.
Newline and linefeed characters are ignored.
stuffVal
The default value that appears in the input field when the dialog box is first
displayed.
..............................................................................
IMPORTANT: F_ApiPromptString() allocates memory for the string it returns.
Use F_Free() to free the string when you are done with it.
..............................................................................
FDK Programmer’s Reference 383
2
FDK Function Reference
F_ApiPushClipboard()
Returns
0 if the user clicked OK, or a nonzero value if the user clicked Cancel or an error
occurred.
If F_ApiPromptString() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
Example
The following code displays the dialog box shown in Figure 2-4:
. . .
IntT err;
StringT sres;
err = F_ApiPromptString(&sres, "String?", "Default text");
if (err) return;
F_ApiAlert(sres, FF_ALERT_CONTINUE_NOTE);
F_Free(sres);
. . .
Figure 2-4 String prompt dialog box
See also
“F_ApiPromptInt()” on page 379 and “F_ApiPromptMetric()” on page 381.
F_ApiPushClipboard()
F_ApiPushClipboard() pushes the current Clipboard contents onto the Clipboard
stack. It is useful if you want to use FDK Clipboard functions, such as F_ApiCopy()
or F_ApiCut(), without losing the Clipboard’s original contents.
384
FDK Programmer’s Reference
F_ApiQuickSelect()
...
FDK Function Reference
Synopsis
#include "fapi.h"
. . .
VoidT F_ApiPushClipboard(VoidT);
Arguments
None.
Returns
VoidT.
If F_ApiPushClipboard() fails, the API assigns the following value to
FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
Example
See “F_ApiPopClipboard()” on page 366.
See also
“F_ApiCopy()” on page 115, “F_ApiCut()” on page 123, “F_ApiPopClipboard()” on
page 366, and “F_ApiPaste()” on page 364.
F _ A p i Q u i c k S e l ec t ()
F_ApiQuickSelect() implements a quick-key interface that allows the user to
choose a string from a list of strings in the document Tag area.
F_ApiQuickSelect() highlights the document Tag area and displays a prompt and
the first string in a specified list of strings. The user can display a string in the Tag area
by typing the first few letters of the string. The user can also scroll through the strings
by pressing the up and down arrow keys. To choose a string, the user presses Return
when the string appears in the Tag area. To cancel the choice, the user clicks in the
document without pressing Return.
FDK Programmer’s Reference 385
2
FDK Function Reference
F_ApiRedisplay()
Synopsis
#include "fapi.h"
. . .
IntT F_ApiQuickSelect(F_ObjHandleT docId,
StringT prompt,
F_StringsT *stringlist);
Arguments
docId
The ID of the document containing the Tag area in which to display the
prompt
prompt
The prompt that appears in the Tag area
stringlist
The list of strings from which the user can choose
Returns
An index into the array of strings specified by stringlist or -1 if the user cancels
the quick selection.
If F_ApiQuickSelect() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
FE_BadDocId
The specified document ID is invalid
Example
See “Implementing quick keys” on page 228 of the FDK Programmer’s Guide.
F _ A p i R e d i sp l a y ( )
F_ApiRedisplay() updates the display for a specified document to reflect any
changes that occurred while FP_Displaying was set to False. If you have set
FP_Displaying to False and subsequently reset it to True, you should call
F_ApiRedisplay() to redisplay each document you modified.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiRedisplay(F_ObjHandleT docId);
386
FDK Programmer’s Reference
F_ApiRedisplay()
...
FDK Function Reference
Arguments
docId
The ID of the document to be redisplayed
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiRedisplay() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
Example
The following code disables redisplaying, and then reenables it and redisplays all the
documents in the session:
. . .
F_ObjHandleT docId;
F_ApiSetInt(0, FV_SessionId, FP_Displaying, False);
/* Code to change documents without reformatting goes here.
*/
F_ApiSetInt(0, FV_SessionId, FP_Displaying, True);
/* Redisplay all the documents in the session. */
docId = F_ApiGetId(0, FV_SessionId, FP_FirstOpenDoc);
while (docId)
{
F_ApiRedisplay(docId);
docId = F_ApiGetId(FV_SessionId, docId,
FP_NextOpenDocInSession);
}
. . .
See also
“F_ApiReformat()”.
FDK Programmer’s Reference 387
2
FDK Function Reference
F_ApiReformat()
F_ApiReformat()
F_ApiReformat() reformats the specified document. If you have disabled and
subsequently reenabled reformatting by setting the session property,
FP_Reformatting, you should then call F_ApiReformat() to reformat each
changed document in the session.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiReformat(F_ObjHandleT docId);
Arguments
docId
The ID of the document to reformat
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiReformat() fails, the API assigns the following value to FA_errno.
388
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FDK Programmer’s Reference
F_ApiRehyphenate()
...
FDK Function Reference
Example
The following code disables reformatting, and then reenables it and reformats all the
documents in the session:
. . .
F_ObjHandleT docId;
F_ApiSetInt(0, FV_SessionId, FP_Reformatting, False);
/* Code to change documents without reformatting goes here.
*/
F_ApiSetInt(0, FV_SessionId, FP_Reformatting, True);
/* Reformat all the documents in the session. */
docId = F_ApiGetId(0, FV_SessionId, FP_FirstOpenDoc);
while (docId)
{
F_ApiReformat(docId);
docId = F_ApiGetId(FV_SessionId, docId,
FP_NextOpenDocInSession);
}
. . .
F_ApiRehyphenate()
F_ApiRehyphenate() rehyphenates a specified document based on changes the user
has made to words’ hyphenation points.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiRehyphenate(F_ObjHandleT docId);
Arguments
docId
The ID of the document to rehyphenate
Returns
FE_Success if it succeeds, or an error code if an error occurs.
FDK Programmer’s Reference 389
2
FDK Function Reference
F_ApiResetEqnSettings()
If F_ApiRehyphenate() fails, the API assigns one of the following values to
FA_errno.
FA_errno value
Meaning
FE_BadDocId
Bad document or book ID
FE_WrongProduct
Current FrameMaker product doesn’t support this operation
FE_SystemError
Couldn’t allocate memory
Example
The following code rehyphenates the active document:
. . .
F_ApiRehyphenate(F_ApiGetId(0, FV_SessionId, FP_ActiveDoc));
. . .
F_ApiResetEqnSettings()
F_ApiResetEqnSettings() resets the document equation settings to the default
settings.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiResetEqnSettings(F_ObjHandleT docId);
Arguments
docId
The ID of the document for which to reset equation settings
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiResetEqnSettings() fails, the API assigns one of the following values to
FA_errno.
390
FA_errno value
Meaning
FE_BadDocId
Bad document or book ID
FDK Programmer’s Reference
F_ApiResetReferenceFrames()
FA_errno value
Meaning
FE_WrongProduct
Current FrameMaker product doesn’t support this operation
FE_SystemError
Couldn’t allocate memory
...
FDK Function Reference
Example
The following code resets the equation settings for the active document:
. . .
F_ApiResetEqnSettings(F_ApiGetId(0,FV_SessionId, FP_ActiveDoc));
. . .
F_ApiResetReferenceFrames()
F_ApiResetReferenceFrames() resets the reference frames in the specified
document. It is useful for updating a document after you have programmatically
changed a reference frame that is referenced by paragraphs in the document.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiResetReferenceFrames(F_ObjHandleT docId);
Arguments
docId
The ID of the document for which to reset reference frames
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiResetReferenceFrames() fails, the API assigns one of the following
values to FA_errno.
FA_errno value
Meaning
FE_BadDocId
Bad document or book ID
FE_WrongProduct
Current FrameMaker product doesn’t support this operation
FE_SystemError
Couldn’t allocate memory
FDK Programmer’s Reference 391
2
FDK Function Reference
F_ApiRestartPgfNumbering()
Example
The following code resets reference frames for the active document:
. . .
F_ApiResetReferenceFrames(F_ApiGetId(0, FV_SessionId,
FP_ActiveDoc));
. . .
F_ApiRestartPgfNumbering()
F_ApiRestartPgfNumbering() restarts the paragraph numbering for a specified
document. For more information on paragraph numbering, see your FrameMaker
product user documentation.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiRestartPgfNumbering(F_ObjHandleT docId);
Arguments
docId
The ID of the document for which to restart paragraph numbering
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiRestartPgfNumbering() fails, the API assigns one of the following
values to FA_errno.
392
FA_errno value
Meaning
FE_BadDocId
Bad document or book ID
FE_WrongProduct
Current FrameMaker product doesn’t support books
FE_SystemError
Couldn’t allocate memory
FDK Programmer’s Reference
F_ApiReturnValue()
...
FDK Function Reference
Example
The following code restarts paragraph numbering for the active document:
. . .
F_ApiRestartPgfNumbering(F_ApiGetId(0, FV_SessionId,
FP_ActiveDoc));
. . .
F _ A p i R e t u r n Va l u e ( )
F_ApiReturnValue() sets a return value for a client-defined callback. It allows a
client to provide status information to the FrameMaker product or client that called the
callback. You can call it in the following callbacks:
F_ApiDialogEvent()
F_ApiNotify()
F_ApiReturnValue() is useful for canceling FrameMaker product operations.
When your client receives a FA_Pre
notification for an
operation, it can cancel the operation by calling F_ApiReturnValue() with
retval set to FR_CancelOperation. For example, if your client’s
F_ApiNotify() callback responds to all FA_Note_PrePrint notifications by
calling F_ApiReturnValue() with retval set to FR_CancelOperation, the
FrameMaker product cancels all print operations.
Your client can also call F_ApiReturnValue() to respond to a
FA_Note_ClientCall notification. The API returns the value specified by retval
to the client that called F_ApiCallClient().
Your client can also call F_ApiReturnValue() in a F_ApiDialogEvent()
callback to prevent the FrameMaker product from closing a modal dialog box.
Your client can call F_ApiReturnValue() several times in a callback function. The
last call it makes before the callback returns overrides any previous calls.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiReturnValue(IntT retval);
FDK Programmer’s Reference 393
2
FDK Function Reference
F_ApiReturnValue()
Arguments
retval
The value to return
You can set retval to any integer. If you client sets retval in response to one of
the following notifications, it can use the listed constants.
Notification
Values client can pass to
F_ApiReturnValue()
FA_Note_DisplayClient
TiDialog
FR_Displayed
TiDialog
The client has displayed
its version of the Text
Inset Properties dialog
box
FR_DisplayedXRe
fDialog
If the client displays or
updates its crossreference dialog, it sets
the return value as
FR_DisplayedXRefD
ialog.If this return
value is not set,
FrameMaker assumes
that the client did not
display any dialog and
the standard crossreference dialog is
displayed.
FA_PreNotificationPoint
FR_Cancel
Operation
Cancel the operation for
which the notification
was issued
FA_Note_PreSaveAsPDF
Dialog
FR_Cancel
Operation
Cancel the Save as PDF
operation
FR_SkipStep
Do not display the
Acrobat Settings dialog
box
FA_Note_PostSaveAsPDF
Dialog
FR_Cancel
Operation
Cancel the Save as PDF
operationa
FA_Note_PreDistill
FR_Cancel
Operation
Cancel the Save as PDF
operation
FA_Note_ClientCall
Any value recognized
by the client that called
F_ApiCallClient(
)
Client-defined
FA_Note_DisplayClientXRef
Dialog
394
FDK Programmer’s Reference
Meaning
F_ApiReturnValue()
Notification
Values client can pass to
F_ApiReturnValue()
...
FDK Function Reference
Meaning
The ID of the
document into which
the file was filtered
The document was
filtered successfully
0
The document was not
filtered successfully
FA_Note_IsCommandEnabled
FR_CommandEnabl
ed
Return value to be used
in response to
notification
FA_Note_IsCommand
Enabled if command
should be enabled.
FA_Note_IsCommandEnabled
FR_CommandDisab
led
Return value to be used
in response to
notification
FA_Note_IsCommand
Enabled if command
should be disabled
FA_Note_FilterIn
a. Note that this event occurs before the distilling operation begins. You can now cancel the operation after the
user closes Save As PDF dialog box.
If your client calls F_ApiReturnValue() for notifications other than those listed
above, it has no effect.
A client can also call F_ApiReturnValue() in a F_ApiDialogEvent() callback
that responds to actions in a client-defined modal dialog box. Normally, when the user
clicks a button in a client-defined modal dialog box, the FrameMaker product calls the
client’s F_ApiDialogEvent() callback and then closes the dialog box. However, if
the client’s F_ApiDialogEvent() callback calls F_ApiReturnValue() with
retVal set to FR_DialogStayUp, the FrameMaker product does not close the
dialog box. The following table lists the values a client can pass to
F_ApiReturnValue() in an F_ApiDialogEvent() callback.
Values client can pass to F_ApiReturnValue()
Meaning
FR_DialogStayUp
Do not close the modal dialog box in which
the event occurred
Any other value
Close the modal dialog box
Returns
The value of the retval parameter the previous time F_ApiReturnValue() was
called in the current callback function.
FDK Programmer’s Reference 395
2
FDK Function Reference
F_ApiReturnValue()
If F_ApiReturnValue() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
A transport error occurred
Example
See “F_ApiCallClient()” on page 93 and “Handling user actions in multiple modeless
dialog boxes” on page 454 of the FDK Programmer’s Guide.
See also
“F_ApiDialogEvent()” on page 155, “F_ApiNotify()” on page 349, and
“F_ApiCallClient()” on page 93.
St ru cture d
F_ApiRun()
F_ApiRun() provides the minimum functionality required in an FDK client’s
main() function.
..............................................................................
IMPORTANT: F_ApiRun() is available only to Windows RPC clients.
..............................................................................
Synopsis
#include "fapi.h"
. . .
IntT F_ApiRun(VoidT);
Arguments
None.
Returns
FE_Success if it succeeds, or a nonzero value if an error occurs.
396
FDK Programmer’s Reference
F_ApiReturnValue()
...
FDK Function Reference
C++ clients that need to include their own main() functions can call F_ApiRun().
F_ApiRun() is defined as:
IntT F_ApiRun()
{
StringT s;
if (s = F_ApiStartUp(NULL))
F_ApiErr(s);
else
while (!FA_bailout)
F_ApiService(0);
F_ApiShutDown();
return(s!=NULL);
}
Example
The following code can be used as the main function for an FDK client written in C++:
int main() {return (F_ApiRun());}
FDK Programmer’s Reference 397
2
FDK Function Reference
F_ApiReturnValue()
See also
“F_ApiShutDown()” on page 455, “F_ApiService()” on page 405, and “F_ApiErr()” on
page 164.
398
FDK Programmer’s Reference
F_ApiSave()
2
...
FDK Reference
FrameMaker+SGMLFDK Fnction Reference
F_ApiSave()
F_ApiSave() saves a document or book. It allows you to script the way the
FrameMaker product saves the file and to specify responses to warnings and messages
that arise while the file is being saved. You can save a file under its current name or save
it as a new file.
Synopsis
#include "fapi.h"
. . .
F_ObjHandleT F_ApiSave(F_ObjHandleT Id,
StringT saveAsName,
F_PropValsT *saveParamsp,
F_PropValsT **saveReturnParamspp);
Arguments
Id
The ID of the document or book to save.
saveAsName
The pathname for saving the document or book.
saveParamsp
A property list that tells the FrameMaker product how to save the
file and how to respond to errors and other conditions. Use
F_ApiGetSaveDefaultParams() or
F_ApiAllocatePropVals() to create and allocate memory
for this property list. To use the default list, specify NULL.
saveReturnParamspp
A property list that returns information about how the
FrameMaker product saved the file.
..............................................................................
IMPORTANT: Always initialize the pointer to the property list that you specify for
saveReturnParamspp to NULL before you call F_ApiSave().
..............................................................................
To get a property list for saveParamsp, you can use
F_ApiGetSaveDefaultParams() and modify individual properties in the list it
returns, or you can create a list from scratch. For information on
F_ApiGetSaveDefaultParams(), see “F_ApiGetSaveDefaultParams()” on
page 234. For information on creating a property list from scratch, see “Creating a
saveParamsp script from scratch” on page 255 of the FDK Programmer’s Guide.
FDK Programmer’s Reference 399
6
FDK Function Reference
F_ApiSave()
The property list returned in saveReturnParamspp has the properties shown in the
following table.
Property
Meaning and possible values
FS_SavedFileName
A string that specifies the saved file’s full pathname.
FS_SaveNativeError
The error condition. If the file is saved successfully, it is
set to FE_Success. See the table below for the
possible values.
FS_SaveStatus
A bit field indicating what happened when the file was
saved. See the table below for the possible values.
Both the FS_SaveNativeError property and the FA_errno global variable
indicate the result of a call to F_ApiSave(). The FS_SaveStatus flags indicate
how or why this result occurred. The following table lists the possible status flags and
the FA_errno and FS_SaveNativeError values associated with them.
FS_SaveNativeError and
FA_errno values
Possible FS_SaveStatus flags
FE_Success
None.
FE_Canceled or
FE_CanceledByClient
(file wasn’t saved)
FV_FileNotWritable: file was not writable.
FV_BadSaveFileName: specified file name is not allowed by
the operating system.
FV_BadFileId: the file’s operating system ID was bad.
FV_BadSaveScriptValue: script specified by
saveParamsp had an invalid value.
FV_CancelSaveFileIsInUse: The file is in use and the user
did not or could not reset the lock. Or the file is in use, and the
FS_FileIsInUse script is set to FV_DoCancel, or it is set to
FV_ResetLockAndContinue but the FrameMaker product
could not reset the lock.
FV_CancelSaveModDateChanged: The file has changed since
the last time it was opened or saved in the current session.
FV_FileWasInUse: file was in use.
FV_LockCouldntBeReset: file lock couldn’t be reset.
FV_LockWasReset: file lock was reset.
FV_LockNotReset: file lock was not reset.
400
FDK Programmer’s Reference
F_ApiSave()
FS_SaveNativeError and
FA_errno values
...
FDK Reference
Possible FS_SaveStatus flags
FE_Canceled or
FE_CanceledByClient
(file wasn’t saved)
FV_FileIsViewOnly: file was View Only.
FE_WrongProduct
None. Current FrameMaker product doesn’t support this
operation
FE_FailedState or
FE_BadParameter
None. The filename was invalid.
FE_FilterFailed
FV_InvalidSaveFilter: The filter specified by
FS_SaveFileTypeHint is not installed, or the syntax for
FS_SaveFileTypeHint is invalid.
After you are done with the property lists you use to call F_ApiSave(), use
F_ApiDeallocatePropVals() to deallocate the memory they use.
Returns
The ID of the document it saved, or 0 if it fails.
Example
See “Example” on page 257 of the FDK Programmer’s Guide and
“F_ApiGetSaveDefaultParams()” on page 234.
See also
“F_ApiDeallocateStructureType()” on page 125, “F_ApiGetSaveDefaultParams()” on
page 234, “F_ApiPrintSaveStatus()” on page 372, and “F_ApiSimpleSave()” on
page 466.
FDK Programmer’s Reference 401
6
FDK Function Reference
F_ApiScrollBox()
F_ApiScrollBox()
F_ApiScrollBox() displays an array of items and allows the user to
choose one.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiScrollBox(IntT *selected_item,
StringT title,
F_StringsT *stringslist
IntT default);
Arguments
selected_item
The index of the selected item when the user clicks OK (or double-clicks
an item). The index of the first item is 0.
title
The title that appears on the dialog box.
stringslist
The list of items to appear in the scroll list.
default
The index of the item that is selected when the dialog box first appears.
For no default, specify -1.
..............................................................................
IMPORTANT: If you set default to -1, always check to make sure the value
returned in selected_item is 0 or greater before you use it as an array index. If
you set default to -1 and the user clicks OK without choosing an item, the value
returned in selected_item will be -1.
..............................................................................
F_StringsT is defined as:
typedef struct {
UIntT len; /* Number of strings */
StringT *val; /* Array of strings */
} F_StringsT;
Returns
0 if the user clicked OK, or a nonzero value if the user clicked Cancel or an error
occurred.
402
FDK Programmer’s Reference
F_ApiScrollBox()
...
FDK Reference
If F_ApiScrollBox() fails, the API assigns the following value to FA_errno.
FA_errno value
Meaning
FE_Transport
The user clicked Cancel, or a transport error occurred
Example
The following code displays a scroll list dialog box, with a default item labeled “Kurt”:
. . .
#include "futils.h"
IntT choice, err;
UCharT msg[256];
F_StringsT names;
StringT nameList[4];
nameList[0]
nameList[1]
nameList[2]
nameList[3]
=
=
=
=
(StringT)"Kelly";
(StringT)"Jens";
(StringT)"Kurt";
(StringT)"Heycke";
names.len = 4;
names.val = nameList;
err = F_ApiScrollBox(&choice, "Choose a name.", &names, 2);
if (!err)
F_Sprintf(msg, "The name is %s.", nameList[choice]);
else
F_Sprintf(msg, "Cancel was pressed");
F_ApiAlert(msg, FF_ALERT_CONTINUE_NOTE);
. . .
See also
“F_ApiChooseFile()” on page 97.
FDK Programmer’s Reference 403
6
FDK Function Reference
F_ApiScrollToText()
F _ A p i S c ro l l To Te x t( )
F_ApiScrollToText() scrolls the document window to a specified text range. It
scrolls to the end of the range that is closest to the current display position.
Synopsis
#include "fapi.h"
. . .
IntT F_ApiScrollToText(F_ObjHandleT docId,
F_TextRangeT *textRangep);
Arguments
docId
The ID of the document containing the text range
textRangep
The text range to which to scroll
Returns
FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiScrollToText() fails, the API assigns one of the following values to
FA_errno.
404
FA_errno value
Meaning
FE_BadDocId
Invalid document ID
FE_BadObjId
Invalid object ID
FE_NotTextObject
One or both of the IDs specified by textRangep is not the ID of
an object that contains text, such as a paragraph (FO_Pgf) or a
flow (FO_Flow)
FE_OffsetNotFound
Offset specified for the text range couldn’t be found in the
specified paragraph or text line
FE_BadRange
Specified text range is invalid
FDK Programmer’s Reference
F_ApiService()
...
FDK Reference
Example
The following code scrolls the document window to the insertion point or the end of the
text selection:
. . .
F_ObjHandleT docId;
F_TextRangeT tr;
/* Get the insertion point or text selection. */
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
if (tr.beg.objId == 0) return;
/* Scroll to it. */
F_ApiScrollToText(docId, &tr);
. . .
See also
“F_ApiCenterOnText()” on page 94.
F_ApiService()
F_ApiService() services calls from the FrameMaker product to the API.
F_ApiService() is useful only if you are providing a replacement for
F_ApiRun()—for example, if your client needs to select on its own file descriptors.
On Windows, F_ApiService parameters are ignored. F_ApiService() waits for and
dispatches a single Windows message. If your application contains its own message
processing loop you need not call this routine. It is not generally feasible for console
applications to receive FDK notifications since there is no way for them to both wait for
user imput and call F_ApiService(). Consequently, console applications should not
register for notifications.
..............................................................................
IMPORTANT: F_ApiService() is only available to Windows RPC clients.
..............................................................................
Synopsis
#include "fapi.h"
. . .
IntT F_ApiService(IntT *imaskp);
FDK Programmer’s Reference 405
6
FDK Function Reference
F_ApiService()
Arguments
imaskp
The address of an integer select() mask.
Returns
The number of bits the call to select() selected, if any.
If you want other file descriptors to be active at the same time as the API “listen” port,
set imaskp to the address of an integer select() mask that you want to OR into
the F_ApiService() function’s call to select(). If the call to select() selects
on any of the parameter’s file descriptors, F_ApiService() returns the number of the
bits, and puts the bits into *imaskp.
Example
The following code sets as the input file descriptor the shell window from which you
start the FrameMaker product and processes requests from that file descriptor:
. . .
/* Set the shell window as the input fd. */
in_fd = open("/dev/tty",O_RDONLY);
/* Start API. If it fails to start, exit and print error.*/
if (s = F_ApiStartUp(NULL))
F_ApiErr(s);
else
while (!FA_bailout)
{
myfds = 1<= 0)
s[i] = F_CharToLower(s[i]);
F_Printf(NULL, "%s\n", s);
. . .
F_CharToLowerUTF8()
Converts a UTF-8 character to lowercase
Synopsis
#include "fencode.h"
. . .
VoidT F_CharToLowerUTF8(const UCharT *c, UCharT *newchar);
Arguments
c
The character to convert
newchar
Pointer to the converted character. It must point to a
block of modifiable memory large enough to store the
converted character (a UTF-8 character requires at
most 4 bytes).
Returns
VoidT
Example
The following code prints Lowercase of Δ is δ
530
FDK Programmer’s Reference
F_CharToUpper()
...
FDK Function Reference
#include "fencode.h"
. . .
UCharT upper[]={0xCE, 0x94};
UCharT lower[4];
F_FdeInitFontEncs((ConStringT)"UTF-8");
F_CharToLowerUTF8(upper, lower);
F_Printf(NULL,"Lowercase of %C is %C", upper, lower);
...
F_CharToUpp er()
F_CharToUpper() converts a character in the FrameMaker product character set to
uppercase.
NOTE: This function is designed to work with the FrameMaker encoding for Roman
characters. It will also work with single-byte characters in the range x00 through x7F for
Asian language encodings.
Synopsis
#include "fdetypes.h"
#include "fcharmap.h"
. . .
UCharT F_CharToUpper(UCharT c);
Arguments
c
The character to convert
Returns
The specified character, converted to uppercase.
FDK Programmer’s Reference 531
7
FDK Function Reference
F_CharToUpperUTF8()
Example
The following code converts a mixed-case string to uppercase. It prints the string
MIXED CASE.
. . .
StringT s;
IntT i;
s = F_StrCopyString((StringT) "mIxeD Case");
for (i=0; i < F_StrLen(s); i++)
s[i] = F_CharToUpper(s[i]);
F_Printf(NULL, "%s\n", s);
. . .
F_CharTo Upp erUT F8()
Converts a UTF-8 character to uppercase
Synopsis
#include "fencode.h"
. . .
VoidT F_CharToUpperUTF8(const UCharT *c, UCharT *newchar);
Arguments
c
The character to convert
newchar
Pointer to the converted character. It must point to a
block of modifiable memory large enough to store the
converted character (a UTF-8 character requires at
most 4 bytes).
Returns
VoidT
Example
The following code prints Uppercase of δ is Δ
532
FDK Programmer’s Reference
F_CharUTF16ToUTF8()
...
FDK Function Reference
#include "fencode.h"
. . .
UCharT upper[4];
UCharT lower[] = {0xCE, 0xB4};
F_FdeInitFontEncs((ConStringT)"UTF-8");
F_CharToUpperUTF8(lower, upper);
F_Printf(NULL,"Uppercase of %C is %C", lower, upper);
...
F_CharUTF16ToUTF8()
Converts a UTF-16 character to a UTF-8 character
Synopsis
#include "fencode.h"
. . .
IntT F_CharUTF16ToUTF8 (const UChar16T *src, UCharT *dest);
Arguments
src
The character to convert
dest
Pointer to the converted character. It must point to a block of modifiable
memory large enough to store the converted character (a UTF-8 character
requires at most 4 bytes).
Returns
The number of bytes (or UTF-8 code points) written in dest
Example
The following code prints 1Б2о3г
FDK Programmer’s Reference 533
7
FDK Function Reference
F_CharUTF32ToUTF8()
#include "fencode.h"
. . .
UChar16T russian_U16[]={0x0411, 0x043E, 0x0433, 0x0000};
UChar16T *t = russian_U16;
UCharT dest[5];
IntT i;
F_FdeInitFontEncs((ConStringT)"UTF-8");
while(*t)
{
F_CharUTF16ToUTF8(t,dest);
F_Printf("%d%C",i,dest); /* dest is not null terminated
here*/
F_UTF16NextChar(&t);
}
...
F_CharUTF32ToUTF8()
Converts a UTF-32 character to a UTF-8 character
Synopsis
#include "fencode.h"
. . .
IntT F_CharUTF32ToUTF8 (UChar32T src, UCharT *dest);
Arguments
src
The character to convert
dest
Pointer to the converted character. It must point to a block of modifiable
memory large enough to store the converted character (a UTF-8 character
requires at most 4 bytes).
Returns
The number of bytes (or UTF-8 code points) written in dest
534
FDK Programmer’s Reference
F_CharUTF8ToUTF16()
...
FDK Function Reference
Example
The following code prints 1Б2о3г
#include "fencode.h"
. . .
UChar32T russian_U32[]={0x0411, 0x043E, 0x0433, 0x0000};
UCharT dest[5];
IntT i;
F_FdeInitFontEncs((ConStringT)"UTF-8");
for(i=0;i<3;i++)
{
dest[F_CharUTF32ToUTF8(russian_U32[i],dest)]=0;
F_Printf("%d%s",i,dest); /* note dest is null terminated here
*/
}
...
F_CharUT F8To UTF16()
Converts a UTF-8 character to a UTF-16 character
Synopsis
#include "fencode.h"
. . .
IntT F_CharUTF8ToUTF16 (const UCharT *src, UChar16T *dest)
Arguments
src
The character to convert
dest
Pointer to the converted character. It must point to a block of modifiable
memory large enough to store the converted character (a UTF-16 character
requires at most 2 code units of 2 bytes each).
Returns
The number of UChar16T (or UTF-16 code points) written in dest
FDK Programmer’s Reference 535
7
FDK Function Reference
F_CharUTF8ToUTF32()
Example
The following code prints 1,0x411
#include "fencode.h"
. . .
UChar16T russian_U16[2];
IntT n;
F_FdeInitFontEncs((ConStringT)"UTF-8");
n = F_CharUTF8ToUTF16("\xD0\x91",russian_U16);
F_Printf("%d,%x", n, russian_U16[0]);
...
F_CharUT F8To UTF32()
Converts a UTF-8 character to a UTF-32 character
Synopsis
#include "fencode.h"
. . .
UChar32T F_CharUTF8ToUTF32 (const UCharT *src);
Arguments
src
The character to convert
Returns
The character in UTF-32
Example
The following code prints 0x411
536
FDK Programmer’s Reference
F_ClearHandle()
...
FDK Function Reference
#include "fencode.h"
. . .
F_FdeInitFontEncs((ConStringT)"UTF-8");
F_Printf("%x",F_CharUTF8ToUTF32("\xD0\x91"));
...
F _ C l e ar H a n d l e ( )
F_ClearHandle() initializes to zero a handle’s block of data.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
ErrorT F_ClearHandle(HandleT handle);
Arguments
handle
The handle specifying the block of data to initialize
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
See “F_AllocHandle()” on page 69.
F_ClearPtr()
F_ClearPtr() initializes the memory block associated with a pointer
to zero.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
ErrorT F_ClearPtr(PtrT ptr,
UIntT size);
FDK Programmer’s Reference 537
7
FDK Function Reference
F_CopyPtr()
Arguments
ptr
The pointer specifying the block of data to initialize
size
The size of the block of data
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
See “F_Alloc()” on page 68.
F_CopyPtr()
F_CopyPtr() copies from the memory area specified by one pointer to the memory
area specified by another pointer.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
ErrorT F_CopyPtr(PtrT srcPtr,
PtrT dstPtr,
UIntT numBytes);
Arguments
srcPtr
The pointer to the memory to be copied. It must be a valid pointer pointing
to at least numBytes of memory.
dstPtr
The pointer to the memory to copy over. It must be a valid pointer pointing
to at least numBytes of modifiable memory.
numBytes
The number of bytes to be copied.
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
538
FDK Programmer’s Reference
F_DeleteFile()
...
FDK Function Reference
Example
The following code copies from the memory area specified by one pointer to the
memory area specified by another pointer:
. . .
UCharT *srcPtr = NULL, *dstPtr = NULL;
srcPtr = F_Alloc(256, NO_DSE);
if(srcPtr == NULL)
return;
dstPtr = F_Alloc(256, NO_DSE);
if(dstPtr == NULL)
return;
if (F_CopyPtr(srcPtr, dstPtr, 256) != FdeSuccess)
F_Printf(NULL, "Couldn't copy pointer.\n");
. . .
F_DeleteFile()
F_DeleteFile() removes the file or directory specified by a filepath.
F_DeleteFile() fails if permission is denied, the filepath specifies a file or directory
that does not exist, or the filepath specifies a directory that is
not empty.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
ErrorT F_DeleteFile(FilePathT *filepath);
Arguments
filepath
The filepath of the file to delete
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
FDK Programmer’s Reference 539
7
FDK Function Reference
F_DigitValue()
Example
The following code deletes the file tmp.txt from the tmp directory:
. . .
FilePathT *path;
path = F_PathNameToFilePath("\\tmp\tmp.txt",
NULL, FDIPath);
F_DeleteFile(path);
. . .
F _ D i g i t Va l u e ( )
Returns the numerical value of a UTF-8 character that is a decimal numeric
NOTE: This function doesn’t return the value of numeric characters like Ⅳ (code point
0x2163) that aren’t in a decimal system.
Synopsis
#include "fencode.h"
. . .
IntT F_DigitValue (UCharT *s);
Arguments
s
The character whose numeric value must be determined.
Returns
The numeric value (0-9) of the character if it is numeric, or -1 if it isn’t
Example
The following code prints ४ + २ = 6
540
FDK Programmer’s Reference
F_DuplicateHandle()
...
FDK Function Reference
...
StringT devanagiri_four="\xE0\xA5\xAA";
StringT devanagiri_two ="\xE0\xA5\xA8";
IntT res;
F_FdeInitFontEncs((ConStringT)"UTF-8");
res = F_DigitValue(devanagiri_four)
+F_DigitValue(devanagiri_two);
F_Printf(NULL,"%C + %C is %d", devanagiri_four, devanagiri_two,
res);
...
F_DuplicateHandle()
F_DuplicateHandle() copies the block of memory specified by a handle to another
handle.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
BoolT F_DuplicateHandle(HandleT srcHandle,
HandleT dstHandle);
Arguments
srcHandle
A handle specifying the block of memory to be copied
dstHandle
A handle specifying the block of memory to which to copy
If the block of memory specified by srcHandle is larger than that specified by
dstHandle, F_DuplicateHandle() copies only as much as dstHandle will
hold. It does not allocate additional memory to dstHandle.
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
FDK Programmer’s Reference 541
7
FDK Function Reference
F_DuplicatePtr()
Example
The following code duplicates a handle:
. . .
HandleT srcHndl, dstHndl;
srcHndl = F_AllocHandle(66000, NO_DSE);
dstHndl = F_AllocHandle(66000, NO_DSE);
F_DuplicateHandle(srcHndl, dstHndl);
. . .
F _ D u p l i ca t e P tr ( )
F_DuplicatePtr() allocates a new block of memory and copies the contents of a
specified block of memory to it. F_DuplicatePtr() doesn’t perform a clever copy.
If the specified block of memory contains pointers, it duplicates the pointers but not the
blocks to which they point.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
PtrT F_DuplicatePtr(PtrT srcPtr,
UIntT size,
PUCharT flags);
Arguments
srcPtr
A pointer specifying the block of memory to duplicate
size
The size of the block of memory to duplicate
flags
Flag specifying whether to bail out (DSE) or return NULL (NO_DSE) if the
memory you request isn’t available
Returns
The new block of memory if it succeeds, or NULL if it fails.
542
FDK Programmer’s Reference
F_Exit()
...
FDK Function Reference
Example
The following code duplicates a pointer:
. . .
UCharT *srcPtr = NULL, *dstPtr = NULL;
srcPtr = F_Alloc(256, NO_DSE);
if(srcPtr == NULL) return;
dstPtr = F_DuplicatePtr(srcPtr, 256, NO_DSE);
if(dstPtr == NULL)
F_Printf(NULL, "Couldn't duplicate pointer.\n");
. . .
F_Exit()
F_Exit() cleans up and exits the application with number n.
..............................................................................
IMPORTANT: If you are writing an API client, do not call F_Exit(). Use
F_ApiBailOut() instead.
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fprogs.h"
. . .
VoidT F_Exit(IntT n);
Arguments
n
The number with which to exit
Returns
VoidT.
Example
The following code exits an application:
. . .
F_Exit(-5);
. . .
FDK Programmer’s Reference 543
7
FDK Function Reference
F_FdeEncodingsInitialized()
F_FdeEncodingsIn itialized()
Determines whether the FDE encoding data has been correctly initialized. If this doesn’t
return true, F_FdeInit or F_FdeInitFontEncs has not been called or has failed and
the FDE won’t function correctly. Use this function, along with F_GetICUDataDir, to
check that the FDE has been correctly set up before making FDE calls.
Synopsis
#include "fencode.h"
. . .
BoolT F_FdeEncodingsInitialized (VoidT);
Arguments
VoidT
Returns
A nonzero value if FDE font encoding has been initialized by F_FdeInit or
F_FdeInitFontEncs, or 0 if it hasn’t.
Example
The following code prints Font Encoding Data Initialized
#include "fencode.h"
...
F_FdeInitFontEncs((ConStringT)"UTF-8");
if (F_FdeEncodingsInitialized())
F_Printf(NULL,"Font Encoding Data Initialized");
...
F_FdeInit()
F_FdeInit() initializes the FDE. Call it before you call any other FDE functions.
..............................................................................
IMPORTANT: If you call F_ApiBailOut(), you must call F_FdeInit() to
reinitialize the FDE.
..............................................................................
544
FDK Programmer’s Reference
F_FdeInitFontEncs()
...
FDK Function Reference
Synopsis
#include "fdetypes.h"
. . .
ErrorT F_FdeInit(VoidT);
Returns
VoidT.
Example
The following code initializes the FDE:
. . .
F_FdeInit();
. . .
F_FdeInitFontEncs()
F_FdeInitFontEncs() initializes the current session’s font encoding data for your
client to use. It also sets the font encoding for any dialog boxes your client displays. Call
it before you call any other FDE functions that have to do with font encodings.
..............................................................................
IMPORTANT: If you call F_ApiBailOut(), you must call
F_FdeInitFontEncs() to reinitialize the font encoding data for your client.
..............................................................................
Calling this function with "UTF-8" as a parameter enables Unicode Mode for the FDE.
Calling this function with any other encoding disables Unicode Mode and enables
Compatibility Mode for the FDE.
Synopsis
#include "fencode.h"
. . .
FontEncIdT F_FdeInitFontEncs(ConStringT fontEncName);
Arguments
fontEncName
The name of the font encoding to use for your client’s dialog boxes.
Possible values for fontEncName are:
FDK Programmer’s Reference 545
7
FDK Function Reference
F_FdeInitFontEncs()
Value
Means
FrameRoman
Roman text
JISX0208.ShiftJIS
Japanese text
BIG5
Traditional Chinese text
GB2312-80.EUC
Simplified Chinese text
KSC5601-1992
Korean text
UTF-8
Enables Unicode Mode for the FDE
Returns
The ID of the font encoding you assigned to your dialog boxes. If the FDE does not
recognize fontEncName as a valid encoding name for the current session, this function
returns the ID for the Roman encoding.
Example
The following code initializes the FDE and ensures the dialog box encoding is one the
client can support. If the dialog box encoding for the current session is Japanese or
Simplified Chinese, it passes that encoding the F_FdeInitFontEncs(). Otherwise,
it passes Roman to F_FdeInitFontEncs():
. . .
FontEncIdT feId;
StringT encName;
F_FdeInit();
encName = F_ApiGetString(0, FV_SessionId,
FP_DialogEncodingName);
if (F_StrIEqual( encName, "JISX0208.ShiftJIS") ||
F_StrIEqual( encName, "GB2312-80")
feId = F_FdeInitFontEncs((ConStringT) encName);
else
feId = F_FdeInitFontEncs((ConStringT) "FrameRoman");
. . .
546
FDK Programmer’s Reference
F_FilePathBaseName()
...
FDK Function Reference
F_ F i l e P a t h BaseN ame()
F_FilePathBaseName() returns the basename of a specified filepath. If a filepath
ends with a directory delimiter, its basename is the string immediately before the
directory delimiter. If a filepath doesn’t end with a directory delimiter, the basename is
the string after the last directory delimiter. For example, the basename of the following
filepaths:
/usr/root/mydirectory/
/usr/root/mydirectory
is mydirectory.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
StringT F_FilePathBaseName(FilePathT *filepath);
Arguments
filepath
The filepath for which to return the basename
Returns
The basename of the specified filepath, or NULL if there is insufficient memory.
F_FilePathBaseName() returns an empty string if filepath specifies a root
directory. It returns NULL if there is not enough memory. F_FilePathBaseName()
allocates the returned string with F_Alloc(). You must use F_Free() to free this
string.
Example
The following code prints the string Basename: tmp.txt:
. . .
FilePathT *path;
StringT basename;
path = F_PathNameToFilePath("\\tmp\tmp.txt",
NULL, FDIPath);
basename = F_FilePathBaseName(path);
F_Printf(NULL, "Basename: %s\n", basename);
F_Free(basename);
. . .
FDK Programmer’s Reference 547
7
FDK Function Reference
F_FilePathCloseDir()
F_FilePathCloseDir()
F_FilePathCloseDir() closes a file handle opened by F_FilePathOpenDir().
After the handle is closed, you can’t reference it.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
VoidT F_FilePathCloseDir(DirHandleT handle);
Arguments
handle
The file handle to close
Returns
VoidT.
Example
For an example of F_FilePathCloseDir() in use, see “F_FilePathGetNext()” on
page 550.
F_ F i l e P a t h C o p y()
F_FilePathCopy() returns a copy of a specified filepath.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
FilePathT *F_FilePathCopy(FilePathT *filepath);
Arguments
filepath
The filepath to return a copy of
Returns
A copy of the specified filepath, or NULL if it fails to allocate enough memory for the
new filepath.
548
FDK Programmer’s Reference
F_FilePathFree()
...
FDK Function Reference
Example
The following code copies a filepath:
. . .
FilePathT *path1, *path2;
path1 = F_PathNameToFilePath("\\tmp\tmp.txt",
NULL, FDIPath);
path2 = F_FilePathCopy(path1);
. . .
F_FilePathFree(path1);
F_FilePathFree(path2);
. . .
F_FilePathFree()
F_FilePathFree() frees the resources associated with a filepath.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
ErrorT F_FilePathFree(FilePathT *path);
Arguments
path
The filepath to free
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
See “F_FilePathCopy()” on page 548.
FDK Programmer’s Reference 549
7
FDK Function Reference
F_FilePathGetNext()
F_FilePathGetNext()
F_FilePathGetNext() returns the next file in a specified directory. You can use it
to scan the files in a directory. To get the directory handle, use
F_FilePathOpenDir(). Each time you call F_FilePathGetNext(), it allocates
a new FilePathT structure. Use F_FilePathFree() to free each FilePathT
structure when you are done with it.
It is illegal to call F_FilePathGetNext() if you have closed the specified directory
by calling F_FilePathCloseDir().
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
FilePathT *F_FilePathGetNext(DirHandleT handle, IntT *statusp);
Arguments
handle
The directory for which to get the next file
statusp
A pointer to memory in which the function can store a
status value
Returns
The next file or subdirectory in the specified directory, or NULL if there is no file or
subdirectory entry left in the directory. If F_FilePathGetNext() fails to construct
the filepath, it returns NULL and sets the value of statusp to a nonzero value.
550
FDK Programmer’s Reference
F_FilePathOpenDir()
...
FDK Function Reference
Example
The following code prints the pathnames of all the files and directories in the tmp
directory:
. . .
DirHandleT handle;
FilePathT *path, *file;
IntT statusp;
StringT pathname;
/* Get filepath and directory handle of tmp directory. */
path = F_PathNameToFilePath((StringT)"\\tmp",
NULL, FDIPath);
handle = F_FilePathOpenDir(path, &statusp);
if (handle == 0)
{
F_FilePathFree(path);
return;
}
/* Traverse files and directories in tmp directory. */
while((file = F_FilePathGetNext(handle, &statusp)) != NULL)
{
pathname = F_FilePathToPathName(file, FDIPath);
F_Printf(NULL, "%s\n", pathname);
F_Free(pathname);
F_FilePathFree(file);
}
/* Free tmp directory handle and filepath. */
F_FilePathCloseDir(handle);
F_FilePathFree(path);
. . .
See also
“F_FilePathOpenDir()” on page 551 and “F_FilePathCloseDir()” on page 548.
F_FilePathOpenDir()
F_FilePathOpenDir() allocates and returns a directory handle that you can use to
call F_FilePathGetNext() to obtain the file and subdirectory entries in the
directory.
FDK Programmer’s Reference 551
7
FDK Function Reference
F_FilePathParent()
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
DirHandleT F_FilePathOpenDir(FilePathT *filepath,
IntT *statusp);
Arguments
filepath
The filepath of the directory
statusp
A pointer to memory in which the function can store a
status value
Returns
A handle to the directory, or NULL if the specified directory does not exist or is
unreadable. F_FilePathOpenDir() returns NULL and sets the value of statusp
to a nonzero value if there is not enough memory.
Example
See “F_FilePathGetNext()” on page 550 and “F_FilePathCloseDir()” on page 548.
F_FilePathPare nt()
F_FilePathParent() returns the filepath of the parent directory of a specified
directory.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
FilePathT *F_FilePathParent(FilePathT *path,
IntT *statusp);
552
FDK Programmer’s Reference
F_FilePathProperty()
...
FDK Function Reference
Arguments
path
The filepath of the directory
statusp
A pointer to memory in which the function can store a
status value
Returns
The filepath of the parent directory of the specified directory, or NULL if path
specifies a root directory. If F_FilePathParent() fails, it returns NULL and sets
statusp to a nonzero value.
Example
The following code prints the pathname of the tmp directory (the parent of the mydir
directory):
. . .
IntT statusp;
FilePathT *path, *parentPath;
StringT pathname;
path = F_PathNameToFilePath("\\tmp\mydir",
NULL, FDIPath);
parentPath = F_FilePathParent(path, &statusp);
pathname = F_FilePathToPathName(parentPath, FDIPath);
F_Printf(NULL, "%s\n", pathname);
. . .
F_FilePathProperty()
F_FilePathProperty() returns information about the file or directory specified by
a filepath.
NOTE: This function works for HTTP paths as well. Property of the cached file is
returned instead of the server file.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
IntT F_FilePathProperty(FilePathT *filepath,
IntT pflags);
FDK Programmer’s Reference 553
7
FDK Function Reference
F_FilePathToPathName()
Arguments
filepath
The filepath of the file or directory.
pflags
Bit flags specifying the file or directory characteristics to evaluate. See the
table below for a list of flags.
You can OR the following bit flags into pflags.
Bit mask
Information returned
FF_FilePathReadable
Whether filepath is readable
FF_FilePathWritable
Whether filepath is writable
FF_FilePathDirectory
Whether filepath is a directory
FF_FilePathFile
Whether filepath is a file
FF_FilePathExist
Whether filepath exists
Returns
A bit mask for the properties specified by pflags.
Example
The following code prints the string The file is readable and writable if
the tmp.txt file in the tmp directory is readable and writable:
. . .
IntT pflags;
FilePathT *path;
pflags = FF_FilePathReadable | FF_FilePathWritable;
path = F_PathNameToFilePath("\\tmp\tmp.txt",
NULL, FDIPath);
if(F_FilePathProperty(path, pflags) == pflags)
F_Printf(NULL, "The file is readable and writable\n");
. . .
F_FilePathToPathName()
F_FilePathToPathName() converts a FilePathT filepath to a platformdependent pathname string for a specified platform.
This function also supports HTTP paths.
554
FDK Programmer’s Reference
F_FilePathToPathName()
...
FDK Function Reference
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
StringT F_FilePathToPathName(FilePathT *filepath,
PathEnumT platform);
Arguments
filepath
The filepath to convert.
platform
The platform for which to produce a pathname. To avoid possible errors
when you port your clients to different platforms, set platform to
FDefaultPath.
Returns
The pathname, or NULL if platform specifies a platform other than the platform on
which the client is currently running or if F_FilePathToPathName() fails to
convert the pathname to a device-independent pathname.
F_FilePathToPathName() allocates the returned string with F_Alloc(). Use
F_Free() to free this string when you are done with it.
Example
The following code creates a filepath from the device-independent pathname
\\tmp\tmp.txt. It uses F_FilePathToPathName() to get a
platform-specific pathname from the filepath.
. . .
FilePathT *path;
StringT pathname;
path = F_PathNameToFilePath("\\tmp\tmp.txt",
NULL, FDIPath);
pathname = F_FilePathToPathName(path, FDefaultPath);
F_Printf(NULL, "%s\n", pathname);
F_Free(pathname);
. . .
Thiscode prints current_drive_letter:\tmp\txt.
.
FDK Programmer’s Reference 555
7
FDK Function Reference
F_FontEncId()
F_FontEncId()
F_FontEncId() returns the ID for the named font encoding. Before calling this
function, you must have called F_FdeInitFontEncs() to initialize the font encoding
data.
This function supports UTF-8.
Synopsis
#include "fencode.h"
. . .
FontEncIdT F_FontEncId(ConStringT fontEncName);
Arguments
fontEncName
The name of the font encoding to use.
Possible values for fontEncName are:
Value
Means
FrameRoman
Roman text
JISX0208.ShiftJIS
Japanese text
BIG5
Traditional Chinese text
GB2312-80.EUC
Simplified Chinese text
KSC5601-1992
Korean text
Returns
The ID of the font encoding you specified. If the FDE does not recognize
fontEncName as a valid encoding name for the current session, this function returns
the ID for the FrameRoman encoding.
556
FDK Programmer’s Reference
F_FontEncName()
...
FDK Function Reference
Example
If the encoding for the current session’s user onterface is JISX0208.ShiftJIS, the
code returns the ID for that encoding. Otherwise, it returns the ID for the FrameRoman
encoding.
FontEncIdT feId;
StringT encName;
F_FdeInit();
encName = F_ApiGetString(0, FV_SessionId,
FP_DialogEncodingName);
. . .
feId = F_FontEncId((ConStringT) "JISX0208.ShiftJIS");
The following code prints UTF-8
...
FontEncIdT feId;
F_FdeInitFontEncs((ConStringT) "UTF-8");
feId = F_TextEncToFontEnc(F_EncUTF8);
if (feId == F_FontEncId("UTF-8"))
F_Printf(NULL, F_FontEncName(feId));
...
.
F_FontEncName()
F_FontEncName() returns the name of the font encoding indicated by the specified
FontEncIdT. Before calling this function, you must have called
F_FdeInitFontEncs() to initialize the font encoding data.
This function can handle UTF-8 encoding.
Synopsis
#include "fencode.h"
. . .
ConStringT F_FontEncName(FontEncIdT fontEncId);
FDK Programmer’s Reference 557
7
FDK Function Reference
F_FontEncToTextEnc()
Arguments
fontEncId
The ID of the font encoding to use.
Returns
The name of the font encoding associated with the specified FontEncIdT, or NULL if
fontEncId is not a valid ID for the session.
Possible font encoding names are :
Value
Means
FrameRoman
Roman text
JISX0208.ShiftJIS
Japanese text
BIG5
Traditional Chinese text
GB2312-80.EUC
Simplified Chinese text
KSC5601-1992
Korean text
UTF-8
Unicode UTF-8 encoding
Example
. . .
FontEncIdT feId;
ConStringT encName
encName = F_FontEncName(feId);
. . .
/* Be sure to free encName when you are through */
F_FontEncToTextEnc()
Converts from FontEncIdT to FTextEncodingT
NOTE: This function has different behaviors for Compatibility Mode and Unicode
Mode. In Unicode Mode, if no match is found, UTF-8 is the default output. In
Compatibility Mode, the default output is FrameRoman.
558
FDK Programmer’s Reference
F_Free()
...
FDK Function Reference
Synopsis
#include "fencode.h"
. . .
FTextEncodingT F_FontEncToTextEnc (FontEncIdT feId);
Arguments
Returns
The text encoding corresponding to the font encoding
Example
The following code converts the string myText from the current Dialog Encoding to
UTF-8 and prints it on the console:
#include "fencode.h"
. . .
F_FdeInit();
F_FdeInitFontEncs("UTF-8");/* Sets FDE to run in Unicode Mode */
F_ApiEnableUnicode(False); /* Sets APIs to run in Compatibility
Mode */
myText = F_ApiGetString(...); /* will return in Dialog Encoding
dlgEnc*/
encName = F_ApiGetString(0, FV_SessionId,
FP_DialogEncodingName);
FTextEncodintT dlgEnc =
F_FontEncToTextEnc(F_FontEncId(encName));
convertedText = F_StrConvertEnc(myText, dlgEnc, F_EncUTF8);
F_Printf(NULL, "%s", convertedText); /* convertedText is in UTF8 */
...
F_Free()
F_Free() frees the memory associated with a specified pointer.
FDK Programmer’s Reference 559
7
FDK Function Reference
F_FreeHandle()
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
ErrorT F_Free(PtrT ptr);
Arguments
ptr
A pointer to the memory to free
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
See “F_Alloc()” on page 68.
F_FreeHandle()
F_FreeHandle() frees allocated memory for a handle that is not locked.
..............................................................................
IMPORTANT: Attempting to dereference a handle after freeing it may cause serious
errors.
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
ErrorT F_FreeHandle(HandleT handle);
Arguments
handle
The handle to free
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
See “F_AllocHandle()” on page 69.
560
FDK Programmer’s Reference
F_GetFilePath()
...
FDK Function Reference
F_GetFilePath ()
F_GetFilePath() returns a platform-independent filepath associated with an open
channel.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
FilePathT *F_GetFilePath(ChannelT channel);
Arguments
channel
The channel associated with the filepath
Returns
The platform-independent filepath associated with the specified channel, or NULL if it
fails. Free the returned filepath with F_FilePathFree() when you are finished with
it.
Example
The following code creates a temporary channel, gets the filepath associated with it, and
prints its platform-specific pathname:
. . .
FilePathT *path;
StringT pathname;
ChannelT tmpChan;
/* Create the temporary channel. */
if((tmpChan = F_ChannelMakeTmp(1024))
return;
path = F_GetFilePath(tmpChan); /* Get
pathname = F_FilePathToPathName(path,
F_Printf(NULL, "The temporary channel
F_FilePathFree(path);
== NULL)
filepath from channel.*/
FDefaultPath);
is %s\n", pathname);
F_Free(pathname);
. . .
F_GetICUDataDir()
Gets the currently set ICU data directory for the calling process
FDK Programmer’s Reference 561
7
FDK Function Reference
F_GetHandleSize()
NOTE: ICU data directory is set on a per-process basis. Certain types of clients, like
synchronous DLL clients on Windows, reside in the same process space as
FrameMaker. Such clients do not need to set the ICU data directory since FrameMaker
sets the ICU data directory for its process. Thus, for such clients, F_GetICUDataDir will
return the ICU data directory set for the FrameMaker process and therefore will return
non-null even if the directory has not explicitly been set using F_SetICUDataDir in the
client.
NOTE: The path returned by this call must not be freed.
Synopsis
#include "fencode.h"
. . .
ConStringT F_GetICUDataDir (VoidT);
Arguments
VoidT
Returns
The currently set ICU data directory path for the calling process
Example
The following code sets the ICU data directory of a client to C:\icu_data if it isn’t
set already:
...
ConStringT icu_dir = F_GetICUDataDir();
if (!icu_dir || !*icu_dir)
F_SetICUDataDir((ConStringT) "C:\\icu_data");
...
F_GetHandleSize()
F_GetHandleSize() returns the size of a handle’s block of data.
562
FDK Programmer’s Reference
F_HandleEqual()
...
FDK Function Reference
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
UIntT F_GetHandleSize(HandleT handle);
Arguments
handle
The handle to return the data block size of
Returns
The size of the handle’s block of data in bytes.
Example
See “F_AllocHandle()” on page 69.
F_Hand leEqu al()
F_HandleEqual() determines whether blocks of memory specified by two handles
have equal contents.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
BoolT F_HandleEqual(HandleT handle1,
HandleT handle2);
Arguments
handle1
The first handle
handle2
The second handle
Returns
True if the blocks of memory specified by handle1 and handle2 have equal
contents.
FDK Programmer’s Reference 563
7
FDK Function Reference
F_HashCreate()
Example
The following code compares the contents of two blocks of memory:
. . .
HandleT hndl1, hndl2;
hndl1 = F_AllocHandle(66000, NO_DSE);
hndl2 = F_AllocHandle(66000, NO_DSE);
if(F_HandleEqual(hndl1, hndl2))
F_Printf(NULL, "The handles are equal.\n");
. . .
F_HashCreate()
F_HashCreate() creates a hash table.
Synopsis
#include "fdetypes.h"
#include "fhash.h"
. . .
HashT F_HashCreate(StringT name, /* Name of the table */
IntT minSize, /* Minimum size of the table */
PShortT keyLen, /* Size of keys */
GenericT notFound, /* Returned if searched key not found */
/* Determine if cell can be reused */
BoolT (*deadQuery)(GenericT),
/* Called when cell is deleted */
VoidT (*removeNotify)(GenericT),
/* Converts key to string*/
Void(*T stringifyMe)(PtrT, UCharT *));
564
FDK Programmer’s Reference
F_HashCreate()
...
FDK Function Reference
Arguments
name
The name of the table; useful for debugging.
minSize
A size suggestion for the memory allocation routines when the FDE
creates the hash table. If you specify 0, theFDE allocates memory
according to its default calculations.
keyLen
The size, in bytes, of a hash key. For string keys, specify
KEY_IS_STRING.
notFound
The value for other F_Hash routines to return if they don’t find a specific
key.
deadQuery
A callback to determine if cell can be reused, or 0 (meaning, don't call any
function here; assume that the table cell cannot be reused).
removeNotify
A callback to invoke when a value is being deleted,(e.g., during
F_HashRemove and F_HashDestroy), or 0 (meaning no callback). You
could use it, for example, to delete a data structure pointed to by the value.
stringifyMe
A function to produce a printable string from a key. Typically used for
debugging.
..............................................................................
IMPORTANT: If the keys are strings, you must specify KEY_IS_STRING for keyLen
and 0 for stringifyMe. If your keys are not strings, you must specify a value for
keyLen, and you must specify a function for stringifyMe.
..............................................................................
The function specified by deadQuery is called as the hash routines maintain the hash
table. You should only specify this function if your code can determine the validity of
the cell’s contents. To It is declared as:
BoolT deadQuery(GenericT datum);
The function specified by removeNotify is called when a cell is deleted. It provides
an opportunity to free any data associated with the table cell. It is declared as:
VoidT removeNotify(GenericT datum);
Within this funciton, you can deallocate memory used by the values. (The FDK
deallocates memory used by the keys.) If you don’t need to deallocate memory for table
cells, pass 0 for this argument.
If the key is not a string, you must specify a callback for stringifyMe. It is declared
as:
VoidT stringifyMe(PtrT key, StringT info);
FDK Programmer’s Reference 565
7
FDK Function Reference
F_HashCreate()
You can use the callback to convert the key to a string, or you can specify a function that
always creates an empty string, for example:
VoidT noString(PtrT x, UCharT *y) {
*y = 0;
}
Returns
The hash table, or NULL on failure.
Example
The following code creates a hash table and sets 26 entries. The data for each entry is a
structure that contains a string and an integer. The code also shows a callback to free the
data as each cell is deleted.
566
FDK Programmer’s Reference
F_HashCreate()
...
FDK Function Reference
. . .
/* Structure for the cell data */
typedef struct {
StringT type;
IntT count;
} myDataT;
/* Callback to free cell data */
VoidT freeCell(GenericT datum)
{
myDataT *data = (myDataT *) datum;
F_Free(data->type);
F_Free(data);
}
. . .
IntT i;
UCharT c;
UCharT s[2];
myDataT *data;
HashTableT *ht;
/* Create a hash table */
ht = F_HashCreate("myHash",0,KEY_IS_STRING,0,0,freeCell,0);
/* Populate the table with 26 cells. */
for(i=0;i<26;i++) {
data = F_Alloc(sizeof(myDataT), DSE);
F_ClearPtr(data, sizeof(myDataT));
c = (UCharT)('A'+i);
F_Sprintf(s, "%c", c);
data->type = F_StrCopyString((StringT)"X");
data->count = (IntT)0;
F_HashSet(ht, s, (GenericT) data);
}
/* Get a cell from the table. */
FDK Programmer’s Reference 567
7
FDK Function Reference
F_HashDestroy()
data = (myDataT *)F_HashGet(ht, "A");
if(data)
F_Printf(NULL, "\n%s: %d\n", data->type, data->count);
F_HashDestroy()
F_HashDestroy() deletes a hash table and all of its entries. If you specified a
callback to handle cell deletion, the FDK calls that function for each cell
F_HashDestroy() deletes.
Synopsis
#include "fdetypes.h"
#include "fhash.h"
. . .
VoidT F_HashDestroy(HashTableT *table);
Arguments
table
The hash table to delete
Returns
VoidT.
Example
The following code destroys a hash table:
. . .
HashTableT *mytable;
F_HashDestroy(mytable);
. . .
F_HashEnumerate()
F_HashEnumerate() accesses each table cell one by one, and calls a specified
function with the key and datum of each cell; the order of access is arbitrary. The
function you specify to handle the table cell should never delete the datum.
568
FDK Programmer’s Reference
F_HashEnumerate()
...
FDK Function Reference
Synopsis
#include "fdetypes.h"
#include "fhash.h"
. . .
VoidT F_HashEnumerate(HashTableT *table,
IntT (*proc)(PtrT, GenericT));
Arguments
table
The hash table
proc
The function to call
The function specified by proc should be defined as:
IntT proc(PtrT key,
GenericT datum);
If this function returns 0, enumeration stops.
Returns
VoidT.
Example
The following code prints out the data associated with each entry in the hash table:
. . .
IntT EnumFuncString(PtrT key, GenericT datum);
HashTableT *mytable;
. . .
F_HashEnumerate(mytable, (FunctionT)EnumFuncString);
. . .
IntT EnumFuncString(PtrT key, GenericT datum)
{
myDataT *data = (myDataT *) datum;
F_Printf(NULL, "Type: %s, count %d.\n",
data->type, data->count
return True;
}
. . .
FDK Programmer’s Reference 569
7
FDK Function Reference
F_HashGet()
F_HashGet()
F_HashGet() fetches an entry from the hash table. The return value is of type
GenericT, you must cast it to the desired type before you can use it.
Synopsis
#include "fdetypes.h"
#include "fhash.h"
. . .
GenericT F_HashGet(HashT table,
PtrT key);
Arguments
table
The hash table
key
The key of the entry to get
Returns
The entry in the hash table with the specified key.
Example
For an example, see “F_HashCreate()” on page 564.
F_HashRemove()
F_HashRemove() removes an entry from the hash table. If you specified a callback to
handle cell deletion, the FDK calls that function for each cell F_HashRemove()
deletes.
Synopsis
#include "fdetypes.h"
#include "fhash.h"
. . .
VoidT F_HashRemove(F_HashT table,
PtrT key);
570
FDK Programmer’s Reference
F_HashReportOnData()
...
FDK Function Reference
Arguments
table
The hash table
key
The key of the entry to get
Returns
VoidT.
Example
The following code removes an entry from a hash table, then prints out the remaing
contents of the table to the console:
. . .
VoidT EnumFuncString();
HashTableT *mytable;
F_HashRemove(mytable, (PtrT)"A");
F_HashEnumerate(mytable, EnumFuncString);
. . .
IntT EnumFuncString(PtrT key, GenericT datum)
{
myDataT *data = (myDataT *) datum;
F_Printf(NULL, "Type: %s, count %d.\n",
data->type, data->count
return True;
}
. . .
F_HashR eportOnD ata()
F_HashReportOnData() returns the number of hash entries with a specified datum.
It prints the string information of the first matched datum to info by using the
stringifyMe function specified by the call to F_HashCreate(). If more than one
entry matching the specified datum is found, the string " +" is appended to the end of
info.
FDK Programmer’s Reference 571
7
FDK Function Reference
F_HashReportOnData()
Synopsis
#include "fdetypes.h"
#include "fhash.h"
. . .
IntT F_HashReportOnData(HashT table,
StringT info,
GenericT datum);
Arguments
table
The hash table
info
A pointer to memory that the stringifyMe function can
write to
datum
The datum to search for
Returns
The number of entries in the hash table with the specified datum.
Example
The following code reports the number of entries with datum of 1:
. . .
UCharT info[256];
IntT num_entries;
HashTableT *ht =
F_HashCreate("color", 0, KEY_IS_STRING, 0, 0, 0, 0);
F_HashSet(ht, (StringT) "red", 1);
F_HashSet(ht, (StringT) "green", 2);
F_HashSet(ht, (StringT) "blue", 3);
F_HashSet(ht, (StringT) "rojo", 1);
F_HashSet(ht, (StringT) "rouge", 1);
num_entries = F_HashReportOnData(ht, info, 1);
F_Printf(0, "Number of entries found with datum %d: %d\n",
1, num_entries);
F_HashDestroy(ht);
. . .
572
FDK Programmer’s Reference
F_HashSet()
...
FDK Function Reference
F_HashSet()
Adds the specified data to the specified hash table, giving it the specified key. This
function makes its own copy of the key, but it does not make a copy of the data.
..............................................................................
IMPORTANT: The routine that copies the key only copies strings or the amount of bytes
specified for keyLen in F_HashCreate(). If you use pointers in your keys, F_HashSet()
will only copy the pointer, not the pointer data.
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fhash.h"
. . .
ErrorT F_HashSet(HashT table,
PtrT key,
GenericT datum);
Arguments
table
The hash table
key
The key of the entry to set
datum
The entry’s datum
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
See “F_HashCreate()” on page 564.
F_IsValidUTF8()
Determines whether the specified byte sequence is a valid UTF-8 string
Synopsis
#include "fencode.h"
. . .
BoolT F_IsValidUTF8 (ConStringT s);
FDK Programmer’s Reference 573
7
FDK Function Reference
F_LanguageNumber()
Arguments
The string to check
s
Returns
A nonzero value if the byte sequence is a valid UTF-8 string, or 0 if it isn’t
Example
The following code prints First is valid, Second is invalid
#include "fencode.h"
. . .
StringT first = "\x41\xE2\x80\x93\x42";
StringT second = "\x41\xE2\x80";
F_FdeInitFontEncs((ConStringT)"UTF-8");
if (F_IsValidUTF8(first))
F_Printf(NULL,"First is valid");
if (!F_IsValidUTF8(first))
F_Printf(NULL,"Second is invalid");
...
F_LanguageNumber()
F_LanguageNumber() returns the Frame API number constant that corresponds to a
language string, such as usenglish or deutsch.
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_LanguageNumber(ConStringT langName);
Arguments
langName
The language string for which to get a constant
Returns
The number constant that corresponds to the specified language string.
574
FDK Programmer’s Reference
F_LanguageNumber()
...
FDK Function Reference
The following table lists the API language strings and the corresponding constants
returned by F_LanguageNumber().
Language string
API language constant
usenglish
FV_LANG_ENGLISH
ukenglish
FV_LANG_BRITISH
deutsch
FV_LANG_GERMAN
swissgerman
FV_LANG_SWISS_GERMAN
francais
FV_LANG_FRENCH
canadianfrench
FV_LANG_CANADIAN_FRENCH
espanol
FV_LANG_SPANISH
catalan
FV_LANG_CATALAN
italiano
FV_LANG_ITALIAN
portuguese
FV_LANG_PORTUGUESE
brasil
FV_LANG_BRAZILIAN
danish
FV_LANG_DANISH
dutch
FV_LANG_DUTCH
norwegian
FV_LANG_NORWEGIAN
nynorsk
FV_LANG_NYNORSK
finnish
FV_LANG_FINNISH
svenska
FV_LANG_SWEDISH
japanese
FV_LANG_JAPANESE
traditionalchinese
FV_LANG_TRADITIONAL_CHINESE
simplifiedchinese
FV_LANG_SIMPLIFIED_CHINESE
korean
FV_LANG_KOREAN
FDK Programmer’s Reference 575
7
FDK Function Reference
F_LanguageString()
Example
The following code prints The language is U.K. English.
. . .
if(FV_LANG_BRITISH == F_LanguageNumber("ukenglish"))
F_Printf(NULL, "The language is U.K. English.");
. . .
F_LanguageString()
F_LanguageString() returns the language string specified by a Frame API
constant, such as FV_LANG_ENGLISH or FV_LANG_GERMAN. For a list of the
language strings and the corresponding constants, see “F_LanguageNumber()” on
page 574.
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
ConStringT F_LanguageString(IntT langConstant);
Arguments
langConstant
The constant for which to get a language string
Returns
The language string specified by the constant. F_LanguageString() returns NULL
if langConstant is not one of the API constants that specify a language. Do not free
the returned string when you are done with it.
Example
The following code prints the string usenglish:
. . .
ConStringT langString;
langString = F_LanguageString(FV_LANG_ENGLISH);
F_Printf(NULL, "%s\n", langString);
. . .
576
FDK Programmer’s Reference
F_LockHandle()
...
FDK Function Reference
F_LockHandle()
F_LockHandle() locks the memory associated with a specified handle so that it can’t
be relocated. F_LockHandle() returns the memory address of the handle’s block of
memory so that you can access it.
AddrT is a super type of PtrT. You should not cast it to PtrT. However, you can cast
PtrT to AddrT. The AddrT type is provided primarily for very large memory blocks
on Windows platforms. Accessing AddrT is slower than accessing PtrT on
Windows platforms.
After you have locked a handle, you can’t use F_FreeHandle() or
F_ReallocHandle() on the handle.
F_LockHandle() increases the lock count.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
AddrT F_LockHandle(HandleT handle);
Arguments
handle
The handle to lock
Returns
The memory address of the data block of the handle if it succeeds, or NULL if fails.
Example
The following code locks a handle:
. . .
HandleT hndl = NULL;
if (F_LockHandle(hndl) == NULL)
F_Printf(NULL, "Couldn't lock handle.\n");
. . .
See also
“F_AllocHandle()” on page 69 and “F_UnlockHandle()” on page 714.
FDK Programmer’s Reference 577
7
578
FDK Function Reference
F_LockHandle()
FDK Programmer’s Reference
F_MakeDir()
2
...
FDK Function Reference
FDK Function Reference
F_MakeDir()
F_MakeDir() creates a directory specified by a filepath. If the permission to create a
directory is denied, F_MakeDir() fails. If the filepath specifies an existing file or
directory, its parent directory is not writable, or if its ancestor directories do not exist,
F_MakeDir() fails.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. .
ErrorT F_MakeDir(FilePathT *filepath);
Arguments
filepath
The filepath of the directory to create
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
The following code creates a directory named adir in the tmp directory:
. . .
FilePathT *path;
path = F_PathNameToFilePath((StringT)"tmpadir",
NULL, FDIPath);
if(F_MakeDir(path)!= FdeSuccess)
{
F_Printf(NULL, "Couldn't create directory.\n");
return;
}
. . .
F_MetricApproxEqual()
F_MetricApproxEqual() compares two metric numbers.
FDK Programmer’s Reference 579
8
FDK Function Reference
F_MetricConstrainAngle()
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
BoolT F_MetricApproxEqual(MetricT x,
MetricT y);
Arguments
x
A metric number to compare with y
y
A metric number to compare with x
Returns
True if the difference of x and y is less than the predefined small value
FM_EPSILON in the FrameMaker product.
Example
The following code gets the width of the first selected object in the current document. If
its width is approximately equal to one inch, it prints the string The width is
approximately one inch.
. . .
#define IN ((MetricT) 65536*72)
F_ObjHandleT docId, objId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
objId = F_ApiGetId(FV_SessionId, docId,
FP_FirstSelectedGraphicInDoc);
if(F_MetricApproxEqual(F_ApiGetMetric(docId, objId, FP_Width),
IN))
F_Printf(NULL, "The width is approximately one inch\n");
. . .
F_MetricConstrainAngle()
F_MetricConstrainAngle() constrains a specified angle to a specified range of
degrees.
580
FDK Programmer’s Reference
F_MetricConstrainAngle()
...
FDK Function Reference
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
VoidT F_MetricConstrainAngle(AngleT *anglep,
AngleT lbound);
Arguments
anglep
The address of the angle to constrain.
lbound
The lower bound of the range of degrees to which to constrain the angle.
F_MetricConstrainAngle() constrains the angle specified by
anglep between lbound and lbound+360 degrees.
The AngleT type is the same as MetricT.
Returns
VoidT.
Example
The following code constrains an angle of 800 degrees. It prints the string 440.00.
. . .
#define DEG (AngleT) 65536
AngleT angle = 800*DEG;
F_MetricConstrainAngle(&angle, 180*DEG);
F_Printf(NULL, "%2.2f\n", F_MetricToFloat((MetricT) angle));
. . .
FDK Programmer’s Reference 581
8
FDK Function Reference
F_MetricDiv()
F_MetricDiv()
F_MetricDiv() divides metric numbers.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
MetricT F_MetricDiv(MetricT x,
MetricT y);
Arguments
x
The dividend
y
The divisor
Returns
The quotient of the specified numbers.
Example
The following code prints the string 0x20000:
. . .
#define PTS (MetricT) 655362F_Printf(NULL, "0x%x\n",
F_MetricDiv(4*PTS, 2*PTS));
. . .
F_MetricFloat()
F_MetricFloat() converts a real number to a metric number.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
MetricT F_MetricFloat(PRealT f);
582
FDK Programmer’s Reference
F_MetricFractMul()
...
FDK Function Reference
Arguments
f
The real number to convert
Returns
The metric number.
Example
The following code prints the string 0x10006:
. . .
F_Printf(NULL, "0x%x\n", F_MetricFloat((PRealT)1.0001));
. . .
F_MetricFractMul()
F_MetricFractMul() multiplies the metric number x by n/d, where n is a
nonnegative and d is a positive integer. F_MetricFractMul() provides greater
accuracy than F_MetricMul() when you are multiplying fractional numbers.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
MetricT F_MetricFractMul(MetricT x,
IntT n,
IntT d);
Arguments
x
The metric number to multiply
n
The numerator of the fraction to multiply by x
d
The denominator of the fraction to multiply by x
Returns
The product of x multiplied by n/d.
FDK Programmer’s Reference 583
8
FDK Function Reference
F_MetricMake()
Example
The following code turns on the view grid of the active document and sets the grid units
to .25 inches:
. . .
#define IN ((MetricT) 65536*72)
F_ObjHandleT docId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
F_ApiSetInt(FV_SessionId, docId, FP_ViewGrid, True);
F_ApiSetMetric(FV_SessionId, docId, FP_ViewGridUnits,
F_MetricFractMul(IN, 1, 4));
. . .
F_MetricMake()
F_MetricMake() constructs a metric number from a fraction.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
MetricT F_MetricMake(IntT numerator,
IntT denominator);
Arguments
numerator
The fraction’s numerator.
denominator
The fraction’s denominator. If it is 0, the FDE assert fails.
Returns
The metric number constructed from the two specified numbers.
Example
The following code sets the zoom of the current document to 125%:
. . .
F_ObjHandleT docId;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
F_ApiSetMetric(FV_SessionId, docId, FP_Zoom,
F_MetricMake(5, 4));
. . .
584
FDK Programmer’s Reference
F_MetricMul()
...
FDK Function Reference
F_MetricMul()
F_MetricMul() multiplies the metric numbers x and y.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
MetricT F_MetricMul(MetricT x,
MetricT y);
Arguments
x
The first metric number
y
The second metric number
Returns
The result of the two multiplied numbers.
Example
The following code prints the string 0x60000:
. . .
#define PTS (MetricT) 65536
F_Printf(NULL, "0x%x\n", F_MetricMul(3*PTS, 2*PTS));
. . .
F_MetricNormalizeAngle()
F_MetricNormalizeAngle() normalizes a specified angle between 0 and 360
degrees.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
VoidT F_MetricNormalizeAngle(AngleT *anglep);
FDK Programmer’s Reference 585
8
FDK Function Reference
F_MetricNormalizeAngle()
Arguments
anglep
The address of the angle to normalize
Returns
VoidT.
Example
The following code normalizes an angle of 800 degrees. It prints the string 80.00.
. . .
#define DEG (AngleT) 65536
AngleT angle = 800*DEG;
F_MetricNormalizeAngle(&angle);
F_Printf(NULL, "%2.2f\n", F_MetricToFloat((MetricT) angle));
. . .
586
FDK Programmer’s Reference
F_MetricSqrt()
...
FDK Function Reference
F_MetricSqrt()
F_MetricSqrt() computes the square root of a metric number.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
MetricT F_MetricSqrt(MetricT x);
Arguments
x
The metric number for which to compute the square root
Returns
The square root of the specified number.
Example
The following code prints the string 0x20000:
. . .
#define PTS (MetricT) 65536
F_Printf(NULL, "0x%x\n", F_MetricSqrt(4*PTS));
. . .
F_MetricSquare()
F_MetricSquare() computes the square of a metric number.
F_MetricSquare() returns a negative number if an overflow error occurs.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
MetricT F_MetricSquare(MetricT x);
FDK Programmer’s Reference 587
8
FDK Function Reference
F_MetricToFloat()
Arguments
x
The metric number to square
Returns
The square of the specified number.
Example
The following code prints the string 0x40000:
. . .
#define PTS (MetricT) 65536
F_Printf(NULL, "0x%x\n", F_MetricSquare(2*PTS));
. . .
F_MetricToFloat()
F_MetricToFloat() converts a metric number to a real number.
Synopsis
#include "fdetypes.h"
#include "fmetrics.h"
. . .
PRealT F_MetricToFloat(MetricT m);
Arguments
m
The metric number to convert
Returns
The real number corresponding to the specified metric number.
Example
The following code prints the string 3.0000:
. . .
#define PTS (MetricT) 65536
F_Printf(NULL, "%4.4f\n", F_MetricToFloat(3*PTS));
. . .
588
FDK Programmer’s Reference
F_MifBegin()
...
FDK Function Reference
F_MifBegin()
F_MifBegin() indents and starts a new MIF statement, and then automatically
increases the indent level.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifBegin(StringT text);
Arguments
text
The MIF statement to write to the MIF channel
Returns
VoidT.
Example
The following code:
. . .
F_MifSetIndent(0);
F_MifBegin("ColorCatalog");
F_MifBegin("Color");
F_MifBegin("ColorTag");
F_MifTextString((StringT)"Black");
F_MifEnd("ColorTag");
F_MifEnd("Color");
F_MifEnd("ColorCatalog");
. . .
generates the following output to the MIF channel:
> # end of Color
> # end of ColorCatalog
F_MifComment()
F_MifComment() writes a comment string to the MIF write channel.
FDK Programmer’s Reference 589
8
FDK Function Reference
F_MifDecimal()
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifComment(StringT s);
Arguments
s
The comment string to write to the MIF channel
Returns
VoidT.
Example
The following code:
. . .
F_MifSetIndent(0);
F_MifMIFFile(5.0);
F_MifComment((StringT) "Generated by FDK Client");
. . .
generates the following output to the MIF channel:
# Generated by FDK Client
F_MifDecimal()
F_MifDecimal() writes a real number with n digits after the decimal point.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifDecimal(PRealT d,
IntT n,
MifUnitT unit);
590
FDK Programmer’s Reference
F_MifEnd()
...
FDK Function Reference
Arguments
s
The real number to write to the MIF channel.
n
The number of digits after the decimal point to be printed.
unit
The MIF unit. See the table below.
The type MifUnitT can have the following values.
MifUnitT value
Measurement unit
MIFUnitIn
Inches
MIFUnitCm
Centimeters
MIFUnitMm
Millimeters
MIFUnitPica
Picas
MIFUnitPt
Points
MIFUnitDd
Didots
MIFUnitCc
Ciceros
MIFUnitDef
Default unit
Returns
VoidT.
Example
The following code:
. . .
F_MifDecimal(3.1415, 3, MIFUnitCm);
. . .
generates the following output to the MIF channel:
3.142 cm
F_MifEnd()
F_MifEnd() indents and finishes a MIF statement, and then automatically decreases
the indent level. If the MIF statement has substatements, the function outputs the
comment string # end of statement, where statement is the name of the
substatement.
FDK Programmer’s Reference 591
8
FDK Function Reference
F_MifEnd()
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifEnd(StringT text);
Arguments
text
The text to write to the MIF channel
Returns
VoidT.
Example
See “F_MifBegin()” on page 589.
592
FDK Programmer’s Reference
F_MifGetIndent()
...
FDK Function Reference
F_MifGetIndent()
F_MifGetIndent() returns the current indent level of the MIF write channel.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
IntT F_MifGetIndent(VoidT);
Arguments
None.
Returns
VoidT.
Example
The following code writes the string Indent is 2 levels:
. . .
F_MifSetIndent(2);
F_Printf(NULL, "Indent is %d levels\n", F_MifGetIndent());
. . .
F_MifIndent()
F_MifIndent() indents the output channel according to the indent level.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifIndent(VoidT);
Arguments
None.
Returns
VoidT.
FDK Programmer’s Reference 593
8
FDK Function Reference
F_MifIndentDec()
Example
The following code indents the output channel according to the current indent level:
. . .
F_MifIndent(VoidT);
. . .
F_MifIndentDec()
F_MifIndentDec() decreases the indent level.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
IntT F_MifIndentDec(VoidT);
Arguments
None.
Returns
VoidT.
Example
The following code:
. . .
F_MifBegin("Pgf");
F_MifBegin("PgfFont");
F_MifIndentDec();
F_MifBegin("FSize");
F_MifDecimal(12.0, 1, MIFUnitPt);
F_MifEnd("FSize");
F_MifEnd("PgfFont");
F_MifEnd("Pgf");
. . .
generates the following output to the MIF channel:
> # end of PgfFont
> # end of Pgf
594
FDK Programmer’s Reference
F_MifIndentInc()
...
FDK Function Reference
F_MifIndentInc()
F_MifIndentInc() increases the indent level.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
IntT F_MifIndentInc(VoidT);
Arguments
None.
Returns
VoidT.
Example
The following code:
. . .
F_MifBegin("Pgf");
F_MifIndentInc();
F_MifBegin("PgfSpBefore");
F_MifDecimal(0.0, 1, MIFUnitPt);
F_MifEnd("PgfSpBefore");
F_MifEnd("Pgf");
. . .
generates the following output to the MIF channel:
> # end of Pgf
F_MifInteger()
F_MifInteger() writes an integer to the MIF write channel.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifInteger(IntT n);
FDK Programmer’s Reference 595
8
FDK Function Reference
F_MifNewLine()
Arguments
n
The integer to write to the MIF channel
Returns
VoidT.
Example
The following code:
. . .
F_MifInteger(24);
. . .
generates the following output to the MIF channel:
24
F_MifNewLine()
F_MifNewLine() writes a new line to the MIF write channel.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifNewLine(VoidT);
Arguments
None.
Returns
VoidT.
596
FDK Programmer’s Reference
F_MifSetIndent()
...
FDK Function Reference
Example
The following code:
. . .
F_MifSetIndent(0);
F_MifMIFFile(5.0);
F_MifNewLine();
F_MifComment((StringT)"Options");
F_MifNewLine();
F_MifComment((StringT)"
Paragraph Tags");
. . .
generates the following output to the MIF channel:
# Options
#
Paragraph Tags
F_MifSetIndent()
F_MifSetIndent() sets the indent level of the MIF write channel.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifSetIndent(IntT indent);
Arguments
indent
The indent level to set
Returns
VoidT.
Example
The following code:
. . .
F_MifMIFFile(5.0);
F_MifSetIndent(3);
F_MifBegin("ColorCatalog");
F_MifEnd("ColorCatalog");
. . .
FDK Programmer’s Reference 597
8
FDK Function Reference
F_MifSetOutputChannel()
generates the following output to the MIF channel:
F_MifSetOutputChannel()
F_MifSetOutputChannel() sets a channel to receive MIF output.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
ChannelT F_MifSetOutputChannel(ChannelT chan);
Arguments
chan
The channel to set as the MIF output channel
Returns
The channel previously set as the MIF output channel.
Example
The following code:
. . .
FilePathT *path;
ChannelT chan;
path = F_PathNameToFilePath((StringT)"my.mif",
NULL, FDefaultPath);
if((chan = F_ChannelOpen(path,"w")) == NULL) return;
F_MifSetOutputChannel(chan);
F_MifSetIndent(0);
F_MifMIFFile(5.0);
F_ChannelClose(chan);
. . .
sets the MIF output channel to the file my.mif in the FrameMaker product directory.
It generates the following output to the file:
598
FDK Programmer’s Reference
F_MifSpace()
...
FDK Function Reference
F_MifSpace()
F_MifSpace() writes a blank space to the MIF output channel.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifSpace(VoidT);
Arguments
None.
Returns
VoidT.
Example
The following code:
. . .
F_MifText((StringT)"Some text");
F_MifSpace();
F_MifText((StringT)"More text");
. . .
generates the following output to the MIF channel:
Some text More text
F_MifTab()
F_MifTab() writes a tab to the MIF channel.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifTab(VoidT);
Arguments
None.
FDK Programmer’s Reference 599
8
FDK Function Reference
F_MifText()
Returns
VoidT.
Example
The following code:
. . .
F_MifText((StringT)"Some text");
F_MifTab();
F_MifText((StringT)"More text");
. . .
generates the following output to the MIF channel:
Some Text
More text
F_MifText()
F_MifText() writes a simple text string to the MIF output channel.
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifText(StringT s);
Arguments
s
The text string to write
Returns
VoidT.
Example
The following code:
. . .
F_MifText((StringT)"Some text");
. . .
generates the following output to the MIF channel:
Some text
600
FDK Programmer’s Reference
F_MifTextString()
...
FDK Function Reference
F_MifTextString()
F_MifTextString() writes a text string enclosed in single quotes (`') to the MIF
channel.
..............................................................................
I M P O RTA NT: This function only works with characters that use the FrameRoman
encoding. This is important if your document includes Asian text. For a function to
write double-byte characters out to MIF, see “F_MifText()” on page 600
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fmifstmt.h"
. . .
VoidT F_MifTextString(StringT s);
Arguments
s
The text string to write
Returns
VoidT.
Example
The following code:
. . .
F_MifTextString((StringT)"This is a string");
. . .
generates the following output to the MIF channel:
`This is a string'
Simple MIF library
Simple MIF library functions are useful for writing MIF statements.
The simple MIF library functions write directly to the MIF channel. To use them, you
must first open a channel with F_ChannelOpen() and then set it as the MIF channel
FDK Programmer’s Reference 601
8
FDK Function Reference
Simple MIF library
with F_MifSetOutputChannel(). For more information on using MIF channels,
see “The MIF library” on page 553 of the FDK Programmer’s Guide.
#include "fmifstmt.h"
. . .
VoidT F_MifMIFFile(PRealT version)
VoidT F_MifString(StringT string);
VoidT F_MifDMargins(PRealT l,
PRealT t,
PRealT r,
PRealT b,
MifUnitT unit);
VoidT F_MifDColumns(IntT DColumns);
VoidT F_MifDColumnGap(PRealT DColumnGap,
MifUnitT unit);
VoidT F_MifDPageSize(PRealT w,
PRealT h,
MifUnitT unit);
VoidT F_MifDStartPage(IntT DStartPage);
VoidT F_MifDTwoSides(BoolT DTwoSides);
VoidT F_MifDParity(IntT DParity);
VoidT F_MifDPageNumStyle(IntT DPageNumStyle);
VoidT F_MifDFNotePgfTag(StringT DFNotePgfTag);
VoidT F_MifDFNoteMaxH(PRealT DFNoteMaxH,
MifUnitT unit);
VoidT F_MifDFNoteNumStyle(IntT DFNoteNumStyle);
VoidT F_MifDFNoteLabels(StringT DFNoteLabels);
VoidT F_MifDFNotesNumbering(IntT DFNotesNumbering);
VoidT F_MifDFNoteNumberPos(IntT DFNoteNumberPos);
VoidT F_MifDPageRounding(IntT DPageRounding);
VoidT F_MifDLinebreakChars(StringT DLinebreakChars);
VoidT F_MifPgfTag(StringT tagStyleName);
VoidT F_MifPgfUseNextTag(BoolT pgfUseNextTag);
VoidT F_MifPgfNextTag(StringT pgfNextTag);
602
FDK Programmer’s Reference
Simple MIF library
...
FDK Function Reference
VoidT F_MifPgfLIndent(PRealT pgfLIndent,
MifUnitT unit);
VoidT F_MifPgfFIndent(PRealT pgfFIndent,
MifUnitT unit);
VoidT F_MifPgfRIndent(PRealT pgfRIndent,
MifUnitT unit);
VoidT F_MifPgfAlignment(IntT pgfAlignment);
VoidT F_MifPgfTopSeparator(StringT pgfTopSeparator);
VoidT F_MifPgfBotSeparator(StringT pgfBotSeparator);
VoidT F_MifPgfPlacement(IntT pgfPlacement);
VoidT F_MifPgfSpBefore(PRealT pgfSpBefore,
MifUnitT unit);
VoidT F_MifPgfSpAfter(PRealT pgfSpAfter,
MifUnitT unit);
VoidT F_MifPgfWithNext(BoolT pgfWithNext);
VoidT F_MifPgfBlockSize(IntT pgfBlockSize);
VoidT F_MifPgfAutoNum(BoolT pgfAutoNum);
VoidT F_MifPgfNumberFont(StringT fTag);
VoidT F_MifPgfNumFormat(StringT pgfNumFormat);
VoidT F_MifPgfNumString(StringT pgfNumString);
VoidT F_MifPgfLineSpacing(IntT pgfLineSpacing);
VoidT F_MifPgfLeading(PRealT pgfLeading,
MifUnitT unit);
VoidT F_MifPgfNumTabs(IntT pgfNumTabs);
VoidT F_MifTSX(PRealT tsx,
MifUnitT unit);
VoidT F_MifTSType(IntT tsType);
VoidT F_MifTSLeaderStr(StringT tsLeader);
VoidT F_MifTSDecimalChar(IntT decimalChar);
VoidT F_MifPgfHyphenate(BoolT pgfHyphenate);
VoidT F_MifHyphenMaxLines(IntT hyphenMaxLines);
VoidT F_MifHyphenMinPrefix(IntT hyphenMinPrefix);
FDK Programmer’s Reference 603
8
FDK Function Reference
Simple MIF library
VoidT F_MifHyphenMinSuffix(IntT hyphenMinSuffix);
VoidT F_MifHyphenMinWord(IntT hyphenMinWord);
VoidT F_MifHyphenQuality(StringT hyphenQuality);
VoidT F_MifPgfLetterSpace(BoolT pgfLetterSpace);
VoidT F_MifPgfMinWordSpace(IntT pgfMinWordSpace);
VoidT F_MifPgfOptWordSpace(IntT pgfOptWordSpace);
VoidT F_MifPgfMaxWordSpace(IntT pgfMaxWordSpace);
VoidT F_MifPgfLanguage(IntT pgfLanguage);
VoidT F_MifPgfCellAlignment(IntT valign);
VoidT F_MifPgfCellMargins(PRealT b,
PRealT t,
PRealT r,
PRealT b,
MifUnitT unit);
VoidT F_MifFTag(StringT fTag);
VoidT F_MifFFamily(StringT fFamily);
VoidT F_MifFVar(StringT fVar);
VoidT F_MifFWeight(StringT fWeight);
VoidT F_MifFAngle(StringT fAngle);
VoidT F_MifFSize(PRealT fSize,
MifUnitT unit);
VoidT F_MifFUnderline(BoolT fUnderline);
VoidT F_MifFStrike(BoolT fstrike);
VoidT F_MifFSupScript(BoolT fSupScript);
VoidT F_MifFSubScript(BoolT fSubScript);
VoidT F_MifFSmallCaps(BoolT fsmallcaps);
VoidT F_MifFCaps(BoolT fcaps);
VoidT F_MifFChangeBar(BoolT fChangeBar);
VoidT F_MifFOutline(BoolT foutline);
VoidT F_MifFShadow(BoolT fshadow);
VoidT F_MifFPairKern(BoolT fPairKern);
604
FDK Programmer’s Reference
Simple MIF library
...
FDK Function Reference
VoidT F_MifFPlain(BoolT fPlain);
VoidT F_MifFBold(BoolT fbold);
VoidT F_MifFItalic(BoolT fitalic);
VoidT F_MifFDX(PRealT fDX,
MifUnitT unit);
VoidT F_MifFDY(PRealT fDY,
MifUnitT unit);
VoidT F_MifFDW(PRealT fDW,
MifUnitT unit);
VoidT F_MifFLocked(BoolT fLocked);
VoidT F_MifFSeparation(IntT fSeparation);
VoidT F_MifFlipLR(BoolT flipLR);
VoidT F_MifPen(IntT pen);
VoidT F_MifFill(IntT fill);
VoidT F_MifPenWidth(PRealT penWidth);
VoidT F_MifSeparation(IntT layer);
VoidT F_MifAngle(IntT angle);
VoidT F_MifBRect(PRealT l,
PRealT t,
PRealT w,
PRealT h,
MifUnitT unit);
VoidT F_MifBeginTextFlow(StringT flowTag,
BoolT autoConnect);
VoidT F_MifEndTextFlow(VoidT);
VoidT F_MifTextRectID(IntT textRectID);
VoidT F_MifID(IntT id);
VoidT F_MifPageSize(PRealT w,
PRealT h,
MifUnitT unit);
VoidT F_MifPageType(IntT pageType);
VoidT F_MifPageTag(StringT pageTag);
VoidT F_MifPageOrientation(IntT pageOrientation);
FDK Programmer’s Reference 605
8
FDK Function Reference
F_PathNameToFilePath()
VoidT F_MifPageNum(IntT pageNum);
VoidT F_MifPageBackground(StringT pageTag);
VoidT F_MifTag(StringT tag);
VoidT F_MifFrameType(IntT frameType);
VoidT F_MifHLine(IntT pen,
PRealT penWidth,
PRealT x,
PRealT y,
PRealT length);
VoidT F_MifNumPoints(IntT n);
VoidT F_MifPoint(PRealT x,
PRealT y,
MifUnitT unit);
VoidT F_MifTLOrigin(PRealT x,
PRealT y,
MifUnitT unit);
VoidT F_MifTLAlignment(IntT align);
VoidT F_MifChar(IntT text);
VoidT F_MifVariable(StringT text);
VoidT F_MifUnits(IntT u);
F_PathNameToFilePath()
F_PathNameToFilePath() constructs a platform-independent FilePathT path
from a platform-specific pathname.
This function also supports HTTP paths.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
FilePathT *F_PathNameToFilePath(StringT pathname,
FilePathT *anchor,
PathEnumT platform);
606
FDK Programmer’s Reference
F_PathNameToFilePath()
...
FDK Function Reference
Arguments
pathname
The pathname to convert to a filepath.
anchor
An anchor for the filepath. If pathname specifies a relative pathname,
F_PathNameToFilePath() constructs the path relative to the anchor
specified by anchor. If pathname specifies an absolute pathname,
F_PathNameToFilePath() ignores the anchor specified by anchor.
platform
The platform for the pathname. To make your client portable and avoid
errors, specify FDefaultPath or FDIPath.
If anchor is NULL, F_PathNameToFilePath() constructs the path relative to the
current directory.
Returns
The platform-independent FilePathT path based on the path specified by
pathname, or NULL if the path specified by pathname is invalid or inconsistent
with the specified platform.
Example
The following code creates filepaths from pathnames:
. . .
FilePathT *anchor, *path1, *path2, *path3, *path4;
path1 = F_PathNameToFilePath("my.txt",
NULL, FDIPath);
path2 = F_PathNameToFilePath("my.txt",
NULL, FDefaultPath);
anchor = F_PathNameToFilePath("tmp",
NULL, FDIPath);
path3 = F_PathNameToFilePath("tmptmp.txt",
NULL, FDIPath);
path4 = F_PathNameToFilePath("tmp.txt",
anchor, FDefaultPath);
. . .
F_FilePathFree(path1);
F_FilePathFree(path2);
F_FilePathFree(path3);
F_FilePathFree(path4);
F_FilePathFree(anchor);
. . .
FDK Programmer’s Reference 607
8
FDK Function Reference
F_PathNameType()
path1 and path2 specify a file named my.txt in the FrameMaker product
directory. path3 and path4 specify a file named tmp.txt in the tmp directory.
F_PathNameType()
F_PathNameType() uses a set of heuristics to guess the path type of the path
specified by pathname. It returns the most likely path type. This path type may not
always be the correct one because of ambiguities in pathnames among the different
platforms.
NOTE: This function returns FDosPath type for HTTP paths. The API
F_PathNameType() logically translates to the API F_PathNameValid() that
returns FDosPath, if the path is valid.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
PathEnumT F_PathNameType(StringT pathname);
Arguments
The pathname for which to guess the path type
pathname
Returns
A constant specifying the pathname type (FDosPath).
Example
The following code returns the pathname types for various pathnames:
. . .
PathEnumT pType; /* FMacPath, FDosPath, FUnixPath, or FDIPath */
pType
pType
pType
pType
. . .
=
=
=
=
F_PathNameType("HD:folder"); /* Returns FMacPath. */
F_PathNameType("c:\\bin"); /* Returns FDosPath. */
F_PathNameType("/tmp"); /* Returns FUnixPath. */
F_PathNameType("file"); /* Returns FDIPath. */
F_Printf()
F_Printf() prints formatted output to the Frame console .
608
FDK Programmer’s Reference
F_Printf()
...
FDK Function Reference
F_Printf() is similar to fprintf(), except it doesn’t support the p conversion
character. All the arguments that you pass to F_Printf() must be FDE types and
should be typecast.
This function can accept the %C escape sequence. In Compatibility Mode, this ignores
the corresponding parameter. In Unicode Mode, the first UTF-8 character in the
corresponding parameter (which must be ConStringT or UCharT *) is printed.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
IntT F_Printf(ChannelT channel,
NativeCharT *format,
... );
Arguments
channel
The channel to which to print the output. To print to the the Frame console
specify NULL.
format
The formatted string to print.
You can precede the conversion character (d, o, x, or u) with l or h. To specify
IntT, precede the conversion character with l. To specify ShortT, precede it with h.
By default, the conversion characters d, o, x, and u specify IntT.
..............................................................................
If you don’t typecast the arguments you pass to F_Printf(), the
output it prints may be different on different platforms.
I M P O RTA NT:
..............................................................................
Returns
The number of matched characters printed.
Examples
The following code prints 100 200 strings:
. . .
F_Printf(NULL, "%d %hd %s\n", (IntT) 100, (ShortT)200,
(StringT) "strings");
. . .
FDK Programmer’s Reference 609
8
FDK Function Reference
F_Progress()
The following code prints ४ + २ = 6
...
StringT devanagiri_four="\xE0\xA5\xAA";
StringT devanagiri_two ="\xE0\xA5\xA8";
IntT res;
F_FdeInitFontEncs((ConStringT)"UTF-8");
res = F_DigitValue(devanagiri_four)
+F_DigitValue(devanagiri_two);
F_Printf(NULL,"%C + %C is %d", devanagiri_four, devanagiri_two,
res);
...
F_Progress()
F_Progress() is a function you can use to indicate what percentage of a process has
been completed. It displays a progress indicator with a “thermometer” showing the
percentage done.
Synopsis
#include "fprogs.h"
. .
ErrorT F_Progress(IntT percent);
Arguments
percent
An integer representing a percentage; for example, 30 represents 30%.
Returns
FeSuccess if it succeeds, or a nonzero value if it fails.
Example
The following code responds to a file-to-file fliter notification, and displays a progress
indicator. If the user does not cancel, then the code will go on to perform the filter
operation.
. . .
VoidT
F_ApiNotify(IntT notification, F_ObjHandleT docId,
StringT filename, IntT iparm)
{
610
FDK Programmer’s Reference
F_PtrEqual()
...
FDK Function Reference
if (notification == FA_Note_FilterFileToFile) {
F_FilterArgsT *argsp = (F_FilterArgsT *) filename;
IntT error;
F_ApiSleep(2); /* give user time to react */
error = F_Progress(10);
if (error != 0)
{
/* return the error result so FrameMaker can */
/* cancel the operation. */
F_ApiReturnValue(-1);
/* Go on to perform the filter operation, calling */
/* F_Progress() at appropriate intervals. */
. . .
F_PtrEqual()
F_PtrEqual() determines whether two blocks of memory have equal contents to a
specified number of bytes.
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
BoolT F_PtrEqual(PtrT ptr1,
PtrT ptr2,
UIntT n);
Arguments
ptr1
A pointer to a block of memory to compare
ptr2
A pointer to a block of memory to compare
n
The number of bytes of memory to compare
Returns
True if the blocks of memory have equal contents to n bytes, or False if they do
not have equal contents or one of the pointers is NULL.
FDK Programmer’s Reference
611
8
FDK Function Reference
F_PtrEqual()
Example
The following code compares two pointers:
. . .
UCharT *ptr1 = NULL, *ptr2 = NULL;
. . .
if(F_PtrEqual(ptr1, ptr2, 256))
F_Printf(NULL, "The pointers are equal to 256 chars.\n");
. . .
612
FDK Programmer’s Reference
F_ReadBytes()
...
FDK Function Reference
F_ReadBytes()
F_ReadBytes() reads a specified number of bytes from a channel to a buffer.
Synopsis
#include "fdetypes.h"
#include "fioutils.h"
. . .
IntT F_ReadBytes(PtrT ptr,
IntT numBytes,
ChannelT channel);
Arguments
ptr
A buffer to which to write the bytes
numBytes
The number of bytes to read
channel
The channel from which to read
Returns
The number of bytes read.
Example
The following code reads the first 255 bytes from a file located in the FrameMaker
product directory:
. . .
UCharT buf[256];
ChannelT chan;
FilePathT *path;
IntT count;
path = F_PathNameToFilePath((StringT)"test.txt",
NULL, FDefaultPath);
if((chan = F_ChannelOpen(path,"r")) == NULL)
return;
count = F_ReadBytes(buf, 255, chan);
buf[count] = '\0'; /* Add a NULL terminator. */
. . .
FDK Programmer’s Reference 613
8
FDK Function Reference
F_ReadLongs()
F_ReadLongs()
F_ReadLongs() reads a specified number of longs (four bytes) from a specified
channel to a specified buffer. It swaps bytes if you have specified a byte order with
F_SetByteOrder() or F_ResetByteOrder() and the byte order is different
from the current platform’s byte order.
Synopsis
#include "fdetypes.h"
#include "fioutils.h"
. . .
IntT F_ReadLongs(PtrT ptr,
IntT num,
ChannelT channel);
Arguments
ptr
A buffer to which to write
num
The number of longs to read
channel
The channel from which to read
Returns
The number of longs actually read.
614
FDK Programmer’s Reference
F_ReadShorts()
...
FDK Function Reference
Example
The following code reads and prints the first 256 long integers from a file located in the
default directory:
. . .
IntT buf[256];
ChannelT chan;
FilePathT *path;
IntT count, i;
path = F_PathNameToFilePath((StringT)"test.dat",
NULL, FDefaultPath);
if((chan = F_ChannelOpen(path,"r")) == NULL) return;
count = F_ReadLongs((PtrT)buf, 256, chan);
for(i=0; itmpt1.txt",
NULL, FDIPath);
newfile = F_PathNameToFilePath("tmpt2.txt",
NULL, FDIPath);
if(F_RenameFile(filepath, newfile) != FdeSuccess)
F_Printf(NULL, "Couldn't rename file.\n");
. . .
F_ResetByteOrder()
F_ResetByteOrder() sets the byte ordering for a specified channel to big-endian.
Subsequent calls to FDE I/O functions, such as F_ReadShorts() and
F_WriteLongs(), will swap bytes if the platform is little-endian.
620
FDK Programmer’s Reference
F_ResetByteOrder()
...
FDK Function Reference
Synopsis
#include "fdetypes.h"
#include "fioutils.h"
. . .
VoidT F_ResetByteOrder(ChannelT channel);
Arguments
channel
The channel for which to set the byte order
Returns
VoidT.
Example
The following code sets a channel’s byte ordering to big-endian:
. . .
ChannelT chan;
. . .
F_ResetByteOrder(chan);
. . .
See also
“F_SetByteOrder()” on page 625.
FDK Programmer’s Reference 621
8
FDK Function Reference
F_ResetDirHandle()
F_ResetDirHandle()
F_ResetDirHandle() resets a file handle so that the next time you call
F_FilePathGetNext(), it returns the first entry in the directory.
It is illegal to call F_ResetDirHandle() if the directory specified by handle is
closed.
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
ErrorT F_ResetDirHandle(DirHandleT handle);
Arguments
handle
The handle to reset. You must specify a handle returned by
F_FilePathOpenDir().
Returns
FdeSuccess if it succeeds, or a nonzero value if it fails.
Example
The following code resets the directory handle for the tmp directory.
. . .
DirHandleT handle;
FilePathT *path, *file;
IntT statusp;
path = F_PathNameToFilePath((StringT)"tmp",
NULL, FDIPath);
handle = F_FilePathOpenDir(path, &statusp);
if(!handle) return;
file = F_FilePathGetNext(handle, &statusp);
. . .
F_ResetDirHandle(handle);
file = F_FilePathGetNext(handle, &statusp);
. . .
622
FDK Programmer’s Reference
F_Scanf()
...
FDK Function Reference
F_Scanf()
F_Scanf() reads formatted input from a specified channel. F_Scanf() is similar
to fscanf(), except it doesn’t support the p conversion character.
You can precede the conversion character (d, o, x, or u) with l or h. To specify
IntT, precede the conversion character with l. To specify ShortT, precede it with h.
By default, the conversion characters d, o, x, and u specify IntT.
..............................................................................
This function only gives consistent results across multiple platforms
when reading text in the FrameRoman encoding.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
IntT F_Scanf(ChannelT channel,
StringT format, ...);
Arguments
channel
The channel from which to read input
format
The format for the input
Returns
The number of input items successfully matched and assigned.
FDK Programmer’s Reference 623
8
FDK Function Reference
F_SetAssert()
Example
The following code reads formatted input and prints it:
. . .
IntT
i;
RealT fp;
FilePathT *path;
ChannelT chan;
F_Printf(NULL, "Enter an integer and floating-point:\n");
path = F_PathNameToFilePath((StringT)"test.txt",
NULL, FDefaultPath);
if((chan = F_ChannelOpen(path,"r")) == NULL) return;
F_Scanf(chan, "%d %f", &i, &fp);
F_Printf(NULL, "The numbers were: %d %f\n", i, fp);
. . .
F_SetAssert()
F_SetAssert() registers an assertion-handler function and returns the client’s
original assertion handle.
The FDK executes the assertion handler when a client calls F_Assert() and
assertion failure occurs. After your assertion-handler function returns, the FDE’s
assertion handler is called to clean up the system and exit the client properly. It is illegal
to call abort() or exit() from the assertion handler.
Synopsis
#include "fdetypes.h"
#include "fassert.h"
. . .
ProcedureT F_SetAssert(ProcedureT myHandler);
Arguments
myHandler
The assertion handler function
The assertion function myHandler is defined as:
VoidT myHandler();
Returns
VoidT.
624
FDK Programmer’s Reference
F_SetByteOrder()
...
FDK Function Reference
Example
See “F_Assert()” on page 498.
F_SetByteOrder()
F_SetByteOrder() sets the byte ordering for a specified channel to little-endian.
Subsequent calls to FDE I/O functions, such as F_ReadShorts() and
F_WriteLongs(), will swap bytes if the platform is big-endian.
Synopsis
#include "fdetypes.h"
#include "fioutils.h"
. . .
VoidT F_SetByteOrder(ChannelT channel);
Arguments
channel
The channel for which to set byte ordering to little-endian
Returns
VoidT.
Example
The following code sets a channel’s byte ordering to little-endian so that subsequent
FDE I/O calls will swap bytes if the platform is big-endian:
. . .
ChannelT chan;
. . .
F_SetByteOrder(chan);
. . .
See also
“F_ResetByteOrder()” on page 620.
F_SetDSExit()
F_SetDSExit() sets the direct straight exit (DSE) function. The FDE calls this
function when you call an FDE memory allocation function, such as F_Alloc(), with
the flags argument set to DSE, and then memory allocation is denied.
F_SetDSExit() returns the current DSE function.
FDK Programmer’s Reference 625
8
FDK Function Reference
F_SetICUDataDir()
Synopsis
#include "fdetypes.h"
#include "fmemory.h"
. . .
ProcedureT F_SetDSExit(ProcedureT fn);
Arguments
fn
The DSE function to set
The DSE function you specify for fn should clean up and exit the client. If the DSE
function returns, the FDE aborts the client. By default, the DSE function is NULL; the
FDE aborts the client when you call an FDE memory allocation function with flags
set to DSE and memory allocation is denied.
Returns
The previous DSE function.
Example
The following code defines and sets a DSE function, and then makes a memory
allocation call that calls the DSE function if there isn’t enough memory:
. . .
VoidT DSExitFn(); /* Declaration */
. . .
VoidT DSExitFn()
{
F_Warning((StringT) "Out of memory...Bailing out.\n");
F_ApiBailOut();
}
. . .
UCharT *ptr = NULL;
F_SetDSExit(DSExitFn);
ptr = F_Alloc(10000000, DSE);
. . .
F_SetICUDataDir()
Sets the ICU data directory for the calling process.
NOTE: This function can accept the path in ASCII only. The path must be on a local, a
mapped drive or a network path.
626
FDK Programmer’s Reference
F_SetICUDataDir()
...
FDK Function Reference
NOTE: ICU data directory is set on a per-process basis. Certain types of clients, like
synchronous DLL clients on Windows, reside in the same process space as
FrameMaker. Such clients do not need to set the ICU data directory since FrameMaker
sets the ICU data directory for its process. If such clients set the ICU data directory
incorrectly using this function, the entire FrameMaker process and other clients might
get affected. Such clients should, therefore, be careful while setting the ICU data
directory.
Synopsis
#include "fencode.h"
. . .
VoidT F_SetICUDataDir (ConStringT path);
Arguments
path
The ICU Data Directory path (absolute path, not relative)
Returns
VoidT
Example
The following code sets the ICU data directory of a client to the ICU data directory
shipped with FrameMaker:
...
UCharT icu_path[256];
StringT icu_dir="\icu_data";
StringT fminit_path = F_ApiGetString(0, FV_SessionId,
FP_FM_InitDir);
UCharT *t,*s;
s=fminit_path;
while(*s)
*t++ = *s++;
s=icu_dir;
while(*s)
*t++ = *s++;
*t=0;
F_SetICUDataDir((ConStringT) icu_path);
...
FDK Programmer’s Reference 627
8
FDK Function Reference
F_Sprintf()
F_Sprintf()
F_Sprintf() prints formatted output to a string. F_Sprintf() is similar to
sprintf(), except it doesn’t support the p conversion character.
All the arguments that you pass to F_Sprintf() must be FDE types and should be
typecast.
You can precede the conversion character (d, o, x, or u) with l or h. To specify
IntT, precede the conversion character with l. To specify ShortT, precede it with h.
By default, the conversion characters d, o, x, and u specify IntT.
..............................................................................
If you don’t typecast the arguments you pass to F_Sprintf(), the
output it generates may be different on different platforms.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
IntT F_Sprintf(StringT str,
StringT format,
...);
Arguments
str
The string to which to print the formatted output
format
The formatted string to print
Returns
The length of the printed string.
628
FDK Programmer’s Reference
F_Sprintf()
...
FDK Function Reference
Example
The following code uses F_Sprintf() to write characters to a buffer. It prints the
following string:
String: FDK. Character: c. Int: 42. Real 3.141500
. . .
UCharT buf[256];
IntT i;
i = F_Sprintf(buf,
"String: %s. ", (StringT)"FDK");
i += F_Sprintf(buf+i, "Character: %c. ", (UCharT)'c');
i += F_Sprintf(buf+i, "Int: %d. ", (IntT)42);
i += F_Sprintf(buf+i, "Real: %f.", (RealT)3.1415);
F_Printf(NULL, "%s\n", buf);
. . .
FDK Programmer’s Reference 629
8
FDK Function Reference
F_Sscanf()
F_Sscanf()
F_Sscanf() reads formatted input from a string. It is equivalent to sscanf().
You can precede the conversion character (d, o, x, or u) with l or h. To specify
IntT, precede the conversion character with l. To specify ShortT, precede it with h.
By default, the conversion characters d, o, x, and u specify IntT.
..............................................................................
This function only gives consistent results across multiple platforms
when reading text in the FrameRoman encoding.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "futils.h"
. . .
IntT F_Sscanf(StringT str,
StringT format,
...);
Arguments
str
The string from which to read input
format
The format of the input
Returns
The number of input items that successfully matched and assigned.
Example
The following code uses F_Sscanf() to read formatted input from a buffer. It prints
the string:
The numbers are: 15 and 12.300000
. . .
IntT
i;
RealT fp;
static UCharT buf[] = "15 12.3";
F_Sscanf(buf, "%d%f", &i, &fp);
F_Printf(NULL, "The numbers are: %d and %f\n", i, fp);
. . .
630
FDK Programmer’s Reference
F_StrAlphaToInt()
...
FDK Function Reference
F_StrAlphaToInt()
F_StrAlphaToInt() converts an alphanumeric string into an integer.
..............................................................................
With this function you can only use strings that contain characters in the
7-bit ASCII range.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_StrAlphaToInt(ConStringT s);
Arguments
s
The string to convert
Returns
The integer equivalent of the specified string.
Example
The following code prints the string 1000-100 = 900:
. . .
F_Printf(NULL, "1000 - 100 = %d\n",
F_StrAlphaToInt("1000") - (IntT)100);
. . .
F_StrAlphaToIntUnicode()
Converts a UTF-8 alphanumeric string into an integer
NOTE: This function won’t work for numeric characters like Ⅳ (code point 0x2163)
that aren’t in a decimal system.This function can take decimal digits from mixed
decimal systems (6 ४ , where ४ is 4 in devanagiri, is valid and interpreted as 64).
Synopsis
#include "fencode.h"
. . .
IntT F_StrAlphaToIntUnicode (ConStringT string);
FDK Programmer’s Reference 631
8
FDK Function Reference
F_StrAlphaToIntUnicode()
Arguments
s
The string to convert
Returns
The integer equivalent of the specified string
Example
The following code prints ४२ + २४ = 66
...
StringT devanagiri_four="\xE0\xA5\xAA";
StringT devanagiri_two ="\xE0\xA5\xA8";
UCharT forty2[256];
UCharT twenty4[256];
IntT res;
FontEncIdT feId = F_FdeInitFontEncs((ConStringT)"UTF-8");
F_StrTruncEnc(forty2,0,feId);
F_StrTruncEnc(twenty4,0,feId);
F_StrCpy(forty2, devanagiri_four);
F_StrCat(forty2, devanagiri_two);
F_StrCpy(twenty4, devanagiri_two);
F_StrCat(twenty4, devanagiri_four);
res = F_StrAlphaToIntUnicode(forty2) +
F_StrAlphaToIntUnicode(twenty4);
F_Printf(NULL,"%s + %s=%d", fourPoint2, twoPoint4, res);
...
632
FDK Programmer’s Reference
F_StrAlphaToReal()
...
FDK Function Reference
F_StrAlphaToReal()
F_StrAlphaToReal() converts an alphanumeric string to a PRealT.
..............................................................................
With this function you can only use strings that contain characters in the
7-bit ASCII range.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
PRealT F_StrAlphaToReal(ConStringT s);
Arguments
s
The string to convert
Returns
A PRealT corresponding to the specified string.
Example
The following code prints the string 10.05-5.05 = 5.00:
. . .
F_Printf(NULL, "10.05 - 5.05 = %2.2f\n",
F_StrAlphaToReal("10.05") - (RealT)5.05);
. . .
F_StrAlphaToRealUnicode()
Converts a UTF-8 alphanumeric string into a PRealT
NOTE: This function won’t work for numeric characters like Ⅳ (code point 0x2163)
that aren’t in a decimal system. This function can take decimal digits from mixed
decimal systems (6. ४ , where ४ is 4 in devanagiri, is valid and interpreted as 6.4).
Synopsis
#include "fencode.h"
. . .
PRealT F_StrAlphaToRealUnicode (ConStringT string);
FDK Programmer’s Reference 633
8
FDK Function Reference
F_StrAlphaToRealUnicode()
Arguments
string
The string to convert
Returns
The PRealT corresponding to the specified string
Example
The following code prints ४ . २ + २ . ४ = 6.6
...
StringT devanagiri_four="\xE0\xA5\xAA";
StringT devanagiri_two ="\xE0\xA5\xA8";
UCharT forty2[256];
UCharT twenty4[256];
PRealT res;
FontEncIdT feId = F_FdeInitFontEncs((ConStringT)"UTF-8");
F_StrTruncEnc(forty2,0,feId);
F_StrTruncEnc(twenty4,0,feId);
F_StrCpy(forty2, devanagiri_four);
F_StrCat(forty2, ".");
F_StrCat(forty2, devanagiri_two);
F_StrCpy(twenty4, devanagiri_two);
F_StrCat(twenty4, ".");
F_StrCat(twenty4, devanagiri_four);
res = F_StrAlphaToRealUnicode(forty2)+
F_StrAlphaToRealUnicode(twenty4);
F_Printf(NULL,"%s + %s=%f", fourPoint2, twoPoint4, res);
...
634
FDK Programmer’s Reference
F_StrBrk()
...
FDK Function Reference
F_StrBrk()
F_StrBrk() returns a pointer to the first occurrence in s1 of any character in s2.
..............................................................................
This function only works with characters that use the FrameRoman
encoding. This is important if your document includes Asian text.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
StringT F_StrBrk(StringT s1,
ConStringT s2);
Arguments
s1
The string to search
s2
The characters to search for
Returns
A pointer to the first occurrence in s1 of any character in s2, or NULL if none of the
characters in s2 occurs in s1.
Example
The following code prints the string Earthshaker:
. . .
StringT s1, s;
s1 = F_StrCopyString("Poseidon Earthshaker");
s = F_StrBrk(s1, (StringT)"pOE");
if (s != NULL) F_Printf(NULL, "%s\n", s);
. . .
F_StrBrkUTF8 ()
Returns a pointer to the first occurrence in UTF-8 string s1 of any UTF-8 character in
s2.
FDK Programmer’s Reference 635
8
FDK Function Reference
F_StrBrkUTF8 ()
Synopsis
#include "fencode.h"
. . .
StringT F_StrBrkUTF8 (StringT s1, ConStringT s2);
Arguments
s1
The string to search
s2
A string containing characters to search for
Returns
A pointer to the first occurrence in s1 of any character in s2, or NULL if none of the
characters in s2 occurs in s1.
Example
The following code prints the string 1 ⊕ 2 ⊖ 3 - ⊕ 2 ⊖ 3 - ⊖ 3
. . .
StringT s, s1;
F_FdeInitFontEncs("UTF-8");
s1 = F_StrCopyString("1 \xE2\x8A\x95 2 \xE2\x8A\x96 3");
F_Printf(NULL, s1);
s = F_StrBrkUTF8(s1, "\xE2\x8A\x95")
F_Printf(NULL, " - %s",s);
s = F_StrBrkUTF8(s1, "\xE2\x8A\x96")
F_Printf(NULL, " - %s",s);
...
636
FDK Programmer’s Reference
F_StrCat()
...
FDK Function Reference
F_StrCat()
F_StrCat() concatenates two strings, terminating the resulting string with a null
character.
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_StrCat(StringT s1,
ConStringT s2);
Arguments
s1
The first string to concatenate
s2
The string to append to the end of s1
F_StrCat() appends the contents of s2 to s1. For it to work correctly, you must
allocate additional memory to s1.
Returns
The final length of the concatenated string.
Example
The following code prints the string It was the best of times. It was the
worst of times.:
. . .
StringT s1, s2;
s1 = F_StrCopyString("It was the best of times. ");
s2 = F_StrCopyString("It was the worst of times.");
s1 = F_Realloc(s1, F_StrLen(s1)+F_StrLen(s2)+1, NO_DSE);
F_StrCat(s1, s2);
F_Printf(NULL, "%s\n", s1);
. . .
FDK Programmer’s Reference 637
8
FDK Function Reference
F_StrCatCharN()
F_StrCatCharN()
F_StrCatCharN() appends a character to a string, limiting the length of the resulting
string to a specified length.
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_StrCatCharN(StringT s1,
PUCharT c,
UIntT n);
Arguments
s1
The string
c
The character to append to the string
n
The length (including the terminating 0) to which to limit the
concatenated string
Returns
The final length of the concatenated string.
Example
The following code prints the string Cronides.:
. . .
StringT s;
s = F_StrNew(F_StrLen("Cronides")+(IntT)1);
F_StrCpy(s, (StringT)"Cronides");
F_StrCatCharN(s,(UCharT)'.', (IntT)10);
F_Printf(NULL, "%s\n", s);
. . .
638
FDK Programmer’s Reference
F_StrCatDblCharNEnc()
...
FDK Function Reference
F_StrCatDblCharNEnc()
F_StrCatDblCharNEnc() appends a double-byte character to a string, limiting the
length of the resulting string to a specified length.
..............................................................................
I M P O RTA NT: This function specifies string length in terms of bytes and not
characters. Also, n includes the terminating byte. A value of 7 for n limits the length of
the string to three double-byte characters.
..............................................................................
Synopsis
#include "fencode.h"
. . .
IntT F_StrCatDblCharN(StringT s1,
UCharT first,
UCharT second,
UIntT n,
FontEncIdT feId);
Arguments
s1
The string
first
The first byte of the double-byte character to append to the string
second
The second byte of the double-byte character to append to the string
n
The length (including the terminating NULL byte) to which to limit the
concatenated string
feId
The ID of the font encoding for the charcter you are appending to the
string
Returns
The final length in bytes of the concatenated string.
FDK Programmer’s Reference 639
8
FDK Function Reference
F_StrCatIntN()
Example
The following code prints the string s, with the character 82CD added to the end of it:
. . .
FontEncIdT feId = F_FontEncId((ConStringT) "JISX0208.ShiftJIS");
StringT s, myString;
. . .
/* Assuming a string of double-byte chars in myString... */
s = F_StrNew(F_StrLen(myString)+(IntT)2);
F_StrCpy(s, myString);
F_StrCatDblCharNEnc(s,\x82, \xCD, F_StrLen(s), feId);
F_Printf(NULL, "%s\n", s);
. . .
F_StrCatIntN()
F_StrCatIntN() converts an integer to a string and appends it to a string, limiting
the length of the resulting string to a specified length.
..............................................................................
I M P O RTA NT: This function specifies string length in terms of bytes and not
characters. Also, n includes the terminating byte. This is important if the string contains
double-byte characters.
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_StrCatIntN(StringT s1,
IntT i,
UIntT n);
Arguments
s1
The string
i
The integer to append to the string
n
The length (including the terminating 0) to which to limit the
concatenated string
Returns
The final length of the concatenated string.
640
FDK Programmer’s Reference
F_StrCatIntN()
...
FDK Function Reference
Example
The following code prints the string Number 9:
. . .
StringT s;
s = F_StrCopyString("Number ");
s = F_Realloc(s, F_StrLen(s)+(IntT)1, NO_DSE);
F_StrCatIntN(s, (IntT)9, (IntT)9);
F_Printf(NULL, "%s\n", s);
. . .
FDK Programmer’s Reference 641
8
FDK Function Reference
F_StrCatN()
F_StrCatN()
F_StrCatN() concatenates two strings, limiting the length of the resulting string to a
specified length.
..............................................................................
I M P O RTA NT: This function specifies string length in terms of bytes and not
characters. Also, n includes the terminating byte. This is important if the string contains
double-byte characters. For strings in an encoding other than FrameRoman, use
F_StrCatNEnc().
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_StrCatN(StringT s1,
ConStringT s2,
UIntT n);
Arguments
s1
The first string to concatenate
s2
The string to append to s1
n
The length (including the terminating 0) to which to limit the
concatenated string
F_StrCat() appends the contents of s2 to s1. For it to work correctly, you must
allocate additional memory to s1.
Returns
The final length of the concatenated string.
642
FDK Programmer’s Reference
F_StrCatNEnc()
...
FDK Function Reference
Example
The following code prints the string The bitter wrath of Achilleus, lord
of the house:
. . .
StringT s1, s2;
s1 = F_StrCopyString("The bitter wrath of Achilleus, ");
s2 = F_StrCopyString("lord of the house of Peleus");
s1 = F_Realloc(s1, F_StrLen(s1)+(IntT)18, NO_DSE);
F_StrCatN(s1, s2, F_StrLen(s1)+(IntT)18);
F_Printf(NULL, "%s\n", s1);
. . .
F_StrCatNEnc()
F_StrCatNEnc() concatenates two strings of the specified encoding, limiting the
length of the resulting string to a specified length.
..............................................................................
I M P O RTA NT: This function specifies string length in terms of bytes and not
characters. Note that a string of three double-byte characters has three characters and six
bytes.
..............................................................................
Synopsis
#include "fencode.h"
. . .
IntT F_StrCatNEnc(StringT s1,
ConStringT s2,
UIntT n,
FontEncIdT feId);
Arguments
s1
The first string to concatenate
s2
The string to append to s1
n
The length (including the terminating 0) to which to limit the
concatenated string
feId
The ID of the font encoding for your strings
F_StrCat() appends the contents of s2 to s1. For it to work correctly, you must
allocate sufficient memory to s1.
FDK Programmer’s Reference 643
8
FDK Function Reference
F_StrCatUTF8CharNByte ()
Returns
The final length in bytes of the concatenated string.
Example
The following code prints s1 after concatenating at least 9 characters of s2 to the end of
s1. Note that F_StrCatNEnc() counts by bytes. With Japanese text, characters could
be either one or two bytes each. For this reason, don’t use F_StrLenEnc() which
returns the string length in characters; instead, use F_StrLen() to return the string
length in bytes.
. . .
FontEncIdT feId = F_FontEncId((ConStringT) "JISX0208.ShiftJIS");
IntT i;
StringT s1, s2;
/*
* Assuming you have Japanese text in s1 and s2... */
i = F_StrLen(s1) + (F_StrLen(s2) + 1);
if (s1 = F_Realloc(s1, i, NO_DSE)) {
F_StrCatNEnc(s1, s2, i, feId);
F_Printf(NULL, "%s\n", s1);
}
. . .
F_StrCatUTF8CharNByte ()
Appends a UTF8 character to a string, limiting the length of the resulting string to a
specified length
..............................................................................
The length of the resulting string is calculated in bytes, not characters.
This is important because a UTF-8 character may take up to 4 bytes.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fencode.h"
. . .
IntT F_StrCatUTF8CharNByte ( StringT s, const UCharT *c, IntT
n);
644
FDK Programmer’s Reference
F_StrChr()
...
FDK Function Reference
Arguments
s
The string
c
The character to append
n
The length limit (in bytes) for s1
Returns
Final length of the copied string in terms of bytes
Example
The following code prints the string Бо + г = Бог
. . .
F_FdeInitFontEncs((ConStringT)"UTF-8");
UCharT s[256];
StringT a = "\xD0\x91\xD0\xBE";
StringT b = "\xD0\xB3";
s[0]=0;
F_StrCpy(s,a);
F_StrCatUTF8CharNByte( s, b, 256);
F_Printf(NULL, "%s + %s = %s\n", a, b, s);
. . .
F_StrChr()
F_StrChr() finds the first occurrence of a character in a string.
..............................................................................
This function only works with characters that use the FrameRoman
encoding. If your document includes Asian text, use F_StrChrEnc() instead.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
StringT F_StrChr(StringT s, PUCharT c);
FDK Programmer’s Reference 645
8
FDK Function Reference
F_StrChrEnc()
Arguments
s
The string to search
c
The character to search s for
Returns
A pointer to the first occurrence of c in s, or NULL if c does not occur in s.
Example
The following code prints the string Hecuba?:
. . .
StringT s, string;
s = F_StrCopyString("Who was he to Hecuba?");
string = F_StrChr(s, 'H');
F_Printf(NULL, "%s\n", string);
. . .
F_StrChrEnc()
F_StrChrEnc() finds the first occurrence in a string, of a double-byte character of
the specified encoding.
Synopsis
#include "fencode.h"
. . .
StringT F_StrChrEnc(ConStringT s,
UCharT first,
UCharT second,
FontEncIdT feId);
Arguments
s
The string to search
first
The first byte of the character to search s for
second
The second byte of the character to search s for
feId
The ID of the font encoding to check against
Returns
A pointer to the first occurrence in s of the double byte character represented by first
and second, or NULL if such a character does not occur in s.
646
FDK Programmer’s Reference
F_StrChrEnc()
...
FDK Function Reference
Example
The following code returns a string beginning with the Japanese character 89C3. Also
see the example for “F_StrChr()” on page 645:
. . .
FontEncIdT feId = F_FontEncId((ConStringT) "JISX0208.ShiftJIS");
StringT s, string;
/* Assuming a string of double-byte chars in s... */
string = F_StrChrEnc(s, \x89, \xC3, feId);
. . .
FDK Programmer’s Reference 647
8
FDK Function Reference
F_StrChrUTF8()
F_StrChrUTF8()
Returns a pointer to the first occurrence of a UTF-8 character in a UTF-8 string, starting
from the end of the string
Synopsis
#include "fencode.h"
. . .
StringT F_StrChrUTF8(ConStringT s, const UCharT *c);
Arguments
s
The string to search
c
The character (in terms of a byte sequence) to search s for
Returns
A pointer to the first occurrence of c in s, or NULL if c doesn’t occur in s
Example
The following code prints "Бог и взял". Here the long hex sequence
"\xD0\x91...\xD0\xBB" is the representation of "Бог дал, Бог и взял" in UTF-8 and
"\xD0\x91" of the character 'Б'
#include "fencode.h"
. . .
StringT s, c, string;
F_FdeInitFontEncs((ConStringT)"UTF-8");
s =
F_StrCopyString("\xD0\x91\xD0\xBE\xD0\xB3\x20\xD0\xB4\xD0\xB0\xD
0\xBB\x2C\x20\xD0\x91\xD0\xBE\xD0\xB3\x20\xD0\xB8\x20\xD0\xB2\xD
0\xB7\xD1\x8F\xD 0\xBB");
c = "\xD0\xBB";
string = F_StrRChrUTF8(s, c);
F_Printf(NULL, "%s\n", string);
. . .
648
FDK Programmer’s Reference
F_StrCmp()
...
FDK Function Reference
F_StrCmp()
F_StrCmp() is equivalent to strcmp(). It compares the ASCII value of each
character in two null-terminated byte strings.
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_StrCmp(ConStringT s1,
ConStringT s2);
Arguments
s1
A string
s2
A string to compare to s1
Returns
An integer greater than 0 if s1 is lexicographically greater than s2; 0 if the strings
are equal; or an integer less than 0 if s1 is less than s2.
Example
The following code prints the string The strings compare:
. . .
if(!F_StrCmp((StringT)"string1", (StringT)"string1"))
F_Printf(NULL, "The strings compare\n");
. . .
FDK Programmer’s Reference 649
8
FDK Function Reference
F_StrCmpN()
F_StrCmpN()
F_StrCmpN() compares two strings to a specified number of characters.
..............................................................................
This function only works with characters that use the FrameRoman
encoding. If your document includes Asian text, use F_StrCmpNEnc() instead.
I M P O RTA NT:
..............................................................................
Synopsis
#include "fdetypes.h"
#include "fstrings.h"
. . .
IntT F_StrCmpN(ConStringT s1,
ConStringT s2,
IntT n);
Arguments
s1
A string
s2
A string to compare to s1
n
The number of characters to compare
Returns
An integer greater than 0 if s1 is lexicographically greater than s2; 0 if the strings
are equal; or an integer less than 0 if s1 is less than s2.
Example
The following code prints the string The strings compare:
. . .
if(!F_StrCmpN((StringT)"string1", (StringT)"string2",(IntT) 6))
F_Printf(NULL, "The strings compare.\n");
. . .
F_StrCmpNEnc()
F_StrCmpNEnc() compares two strings of the specified encoding up to a specified
number of bytes. Note that case is not applicable for double-byte characters, so this
function only considers case within the 7 bit ASCII range of characters.
650
FDK Programmer’s Reference
F_StrICmpNUTF8Char
...
FDK Function Reference
Synopsis
#include "fencode.h"
. . .
IntT F_StrCmpNEnc(ConStringT s1,
ConStringT s2,
IntT n,
FontEncIdT feId);
Arguments
s1
A string
s2
A string to compare to s1
n
The length of the strings, in bytes, by which to compare the strings
feId
The ID of the font encoding to check against
Returns
An integer greater than 0 if s1 is lexicographically greater than s2; 0 if the strings
are equal; or an integer less than 0 if s1 is less than s2.
Example
The following code determines whether s1 is lower in sort order than s2:
. . .
FontEncIdT feId = F_FontEncId((ConStringT) "JISX0208.ShiftJIS");
ConStringT s1, s2;
. . .
/* Assuming you have Japanese text in string1 and string2... */
if(F_StrCmpNEnc(s1, s2, (IntT) 6, feId) < 0)
F_Printf(NULL, "The first 6 bytes of s1 are lower in
sort order than the first 6 bytes of s2.\n");
. . .
F_StrICmpNUTF8Char
Compares the Unicode code points of each character in two UTF-8 strings up to a
specified number of UTF-8 characters (not bytes). This function ignores cases.
FDK Programmer’s Reference 651
8
FDK Function Reference
F_StrCmpUTF8()
Synopsis
#include "fencode.h"
. . .
IntT F_StrICmpNUTF8Char ( ConStringT s1, ConStringT s2, IntT n);
Arguments
s1
A string
s2
A string to compare to s1
Returns
An integer greater than 0 if s1 is lexicographically greater than s2; 0 if the strings are
equal; or an integer less than 0 if s1 is less than s2.
Example
The following code prints the string First 2 chars of Бог and Боо are equal
. . .
F_FdeInitFontEncs((ConStringT)"UTF-8");
StringT s1 = F_StrCopyString("\xD0\x91\xD0\xBE\xD0\xB3");
StringT s2 = F_StrCopyString("\xD0\x91\xD0\xBE\xD0\xBE");
if(!F_StrICmpNUTF8Char(s1, s2, 2))
F_Printf(NULL, "First 2 chars of %s and %s are equal\n", s1,
s2);
. . .
F_StrCmpUTF8()
Compares the Unicode code point of each character in two null-terminated UTF-8
strings.
Synopsis
#include "fencode.h"
. . .
IntT F_StrCmpUTF8(ConStringT s1, ConStringT s2);
652
FDK Programmer’s Reference
F_StrCmpUTF8()
...
FDK Function Reference
Arguments
s1
A string
s2
A string to compare to s1
Returns
An integer greater than 0 if s1 is lexicographically greater than s2; 0 if the strings are
equal; or an integer less than 0 if s1 is less than s2
Example
The following code prints the string The strings Áîã and Áîã are equal
. . .
F_FdeInitFontEncs((ConStringT)"UTF-8");
StringT s1 = F_StrCopyString("\xD0\x91\xD0\xBE\xD0\xB3");
StringT s2 = F_StrCopyString("\xD0\x91\xD0\xBE\xD0\xB3");
if(!F_StrCmp(s1, s2))
F_Printf(NULL, "The strings %s and %s are equal\n", s1, s2);
. . .
The following code prints the string Бог дал is less than Бог и взял
. . .
F_FdeInitFontEncs((ConStringT)"UTF-8");
StringT s1 =
F_StrCopyString("\xD0\x91\xD0\xBE\xD0\xB3\x20\xD0\xB4\xD0\xB0\xD
0\xBB");
StringT s2 =
F_StrCopyString("\xD0\x91\xD0\xBE\xD0\xB3\x20\xD0\xB8\x20\xD0\xB
2\xD0\xB
7\xD1\x8F\xD0\xBB");
if(F_StrCmp(s1, s2)<0)
F_Printf(NULL, "%s is less than %s\n", s1, s2);
else
F_Printf(NULL, "%s is greater than %s\n", s1, s2);
. . .
FDK Programmer’s Reference 653
8
FDK Function Reference
F_StrCmpUTF8Locale()
F_StrCmpUTF8Locale()
Compares the UTF-8 string based on Unicode Collation Algorithm (UCA)
NOTE: Because the comparison honors the current system locale, it varies slightly with
language rules in different locales.
This doesn’t perform a code point-based comparison, but instead uses UCA and
localization information in order to compare strings correctly. For example, if used for
sorting, it sorts all digits together, sorting the Devanagiri representation of 2 between the
English representations of 1 and 3. Similarly, the 'Double Width B' sorts between 'A'
and 'C' even though its code point is much higher. This also performs canonical
normalization to ensure that the Unicode character sequences 0x00C4 and 0x0041
0x0308, which are both ways of representing Ä, are considered equivalent.
Synopsis
#include "fencode.h"
. . .
IntT F_StrCmpUTF8Locale (ConStringT s1, ConStringT s2);
Arguments
s1
A string
s2
A string to compare to s1
Returns
An integer greater than 0 if s1 is lexicographically greater than s2; 0 if the strings are
equal; or an integer less than 0 if s1 is less than s2.
Example
The following code prints the string a. For
example, the string you supply
for my.css would be:
"type=\"text\\css\"
href=\"my.css\""
Only use this string to set a
specific stylesheet
specification.
F_ApiGetString() always
returns NULL for this
parameter. To get the list of
stylesheet specifications
associated with a book, use
FP_XmlStyleSheetList,
below.
FDK Programmer’s Reference 727
4
The DOCTYPE system identifier for the source XML document.
Books
Property
FP_XmlStyleSheetList
Type
Meaning
F_StringsT
A list of stylesheet processing
instructions for the current
document. One document can
have more than one stylesheet
specification associated with it.
The FDK does not verify that
you use correct syntax in these
strings.
The strings should not include
the PI delimiters, and ?>.
For example, the string you
supply for my.css would be:
"type=\"text\\css\"hre
f=\"my.css\""
Setting a list to
FP_XmlStyleSheetList
completely overwrites the
preceeding list.
FP_XmlSystemId
StringT
3
The
DOCT
YPE
system
identifi
er for
the
source
XML
docume
nt.
728
FDK Programmer’s Reference
Books
Property
FP_XmlUseBOM
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Indicates whether a byte order
mark was detected when
opening the source XML. Can
be one of:
FV_XML_USEBOM_NA
FV_XML_USEBOM_NO
FV_XML_USEBOM_YES
When saving as XML, it this is
set to FV_XML_USEBOM_YES,
FrameMaker writes a byte
order mark in the resulting
XML.
FP_XmlVersion
StringT
The XML Version that was
specified in the XML
Declaration when the file was
opened. If no XML version was
specified,
F_ApiGetString() returns
an empty string.
If this string contains an invalid
XML declaration, it will
produce a parsing error when
this document is saved as
XML.
FP_XmlWellFormed
IntT
Indicates whether the source
XML
qualified as well formed. Can
be one of:
FV_XML_WELLFORMED_NA
FV_XML_WELLFORMED_NO
FV_XML_WELLFORMED_YE
S
Book PDF properties
FO_Book objects have the following properties that provide PDF information
PDF Document Info dictionaries The FP_PDFDocInfo property defines a list of
strings to enter in a PDF Document Info dictionary. In PDF, these strings can use
Unicode encoding.
FDK Programmer’s Reference 729
4
The DOCTYPE system identifier for the source XML document.
Books
The FP_PDFDocInfo property defines a list of strings to enter in a PDF Document Info
dictionary. For one dictionary entry, you provide two strings; the first is the entry name,
and the second is the entry content. The entry name can be up to 126 bytes; the entry
content can be up to 32765 characters.
The entry name is a string of bytes within the ASCII range. For non-printable ASCII,
provide Hex codes. To represent a Hex code, precede the code with the “#” character;
for example #24. To represent the “#” character, enter #23. Finally, an entry name may
not include a byte with a value of zero (#00).
The entry content can include Unicode encoding.
For more information on Acrobat specific functionality see the Acrobat Documentation.
PDF properties The following table lists the PDF properties for books.
Type
Meaning
FP_AcrobatBookmarkDisplayTags
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_PDFBookmarkDisplay
Tags instead.
FP_DocAcrobatColumn
ArticleThreads
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFNoArticleThreads
instead.
FP_DocAcrobatDefaultsChanged
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFefaults
Changed instead.
FP_DocAcrobatElementList
F_Strin
gsT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFElementList instead.
FP_DocAcrobatElements
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFElements instead.
FP_DocAcrobatNoArticleThreads
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFNoArticle
Threads instead.
Property
730
FDK Programmer’s Reference
Books
Property
FP_GenerateAcrobatInfo
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
True if Generate Adobe Acrobat
Data is on. To generate PDF data, you
must set other document print
properties as follows:
FP_PrintToFile: True
FP_PrintThumbnails:
False
FP_PrintSeps: False
FP_PrintBlankPages:
True
FP_PrintLastSheetFirst:
False
FP_PrintNumCopies: 1
FP_PrintOddPages:
True
FP_PrintEvenPages:
True
FP_PrintScale: 100%
FP_DocPDFColumnArticleThreads
IntT
True if you want separate article
threads for each column, False if
you want separate article threads for
each text frame. Note that
FP_DocPDFNoArticleThread
must be false.
FP_DocPDFDefaultsChanged
IntT
True if the default heuristics for
determining the paragraph level are
disabled.
FP_DocPDFElementList
F_Strin
gsT
List of the element tags and context
labels to include in bookmarks.
FP_DocPDFElementList applies
only to structured documents.
FP_DocPDFElements
IntT
True if elements rather than
paragraphs are used for bookmarks.
FP_DocPDFElements applies only
to structured documents.
FP_DocPDFNoArticleThreads
IntT
True if you do not want article
threads in the resulting PDF.
FDK Programmer’s Reference 731
4
The DOCTYPE system identifier for the source XML document.
Books
Type
Meaning
FP_GenerateAcrobatInfo
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_GeneratePDFInfo instead.
FP_GeneratePDFInfo
IntT
True if Generate Adobe Acrobat
Data is on. To generate PDF data, you
must set other document print
properties as follows
Property
FP_PrintToFile: True
FP_PrintThumbnails: False
FP_PrintSeps: False
FP_PrintBlankPages: True
FP_PrintLastSheetFirst:
False
FP_PrintNumCopies: 1
FP_PrintOddPages: True
FP_PrintEvenPages: True
FP_PrintScale: 100%
FP_PDFBookmark
BoolT
True if the FrameMaker product will
generate bookmarks when saving as
PDF.
FP_PDFBookmarksOpenLevel
IntT
The level of bookmarks to have
expanded when Acrobat opens the
generated PDF document. Can be any
integer, or one of the following
defined values:
FV_PDFBookmarksOpenDefa
ultLevel
FV_PDFBookmarksOpenAllL
evels
FV_PDFBookmarksOpenNone
Level
If you specify an integer greater than
the number of levels in the
Bookmarks Settings,
FV_PDFBookmarksOpenAllLevel
s takes effect.
FP_PDFBookmarkDisplayTagsta
732
FDK Programmer’s Reference
IntT
True if Include Paragraph Tags in
Bookmark Text is on (the paragraph
tag is added before the paragraph text
in each bookmark).
Books
Property
FP_PDFDestsMarked
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
True if the document has paragraphs
or elements marked via
FP_MarkedForNamed
Destination.
One of two things must happen in
order for this property to be True:
The document was created in version
6.0 or later; the document was opened
in version 6.0 or later, and the PDF
FileSize Optimization client was run
over it to mark all paragraphs or
elements that are targets of hypertext
links.
Normally, your client should not set
this value.
FP_PDFDistillerAbsent†
IntT
A value of 1 indicates that there is
no Acrobat Distiller available.
FP_PDFDocInfo
F_Strin
gsT
A list of strings expressing values to
be set in the PDF Document Info
dictionary when you save the book as
PDF. Each dictionary entry is
expressed as a pair of strings; the first
string expresses the field name, and
the second string expresses the field
value.
FP_PDFEndPage
StringT
The last page of the printing page
range, in the FrameMaker numbering
style
FP_PDFJobOption
StringT
The name of the Distiller Job Options.
If the specified name does not exist in
the Distiller Job Options list, then the
first Distiller Job Option in the list is
used.
FP_PDFJobOptionsAbsent†
IntT
A value of 1 indicates that PDF Job
Options are not available.
FP_PDFOpenPage
StringT
The PDF page number, in the
FrameMaker numbering style, at
which Acrobat opens the generated
PDF document.
FP_PDFPageHeight
MetricT
Page height for the generated PDF.
FP_PDFPageWidth
MetricT
Page width for the generated PDF.
FDK Programmer’s Reference 733
4
The DOCTYPE system identifier for the source XML document.
Books
Type
Meaning
FP_PDFPrintPageRange
IntT
True for generating PDF for the the
specified page range; if False,
FrameMaker generates PDF for the
entire document or book.
FP_PDFSeparateFiles
IntT
True, if a separate PDF file should be
Property
generated for each document in a
book. This property can be set for
single documents, but is ignored in
that case.
FP_PDFStartPage
StringT
The first page of the printing page
range, in the FrameMaker numbering
style.
FP_PDFZoomFactor
MetricT
When FP_PDFZoomType is
FV_PDFZoomNone, the zoom
percentage of the PDF document
(metric 25% to 1600%) If the number
is negative or zero,
FV_PDFZoomDefault takes effect.
FP_PDFZoomType
IntT
The PDF zoom setting with which
Acrobat opens the generated PDF
document. Can be one of:
FV_PDFZoomDefault
FV_PDFZoomPage
FV_PDFZoomWidth
FV_PDFZoomHeight
FV_PDFZoomNone
If a different value is specified,
FV_PDFZoomDefault takes
effect.
734
FDK Programmer’s Reference
Books
Property
FP_PDFRegistrationMarks
FP_PFDAllNamedDestinations
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Registration marks for the generated
PDF. May be one of:
IntT
FV_PDFRegistrationMarks
None
FV_PDFRegistrationMarks
Western
FV_PDFRegistrationMarks
Tombo
True if PDF generated from this
book will include Named
Destinations for every paragraph and
structure element in the book. This
results in a larger PDF filesize.
If False, the generated PDF will
have Named Destinations only for
those paragraphs and structure
elements that have already been
marked with
FP_PDFDestinations
Marked = True.
For documents created in versions
earlier than 6.0, True indicates the
user has not used the Optimize PDF
Size command for the document;
normally your client should not
change this value to False.
FDK Programmer’s Reference 735
4
The DOCTYPE system identifier for the source XML document.
Books
Book print properties
FO_Book objects have the following properties that specify how a book is printed.
Type
Meaning
FP_PrintBlankPages
IntT
True if FP_PageRounding allows empty
pages at the end of documents.
FP_PrintCollated
IntT
True if Collate is enabled.
FP_PrintEmulsion
IntT
Direction of print emulsion:
Property
FV_EMUL_UP: Emulsion side up
FV_EMUL_DOWN: Emulsion side down
FP_PrinterName
StringT
Name of printer. Setting FP_PrinterName
on Windows
has no effect. When you set
FP_PrinterName, you can set the printer
to the default printer by specifying NULL.
FP_PrintEvenPages
IntT
True if Print Even-Numbered Pages is
enabled.
FP_PrintFileName
StringT
Filename of file to print to. When you set
FP_PrintFileName, you can set the
filename to the default filename by
specifying NULL.
FP_PrintImaging
IntT
Type of print imaging:
FV_IMG_POSITIVE
FV_IMG_NEGATIVE
736
FP_PrintLastSheetFirst
IntT
True if Last Sheet First is enabled.
FP_PrintLowRes
IntT
True if Low-Resolution is enabled.
FP_PrintNumCopies
IntT
Number of copies to print.
FP_PrintOddPages
IntT
True if Odd-Numbered Pages is enabled.
FP_PrintPaperHeight
MetricT
Height of paper.
FP_PrintPaperWidth
MetricT
Width of paper.
FP_PrintRegistration
Marks
IntT
True if Registration Marks is enabled.
FP_PrintScale
IntT
Scale factor expressed as a percentage of
black (metric 0% to 100%)a
FP_PrintSeps
IntT
True if Print Separations is enabled.
FDK Programmer’s Reference
Books
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_PrintToFile
IntT
True if Print Only to File is enabled.
FP_SkipBlankSeps
IntT
True if Skip Blank Separations is enabled
(don’t print blank color separations).
Property
a. In the API, most percentages are represented as MetricT fractions. For print scale percentages, the
MetricT value 1<<16 or 0x10000 specifies 100%. For more information on MetricT values, see
“MetricT values” on page 954.
Book structure properties
The following FO_Book properties apply only to Structured books.
Type
Meaning/possible values
FP_CustomElementList
F_StringsT
List of tags to display when
FP_ElementCatalogDisplay
is set to FV_ELCAT_CUSTOM.
FP_ElementCatalog†
F_Element
CatalogEntriesT
List of elements in Element
Catalog.
FP_ElementCatalog
Display
IntT
Catalog display options. Show
tags for:
Property
FV_ELCAT_STRICT: valid
children for working start to
finish
FV_ELCAT_LOOSE: valid
children for working in any order
FV_ELCAT_CHILDREN: children
allowed anywhere in parent
FV_ELCAT_ALL: all elements
FV_ELCAT_CUSTOM: the list of
tags specified by
FP_CustomElementList
FP_Element
Selection
F_ElementRangeT
The currently selected element
range in the book.
FDK Programmer’s Reference 737
4
The DOCTYPE system identifier for the source XML document.
Books
Type
Meaning/possible values
FP_FileExtensionOverri
de
StringT
The file extension to use when
saving this document as XML.
Typically, this is used to save
XHTML with a .htm extension
rather than .xml. This setting
should be set in the structure
application for this document’s
DOCTYPE, and that setting may
be a more reliable source for this
value.
FP_FirstFmtChangeList
InDoc
F_ObjHandleT
ID of the first format change list
in the list of format change lists in
the book (FO_FmtChangeList
ID).
FP_FirstElement
DefInDoc†
F_ObjHandleT
ID of first element definition in
book (FO_ElementDef ID).
FP_HighestLevel
Element†
F_ObjHandleT
Highest-level element if the book
is structured (FO_Element ID).
FP_NewElemAttrDisplay
IntT
Specifies attribute display
properties for new elements:
Property
FV_ATTR_DISP_NONE: don’t
display attributes
FV_ATTR_DISP_REQSPEC:
display required and specified
attributes
FV_ATTR_DISP_ALL: display
all attributes
FP_NewElemAttrEditing
IntT
Specifies when the Edit
Attributes dialog box appears for
new elements:
FV_ATTR_EDIT_NONE
FV_ATTR_EDIT_REQUIRED
FV_ATTR_EDIT_ALWAYS
738
FP_SeparateInclusions
IntT
True if inclusions are listed
separately in the element catalog.
FP_SgmlApplication
StringT
Retained for backward
compatibility. Use
FP_StructuredApplication.
FP_UseInitialStructure
IntT
True if Framemaker inserts
initial structure for new elements.
FDK Programmer’s Reference
Books
...
The DOCTYPE system identifier for the source XML document.
Book View Only properties
FO_Book objects have the following view-only properties.
Type
Meaning
FP_BookIsViewOnly
IntT
True if the book is view-only.
FP_ViewOnlyDeadCodes
F_UIntsT
List of F-codes that can’t be
executed in the book
FP_ViewOnlyWinBorders
IntT
True if the book has normal
window borders; False if the
book’s border buttons are
suppressed
FP_ViewOnlyWinPopup
IntT
True if the book window
pop-up menu is available
Property
FO_BookComponent
An FO_BookComponent object represents a book component.
FO_BookComponent objects have the following properties.
..............................................................................
IMPORTANT: If you change the numbering properties of a FO_BookComponent
object, you must then call F_ApiSimpleGenerate() or F_ApiUpdateBook() to
update the document associated with the book component.
..............................................................................
Property
FP_BookComponentIs
Generatable†
Type
Meaning
IntT
True if book component
is a generated file
(FP_BookComponentType
is not set to
FV_BK_NOT_GENERATABLE)
FDK Programmer’s Reference 739
4
The DOCTYPE system identifier for the source XML document.
Books
Property
FP_BookComponentType
Type
Meaning
IntT
Type of book component:
FV_BK_INDEX_AUTHOR: index of
authors
FV_BK_INDEX_FORMATS: index of
formats
FV_BK_INDEX_MARKER: index of
markers
FV_BK_INDEX_REFERENCES:
index of references
FV_BK_INDEX_STAN: standard
index
FV_BK_INDEX_SUBJECT: subject
index
FV_BK_LIST_FIGURE: list of
figures
FV_BK_LIST_FORMATS: list of
formats
FV_BK_LIST_MARKER: list of
markers
FV_BK_LIST_MARKER_ALPHA:
alphabetical list of markers
FV_BK_LIST_PGF: list of
paragraphs
FV_BK_LIST_PGF_ALPHA:
alphabetical list of paragraphs
FV_BK_LIST_REFERENCES: list of
references
FV_BK_LIST_TABLE: list of tables
FV_BK_NOT_GENERATABLE: book
component is not a
generated file
FV_BK_TOC: table of contents
FP_BookParent†
740
FDK Programmer’s Reference
F_ObjHandleT
Book that contains the component
(FO_Book ID)
Books
Property
FP_ChapNumCompute
Method
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
The component document’s chapter
numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous chapter.
FV_NUM_RESTART: Use the value
specified for FP_ChapterNumber.
FV_NUM_SAME: Use the same
chapter number as for the previous
file.
FV_NUM_READ_FROM_FILE: Use
the numbering properties from the
document associated with this book
component.
FP_ChapterNumber
IntT
If FP_ChapNumComputeMethod is
FV_NUM_RESTART, use this as the
chapter number
FP_ChapterNumStyle
IntT
The numbering style; one of:
FV_NUMSTYLE_NUMERIC: Arabic.
FV_NUMSTYLE_ROMAN_UC:
Roman, uppercase.
FV_NUMSTYLE_ROMAN_LC:
Roman,lowercase.
FV_NUMSTYLE_ALPHA_UC:
Alphabetic, uppercase.
FV_NUMSTYLE_ALPHA_LC:
Alphabetic, lowercase.
FV_NUMSTYLE_KANJI: Kanji.
FV_NUMSTYLE_ZENKAKU:
Zenkaku.
FV_NUMSTYLE_ZENKAKU_UC:
Zenkaku, uppercase.
FV_NUMSTYLE_ZENKAKU_LC:
Zenkaku, lowercase.
FV_NUMSTYLE_KANJI_KAZU:
Kazu.
FV_NUMSTYLE_DAIJI: Daiji.
FV_NUMSTYLE_TEXT: Text.
FP_ChapterNumText
StringT
If FP_ChapNumStyle is
FV_NUMSTYLE_TEXT, use this
string as the chapter number.
FDK Programmer’s Reference 741
4
The DOCTYPE system identifier for the source XML document.
Books
Property
FP_ComponentDisplay
Text
Type
Meaning
StringT
Text that displays in the book window
when the value of
FP_TypeOfDisplayText =
FV_BK_TEXT;.
To reset
FP_ComponentDisplayText so
the FrameMaker product
automatically updates the text line
with normal information, set it to an
empty string ("").
742
FP_ComponentIsSelected
IntT
True if the component is selected in
the book window
FP_ExtractTags
F_StringsT
List of paragraph tags or markers
type names that are used to set up a
generatable file (for example, table of
contents, list of figures, standard
index or index of authors)
FP_FirstPageNum
IntT
Number for the first page in the
component; used when
FP_PageNumComputeMethod =
FV_NUM_RESTART.
FP_FnFirstNum
StringT
Number for the first footnote in the
component; used when
FP_FnNumComputeMethod =
FV_NUM_RESTART.
FP_FnCustNumString
StringT
Characters for custom document
footnote numbers.
FDK Programmer’s Reference
Books
Property
FP_FnNumStyle
Type
Meaning
IntT
Footnote numbering style:
...
The DOCTYPE system identifier for the source XML document.
FV_FN_NUM_NUMERIC: Arabic
FV_FN_NUM_ROMAN_UC: Roman
uppercase
FV_FN_NUM_ROMAN_LC: Roman
lowercase
FV_FN_NUM_ALPHA_UC: Alphabetic
uppercase
FV_FN_NUM_ALPHA_LC: Alphabetic
lowercase
FV_FN_NUM_KANJI: Kanji
characters
FV_FN_NUM_ZENKAKU: Zenkaku
FV_FN_NUM_ZENKAKU_UC:
Zenkaku uppercase
FV_FN_NUM_ZENKAKU_LC:
Zenkaku lowercase
FV_FN_NUM_KANJI_KAZU: Kazu
FV_FN_NUM_DAIJI: Daiji
FV_FN_NUM_CUSTOM: Custom
numbering
FP_FnNumCompute
Method
IntT
The component document’s footnote
numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous file.
FV_NUM_RESTART: Use the
number specified by
FP_FnFirstNum.
FV_NUM_PER_PAGE: Restart
numbering on each page.
FV_NUM_READ_FROM_FILE: Use
the numbering properties from the
document associated with this book
component.
FP_GenerateInclude
IntT
True if the document
appears in the scroll list of files to be
generated by the Generate/Update
command for the book
FDK Programmer’s Reference 743
4
The DOCTYPE system identifier for the source XML document.
Books
Type
Meaning
FP_ImportFmtInclude
IntT
True if the book component is
included in the list of components to
be updated with imported formats or
element definitions when the user or
a client executes Import Formats or
Import Element Definitions
FP_InsertLinks
IntT
True if hypertext links are
automatically inserted in generated
files
FP_Name
StringT
Pathname of document that the
component represents
FP_NextComponentInBook
F_ObjHandleT
Next component in the book file
(FO_BookComponent ID)
FP_NextSelected
ComponentInBook†
F_ObjHandleT
Next selected component in the book
window (FO_BookComponent ID)
FP_PageNumbering
IntT
Obsolete for version 6.0 and later; use
FP_PageNumComputeMethod:
Property
The component document’s page
numbering type:
FV_BK_CONT_PAGE_NUM
FV_BK_RESET_PAGE_NUM
FV_BK_READ_FROM_FILE
FP_PageNumCompute
Method
IntT
The component document’s page
numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous file.
FV_NUM_RESTART: Restart
numbering at the value specified by
the FP_FirstPageNum property.
FV_NUM_READ_FROM_FILE: Use
the numbering properties from the
document associated with this book
component.
744
FDK Programmer’s Reference
Books
Property
FP_PageNumStyle
Type
Meaning
IntT
Page numbering style:
...
The DOCTYPE system identifier for the source XML document.
FV_PAGE_NUM_NUMERIC: Arabic
FV_PAGE_NUM_ROMAN_UC: Roman
uppercase
FV_PAGE_NUM_ROMAN_LC: Roman
lowercase
FV_PAGE_NUM_ALPHA_UC:
Alphabetic uppercase
FV_PAGE_NUM_ALPHA_LC:
Alphabetic lowercase
FV_PAGE_NUM_KANJI: Kanji
characters
FV_PAGE_NUM_ZENKAKU: Zenkaku
FV_PAGE_NUM_ZENKAKU_UC:
Zenkaku uppercase
FV_PAGE_NUM_ZENKAKU_LC:
Zenkaku lowercase
FV_PAGE_NUM_KANJI_KAZU: Kazu
FV_PAGE_NUM_DAIJI: Daiji
FP_PagePrefix
StringT
Obsolete for version 6.0 and later; use
chapter and volume numbering
instead:
Page prefix string
FP_PageSide
IntT
Page side to start the component
document on:
FV_BK_START_FROM_FILE
FV_BK_START_NEXT_
AVAILABLE
FV_BK_START_LEFT
FV_BK_START_RIGHT
FP_PageSuffix
StringT
Obsolete for version 6.0 and later; use
chapter and volume numbering
instead:
Page suffix string
FDK Programmer’s Reference 745
4
The DOCTYPE system identifier for the source XML document.
Books
Property
FP_PgfNumbering
Type
Meaning
IntT
Obsolete for version 6.0 and later; use
FP_PgfNumComputeMethod:
The component document’s
paragraph numbering:
FV_BK_CONT_PGF_NUM
FV_BK_RESTART_PGF_NUM
FP_PgfNumCompute
Method
IntT
The component document’s
paragraph numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous file.
FV_NUM_RESTART: Restart
numbering at 1.
FV_NUM_READ_FROM_FILE: Use
the numbering properties from the
document associated with this book
component.
746
FP_PrevComponentInBook
F_ObjHandleT
Previous component in the book file
(FO_BookComponent ID)
FP_PrintInclude
IntT
True if the component document is
included in list of book files to be
printed
FP_TblFnCustNumString
StringT
Characters for custom table footnote
numbers.
FDK Programmer’s Reference
Books
Property
FP_TblFnNumStyle
Type
Meaning
IntT
Table footnote numbering style:
...
The DOCTYPE system identifier for the source XML document.
FV_FN_NUM_NUMERIC: Arabic
FV_FN_NUM_ROMAN_UC: Roman
uppercase
FV_FN_NUM_ROMAN_LC: Roman
lowercase
FV_FN_NUM_ALPHA_UC: Alphabetic
uppercase
FV_FN_NUM_ALPHA_LC: Alphabetic
lowercase
FV_FN_NUM_KANJI: Kanji
characters
FV_FN_NUM_ZENKAKU: Zenkaku
FV_FN_NUM_ZENKAKU_UC:
Zenkaku uppercase
FV_FN_NUM_ZENKAKU_LC:
Zenkaku lowercase
FV_FN_NUM_KANJI_KAZU: Kazu
FV_FN_NUM_DAIJI: Daiji
FV_FN_NUM_CUSTOM: Custom
numbering
FP_TblFnNumCompute
Method
IntT
The component document’s table
footnote numbering type:
FV_NUM_RESTART: Start at 1.
FV_NUM_READ_FROM_FILE: Use
the numbering properties from the
document associated with this book
component.
FP_Unique
IntT
UID of the book component
FDK Programmer’s Reference 747
4
The DOCTYPE system identifier for the source XML document.
Books
Property
FP_VolNumCompute
Method
Type
Meaning
IntT
The component document’s volume
numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous
volume.
FV_NUM_RESTART: Use the value
specified for FP_VolumeNumber.
FV_NUM_SAME: Use the same
volume number as for the previous
file.
FV_NUM_READ_FROM_FILE: Use
the numbering properties from the
document associated with this book
component.
FP_VolumeNumber
IntT
If FP_VolNumComputeMethod is
FV_NUM_RESTART, use this as the
volume number
FP_VolumeNumStyle
IntT
The numbering style; one of:
FV_NUMSTYLE_NUMERIC: Arabic.
FV_NUMSTYLE_ROMAN_UC:
Roman, uppercase.
FV_NUMSTYLE_ROMAN_LC:
Roman, lowercase.
FV_NUMSTYLE_ALPHA_UC:
Alphabetic, uppercase.
FV_NUMSTYLE_ALPHA_LC:
Alphabetic, lowercase.
FV_NUMSTYLE_KANJI: Kanji.
FV_NUMSTYLE_ZENKAKU:
Zenkaku.
FV_NUMSTYLE_ZENKAKU_UC:
Zenkaku, uppercase.
FV_NUMSTYLE_ZENKAKU_LC:
Zenkaku, lowercase.
FV_NUMSTYLE_KANJI_KAZU:
Kazu.
FV_NUMSTYLE_DAIJI: Daiji.
FV_NUMSTYLE_TEXT: Text.
748
FDK Programmer’s Reference
Books
Property
FP_VolumeNumText
Type
Meaning
StringT
If FP_VolNumStyle is
FV_NUMSTYLE_TEXT, use this
string as the chapter number.
...
The DOCTYPE system identifier for the source XML document.
Book component structure properties
The following FO_BookComponent properties are used in Structured FrameMaker
only.
Type
Meaning/possible values
FP_ComponentElement†
F_ObjHandleT
Component element (FO_Element
ID)
FP_ExtractElementTags
F_StringsT
List of element tags that are used to
set up a generatable file (for
example, table of contents, list of
figures, or list of tables)
Property
FDK Programmer’s Reference 749
4
The DOCTYPE system identifier for the source XML document.
Character formats
Character formats
The API uses an FO_CharFmt object to represent a character format.
FO_CharFmt
FO_CharFmt objects have the following properties.
Type
Meaning
FP_BkColor
F_ObjHandleT
Text background color
FP_Capitalization
IntT
The capitalization type:
Property
FV_CAPITAL_CASE_NORM: normal
capitalization (mixed uppercase and
lowercase)
FV_CAPITAL_CASE_SMALL:
small caps
FV_CAPITAL_CASE_LOWER:
lowercase letters only
FV_CAPITAL_CASE_UPPER:
uppercase letters only
750
FP_ChangeBar
IntT
True if Change Bars are on.
FP_CharTag
StringT
The character format’s tag name.
FP_Color
F_ObjHandleT
Spot color (FO_Color ID).
FP_CombinedFontFamil
y
F_ObjHandleT
Combined font definition
(FO_CombinedFontDefn)
FP_FontAngle
IntT
Font angle (specifies an index into the
array of font angles provided by the
session property
FP_FontAngleNames).
FP_FontEncodingName†
StringT
The font’s encoding
FP_FontFamily
IntT
Font family (specifies an index into the
array of font families provided by the
session property
FP_FontFamilyNames).
FDK Programmer’s Reference
Character formats
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_FontPlatformName
StringT
Name that uniquely identifies a font on a
specific platform (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide). For combined fonts, this is the
Asian font name.
FP_FontPostScript
Name
StringT
Name given to a font when it is sent to a
PostScript printer (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide). For combined fonts, this is the
Asian font name.
FP_UseBkColor
F_ObjHandleT
True: text background color set for this
character format (False if AsIS)
FP_WesternFont
PlatformName
StringT
Name that uniquely identifies the Roman
component of a combined font on a
specific platform (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_WesternFont
PostScriptName
StringT
Name given to the Roman component of a
combined font when it is sent to a
PostScript printer (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontSize
MetricT
Font size (2 pt to 400 pt).
FP_FontVariation
IntT
Font variation (specifies an index into the
array of font variations provided by the
session property
FP_FontVariationNames).
FP_FontWeight
IntT
Font weight (specifies an index into the
array of font weights provided by the
session property
FP_FontWeightNames).
Property
FDK Programmer’s Reference 751
4
The DOCTYPE system identifier for the source XML document.
Character formats
Property
FP_Language
Type
Meaning
IntT
Hyphenation and spell-checking language
to use:
FV_LANG_BRAZILIAN
FV_LANG_BRITISH
FV_LANG_CANADIAN_FRENCH
FV_LANG_CATALAN
FV_LANG_DANISH
FV_LANG_DUTCH
FV_LANG_ENGLISH
FV_LANG_FINNISH
FV_LANG_FRENCH
FV_LANG_GERMAN
FV_LANG_ITALIAN
FV_LANG_NOLANGUAGE
FV_LANG_NORWEGIAN
FV_LANG_NYNORSK
FV_LANG_PORTUGUESE
FV_LANG_SPANISH
FV_LANG_SWEDISH
FV_LANG_SWISS_GERMAN
FV_LANG_JAPANESE
FV_LANG_TRADITIONAL_CHINESE
FV_LANG_SIMPLIFIED_CHINESE
FV_LANG_KOREAN
752
FP_KernX
MetricT
Horizontal kern value for manual kerning
expressed as a percentage of an em
(metric –1000% to 1000%).a A positive
value moves a character right and a
negative value moves a character left.
FP_KernY
MetricT
Vertical kern value for manual kerning
expressed as a percentage of an em
(metric –1000% to 1000%). A positive
value moves characters up and a negative
value moves characters down.
FP_Name
StringT
The character format’s name.
FP_NextCharFmtInDoc†
F_ObjHandleT
Next character format in document
(FO_CharFmt ID).
FDK Programmer’s Reference
Character formats
Type
Meaning
FP_Overline
IntT
True if Overline is enabled.
FP_PairKern
IntT
True if Pair Kern is enabled.
FP_Position
IntT
Vertical position of character:
Property
...
The DOCTYPE system identifier for the source XML document.
FV_POS_NORM: Normal
FV_POS_SUB: Subscript
FV_POS_SUPER: Superscript
FP_Spread
MetricT
Obsolete property, but still functional.
See corresponding "tracking" property
below.
FP_Stretch
MetricT
Character stretch (set width) expressed as
a percentage of normal stretch for the font
(metric –10% to 1000%).
FP_Strikethrough
IntT
True if Strikethrough is enabled.
FP_Tracking
MetricT
Character tracking expressed as a
percentage of an em (metric –100% to
1000%).
FP_Underlining
IntT
Underlining type:
FV_CB_NO_UNDERLINE
FV_CB_SINGLE_UNDERLINE
FV_CB_DOUBLE_UNDERLINE
FV_CB_NUMERIC_UNDERLINE
FP_UseCapitalization
IntT
True if FP_Capitalization
property overrides default; False if As
Is setting used.
FP_UseChangeBar
IntT
True if FP_ChangeBar property
overrides default; False if As Is setting
used.
FP_UseColor
IntT
True if FP_Color property overrides
default; False if As Is setting used.
FP_UseFontAngle
IntT
True if FP_FontAngle
overrides default; False if As Is setting
used.
FDK Programmer’s Reference 753
4
The DOCTYPE system identifier for the source XML document.
Character formats
Type
Meaning
FP_UseFontFamily
IntT
True if FP_FontFamily
overrides default; False if As Is setting
used.
FP_UseFontSize
IntT
True if FP_FontSize
overrides default; False if As Is setting
used.
FP_UseFontVariation
IntT
True if FP_FontVariation
overrides default; False if As Is setting
used.
FP_UseFontWeight
IntT
True if FP_FontWeight
overrides default; False if As Is setting
used.
FP_UseKernX
IntT
True if FP_KernX
overrides default; False if As Is setting
used.
FP_UseKernY
IntT
True if FP_KernY
overrides default; False if As Is setting
used.
FP_UseOverline
IntT
True if FP_Overline property
overrides default; False if As Is setting
used.
FP_UsePairKern
IntT
True if FP_PairKern property
overrides default; False if As Is setting
used.
FP_UsePosition
IntT
True if FP_Position overrides
default; False if As Is setting used.
FP_UseSpread
IntT
Obsolete property, but still functional.
See corresponding "tracking" property
below.
FP_UseStretch
IntT
True if FP_Stretch property overrides
default, False if As Is setting is used.
FP_UseStrikethrough
IntT
True if FP_Strikethrough property
overrides default; False if As Is setting
used.
Property
754
FDK Programmer’s Reference
Colors
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_UseTracking
IntT
True if FP_Tracking property
overrides default; False if As Is setting
used.
FP_UseUnderlining
IntT
True if FP_Underlining property
overrides default; False if As Is setting
used.
Property
a. In the API, most percentages are represented as MetricT fractions. For spread percentages, the MetricT
value 1<<16 or 0x10000 specifies 100% or 1. For more information on MetricT values, see
“MetricT values” on page 954.
Colors
The API uses an FO_Color object to represent each color in a Frame document.
Properties that specify colors specify the IDs of FO_Color objects.
FO_Color
FO_Color objects have the following properties.
Type
Meaning
FP_Black
MetricT
Percentage of black
(metric 0% to 100%)a
FP_ColorOverprint
IntT
Overprint setting for the color:
Property
FV_COLOR_OVERPRINT
FV_COLOR_KNOCKOUT
FP_ColorPrintCtl
IntT
Type of color printing used in document:
FV_PRINT_SPOT
FV_PRINT_PROCESS
FV_PRINT_NO
FP_ColorTintPercent
MetricT
The tint percentage (0% to 100%) or
FV_COLOR_NOT_TINTED if the color is
not a tint. Specifies the percentage of the
FP_TintBaseColor to use for tinting.
FDK Programmer’s Reference 755
4
The DOCTYPE system identifier for the source XML document.
Colors
Type
Meaning
FP_ColorViewCtl
IntT
A 12-bit number for spot color views. The
least significant 2 bits are View 1, the next
2 bits are View 2, and so on. For more
information, see Figure 3-1 and the text
below.
FP_Cyan
MetricT
Percentage of cyan
(metric 0% to 100%)
FP_FamilyName
StringT
Color library name. Note that that you must
specify the full ink name, including any
trademark symbols. For example, use
"MUNSELL\xa8 Book of Color" for
“MUNSELL® Book of Color.”
FP_InkName
StringT
Specifies the name of the color library
pigment. Use this instead of FP_Pantone.
FP_Magenta
MetricT
Percentage of magenta
(metric 0% to 100%)
FP_Name
StringT
Name of color
FP_NextColorInDoc†
F_ObjHandleT
Next color in document (FO_Color ID)
FP_ReservedColor
IntT
Color names reserved by Frame products:
Property
FV_COLOR_NOT_RESERVED
FV_COLOR_CYAN
FV_COLOR_MAGENTA
FV_COLOR_YELLOW
FV_COLOR_BLACK
FV_COLOR_WHITE
FV_COLOR_RED
FV_COLOR_GREEN
FV_COLOR_BLUE
FP_TintBaseColor
F_ObjHandleT
Color from which the tint is derived
(FO_Color ID), or
FV_NO_BASE_COLOR if the color is not
a tint.
FP_Yellow
MetricT
Percentage of yellow
(metric 0% to 100%)
a. In the API, most percentages are represented as MetricT fractions. For color percentages, the MetricT
value 1<<16 or 0x10000 specifies 1%. For more information on MetricT values, see “MetricT
values” on page 954.
756
FDK Programmer’s Reference
Columns
...
The DOCTYPE system identifier for the source XML document.
The FP_ColorViewCtl property specifies a 12-bit number for color views. The two
least significant bits are View 1, the next 2 bits are View 2, and so on, as shown in
Figure 3-1.
12-bit number
View 6 View 5 View 4 View 3 View 2 View 1
Figure 3-1 Bit positions representing spot color views
The values of each 2-bit setting are one of the following:
FV_SEP_NORMAL
FV_SEP_NONE
FV_SEP_WHITE
Columns
The API uses an FO_SubCol object to represent each subcolumn in a text frame.
FO_SubCol objects have the following properties. All of these properties are readonly.
Type
Meaning
FP_ContentHeight†
MetricT
The distance between the top of the
column and the baseline of the last line in
the column.
FP_FirstAFrame†
F_ObjHandleT
First anchored frame in the column
(FO_AFrame ID).
FP_FirstCell†
F_ObjHandleT
First table cell in the column (FO_Cell
ID).
FP_FirstFn†
F_ObjHandleT
First footnote in the column (FO_Fn ID).
FP_FirstPgf†
F_ObjHandleT
First paragraph in the column (FO_Pgf
ID).
FP_FrameParent†
F_ObjHandleT
ID of text frame that contains the column
(FO_TextFrame ID).
FP_Height†
MetricT
Column height.
FP_LastAFrame†
F_ObjHandleT
Last anchored frame in the column
(FO_AFrame ID).
Property
FDK Programmer’s Reference 757
4
The DOCTYPE system identifier for the source XML document.
Combined font definitions
Type
Meaning
FP_LastCell†
F_ObjHandleT
Last table cell in the column (FO_Cell
ID).
FP_LastFn†
F_ObjHandleT
Last footnote in the column (FO_Fn ID).
F_ObjHandleT
Last paragraph in the column (FO_Pgf
ID).
FP_LocX†
MetricT
Offset from left side of the text frame that
contains the column.
FP_LocY†
MetricT
Offset from top of text frame that contains
the column.
FP_NextSubCol†
F_ObjHandleT
Next column in the text frame that
contains the column (FO_SubCol ID).
FP_Overflowed†
IntT
True if the text frame containing the
column has Autoconnect turned off and
text overflows the column.
FP_ParentTextFrame†
F_ObjHandleT
ID of text frame that contains the column
(FO_TextFrame ID).
FP_PrevSubCol†
F_ObjHandleT
Previous column in the text frame that
contains the column (FO_SubCol ID).
FP_Unique†
IntT
Text column’s UID.
FP_Width†
MetricT
Column width.
Property
FP_LastPgf
Text
†
To get the text in a column, call
F_ApiGetText() with objId set to
the column ID. To add text to a column,
call F_ApiAddText(). To delete text
from a column, call
F_ApiDeleteText(). For more
information, see “F_ApiAddText()” on
page 80, “F_ApiDeleteText()” on
page 151, and “F_ApiGetText()” on
page 249.
Combined font definitions
The API uses an FO_CombinedFontDefn object to represent each combined font in
a document.
758
FDK Programmer’s Reference
Combined font definitions
...
The DOCTYPE system identifier for the source XML document.
FO_Doc objects have a property to specify the first combined font in the document’s
list of combined fonts. To see this property, see “Document object pointer properties”
on page 780.
..............................................................................
IMPORTANT: Combined fonts are stored with the document, not with the current
session. The session property, FP_FontFamilyNames returns a list of fonts available
for the current session, but it does not include any combined fonts. To get a list of
combined font definitions, use FP_FirstCombinedFontDefnInDoc to get the first
combined font definition in the document. From that you can build a list of combined
font definitionss using FP_NextCombinedFontDefnInDoc.
..............................................................................
FO_CombinedFontDefn
FO_CombinedFontDefn objects have the following properties.
Type
Meaning
FP_NextCombinedFont
DefnInDoc†
IntT
Next combined font definition instance in
the document
(FO_CombinedFontDefn ID)
FP_Name
StringT
Name of the combined font.
FP_BaseFamily
IntT
Asian font family (specifies index into
the arrays of font families provided by the
session property,
FP_FontFamilyNames)
FP_WesternFamily
IntT
Western font family (specifies index into
the arrays of font families provided by the
session property,
FP_FontFamilyNames)
FP_ViewHotspotIndica
tors
BoolT
Turns on hotspot indicators. Hotspot
indicators are small square boxes at the
centre of an object to indicate that the
object is actually a hotspot.
FP_WesternSize
MetricT
Scaling factor for Roman text expressed
as a percentage of base font size (metric
1% to 1000%)
FP_WesternShift
MetricT
Baseline offset of Roman text expressed
as a percentage of base font size (metric
1% to 1000%)
Property
FDK Programmer’s Reference 759
4
The DOCTYPE system identifier for the source XML document.
Combined font definitions
Type
Meaning
FP_FontEncodingName†
StringT
Combined font’s encoding, based on the
FP_BaseFamily
FP_UserString
StringT
Property
760
FDK Programmer’s Reference
Commands, menus, menu items, and menu item separators
...
The DOCTYPE system identifier for the source XML document.
Commands, menus, menu items, and menu item separators
The API uses FO_Command objects to represent commands, FO_Menu objects to
represent menus, and FO_MenuItemSeparator objects to represent menu item
separators. Menu items are FO_Command objects that appear on a menu. Each of these
object types has a number of common properties and a number of properties that are
specific to it.
Common command, menu, and menu item separator properties
All commands, menus, and menu item separators have the following properties.
Type
Meaning
FP_Label
StringT
The label the user sees on a
menu. The label for menu item
separators is read-only; it is
always ---.
FP_MenuItemIsEnabled†
IntT
True if the menu or menu item
is enabled or False if it is
disabled (dimmed).
FP_Name†
StringT
The command, menu, or menu
item separator name.a
FP_NextMenuItemInMenu
F_ObjHandleT
The next menu item, menu, or
separator in the menu.
FP_NextMenuItemInSession†
F_ObjHandleT
The next menu item, menu, or
separator in the list of menu
items, menus, and separators in
the session.
FP_PrevMenuItemInMenu
F_ObjHandleT
The previous menu item, menu,
or separator in
the menu.
Property
a. The names for the default, predefined separators are !Separator, !Separator1, !Separator2,
!Separator3, !Separator4, and !Separator5.
FDK Programmer’s Reference 761
4
The DOCTYPE system identifier for the source XML document.
Commands, menus, menu items, and menu item separators
FO_Command
An FO_Command object represents a command or a menu item (a command that
appears on a menu). FO_Command objects have the following properties.
Property
Type
See “Common command, menu, and
menu item separator properties” on
page 760.
Common command, menu, and
menu item separator object
properties
762
Meaning
FP_CanHaveCheckMark
IntT
True if the menu item can have a check
mark. If the menu item is defined by the
FrameMaker product, you can get this
property, but not set it.
FP_CheckMarkIsOn
IntT
True if the menu item can have a check
mark and the check mark is on. If the
menu item is defined by the FrameMaker
product, you can get this property, but
not set it.
FP_CommandNum
IntT
The integer that you specified for the
cmd parameter of
F_ApiDefineAndAddCommand() or
F_ApiDefineCommand() when you
created the command. When the user
executes the command, the FrameMaker
product passes this integer to your
client’s F_ApiCommand() function. If
the menu item is defined by the
FrameMaker product, you can get this
property, but not set it.
FP_EnabledWhen
IntT
The context in which the menu item is
enabled. For a list of the constants that
this field can specify, see the table below.
If the menu item is defined by the
FrameMaker product, you can get this
property, but not set it.
FP_ExpandOMaticParent†
F_ObjHandleT
If the menu item is an expandomatic
menu item, the ID of its virtual parent
(FO_Command ID).
FP_Fcode†
UIntT
An f-code that the FrameMaker product
executes when the user chooses the menu
item or presses the keyboard shortcut.
FDK Programmer’s Reference
Commands, menus, menu items, and menu item separators
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_Fcodes†
F_UIntsT
The list of f-codes that the FrameMaker
product executes when the user chooses
the menu item or presses the keyboard
shortcut. Normally, the first f-code in the
list is the same as the f-code specified by
FP_Fcode.
FP_HasShiftOrUnshift
Command
IntT
Specifies whether a command has an
accompanying shift command or unshift
command:
Property
FV_ITEM_HAS_SHIFT_COMMAND
FV_ITEM_HAS_UNSHIFT_COMMAND
FV_ITEM_HAS_NO_SHIFT_OR_
UNSHIFT_COMMAND
FP_HelpLink
StringT
The hypertext link to call when the user
requests context-sensitive help for the
command.
If you set this property, specify
the destination file and an
optional page number or
linkname. For example, specify
foo.doc:lastpage. Do not specify
hypertext commands such as
gotopage. The FrameMaker product
automatically prepends the appropriate
hypertext command
to the FP_HelpLink string when the
user requests
context-sensitive help.
If the destination file is not in the client
directory, the FrameMaker product looks
for it in the FrameMaker product help
directory.
This property is valid only for commands
created by clients. It is not valid for
commands created directly by
FrameMaker products.
FP_KeyboardShortcut
Label
StringT
The keyboard shortcut string that appears
on the menu. This string need not be one
of the actual shortcuts specified by
FP_KeyboardShortcuts.
FDK Programmer’s Reference 763
4
The DOCTYPE system identifier for the source XML document.
Commands, menus, menu items, and menu item separators
Type
Meaning
FP_KeyboardShortcuts
F_StringsT
The list of keyboard shortcuts the user
can press to execute the command. To
add a shortcut, append it to the list. The
API does not allow you to delete
shortcuts from the list.
FP_Labels
F_StringsT
If the command is a menu item, the list of
labels it can have in different contexts. If
the menu item has only one label in all
contexts, FP_Labels specifies only
the string for that label.
Property
If the menu item has different labels in
different contexts, FP_Labels
specifies pairs of strings with the
following format:
Context,Label
where Label specifies the menu item
label and Context specifies the
context in which the label appears on the
menu. For more information, see
“Getting and setting menu item labels”
on page 395 of the FDK Programmer’s
Guide.
FP_MenuItemType†
IntT
The type of command or menu item:
FV_MENUITEM_FRAME: the command is
a menu item defined by the FrameMaker
product.
FV_MENUITEM_API: the command is a
menu item defined by a client.
FV_MENUITEM_MACRO: the menu item
is not a command; it calls a macro.
FV_MENUITEM_EXPANDOMATIC: the
menu item is an expandomatic menu
item (such as !ShowParagraphTags)
defined by the FrameMaker product.
FP_Mode†
IntT
The mode in which keyboard shortcuts
are recorded:
FV_MODE_ALL
FV_MODE_MATH
FV_MODE_NONMATH
764
FDK Programmer’s Reference
Commands, menus, menu items, and menu item separators
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_NextCommandIn
Session†
F_ObjHandleT
The next command in the list of
commands in the session.
FP_ShiftOrUnshift
Command
F_ObjHandleT
If FP_HasShiftOrUnshiftCommand
is set to
FV_ITEM_HAS_SHIFT_COMMAND, the
ID of the command to use when the user
holds down the Shift key.
Property
If FP_HasShiftOrUnshiftCommand
is set to
FV_ITEM_HAS_UNSHIFT_COMMAND,
the ID of the command to use when the
user isn’t holding down the Shift key.
The following table lists the values FP_EnabledWhen can have and the
corresponding contexts in which a menu item is active.
FP_EnabledWhen value
Context in which a menu item is active
FV_ENABLE_ALWAYS_ENABLE
All contexts. This is the default value.
If the menu item is disabled, setting
FP_EnabledWhen to this value enables it.
FV_ENABLE_ALWAYS_DISABLE
No context. The menu item is disabled.
If a menu item is enabled and you set
FP_EnabledWhen to this value, it disables
and dims the menu item.
FV_ENABLE_BOOK_HAS_
SELECTION
The book contains a selection.
FV_ENABLE_DOC_OR_BOOK_HAS_
SELECTION
A document is in the front, or a book has a selection.
FV_ENABLE_IN_PARA_TEXT
The insertion point or selection is in a paragraph (but
not in a math object).
FV_ENABLE_IN_TEXT_LINE
The insertion point or selection is in a graphic text line.
FV_ENABLE_IS_TEXT_SEL
The selection is in a paragraph.
FV_ENABLE_IN_MATH
The insertion point or selection is in a
math object.
FV_ENABLE_IN_TEXT
The insertion point or selection is in a graphic text line
or a paragraph.
FDK Programmer’s Reference 765
4
The DOCTYPE system identifier for the source XML document.
Commands, menus, menu items, and menu item separators
FP_EnabledWhen value
766
Context in which a menu item is active
FV_ENABLE_OBJ_PROPS
The insertion point is in text, a table, or a math object,
or a graphic object is selected.
FV_ENABLE_IN_TABLE
The insertion point or selection is in any part of a table.
FV_ENABLE_IN_TABLE_TITLE
The insertion point or selection is in the
table title.
FV_ENABLE_IN_CELL_TEXT
The insertion point or selection is in a
table cell.
FV_ENABLE_IS_CELL
A single cell in a table is selected.
FV_ENABLE_IS_CELLS
One or more cells in a table are selected.
FV_ENABLE_IS_TABLE
An entire table is selected.
FV_ENABLE_IS_OBJ
An object is selected.
FV_ENABLE_IS_TEXT_FRAME
A text frame is selected.
FV_ENABLE_IS_OR_IN_FRAME
The selected object is a graphic frame or is in a graphic
frame that is not a page frame.
FV_ENABLE_IS_AFRAME
The first selected object is an anchored frame.
FV_ENABLE_IS_GRAPHIC_INSET
The first selected object is a graphic inset.
FV_ENABLE_IS_TEXT_INSET
The first selected object is a text inset.
FV_ENABLE_IN_FLOW
A text frame is selected, or the insertion point or
selection is in a paragraph.
FV_ENABLE_COPY
Some text or an object is selected.
FV_ENABLE_COPY_FONT
The insertion point or selection is in the text
of a paragraph, a math object, a table, or a
text line.
FV_ENABLE_CAN_PASTE
The Clipboard contains an object or text that can be
pasted at the insertion point.
FV_ENABLE_IS_VIEW_ONLY
The current document is locked.
FV_ENABLE_NEEDS_DOCP_
OR_BOOKP
A document or a book is open.
FV_ENABLE_NEEDS_DOCP_ONLY
A document is open.
FV_ENABLE_NEEDS_BOOKP_ONLY
A book is open.
FDK Programmer’s Reference
Commands, menus, menu items, and menu item separators
...
The DOCTYPE system identifier for the source XML document.
FO_MenuItemSeparator
An FO_MenuItemSeparator object represents a menu item separator.
FO_MenuItemSeparator objects have only the common properties for commands,
menus, and menu item separators.
Type
Property
Common command, menu, and menu
item separator object properties
Meaning
See “Common command, menu, and
menu item separator properties” on
page 760.
FO_Menu
An FO_Menu object represents a menu. FO_Menu objects have the following
properties.
Property
Type
Meaning
See “Common command, menu, and
menu item separator properties” on
page 760.
Common command, menu, and
menu item separator object
properties
FP_FirstMenuItemInMenu
F_ObjHandleT
The first menu item or menu in the
menu.
FP_MenuType†
IntT
Type of menu:
FV_MENU_MENUBAR: a menu bar
defined by the FrameMaker product
FV_MENU_POPUP: a pop-up menu
FV_MENU_ADHOCRULER: an ad hoc
formatting menu that appears on the
ruler
FV_MENU_DEFAULT: a pull-down or
pull-right menu
FDK Programmer’s Reference 767
4
The DOCTYPE system identifier for the source XML document.
Conditions
Conditions
The API uses an FO_CondFmt object to represent each conditional text format in a
document. It uses FO_AttrCondExpr object to filter output content based on conditional
text attributes.
FO_Doc objects also have properties that specify how all the condition formats in the
document appear. For a list of these properties, see “Document condition properties” on
page 797.
FO_AttrCondExpr
An object of type attribute conditional expression. Represents a boolean expression that
filters output content. This object has the following properties:
Type
Meaning
FP_AttrCondExprStr
StringT
Returns or sets the actual Boolean
conditional expression
FP_AttrCondExprIsActive
Boolean
Returns or sets whether the conditional
expression is active or not.
FP_FirstAttrCondExprInDo
c
StringT
Returns the handle to the first attribute
conditional expression object in doc.
FP_NextAttrCondExprInDoc
StringT
Returns the handle to the next attribute
conditional expression object in document
relative to the passed object (of type
FO_AttrCondExpr)
Property
FO_CondFmt
FO_CondFmt objects have the following properties.
Type
Meaning
FP_BkColor
F_ObjHandleT
Text background color
FP_CondFmtIsShown
IntT
True if the condition is shown. To hide
text with a specified condition, set this
property and the FO_Doc property,
FP_ShowAll, to False.
FP_Name
StringT
Name of the condition format.
Property
768
FDK Programmer’s Reference
Conditions
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_NextCondFmtInDoc†
F_ObjHandleT
Next condition format in document
(FO_CondFmt ID).
FP_SepOverride
F_ObjHandleT
Color separation format override
(FO_Color ID).
FP_StyleOverride
IntT
Style condition indicators for conditional
text:
Property
FV_CN_CHANGEBAR
FV_CN_DOUBLE_UNDERLINE
FV_CN_NO_OVERRIDE
FV_CN_OVERLINE
FV_CN_SINGLE_UNDERLINE
FV_CN_STRIKETHROUGH
FV_CN_NUMERIC_UNDERLINE
FV_CN_NMRIC_AND_CHNGBAR
FP_UseBkColor
F_ObjHandleT
True: text background color set for this
character format (False if AsIS)
FP_UseSepOverride
IntT
True if color specified by
FP_SepOverride is used instead
of default.
FDK Programmer’s Reference 769
4
The DOCTYPE system identifier for the source XML document.
Cross-references
Cross-references
The API uses an FO_XRef object to represent a cross-reference instance and an
FO_XRefFmt object to represent a cross-reference format.
FO_XRef
FO_XRef objects have the following properties.
Type
Meaning
FP_Element†
F_ObjHandleT
If the cross-reference is in a Structured
document, the ID of the associated element.
FP_Locked
IntT
True if the cross-reference is part of a text
inset that retains formatting information
from the source document. The crossreference is not affected by global formatting
performed on the document.
FP_NextXRefInDoc†
F_ObjHandleT
Next cross-reference instance in document
(FO_XRef ID).
FP_TextRange†
F_TextRangeT
Text range that the cross-reference instance
encompasses.
FP_Unique†
IntT
The cross-reference’s UID.
FP_XRefFmt
F_ObjHandleT
ID of the cross-reference’s format
(FO_XrefFmt ID).
FP_XRefFile
StringT
The filename of the file containing the crossreference source. If the cross-reference
source is in the same document as the cross
reference, the filename is an empty string
("").
FP_XrefIs
Unresolved†
IntT
True if the FrameMaker product was unable
to resolve the cross-reference the last time it
updated cross-references.
Property
Note that this property is set only when the
FrameMaker product updates crossreferences. Changes to the document, in and
of themselves, do not affect this property.
770
FDK Programmer’s Reference
Dialog boxes
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_XRefSrcText
StringT
If FP_XRefSrcIsElem is False, the text
of the cross-reference source marker; if
FP_XRefSrcIsElem is True, a string
specifying UID:src_name:text, where
UID is the unique ID of the source element,
name is the element name, and text is text
content of the source element.
FP_XRefSrcIsElem
IntT
True if the cross-reference source is a
structural element.
Property
FO_XRefFmt
FO_XRefFmt objects have the following properties.
Type
Meaning
FP_Fmt
StringT
The cross-reference format (a string that
specifies text and building blocks)
FP_Name
StringT
The cross-reference format’s name
FP_NextXRefFmtInDoc†
F_ObjHandleT
ID of the next cross-reference format
(FO_XRefFmt ID)
Property
Dialog boxes
The API uses an FO_DialogResource object to represent a dialog box and the
following objects to represent the items in it:
FO_DlgBox
FO_DlgButton
FO_DlgCheckBox
FO_DlgEditBox
FO_DlgImage
FDK Programmer’s Reference 771
4
The DOCTYPE system identifier for the source XML document.
Dialog boxes
FO_DlgLabel
FO_DlgPopUp
FO_DlgRadioButton
FO_DlgScrollBar
FO_DlgScrollBox
FO_DlgTriBox
FO_DialogResource
An FO_DialogResource object represents a dialog box. FO_DialogResource
objects have the following properties.
Property
FP_DockDialog
772
Type
Meaning
IntT
Allows setting of the dock location of a modeless dialog.
It can have one of the following values:
FV_DIALOG_DOCK_NONE: No docking of
dialog; the dialog will be a floating one.
FV_DIALOG_DOCK_LEFT: Dock dialog to the
left
FV_DIALOG_DOCK_RIGHT: Dock dialog to the
right
FV_DIALOG_DOCK_BOTTOM: Dock dialog to
the bottom
FV_DIALOG_DOCK_ALL: Allow docking of
dialog to left, right or bottom
FP_DoubleClick†
IntT
True if the dialog box was double-clicked on. The
value of this property is valid only when your client gets
it in the F_ApiDialogEvent() callback.
FP_Focus
IntT
If set, instead of refocusing on the document after
processing a command from the dialog, keeps the focus
on the dialog itself.
FDK Programmer’s Reference
Dialog boxes
Property
FP_GroupDialog
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
FP_GroupDialog property enables the clients to group
a modless dialog in a particular group so that when the
dialog is launched it opens in the group specified by this
property.
FV_DIALOG_GROUP_SPECIAL: Place in
special group along with panels like marker,
hypertext etc.
FV_DIALOG_GROUP_CATALOGS: Group
along with catalogs
FV_DIALOG_GROUP_DESIGNERS: Group
along with designers
FV_DIALOG_GROUP_ATTRIBUTES: Group
along with panels like attribute-editor
FV_DIALOG_GROUP_PODS: Group with
pods
FV_DIALOG_GROUP_PODSRIGHT: Group
with pods on right sied e.g FONTPOD
FV_DIALOG_GROUP_EDIT: Place in edit
group
FV_DIALOG_GROUP_ALLPANELS: Place
with any panel group
FV_DIALOG_GROUP_RMKITS: Place with
Rmkits like DITAMap, book etc
FV_DIALOG_GROUP_ALL: Place with any
group.
FDK Programmer’s Reference 773
4
The DOCTYPE system identifier for the source XML document.
Dialog boxes
Property
FP_HelpLink
Type
Meaning
StringT
The hypertext link to call when the user requests
context-sensitive help for the dialog box.
If you set this property, specify the destination file and
an optional page number or linkname. For example,
specify foo.doc:lastpage. Do not specify
hypertext commands such as gotopage. The
FrameMaker product automatically prepends the
appropriate hypertext command to the FP_HelpLink
string when the user requests context-sensitive help.
If the destination file is not in the client directory, the
FrameMaker product looks for it in the FrameMaker
product help directory.
If your client has not defined a help link for the dialog
box, this string is the default help link to the help main
menu.
The FrameMaker product includes dialog boxes that are
shared by multiple commands. The string for such dialog
boxes is prepended with a Shared db: statement. .
FP_IsDialogDock
ed
IntT
Property to determine if the dialog is in docked state or
not.
FP_IsDialogVisi
ble
IntT
Property to determine if the dialog is visible or not.
FP_Label
StringT
The dialog box title.
FP_NumItems†
IntT
The number of items in the dialog box.
FP_MaxSize
IntT
Sets maximum size for modeless dialogs (lower word:
width, higher word: height). Here is an example of
setting maximum size to 230:
F_ObjHandleT dlgId =
F_ApiOpenResource (FO_DialogResource,
(StringT)"dialog");
F_ApiSetInt (FV_SessionId , dlgId,
FP_MaxSize, 230);
F_ApiModelessDialog (1, dlgId);
774
FDK Programmer’s Reference
Dialog boxes
Property
FP_MinSize
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Set minimum size for modeless dialogs (lower word:
width, higher word: height). Here is an example of
setting minimum size to 230:
F_ObjHandleT dlgId =
F_ApiOpenResource (FO_DialogResource,
(StringT)"dialog");
F_ApiSetInt (FV_SessionId , dlgId,
FP_MinSize, 230);
F_ApiModelessDialog (1, dlgId);
FP_ScreenHeight
IntT
Height of the dialog box window in pixels.
FP_ScreenWidth
IntT
Width of the dialog box window in pixels.
FP_ScreenX
IntT
The offset of the dialog box window in pixels from the
left side of the screen (or the left of the FrameMaker
product application window on Windows).
If you set a value that would result in the dialog box
window being off the screen, that value is ignored and
the old value is retained.
FP_ScreenY
IntT
The offset of the dialog box window in pixels from the
top of the screen (or the top of the FrameMaker product
application window on Windows).
If you set a value that would result in the dialog box
window being off the screen, that value is ignored and
the old value is retained.
FO_DlgBox
An FO_DlgBox object represents a rectangular box drawn around a set of items in a
dialog box. FO_DlgBox objects have the following property.
Property
FP_Visibility
Type
Meaning
IntT
True if the box is visible
FDK Programmer’s Reference 775
4
The DOCTYPE system identifier for the source XML document.
Dialog boxes
FO_DlgButton
An FO_DlgButton object represents a button. FO_DlgButton objects have the
following properties.
Type
Meaning
FP_Label
StringT
The label that appears on the button
FP_Sensitivity
IntT
True if the button is enabled; False if it is disabled
(dimmed)
FP_State†
IntT
Constant specifying the state of the button:
Property
FV_DlgOptNotActive: the button was not clicked
FV_DlgOptActive: the button was clicked
FP_Visibility
IntT
True if the button is visible
FO_DlgCheckBox
An FO_DlgCheckBox object represents a checkbox. FO_DlgCheckBox objects
have the following properties.
Type
Meaning
FP_Label
StringT
The label that appears next to the checkbox
FP_Sensitivity
IntT
True if the checkbox is enabled; False if it is
disabled (dimmed)
FP_State
IntT
Constant specifying the state of the checkbox:
Property
FV_DlgOptActive: the checkbox is on
FV_DlgOptNotActive: the checkbox is off
FP_Visibility
776
FDK Programmer’s Reference
IntT
True if the checkbox is visible
Dialog boxes
...
The DOCTYPE system identifier for the source XML document.
FO_DlgEditBox
An FO_DlgEditBox object represents a text box. FO_DlgEditBox objects have
the following properties.
Type
Meaning
FP_Sensitivity
IntT
True if the text box is enabled; False if it is
disabled (dimmed)
FP_Text
StringT
The text in the text box
FP_Visibility
IntT
True if the text box is visible
Property
FO_DlgImage
An FO_DlgImage object represents an image pop-up menu. FO_DlgImage objects
have the following properties.
Type
Meaning
FP_Labels
F_StringsT
The list of settings displayed in the image pop-up
menu.
FP_Sensitivity
IntT
True if the image pop-up menu is enabled; False
if it is disabled (dimmed).
FP_State
IntT
The index (in the list specified by FP_Labels) of
the chosen setting. If no setting is chosen, it is -1.
FP_Visibility
IntT
True if the image pop-up menu is visible.
Property
FO_DlgLabel
An FO_DlgLabel object represents a label in a dialog box. FO_DlgLabel objects
have the following properties.
Property
FP_Label
Type
Meaning
StringT
The string displayed by the label
FDK Programmer’s Reference 777
4
The DOCTYPE system identifier for the source XML document.
Dialog boxes
Type
Meaning
FP_Sensitivity
IntT
True if the label is enabled; False if it is disabled
(dimmed)
FP_Visibility
IntT
True if the label is visible
Property
FO_DlgPopUp
An FO_DlgPopUp object represents a pop-up menu in a dialog box. FO_DlgPopUp
objects have the following properties.
Type
Meaning
FP_Labels
F_StringsT
The list of settings displayed in the pop-up menu.
FP_Sensitivity
IntT
True if the pop-up menu is enabled; False if it is
disabled (dimmed).
FP_State
IntT
The index (in the list specified by FP_Labels) of
the chosen setting. If no setting is chosen, it is -1.
FP_Visibility
IntT
True if the pop-up menu is visible.
Property
FO_DlgRadioButton
An FO_DlgRadioButton object represents a radio button. FO_DlgRadioButton
objects have the following properties.
Type
Meaning
FP_Label
StringT
The label that appears next to the radio button.
FP_Sensitivity
IntT
True if the radio button is enabled; False if it is
disabled (dimmed).
Property
778
FDK Programmer’s Reference
Dialog boxes
Property
FP_State
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Constant specifying the state of the radio button:
FV_DlgOptNotActive: the radio button
is not on.
FV_DlgOptActive: the radio button is on.
Setting FP_State to False has no effect. To
turn a radio button off, you must turn on another one
of the buttons in the button set.
FP_Visibility
IntT
True if the radio button is visible.
FO_DlgScrollBar
An FO_DlgScrollBar object represents a scroll bar. FO_DlgScrollBar objects
have the following properties.
Type
Meaning
FP_IncrVal
IntT
The amount that the scroll bar’s thumb box moves
when the user clicks on either side of it in scroll bar.
For example, if FP_IncrVal is set to 10, the
scroll box moves 10 increments to the left when the
user clicks to the left of the thumb box.
FP_MaxVal
IntT
The largest value to which the user can drag the
scroll bar.
FP_MinVal
IntT
The smallest value to which the user can drag the
scroll bar.
FP_Size
MetricT
The scroll bar width if the scroll bar is horizontal or
the scroll bar height if the scroll bar is vertical.
FP_Sensitivity
IntT
True if the scroll bar is enabled; False if it is
disabled (dimmed).
FP_State
IntT
The value of the scroll bar.
FP_Visibility
IntT
True if the scroll bar is visible.
Property
FDK Programmer’s Reference 779
4
The DOCTYPE system identifier for the source XML document.
Dialog boxes
FO_DlgScrollBox
An FO_DlgScrollBox object represents a scroll list. FO_DlgScrollBox objects
have the following properties.
Property
FP_DoubleClick
Type
Meaning
IntT
True if double-clicking an item has the
effect of clicking the default button in the dialog
box.
The FP_DoubleClick property of the
FO_DlgScrollBox object does not specify
whether an item in a scroll list was double-clicked.
To determine this, you must get the
FP_DoubleClick property of the
FO_DialogResource object in the
F_ApiDialogEvent() callback. For more
information, see “FO_DialogResource” on
page 771.
780
FP_FirstVis
IntT
The index (in the list specified by FP_Labels) of
the item that appears at the top of the scroll list.
FP_Labels
F_StringsT
The list of items in the scroll list.
FP_NumLines†
IntT
The number of items displayed in the
scroll list.
FP_Sensitivity
IntT
True if the scroll list is enabled; False if it is
disabled (dimmed).
FP_State
IntT
The index (in the list specified by FP_Labels) of
the selected item. If no item is selected, it is -1.
FP_Visibility
IntT
True if the scroll list is visible.
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
FO_DlgTriBox
An FO_DlgTriBox object represents a tri-state checkbox (tribox). A tribox is a
checkbox that can be on, off, or As Is (grayed or stippled). FO_DlgTriBox objects
have the following properties.
Type
Meaning
FP_Label
StringT
The label that appears next to the tribox
FP_Sensitivity
IntT
True if the tribox is enabled; False if it is
disabled (dimmed)
FP_State
IntT
Constant specifying the state of the tribox:
Property
FV_DlgOptNotActive: the tribox is off
FV_DlgOptActive: the tribox is on
FV_DlgOptDontCare: the tribox is set to As Is
FP_Visibility
IntT
True if the tribox is visible
Documents
The API uses an FO_Doc object to represent each open document in a FrameMaker
product session.
FO_Doc
FO_Doc objects have the following properties.
Document object pointer properties
FO_Doc objects have the following properties that specify the IDs of other objects.
Type
Meaning
FP_BkColor
F_ObjHandleT
Text background color
FP_CurrentPage
F_ObjHandleT
Current page (FO_BodyPage,
FO_MasterPage, or
FO_RefPage ID)
FP_FirstAttrCondExprInDoc
F_ObjHandleT
First attribute conditional
expression object in doc.
Property
FDK Programmer’s Reference 781
4
The DOCTYPE system identifier for the source XML document.
Documents
Type
Meaning
FP_FirstBodyPageInDoc†
F_ObjHandleT
First body page in the document
(FO_BodyPage ID)
FP_FirstCharFmtInDoc†
F_ObjHandleT
First character tag in the list of the
document’s character tags
(FO_CharFmt ID)
FP_FirstColorInDoc†
F_ObjHandleT
First color in the list of
document’s colors
(FO_Color ID)
FP_FirstCombinedFontDefnI
nDoc†
F_ObjHandleT
First combined font definition in
the list of the document’s
combined font definitions
(FO_CombinedFontDefn ID)
FP_FirstCondFmtInDoc†
F_ObjHandleT
First condition tag in the list of the
document’s condition tags
(FO_CondFmt ID)
FP_FirstFlowInDoc†
F_ObjHandleT
First flow in the list of the
document’s flows (FO_Flow ID)
FP_FirstFnInDoc†
F_ObjHandleT
First footnote in the list of the
documents footnotes (FO_Fn ID)
FP_FirstGraphicInDoc†
F_ObjHandleT
First graphic object in the
list of the document’s
graphic objects
(FO_GraphicObject ID)
FP_FirstMarkerInDoc†
F_ObjHandleT
First marker in the list of the
document’s markers (FO_Marker
ID)
FP_FirstMarkerTypeInDoc†
F_ObjHandleT
First marker type in the list of the
document’s marker types
(FO_MarkerType ID)
FP_FirstMasterPageInDoc†
F_ObjHandleT
First master page in
the document
(FO_MasterPage ID)
FP_FirstPgfFmtInDoc†
F_ObjHandleT
First paragraph tag in the list of
the document’s paragraph tags
(FO_PgfFmt ID)
FP_FirstPgfInDoc†
F_ObjHandleT
First paragraph (FO_Pgf ID) in
the list of the document’s
paragraphs
Property
782
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_FirstRefPageInDoc†
F_ObjHandleT
First reference page in the
document (FO_RefPage ID)
FP_FirstRubiInDoc†
F_ObjHandleT
First rubi composite in the list of
the document’s rubi composites
(FO_Rubi ID)
FP_FirstRulingFmtInDoc†
F_ObjHandleT
First ruling format in the list of the
document’s ruling formats
(FO_RulingFmt ID)
FP_FirstSelectedTiInDoc†
F_ObjHandleT
First selected text inset
in the list of selected text insets in
the document
(FO_TiApiClient,
FO_TiText,
FO_TiTextTable, or
FO_TiFlow ID)
FP_FirstSelected
GraphicInDoc†
F_ObjHandleT
First selected graphic object in the
list of selected graphic objects in
the document (FO_Graphic ID)
FP_FirstTblFmtInDoc†
F_ObjHandleT
First table format in the list of the
document’s table formats
(FO_TblFmt ID)
FP_FirstTblInDoc†
F_ObjHandleT
First table in the list of the
document’s tables (FO_Tbl ID)
FP_FirstTiInDoc†
F_ObjHandleT
First text inset in the list of the
document’s text insets
(FO_TiApiClient,
FO_TiText,
FO_TiTextTable, or
FO_TiFlow ID)
FP_FirstVarFmtInDoc†
F_ObjHandleT
First variable format in the list of
the document’s variable formats
(FO_VarFmt ID)
FP_FirstVarInDoc†
F_ObjHandleT
First variable in the list of the
document’s variables (FO_Var
ID)
FP_FirstXRefFmtInDoc†
F_ObjHandleT
First cross-reference format
in the list of the document’s crossreference formats (FO_XRefFmt
ID)
FP_FirstXRefInDoc†
F_ObjHandleT
First cross-reference in the list of
the document’s cross-references
(FO_XRef ID)
Property
FDK Programmer’s Reference 783
4
The DOCTYPE system identifier for the source XML document.
Documents
Type
Meaning
FP_HiddenPage†
F_ObjHandleT
Hidden page (FO_HiddenPage
ID)
FP_LastBodyPageInDoc†
F_ObjHandleT
Last body page in the document
(FO_BodyPage ID)
FP_LastMasterPageInDoc†
F_ObjHandleT
Last master page
(FO_MasterPage ID)
FP_LastRefPageInDoc†
F_ObjHandleT
Last reference page in the
document (FO_RefPage ID)
FP_LeftMasterPage†
F_ObjHandleT
Left master page
(FO_MasterPage ID)
FP_MainFlowInDoc†
F_ObjHandleT
Main flow (FO_Flow ID)
FP_MarkerTypeNames†
F_StringsT
List of markertype names
FP_NextOpenDocIn
Session†
F_ObjHandleT
Next open document in the list of
open documents in the session
(FO_Doc ID)
FP_ReviewerNameList
StringListT
List of all the reviewers who have
given review comments (using
Track Text Edits) for that
document
FP_RightMasterPage†
F_ObjHandleT
Right master page
(FO_MasterPage ID)
FP_SelectedTbl†
F_ObjHandleT
If any table cells are selected, the
ID of the table containing them
(FO_Tbl ID)
FP_ShowElementDescriptive
Names
IntT
If true, then show element
descriptive names in element
catalog, as specified in element
definition.
FP_TrackChangesAddedColor
F_ObjHandleT
Text color for the Added text.
FP_TrackChangesDeletedCol
or
F_ObjHandleT
Text color for the deleted text.
FP_UseInitialStructureOfA
utoInsertedElements
IntT
If true, then auto-insertion rules
will be processed recursively. For
example, if an element is inserted
automatically, and in the element
definition auto-insertion rules
exist for this element, then those
rules will also be processed.
Property
784
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
XMP Metadata
FrameMaker supports XMP Metadata, which is a protocol to store information about a
file as encoded packets that are available to external applications. This information is
similar to the information stored in the PDF Document Info dictionary. However, XMP
data can contain fields that have no counterpart in PDF Document Info.
FrameMaker maps the values of string pairs in FP_PDFDocInfo to XMP Metadata.
If an external application modifies the document’s metadata, these mapped fields will
be updated in FP_PDFDocInfo. Likewise, if you change a field in
FP_PDFDocInfo via the FDK, then FrameMaker will update the encoded XMP
packets to reflect this new information. The following table lists the supported fields.
External indicates that the field value can be changed by your client, an external
application, or the user interface. Internal indicates a field that FrameMaker
maintains—you cannot modify its value.
PDF Field:
XMP Field
Internal/External:
Author
dc:Creator
External
Title
dc:Title
External
Subject
dc:Description
External
Keywords
pdf:Keywords
External
Copyright
dc:Rights
External
Web Statement
xapRights:WebStatement
External
Job Reference
xapBJ:JobRef
External
Marked
xapRights:Marked
External
Creation Date
xap:CreateDate
Internal
ModDate
xap:ModifyDate
Internal
Metadata Date
Metadata Date
Internal
Creator
pdf:CreatorTool
Internal (FrameMaker—not
displayed in a dialog box)
You can modify XMP data directly for a document by setting a value to the
FP_FileInfoPacket document property. The FDK sample clients include a client
that reads a text file and sets the file’s content to the FP_FilePacket property. XMP
uses the RDF syntax—see http://www.w3.org/1999/02/22-rdf-syntax-ns#, or print the
FP_FilePacket to the console to see the XMP syntax. XMP data can include UNICODE
FDK Programmer’s Reference 785
4
The DOCTYPE system identifier for the source XML document.
Documents
characters. See “PDF Document Info dictionaries” (below) for information about
representing UNICODE in a StringT.
Document PDF properties
FO_Doc objects store information to use when you save the document as PDF.
PDF Document Info dictionaries The FP_PDFDocInfo property defines a list of
strings to enter in a PDF Document Info dictionary. In PDF, these strings can use
Unicode encoding.
The FP_PDFDocInfo property defines a list of strings to enter in a PDF Document Info
dictionary. For one dictionary entry, you provide two strings; the first is the entry name,
and the second is the entry content. The entry name can be up to 126 bytes; the entry
content can be up to 32765 characters.
The entry name is a string of bytes within the ASCII range. For non-printable ASCII,
provide Hex codes. To represent a Hex code, precede the code with the “#” character;
for example #24. To represent the “#” character, enter #23. Finally, an entry name may
not include a byte with a value of zero (#00).
The entry content can include Unicode encoding.
PDF document properties FO_Doc objects have the following properties that
provide PDF information:
Type
Meaning
FP_AcrobatBookmark
DisplayTags
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_PDFBookmarkDisplayTags
instead.
FP_DocAcrobatColumn
ArticleThreads
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFColumnArticle
Threads instead.
FP_DocAcrobatDefaults
Changed
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFDefaultsChanged
instead.
FP_DocAcrobatElement
List
F_StringsT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFElementList instead.
Property
786
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_DocAcrobatElements
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFElements instead.
FP_DocAcrobatNoArticle
Threads
IntT
Retained in Version 6.0 or later for
backward compatibility. Use
FP_DocPDFNoArticleThreads
instead.
FP_DocPDFColumn
ArticleThreads
IntT
True if you want separate article
threads for each column, False if you
want separate article threads for each
text frame. Note that
FP_DocPDFNoArticleThread must
be false.
FP_DocPDFDefaults
Changed
IntT
True if the default heuristics for
determining the paragraph level are
disabled.
FP_DocPDFElement
List
F_StringsT
List of the element tags and context
labels to include in bookmarks.
FP_DocPDFElementList applies
only to structured documents.
FP_DocPDFElements
IntT
True if elements rather than paragraphs
are used for bookmarks.
FP_DocPDFElements applies only to
structured documents.
FP_DocPDFNoArticle
Threads
IntT
True if you do not want article threads
in the resulting PDF.
Property
FDK Programmer’s Reference 787
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_GenerateAcrobatInfo
Type
Meaning
IntT
True if Generate Adobe Acrobat Data is
on. To generate PDF data, you must set
other document print properties as
follows:
FP_PrintToFile: True
FP_PrintThumbnails:
False
FP_PrintSeps: False
FP_PrintBlankPages:
True
FP_PrintLastSheetFirst:
False
FP_PrintNumCopies: 1
FP_PrintOddPages: True
FP_PrintEvenPages: True
FP_PrintScale: 100%
FP_GeneratePDFInfo
IntT
True if Generate Adobe Acrobat Data
is on. To generate PDF data, you must
set other document print properties as
follows
FP_PrintToFile: True
FP_PrintThumbnails: False
FP_PrintSeps: False
FP_PrintBlankPages: True
FP_PrintLastSheetFirst: False
FP_PrintNumCopies: 1
FP_PrintOddPages: True
FP_PrintEvenPages: True
FP_PrintScale: 100%
788
FDK Programmer’s Reference
Documents
Property
FP_PDFAllNamed
Destinations
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
True if PDF generated from this book
will include Named Destinations for
every paragraph and FrameMaker
structure element in the document. This
results in a larger PDF filesize.
If False, the generated PDF will have
Named Destinations only for those
paragraphs and structure elements that
have already been marked with
FP_PDFDestinations
Marked = True.
FP_PDFBookmark
BoolT
True if the FrameMaker product will
generate bookmarks when saving as
PDF.
FP_PDFBookmarksOpenLev
el
IntT
The level of bookmarks to have
expanded when Acrobat opens the
generated PDF document. Can be any
integer, or one of the following defined
values:
FV_PDFBookmarksOpenDefaul
tLevel
FV_PDFBookmarksOpenAllLev
els
FV_PDFBookmarksOpenNoneLe
vel
If you specify an integer greater than the
number of levels in the Bookmarks
Settings,
FV_PDFBookmarksOpenAllLevels
takes effect.
FP_PDFBookmarkDisplay
Tags
IntT
True if Include Paragraph Tags in
Bookmark Text is on (the paragraph tag
is added before the paragraph text in
each bookmark).
FDK Programmer’s Reference 789
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_PDFDests
Marked
Type
Meaning
IntT
True if the book has documents with
paragraphs or elements marked via
FP_MarkedForNamedDestination.
One of two things must happen in order
for this property to be True: The
document was created in version 6.0 or
later; the document was opened in
version 6.0 or later, and the PDF
FileSize Optimization client was run
over it to mark all paragraphs or
elements that are targets of hypertext
links.
FP_PDFDistillerAbsent†
IntT
A value of 1 indicates that there is
no Acrobat Distiller available.
FP_PDFDocInfo
F_StringsT
A list of strings expressing values to be
set in the PDF Document Info dictionary
when you save the document as PDF.
Each dictionary entry is expressed as a
pair of strings; the first string expresses
the entry name, and the second string
expresses the entry value.
FP_PDFEndPage
StringT
The last page of the printing page range,
in the FrameMaker numbering style
FP_PDFJobOption
StringT
The name of the Distiller Job Options. If
the specified name does not exist in the
Distiller Job Options list, then the first
Distiller Job Option in the list is used.
FP_PDFJobOptionsAbsent
IntT
A value of 1 indicates that PDF Job
Options are not available.
FP_PDFOpenPage
StringT
The PDF page number, in the
FrameMaker numbering style, at
which Acrobat opens the generated
PDF document.
FP_PDFPageHeight
MetricT
Page height for the generated PDF.
FP_PDFPageWidth
MetricT
Page width for the generated PDF.
FP_PDFPrintPageRange
IntT
True for generating PDF for the the
specified page range; if False,
FrameMaker generates PDF for the
entire document or book.
†
790
FDK Programmer’s Reference
Documents
Property
FP_PDFRegistrationMark
s
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Registration marks for the generated
PDF. May be one of:
FV_PDFRegistrationMarksNo
ne
FV_PDFRegistrationMarksWe
stern
FV_PDFRegistrationMarksTo
mbo
FP_PDFSeparateFiles
IntT
True, if a separate PDF file should be
generated for each document in a book.
This property can be set for single
documents, but is ignored in that case.
FP_PDFStartPage
StringT
The first page of the printing page range,
in the FrameMaker numbering style.
FP_PDFStructure
IntT
True if the document will create
structured PDF when you save it as PDF.
The structure is assigned via the
FP_PDFStructureLevel property of
FO_PgfFmt objects.
FP_PDFZoomFactor
MetricT
When FP_PDFZoomType is
FV_PDFZoomNone, the zoom
percentage of the PDF document (metric
25% to 1600%) If the number is
negative or zero,
FV_PDFZoomDefault takes effect.
FP_PDFZoomType
IntT
The PDF zoom setting with which
Acrobat opens the generated PDF
document. Can be one of:
FV_PDFZoomDefault
FV_PDFZoomPage
FV_PDFZoomWidth
FV_PDFZoomHeight
FV_PDFZoomNone
If a different value is specified,
FV_PDFZoomDefault takes effect.
FDK Programmer’s Reference 791
4
The DOCTYPE system identifier for the source XML document.
Documents
General document properties
FO_Doc objects have the following general properties.
Property
FP_BannerTextDispl
ay
Type
Meaning
BoolT
Specifies whether banner text should be
displayed in a document. Here is an example
of usage:
F_ApiGetInt(FV_SessionId,
F_ObjHandleT docId,
FP_BannerTextDisplay);
F_ApiSetInt(FV_SessionId,
F_ObjHandleT docId,
FP_BannerTextDisplay,
True/False);
FP_ChapNumCompute
Method
IntT
The document’s chapter numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous chapter.
FV_NUM_RESTART: Use the value
specified for FP_ChapterNumber.
FV_NUM_SAME: Use the same chapter
number as for the previous file.
FP_ChapterNumber
792
FDK Programmer’s Reference
IntT
If FP_ChapNumComputeMethod is
FV_NUM_RESTART, use this as the chapter
number
Documents
Property
FP_ChapterNumStyle
Type
Meaning
IntT
The numbering style; one of:
...
The DOCTYPE system identifier for the source XML document.
FV_NUMSTYLE_NUMERIC: Arabic.
FV_NUMSTYLE_ROMAN_UC: Roman
numerals, uppercase.
FV_NUMSTYLE_ROMAN_LC: Roman,
lowercase.
FV_NUMSTYLE_ALPHA_UC: Alphabetic,
uppercase.
FV_NUMSTYLE_ALPHA_LC: Alphabetic,
lowercase.
FV_NUMSTYLE_KANJI: Kanji.
FV_NUMSTYLE_ZENKAKU: Zenkaku.
FV_NUMSTYLE_ZENKAKU_UC: Zenkaku,
uppercase.
FV_NUMSTYLE_ZENKAKU_LC: Zenkaku,
lowercase.
FV_NUMSTYLE_KANJI_KAZU: Kazu.
FV_NUMSTYLE_DAIJI: Daiji.
FV_NUMSTYLE_TEXT: Text.
FP_ChapterNumText
StringT
If FP_ChapNumStyle is
FV_NUMSTYLE_TEXT, use this string as the
chapter number.
FP_Dictionary
F_StringsT
List of words to accept when spell- checking
the document.
FP_DocIsHelp†
Int
True if the document is the FrameMaker
product’s Help document.
FP_DocIsModified†
IntT
True if document has been modified. While
this property is read-only, you can modify a
document without setting this property to
True by setting FP_Untouchable to True
for the document before your client modifies
it.
FP_DocIsViewOnly
IntT
True if document is View Only.
FDK Programmer’s Reference 793
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_DocOpenType†
Type
Meaning
IntT
Type of document the file was opened as:
FV_DOC_TYPE_BINARY: Frame binary
document
FV_DOC_TYPE_TEXT: ASCII text document
FV_DOC_TYPE_MIF: MIF document
FV_DOC_TYPE_FILTER: a filtered
document
FP_DocSaveType†
IntT
Type of document the file is saved as:
FV_DOC_TYPE_BINARY: Frame binary
document
FV_DOC_TYPE_TEXT: ASCII text document
FV_DOC_TYPE_MIF: MIF document
FV_DOC_TYPE_FILTER: a filtered
document
FP_DontUpdateText
Insets
IntT
True if FrameMaker product doesn’t
automatically update text insets when it
opens the document.
FP_DontUpdateXRefs
IntT
True if FrameMaker product doesn’t
automatically update cross-references when
it opens or prints the document.
FP_FormatOverride
IntT
Specfies whether there are
format overrides at the current insertion
point.
If the insertion point is in a text range that has
a character format applied to it,
FP_FormatOverride is True if (and
only if) the text formatting at the insertion
point overrides the
character format.
If the insertion point is in a text range that has
does not have a character format applied to
it, FP_FormatOverride is True if
(and only if) the paragraph containing the
insertion point has formatting
that overrides the Paragraph
Catalog format.
794
FP_IsOnScreen
IntT
True if document is visible on
the screen.
FP_IsDocDitamap†
BoolT
True if the document is a DITA Map.
FP_IsDocDita†
BoolT
True if the document is a DITA document
(Map/Topic).
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_LineNumDistance
MetricT
Sets the line number display width, that is,
the space in which the line numbers are
displayed.
FP_LineNumRestart
IntT
If set, restarts line number display on each
page.
FP_LineNumShow
IntT
If set, enables the line number display.
FP_Name†
StringT
Filename of the document.
FP_PageNumCompute
Method
IntT
The component document’s page numbering
type:
Property
FV_NUM_CONTINUE: Continue the
numbering from the previous file.
FV_NUM_RESTART: Restart numbering at
the value specified by the
FP_FirstPageNum property.
FP_PgfNumCompute
Method
IntT
The document’s paragraph numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous file.
FV_NUM_RESTART: Restart numbering at
1.
FP_PreviewState
Int
Determines the preview state of the
document when track changes is enabled.
Valid values are:
FV_PREVIEW_OFF_TRACK_CHANGE:
Turn off preview
FV_PREVIEW_ON_ORIGINAL:Turn on
preview while showing the original content.
Shows the original state of document as if all
the tracked changes were rejected
FV_PREVIEW_ON_FINAL: Turn on
preview while showing the final content.
Shows the final state of document as if all the
tracked changes were accepted.
FDK Programmer’s Reference 795
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_StatusLine
Type
Meaning
StringT
String that appears in the document status
bar. Note that this property always returns an
empty string; it is effectively write-only
If you set FP_StatusLine to a string
other than an empty string (""), the string
will remain in the status bar until you reset it.
To reset FP_StatusLine so the
FrameMaker product automatically updates
the status line with normal status
information, set it to an empty string ("").
FP_TextSelection
F_TextRangeT
The currently selected text range or insertion
point in the document.
FP_Untouchable
IntT
False by default. Setting this to True
allows your client to modify a document
without the FrameMaker product setting
FP_DocIsModified to True.
FP_ViewOnlyWin
Palette
Int
True if document acts like a palette when it
is View Only.
FP_VolNumCompute
Method
IntT
The document’s volume numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous volume.
FV_NUM_RESTART: Use the value
specified for FP_VolumeNumber.
FV_NUM_SAME: Use the same volume
number as for the previous file.
FP_VolumeNumber
796
FDK Programmer’s Reference
IntT
If FP_VolNumComputeMethod is
FV_NUM_RESTART, use this as the volume
number
Documents
Property
FP_VolumeNumStyle
Type
Meaning
IntT
The numbering style; one of:
...
The DOCTYPE system identifier for the source XML document.
FV_NUMSTYLE_NUMERIC: Arabic.
FV_NUMSTYLE_ROMAN_UC: Roman
numerals, uppercase.
FV_NUMSTYLE_ROMAN_LC: Roman
numerals,lowercase.
FV_NUMSTYLE_ALPHA_UC: Alphabetic,
uppercase.
FV_NUMSTYLE_ALPHA_LC: Alphabetic,
lowercase.
FV_NUMSTYLE_KANJI: Kanji.
FV_NUMSTYLE_ZENKAKU: Zenkaku.
FV_NUMSTYLE_ZENKAKU_UC: Zenkaku,
uppercase.
FV_NUMSTYLE_ZENKAKU_LC: Zenkaku,
lowercase.
FV_NUMSTYLE_KANJI_KAZU: Kazu.
FV_NUMSTYLE_DAIJI: Daiji.
FV_NUMSTYLE_TEXT: Text.
FP_VolumeNumText
StringT
If FP_VolNumStyle is
FV_NUMSTYLE_TEXT, use this string as the
chapter number.
Document change bar properties
FO_Doc objects have the following properties that specify how change bars appear in
a document.
Type
Meaning
FP_AutoChangeBars
IntT
True if Automatic Change Bars is
enabled
FP_ChangeBarColor
F_ObjHandleT
The spot color (FO_Color ID)
FP_ChangeBarDistance
MetricT
Distance between change bar and text
column
Property
FDK Programmer’s Reference 797
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_ChangeBarPosition
Type
Meaning
IntT
Position of change bars:
FV_CB_COL_LEFT: Left of Column
FV_CB_COL_RIGHT: Right of
Column
FV_CB_COL_NEAREST: Side Nearest
to Page Edge
FV_CB_COL_FURTHEST: Side
Farthest from Page Edge
FP_ChangeBarThickness
MetricT
Width of change bars
Document condition properties
FO_Doc objects have the following properties that specify the conditional text
expression and how conditional text appears in a document.
Type
Meaning
FP_BooleanConditionExpr
ession
StringT
Returns or sets the Boolean
conditional expression for the
document. Different from attribute
conditional expression. This
expression is created with conditional
tags while attribute conditional
expression is based on attribute values.
FP_ShowAll
IntT
True if all conditions are displayed
FP_ShowCondIndicators
IntT
True if condition indicators (format
overrides) are displayed
Property
798
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Document equation properties
FO_Doc objects have the following properties that specify the appearance of all
equations in the document.
Type
Meaning
FP_EqnIntegralSizeLarge
MetricT
Point size of integral symbol in large
equations (2 pt to 400 pt)
FP_EqnIntegralSizeMed
MetricT
Point size of integral symbol in
medium equations (2 pt to 400 pt)
FP_EqnIntegralSizeSmall
MetricT
Point size of integral symbol in small
equations (2 pt to 400 pt)
FP_EqnLevel1SizeLarge
MetricT
Point size of level 1 expression in large
equations (2 pt to 400 pt)
FP_EqnLevel1SizeMed
MetricT
Point size of level 1 expression in
medium equations (2 pt to 400 pt)
FP_EqnLevel1SizeSmall
MetricT
Point size of level 1 expression in small
equations (2 pt to 400 pt)
FP_EqnLevel2SizeLarge
MetricT
Point size of level 2 expression in large
equations (2 pt to 400 pt)
FP_EqnLevel2SizeMed
MetricT
Point size of level 2 expression in
medium equations (2 pt to 400 pt)
FP_EqnLevel2SizeSmall
MetricT
Point size of level 2 expression in small
equations (2 pt to 400 pt)
FP_EqnLevel3SizeLarge
MetricT
Point size of level 3 expression in large
equations (2 pt to 400 pt)
FP_EqnLevel3SizeMed
MetricT
Point size of level 3 expression in
medium equations (2 pt to 400 pt)
FP_EqnLevel3SizeSmall
MetricT
Point size of level 3 expression in small
equations (2 pt to 400 pt)
FP_EqnSigmaSizeLarge
MetricT
Point size of sigma symbol in large
equations (2 pt to 400 pt)
FP_EqnSigmaSizeMed
MetricT
Point size of sigma symbol in medium
equations (2 pt to 400 pt)
FP_EqnSigmaSizeSmall
MetricT
Point size of sigma symbol in small
equations (2 pt to 400 pt)
Property
FDK Programmer’s Reference 799
4
The DOCTYPE system identifier for the source XML document.
Documents
Type
Meaning
FP_Functions
StringT
Character format tag of equation font to
apply to Math Functions
FP_Numbers
StringT
Character format tag of equation font to
apply to Math Numbers
FP_Strings
StringT
Character format tag of equation font to
apply to Math Strings
FP_Symbols
StringT
Character format tag of equation font to
apply to Math Symbols
FP_SymbolsList†
F_StringsT
List of math symbol fonts used in
Equation Fonts dialog box
FP_Variables
StringT
Character format tag of equation font to
apply to Math Variables
FP_VerticalTrackingLarg
e
MetricT
Vertical tracking in large equations
FP_VerticalTrackingMedi
um
MetricT
Vertical tracking in medium equations
FP_VerticalTrackingSmal
l
MetricT
Vertical tracking in small equations
Property
Document hypertext properties
FO_Doc objects have the following properties that specify whether to parse and
validate a hypertext command, and indicate the results of the parsing and validation.
To parse a hypertext command, set the value of FP_HypertextCommandText to the
command you want to parse. Setting the string executes the parser, and if
FP_HypertextDoValidate is true, setting the string executes validation as well.
Type
Meaning
FP_HypertextDoValidate
BoolT
True if the next hypertext string sent to
FP_HypertextCommandText will be
validated
FP_HypertextCommandText
StringT
The hypertext command to parse.
Setting this value executes the parser. If
FP_HypertextDoValidate is True,
the command will be parsed and
validated.
Property
800
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_HypertextParsedArgs†
StringLi
stT
The value of
FP_HypertextCommand, parsed into
individual tokens
FP_HypertextParseErr†
IntT
Non-zero if there was a parse error. See
“FP_HypertextParseErr” on page 801.
FP_HypertextValidateErr†
IntT
Non-zero if
FP_HypertextDoValidate was true
and there was a validation error. See
“FP_HypertextValidateErr” on
page 802.
FP_HypertextParseBad
Param†
IntT
If there was a parse error, an index into
the FP_HypertextParsedArgs
string list.
FP_HypertextParseErrMsg†
StringT
The message FrameMaker generates for
a parse error
FP_HypertextParsedCmd
Code†
IntT
The FrameMaker hypertext command in
FP_HypertextCommandText, as
determined by the parser. See
“Command codes” on page 803.
FP_HypertextParsedCmd
Dest†
IntT
For link commands, the destination type
in FP_HypertextCommandText, as
determined by the parser. See “Link
destinations” on page 804.
FP_HypertextParsedCmd
DestObjType†
IntT
For links to objects, the type of the
object in the target document. See “Link
destination object types” on page 805.
FP_HypertextParsedCmd
DestObjID†
IntT
For links to objects, the UID of the
object in the target document.
FP_HypertextParsedCmd
MatrixRows†
IntT
If FP_HypertextParsedCmdCode is
FV_CmdMatrix, the number of rows in
the matrix.
FP_HypertextParsedCmd
MatrixColumns†
IntT
If FP_HypertextParsedCmdCode is
FV_CmdMatrix, the number of
columns in the matrix.
FP_HypertextParsed
LinkName†
StringT
For links to named targets, either the
value of a newlink command, or a
keyword such as FirstPage or
LastPage.
Property
FDK Programmer’s Reference 801
4
The DOCTYPE system identifier for the source XML document.
Documents
Type
Meaning
FP_HypertextParsed
PageName†
StringT
For links to pages, the page number.
FP_HypertextParsed
FlowName†
StringT
For popup and matrix commands, the
name of the flow (on a reference page)
that contains the popup or matrix list of
commands.
FP_HypertextParsed
ClientName†
StringT
For message commands, the name of the
API client to receive the message.
FP_HypertextParsed
Title†
StringT
If FP_HypertextParsedCmdCode is
FV_CmdAlertTitle, the specified
title for the alert box.
FP_HypertextParsed
Message†
StringT
If FP_HypertextParsedCmdCode is
FV_CmdAlert, FV_CmdAlerTitle,
or FV_CmdMessage, the specified
message for the hypertext command.
FP_HypertextParsed
DIFileName†
StringT
For links to external files, the absolute
path to the target file, expressed in
platform independent syntax.
Property
FP_HypertextParseErr The following table shows error codes to which
FP_HypertextParseErr can be set:
Value
802
Meaning
FV_HypertextSyntaxOK
No parse errors
FV_HypertextEmptyComma
nd
Hypertext string is empty
FV_Hypertext
UnrecognizedCommand
Cannot map the first keyword to an existing
FP_HypertextParsedCmdCode
FV_HypertextMissing
Arguments
One or more arguments required for the command is missing
FV_HypertextExtra
Arguments
More than the required number of arguments for the
command; extra arguments were ignored
FV_HypertextBadSyntax
PathSpec
File reference expected for this command, but no valid
filepath found
FDK Programmer’s Reference
Documents
Value
...
The DOCTYPE system identifier for the source XML document.
Meaning
FV_HypertextUnanchored
PartialPath
File reference is relative to the current document, but the
current document has not been saved; file location could not
be calculated
FV_HypertextHelpDirNot
Found
Default help directory either does not exist (help was not
installed) or cannot be found
FV_HypertextExpectedA
NumberParam
Command expected a number but got text; check
FP_HypertextParseBadParam
FP_HypertextValidateErr The following table shows error codes to which
FP_HypertextValidateErr can be set:
Value
Meaning
FV_HypertextValid
No validation errors
FV_HypertextUses
DefaultText
Default text was found as an argument; are you sure the
default text is what you want?
FV_HypertextFileNot
Regular
The referenced file could not be found, or is not a regular
file; for example, it could be a directory name
FV_HypertextFileNot
MakerDoc
The referenced file is not made by a FrameMaker product
FV_HypertextCantOpen
DestFile
Can’t open the file; perhaps you don’t have permission,
or the file is locked
FV_HypertextDestination
LinkNotFound
The referenced file is valid, but can’t find the named link
within it
FV_HypertextPageNameNot
Found
The referenced file is valid, but can’t find the specified
page
FV_HypertextUnrecognized
ObjectType
The referenced file is valid, but the link is to an object
with an unrecognized object type
FV_HypertextObjectIDNot
Found
A link to an object, but can’t find the object
FV_HypertextBadMatrix
Size
One or both of the matrix dimensions is bad; must be
between 1 and 99
FV_HypertextMatrix
CommandInvalid
One of the cammands in the reference page flow for a
matrix command has a parse or validation error
FV_HypertextFlowMissing
Lines
The reference flow for a matrix or popup command is
missing one or more lines
FDK Programmer’s Reference 803
4
The DOCTYPE system identifier for the source XML document.
Documents
Value
Meaning
FV_HypertextNoNamedFlow
Can’t find the named reference flow for a matrix or
popup command
FV_HypertextRecursive
Flow
The reference flow for a matrix or popup command
contains nested popup or matrix commands that name a
parent reference flow
FV_HypertextMissingPopup
Marker
At least one entry in the popup command’s reference
flow has no hypertext marker in it
FV_HypertextMissingPopup
LabelItem
One entry in the popup command’s reference flow has no
text in it
FV_HypertextEmptyLineIn
MiddleOfPopup
One entry in the popup command’s reference flow has no
text in it
FV_HypertextCommand
IllegalWithinPopup
Invalid command in the popup command’s reference
flow; for example, matrix or newlink
FV_HypertextFcodeInvalid
Invalid FCode in the hypertext command
Command codes The following table shows the possible values for
FP_HypertextParsedCmdCode:
Value
804
Meaning
FV_CmdError
Parser is in an error state
FV_CmdUnknown
Unknown command
FV_CmdNoop
Command causes no event
FV_CmdAlert
alert command
FV_CmdAlertTitle
alerttitle command
FV_CmdExit
exit commant
FV_CmdGoToLink
gotolink command
FV_CmdGoToLinkFitWin
gotolinkfitwin command
FV_CmdGoToNew
gotonew command
FV_CmdGoToPage
gotopage command
FV_CmdGoToObjectId
gotoObjectId command
FV_CmdGoToObjectIdFitWin
gotoObjectIdfitwin command
FDK Programmer’s Reference
Documents
Value
...
The DOCTYPE system identifier for the source XML document.
Meaning
FV_CmdMatrix
matrix command
FV_CmdMessage
message command
FV_CmdNewLink
newlink command
FV_CmdNextPage
nextpage command
FV_CmdOpenLink
openlink command
FV_CmdOpenLinkFitWin
openlinkfitwin command
FV_CmdOpenNew
opennew command
FV_CmdOpenObjectId
openObjectId command
FV_CmdOpenObjectIdFitWin
openObjectIdfitwin command
FV_CmdOpenPage
openpage command
FV_CmdPopup
popup command
FV_CmdPreviousLink
previouslink command
FV_CmdPreviousLinkFitWin
previouslinkfitwin command
FV_CmdPreviousPage
previouspage command
FV_CmdQuit
quit command
FV_CmdQuitAll
quitall command
Link destinations The following table shows the possible values for
FP_HypertextParsedCmdDest:
Value
Meaning
FV_DestNowhere
No destination found
FV_DestMarkerNewLink
Destination is a newlink
FV_DestFirstPage
Destination is the first page of a file
FV_DestLastPage
Destination is the last page of a file
FV_DestPageNum
Destination is a named page (usually a page number)
FV_DestFluidFlow
Destination is to a fluid flow document
FDK Programmer’s Reference 805
4
The DOCTYPE system identifier for the source XML document.
Documents
Value
Meaning
FV_DestMarker
Destination is a marker
FV_DestObjectId
Destination is an object ID (usually for generated hypertext
commands)
FV_DestXRef
Destination is a cross-reference
Link destination object types The following table shows the possible values for
FP_HypertextParsedCmdDestObjType:
Value
Meaning
FV_ObjectUnknown
Unknown or invalid object
FV_ObjectMarker
Object is a marker
FV_ObjectPgf
Object is a paragraph
FV_ObjectXref
Object is a cross-reference
FV_ObjectGraphic
Object is a graphic
FV_ObjectElement
Object is an element
FV_ObjectTextInset
Object is a text inset
FV_ObjectDataLink
Object is subscribed data
Document menu properties
FO_Doc objects have the following properties that specify a document’s menu bars.
Type
Meaning
FP_MenuBar
F_ObjHandleT
The ID of the document’s menu bar
(FO_Menu ID)
FP_ViewOnlyMenuBar
F_ObjHandleT
The ID of the document’s menu bar when
the document is locked (FO_Menu ID)
Property
806
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Document footnote properties
FO_Doc objects have the following properties that specify the appearance of footnotes
in a document.
Type
Meaning
FP_FnCustNumString
StringT
Characters for custom document footnote
numbers
FP_FnFirstNum
IntT
First document footnote number
FP_FnFmt
StringT
Paragraph tag of footnote
FP_FnHeightPerCol
MetricT
Maximum height allowed for document
footnotes (36 pt to 32767 pt)
FP_FnInstancePosition
IntT
Placement of document footnote number in
footnote:
Property
FV_FN_POS_SUPER: Superscript
FV_FN_POS_BASELINE: Baseline
FV_FN_POS_SUB: Subscript
FP_FnInstancePrefix
StringT
Prefix to appear before document footnote
number in footnote
FP_FnInstanceSuffix
StringT
Suffix to appear after document footnote
number in footnote
FP_FnNumCompute
Method
IntT
The document’s footnote numbering type:
FV_NUM_CONTINUE: Continue the
numbering from the previous file.
FV_NUM_RESTART: Restart numbering at the
value specified by the associated FO_Doc
object’s FP_FnFirstNum property.
FV_NUM_PER_PAGE: Restart numbering on
each page.
FP_FnNumberingPerPage
IntT
Obsolete for version 6.0 and later; use
FP_FnNumComputeMethod instead.
Retained for backward compatibility; you do
not need to set FAPI_55_BEHAVIOR to use
this property.
True if document footnote numbering is by
page, rather than by flow
FDK Programmer’s Reference 807
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_FnNumStyle
Type
Meaning
IntT
Document footnote numbering style:
FV_FN_NUM_NUMERIC: Arabic
FV_FN_NUM_ROMAN_UC: Roman uppercase
FV_FN_NUM_ROMAN_LC: Roman lowercase
FV_FN_NUM_ALPHA_UC: Alphabetic
uppercase
FV_FN_NUM_ALPHA_LC: Alphabetic
lowercase
FV_FN_NUM_KANJI: Kanji characters
FV_FN_NUM_ZENKAKU: Zenkaku
FV_FN_NUM_ZENKAKU_UC: Zenkaku
uppercase
FV_FN_NUM_ZENKAKU_LC: Zenkaku
lowercase
FV_FN_NUM_KANJI_KAZU: Kazu
FV_FN_NUM_DAIJI: Daiji
FV_FN_NUM_CUSTOM: Custom numbering
FP_FnRefPosition
IntT
Position of footnote reference in document
text:
FV_FN_POS_SUPER: Superscript
FV_FN_POS_BASELINE: Baseline
FV_FN_POS_SUB: Subscript
808
FP_FnRefPrefix
StringT
Prefix to appear before number in document
text
FP_FnRefSuffix
StringT
Suffix to appear after number in document text
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Document flow properties
The following properties were FO_Doc properties in earlier versions of the FDK. In
the current version of the FDK, they are FO_Flow properties. They are no longer valid
FO_Doc properties.
Type
Meaning
FP_MaxInterlinePadding
MetricT
Not a valid FO_Doc property in the current
version of the FDK. See “FO_Flow” on
page 829.
FP_MaxInterPgfPadding
MetricT
Not a valid FO_Doc property in the current
version of the FDK. See “FO_Flow” on
page 829.
Property
Document page properties
FO_Doc objects have the following properties that specify page appearance.
Type
Meaning
FP_BottomMargin
MetricT
Bottom page margin
FP_ColGap
MetricT
Size of gap between text columns
FP_DocIsDoubleSided
IntT
True if two-sided page layout
FP_FirstPageNum
IntT
Page number of first page
FP_FirstPageVerso
IntT
False for right first page; True for left first
page
FP_LeftMargin
MetricT
Left page margin
FP_NumCols†
IntT
Number of columns
FP_PageHeight
MetricT
Height of the document’s pages. Setting this
property automatically sets the
FP_PageHeight property of all of the
document’s body pages.
FP_PageNumCompute
Method
IntT
The document’s page numbering type:
Property
FV_NUM_CONTINUE: Continue the numbering
from the previous file.
FV_NUM_RESTART: Restart numbering at the
value specified by the associated FO_Doc
object’s FP_FirstPageNum property.
FDK Programmer’s Reference 809
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_PageNumStyle
Type
Meaning
IntT
Page numbering style:
FV_PAGE_NUM_NUMERIC: Arabic
FV_PAGE_NUM_ROMAN_UC: Roman uppercase
FV_PAGE_NUM_ROMAN_LC: Roman lowercase
FV_PAGE_NUM_ALPHA_UC: Alphabetic
uppercase
FV_PAGE_NUM_ALPHA_LC: Alphabetic
lowercase
FV_PAGE_NUM_KANJI: Kanji characters
FV_PAGE_NUM_ZENKAKU: Zenkaku
FV_PAGE_NUM_ZENKAKU_UC: Zenkaku
uppercase
FV_PAGE_NUM_ZENKAKU_LC: Zenkaku
lowercase
FV_PAGE_NUM_KANJI_KAZU: Kazu
FV_PAGE_NUM_DAIJI: Daiji
FP_PageRounding
IntT
How to round pages:
FV_PR_DEL_EMPTY: Delete Empty Pages
FV_PR_KEEP_NUM_EVEN: Make Page Count
Even
FV_PR_KEEP_NUM_ODD: Make Page
Count Odd
FV_PR_DONT_CHANGE: Don’t Change
Page Count
FP_PageWidth
810
FDK Programmer’s Reference
MetricT
Width of the document’s pages. Setting this
property automatically sets the
FP_PageWidth property of all of the
document’s body pages.
Documents
Property
FP_PointPageNumStyle
Type
Meaning
IntT
Point page numbering style:
...
The DOCTYPE system identifier for the source XML document.
FV_POINT_PAGE_NUM_NUMERIC: Arabic
FV_POINT_PAGE_NUM_ROMAN_UC: Roman
uppercase
FV_POINT_PAGE_NUM_ROMAN_LC: Roman
lowercase
FV_POINT_PAGE_NUM_ALPHA_UC:
Alphabetic uppercase
FV_POINT_PAGE_NUM_ALPHA_LC:
Alphabetic lowercase
FV_POINT_PAGE_NUM_KANJI: Kanji
characters
FV_POINT_PAGE_NUM_ZENKAKU: Zenkaku
FV_POINT_PAGE_NUM_ZENKAKU_UC:
Zenkaku uppercase
FV_POINT_PAGE_NUM_ZENKAKU_LC:
Zenkaku lowercase
FV_POINT_PAGE_NUM_KANJI_KAZU: Kazu
FV_POINT_PAGE_NUM_DAIJI: Daiji
FP_RightMargin
MetricT
Right page margin
FP_SmartQuotes
IntT
True if Smart Quotes is enabled
FP_SmartSpaces
IntT
True if Smart Spaces is enabled
FP_TopMargin
MetricT
Top page margin
FDK Programmer’s Reference
811
4
The DOCTYPE system identifier for the source XML document.
Documents
Document print properties
FO_Doc objects have the following properties that specify how a document is printed.
Property
FP_DownloadFonts
Type
Meaning
IntT
The fonts to download to the printer when
printing. The default is
FV_PR_DOWNLOAD_NONE.
Can be one of:
FV_PR_DOWNLOAD_NONE
FV_PR_DOWNLOAD_ALL
FV_PR_DOWNLOAD_ALL_BUT_
STANDARD_13
FV_PR_DOWNLOAD_ALL_BUT_
STANDARD_35
FP_PrintBlankPages
IntT
True if FP_PageRounding allows empty
page at end of document.
FP_PrintCollated
IntT
True if Collate is enabled.
FP_PrintCols
IntT
If FP_PrintThumbnails is True, the
number of columns to print.
FP_PrintEmulsion
IntT
Direction of print emulsion:
FV_EMUL_UP: Emulsion side up
FV_EMUL_DOWN: Emulsion side down
812
FP_PrintEndPage
IntT
Number of last page to print. Note that the
value of FP_DocFluidFlow must be 0; you
can’t print a range of pages when a document
is in fluid view.
FP_PrintEndPageName
IntT
Page number string for the last page to print;
use this when the pages are numbered with a
style other than FV_PAGE_NUM_NUMERIC.
Note that the value of FP_DocFluidFlow
must be 0; you can’t print a range of pages
when a document is in fluid view.
FP_PrintEndPoint
IntT
Number of last point page to print.
FP_PrinterName
StringT
Name of printer. Setting FP_PrinterName
on Windows has no effect. When you set
FP_PrinterName, you can set the printer to
the default printer by specifying NULL.
FP_PrintEvenPages
IntT
True if Print Even-Numbered Pages is
enabled.
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_PrintFileName
StringT
Filename of file to print to. When you set
FP_PrintFileName, you can set the
filename to the default filename by
specifying NULL.
FP_PrintImaging
IntT
Type of print imaging:
Property
FV_IMG_POSITIVE
FV_IMG_NEGATIVE
FP_PrintLastSheetFirst
IntT
True if Last Sheet First is enabled.
FP_PrintLowRes
IntT
True if Low-Resolution is enabled.
FP_PrintManualFeed
IntT
True if Manual Feed is enabled.
FP_PrintNumCopies
IntT
Number of copies to print.
FP_PrintOddPages
IntT
True if Odd-Numbered Pages is enabled.
FP_PrintPaperHeight
MetricT
Height of paper.
FP_PrintPaperWidth
MetricT
Width of paper.
FP_PrintRegistration
Marks
IntT
True if Registration Marks is enabled.
FP_PrintRows
IntT
If FP_PrintThumbnails is True, the
number of rows to print.
FP_PrintScale
IntT
Scale factor.
FP_PrintScope
IntT
Pages to print. Note that the value of
FP_DocFluidFlow must be 0; you can’t
print a range of pages when a document is in
fluid view.
FV_PR_ALL: Print all pages
FV_PR_RANGE: Print a range of pages
FP_PrintSeps
IntT
True if Print Separations is enabled.
FP_PrintStartPage
IntT
Number of first page to print. Note that the
value of FP_DocFluidFlow must be 0; you
can’t print a range of pages when a document
is in fluid view.
FDK Programmer’s Reference 813
4
The DOCTYPE system identifier for the source XML document.
Documents
Type
Meaning
FP_PrintStartPage
Name
IntT
Page number string for the first page to print;
use this when the pages are numbered with a
style other than FV_PAGE_NUM_NUMERIC.
Note that the value of FP_DocFluidFlow
must be 0; you can’t print a range of pages
when a document is in fluid view.
FP_PrintStartPoint
IntT
Number of first point page to print.
FP_PrintThumbnails
IntT
True if Print Thumbnails is enabled.
FP_PrintToFile
IntT
True if Print Only to File is enabled.
FP_SkipBlankSeps
IntT
True if Skip Blank Separations is enabled
(don’t print blank color separations).
FP_TomboMarks
BoolT
True if registration marks are enabled, and
set to Tombo. When printing Tombo Marks
via the API, you must also set
FP_PrintRegistrationMarks to True.
FP_Trapwise
Compatibility
BoolT
True if Trapwise Compatibility is enabled.
Setting this to True automatically sets
FP_PrintToFile to True and
FP_PrintSep to False.
Property
Document rubi properties
FO_Doc objects have the following properties that specify formatting for rubi
composites:
814
FP_NarrowRubiSpaceForKanji
IntT
Allowable values are:
FV_Wide
FV_Narrow
FV_Proportional
FP_NarrowRubiSpaceForOther
IntT
Allowable values are:
FV_Wide
FV_Narrow
FV_Proportional
FP_RubiAlignAtBoundaries
IntT
TRUE if rubi and oyamoji text
should be aligned at line
boundaries
FP_RubiOverhang
IntT
TRUE if rubi is allowed to overhang
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
FP_RubiSize
MetricT
Scaling factor for rubi text
expressed as percentage of the
current font size (metric 1% to
1000%). If this property and the
FP_RubiFixedSize property
both have values, the most recently
set property value is used.
FP_RubiFixedSize
MetricT
Fixed size for all rubi text (metric
2pts to 400pts). If this property and
the FP_RubiSize property both
have values, the most recently set
property value is used.
FP_WideRubiSpaceForKanji
IntT
Allowable values are:
FV_Wide
FV_Narrow
FV_Proportional
FP_WideRubiSpaceForOther
IntT
Allowable values are:
FV_Wide
FV_Narrow
FV_Proportional
FDK Programmer’s Reference 815
4
The DOCTYPE system identifier for the source XML document.
Documents
Document selection properties
FO_Doc objects have the following properties that specify the selected text or graphics
in a document.
Type
Meaning
FP_FirstSelected
GraphicInDoc†
F_ObjHandleT
First selected graphic object in the
document’s list of selected graphic
objects (FO_Graphic ID).
FP_Element
Selection
F_ElementRangeT
The currently selected element range in
the document. For information on
getting and setting the text selection or
insertion point in terms of elements, see
“How the API represents the element
selection in a structured FrameMaker
document” on page 81 of the FDK
Programmer’s Guide.
FP_SelectedTbl†
F_ObjHandleT
If any table cells are selected, the ID of
the table containing them
(FO_Tbl ID). For information on
getting and setting table selections, see
“Getting the IDs of selected tables and
table rows” on page 285 of the FDK
Programmer’s Guide.
FP_FirstSelected
TiInDoc†
F_ObjHandleT
First selected text inset in the list of
selected text insets in the document
(FO_TiApiClient, FO_TiText,
FO_TiTextTable, or FO_TiFlow
ID).
FP_TextSelection
F_TextRangeT
The currently selected text range or
insertion point in the document. For
information on getting and setting the
text selection or insertion point in a
document, see “Getting and setting the
insertion point or text selection” on
page 321 of the FDK Programmer’s
Guide.
Property
For information on how the API represents selected text and graphics, see “How the
API represents the selection in a document” on page 80 of the FDK Programmer’s
Guide. For information on getting and setting the structural element selection structured
documents, see “Getting and setting the structural element selection” on page 329 of the
FDK Programmer’s Guide.
816
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Document structure properties
FO_Doc objects have the following structure properties, which apply only to structured
documents.
Type
Meaning
FP_CustomElementList
F_StringsT
List of tags to display when
FP_ElementCatalogDisplay
is set to FV_ELCAT_CUSTOM.
FP_DefaultExclusions
F_StringsT
List of exclusions inherited when
document is included in a
structured book.
FP_DefaultInclusions
F_StringsT
List of inclusions inherited when
document is included in a
structured book.
FP_ElementBoundary
Display
IntT
Element boundary display options:
Property
FV_ELEM_DISP_NONE: don’t
display any element boundaries
FV_ELEM_DISP_BRACKETS:
display the bracketed boundaries
FV_ELEM_DISP_TAGS: display
the element tags
FP_ElementCatalog
F_Element
CatalogEntriesT
List of elements in Element
Catalog.
FP_ElementCatalog
Display
IntT
Catalog display options. Show tags
for:
FV_ELCAT_STRICT: valid
children for working start to finish
FV_ELCAT_LOOSE: valid children
for working in any order
FV_ELCAT_CHILDREN: children
allowed anywhere in parent
FV_ELCAT_ALL: all elements
FV_ELCAT_CUSTOM: the list of
tags specified by
FP_CustomElementList
FP_FirstElementDef
InDoc†
F_ObjHandleT
ID of first element definition in the
list of element definitions in the
document (FO_ElementDef ID).
FDK Programmer’s Reference 817
4
The DOCTYPE system identifier for the source XML document.
Documents
Type
Meaning
FP_FirstFmtChangeList
InDoc
F_ObjHandleT
ID of the first format change list in
the list of format change lists in the
document (FO_FmtChangeList
ID).
FP_MaxBottomMargin
MetricT
Maximum bottom margin allowed
in the document.
FP_MaxFirstIndent
MetricT
Maximum first indent allowed in
the document.
FP_MaxFontSize
MetricT
Maximum font size allowed in the
document.
FP_MaxLeading
MetricT
Maximum leading allowed in the
document.
FP_MaxLeftIndent
MetricT
Maximum left indent allowed in
the document.
FP_MaxLeftMargin
MetricT
Maximum left margin allowed in
the document.
FP_MaxRightIndent
MetricT
Maximum right indent allowed in
the document.
FP_MaxRightMargin
MetricT
Maximum right margin allowed in
the document.
FP_MaxSpaceAbove
MetricT
Maximum space above paragraph
allowed in the document.
FP_MaxSpaceBelow
MetricT
Maximum space below paragraph
allowed in the document.
FP_MaxSpread
MetricT
Obsolete property, but still
functional. See corresponding
"tracking" property below.
FP_MaxStretch
MetricT
Maximum character stretch (set
width) expressed as a percentave of
normal stretch for the font (metric
–10% to 1000%).
FP_MaxTabPosition
MetricT
Maximum tab position allowed in
the document.
FP_MaxTracking
MetricT
Maximum character tracking
expressed as a percentage of an em.
FP_MaxTopMargin
MetricT
Maximum top margin allowed in
the document.
Property
818
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_MinBottomMargin
MetricT
Minimum bottom margin allowed
in the document.
FP_MinFirstIndent
MetricT
Minimum first indent allowed in
the document.
FP_MinFontSize
MetricT
Minimum font size allowed in the
document.
FP_MinLeading
MetricT
Minimum leading allowed in the
document.
FP_MinLeftIndent
MetricT
Minimum left indent allowed in the
document.
FP_MinLeftMargin
MetricT
Minimum left margin allowed in
the document.
FP_MinRightIndent
MetricT
Minimum right indent allowed in
the document.
FP_MinRightMargin
MetricT
Minimum right margin allowed in
the document.
FP_MinSpaceAbove
MetricT
Minimum space above paragraph
allowed in the document.
FP_MinSpaceBelow
MetricT
Minimum space below paragraph
allowed in the document.
FP_MinSpread
MetricT
Obsolete property, but still
functional. See corresponding
"tracking" property below.
FP_MinStretch
MetricT
Minimum character stretch (set
width) expressed as a percentage of
normal stretch for the font (metric
–10% to 1000%).
FP_MinTabPosition
MetricT
Minimum tab position allowed in
the document.
FP_MinTracking
MetricT
Minimum character tracking
expressed as a percentage of an em.
FP_MinTopMargin
MetricT
Minimum top margin allowed in
the document.
Property
FDK Programmer’s Reference 819
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_NewElemAttrDisplay
Type
Meaning
IntT
Specifies attribute display
properties for new elements:
FV_ATTR_DISP_NONE: don’t
display attributes
FV_ATTR_DISP_REQSPEC:
display required and specified
attributes
FV_ATTR_DISP_ALL: display all
attributes
FP_NewElemAttrEditing
Specifies when the Edit Attributes
dialog box appears for new
elements:
IntT
FV_ATTR_EDIT_NONE
FV_ATTR_EDIT_REQUIRED
FV_ATTR_EDIT_ALWAYS
FP_SeparateInclusions
IntT
True if inclusions are listed
separately in the Element Catalog.
FP_SgmlApplication
StringT
Retained for backward
compatibility. Use
FP_StructuredApplication.
FP_UseInitial
Structure
IntT
True if FrameMaker inserts initial
structure for new elements.
Document table footnote properties
FO_Doc objects have the following properties that specify how table footnotes appear.
Property
FP_TblFnCellPosition
Type
Meaning
IntT
Placement of footnote number in footnote
text:
FV_FN_POS_SUPER: Superscript
FV_FN_POS_BASELINE: Baseline
FV_FN_POS_SUB: Subscript
820
FP_TblFnCellPrefix
StringT
Prefix to appear before table footnote number
in table cell
FP_TblFnCellSuffix
StringT
Suffix to appear after table footnote number in
table cell
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_TblFnCustNumString
StringT
Characters for custom table footnote numbers
FP_TblFnFmt
StringT
Paragraph tag of table footnote
FP_TblFnNumStyle
IntT
Footnote numbering style for tables in
document:
Property
FV_FN_NUM_NUMERIC: Arabic
FV_FN_NUM_ROMAN_UC: Roman uppercase
FV_FN_NUM_ROMAN_LC: Roman lowercase
FV_FN_NUM_ALPHA_UC: Alphabetic
uppercase
FV_FN_NUM_ALPHA_LC: Alphabetic
lowercase
FV_FN_NUM_KANJI: Kanji characters
FV_FN_NUM_ZENKAKU: Zenkaku
FV_FN_NUM_ZENKAKU_UC: Zenkaku
uppercase
FV_FN_NUM_ZENKAKU_LC: Zenkaku
lowercase
FV_FN_NUM_KANJI_KAZU: Kazu
FV_FN_NUM_DAIJI: Daiji
FV_FN_NUM_CUSTOM: Custom numbering
FP_TblFnPosition
IntT
Placement of footnote number in text:
FV_FN_POS_SUPER: Superscript
FV_FN_POS_BASELINE: Baseline
FV_FN_POS_SUB: Subscript
FP_TblFnPrefix
StringT
Prefix to appear before number in table
footnote
FP_TblFnSuffix
StringT
Suffix to appear after number in table footnote
FDK Programmer’s Reference 821
4
The DOCTYPE system identifier for the source XML document.
Documents
Document type-in properties
FO_Doc objects have the following type-in properties. These properties specify the text
characteristics at the insertion point.
Property
FP_Capitalization
Type
Meaning
IntT
Type of capitalization:
FV_CAPITAL_CASE_NORM
FV_CAPITAL_CASE_SMALL
FV_CAPITAL_CASE_LOWER
FV_CAPITAL_CASE_UPPER
822
FP_ChangeBar
IntT
True if Change Bars are enabled.
FP_CharTag
StringT
Name of character format tag.
FP_Color
F_ObjHandle
T
Spot color (FO_Color ID).
FP_CondFmtIsShown
IntT
True if condition is shown.
FP_CombinedFont
Family
F_ObjHandle
T
Combined font definition
(FO_CombinedFontDefn)
FP_FontEncoding
Name†
StringT
The font’s encoding
FP_FontAngle
IntT
Font angle (specifies an index into the array
of font angles provided by the session
property, FP_FontAngleNames).
FP_FontFamily
IntT
Font family (specifies an index into the
array of font families provided by the
session property,
FP_FontFamilyNames).
FP_FontPlatform
Name
StringT
Name that uniquely identifies a font on a
specific platform (for more information, see
“How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontPostScript
Name
StringT
Name given to a font when it is sent to a
PostScript printer (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontSize
MetricT
Font size (2 pt to 400 pt).
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_FontVariation
IntT
Font variation (specifies an index
into the array of font variations provided by
the session property
FP_FontVariationNames).
FP_FontWeight
IntT
Font weight (specifies an index into
the array of font weights provided by the
session property FP_FontWeightNames).
FP_InCond
F_IntsT
Condition tags that apply to the text (array
of FO_CondFmt IDs).
FP_KernX
MetricT
Horizontal kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%). A positive value moves
a character right and a negative value
moves a character left.
FP_KernY
MetricT
Vertical kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%). A positive value moves
characters up and a negative value moves
characters down.
FP_Overline
IntT
True if Overline style is enabled.
FP_PairKern
IntT
True if Pair Kern is enabled.
FP_Position
IntT
Text position relative to baseline of text:
Property
FV_POS_NORM: Normal
FV_POS_SUB: Subscript
FV_POS_SUPER: Superscript
FP_SepOverride
F_ObjHandle
T
Custom color separation override
(FO_Color ID).
FP_Spread
MetricT
Obsolete property, but still functional. See
corresponding "tracking" property below.
FP_Stretch
MetricT
Character stretch (set width) expressed as a
percentage of normal stretch for the font
(metric –10% to 1000%).
FP_Strikethrough
IntT
True if Strikethrough style is enabled.
FDK Programmer’s Reference 823
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_Style
Overrides†
Type
Meaning
IntT
Style condition indicators for conditional
text:
FV_CN_DOUBLE_UNDERLINE
FV_CN_NO_OVERRIDE
FV_CN_OVERLINE
FV_CN_SINGLE_UNDERLINE
FV_CN_STRIKETHROUGH
FP_Tracking
MetricT
Character tracking expressed as a
percentage of an em (metric –100% to
1000%).
FP_Underlining
IntT
Type of underlining:
FV_CB_NO_UNDERLINE
FV_CB_SINGLE_UNDERLINE
FV_CB_DOUBLE_UNDERLINE
FV_CB_NUMERIC_UNDERLINE
FP_UseSepOverride
IntT
True if FP_SepOverride overrides
default.
Document typographic properties
FO_Doc objects have the following typographic properties.
Type
Meaning
FP_LineBreakAfter
StringT
Characters at which it is permissible to break
lines
FP_SmallCapsSize
MetricT
Scaling factor for small caps expressed as
percentage of current font size
(metric 1% to 1000%)a
FP_SmallCapStretch
MetricT
Character stretch (set width) for small caps
expressed as a percentage of normal stretch for
the font (metric –10% to 1000%).
FP_SubScriptShift
MetricT
Baseline offset of subscripts expressed as
percentage of current font size
(metric 1% to 1000%)
Property
824
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_SubScriptSize
MetricT
Scaling factor for subscripts expressed as
percentage of current font size
(metric 1% to 1000%)
FP_SubScriptStretch
MetricT
Character stretch (set width) for subscripts
expressed as a percentage of normal stretch for
the font (metric –10% to 1000%).
FP_SuperScriptShift
MetricT
Baseline offset of superscripts expressed as
percentage of current font size (metric 1% to
1000%)
FP_SuperScriptSize
MetricT
Scaling factor for superscripts expressed as
percentage of the current font size (metric 1% to
1000%)
FP_SuperScriptStretc
h
MetricT
Character stretch (set width) for superscripts
expressed as a percentage of normal stretch for
the font (metric –10% to 1000%).
Property
a. In the API, most percentages are represented as MetricT fractions. For scaling factor and offset
percentages, the MetricT value 1<<16 or 0x10000 specifies 100% of the current font size. For more
information on MetricT values, see “MetricT values” on page 954.
Document view properties
FO_Doc objects have the following properties that specify how the document appears
in the application window. Document must be visible to modify view properties..
Type
Meaning
FP_CurrentPage
F_ObjHandleT
Current page (FO_BodyPage,
FO_MasterPage, FO_RefPage ID).
FP_IsIconified
IntT
True if the document window is
iconified.
FP_IsInFront
IntT
True if the document window is in front
of other windows in the FrameMaker
product session.
FP_IsOnScreen
IntT
True if document is visible on
the screen.
FP_Label
StringT
The title in the document window title bar.
FP_ScreenHeight
IntT
Height of the document window
in pixels.
Property
FDK Programmer’s Reference 825
4
The DOCTYPE system identifier for the source XML document.
Documents
Type
Meaning
FP_ScreenWidth
IntT
Width of the document window
in pixels.
FP_ScreenX
IntT
The offset of the document window in
pixels from the left side of the screen (or
the left of the FrameMaker product
application window on Windows).
Property
If you set a value that would result in the
document window being off the screen,
that value is ignored and the old value is
retained.
FP_ScreenY
IntT
The offset of the document window in
pixels from the top of the screen (or the top
of the FrameMaker product application
window on Windows).
If you set a value that would result in the
document window being off the screen,
that value is ignored and the old value is
retained.
826
FP_SnapAngle
MetricT
Angle of rotation for Snap Rotate.
FP_SnapGridUnits
MetricT
Units for Snap Grid Spacing
(0 to 32768 pt).
FP_SpotColorView
IntT
Spot color separation view (0 to 6).
0 specifies View 1, 1 specifies View 2,
and so on.
FP_ViewBorders
IntT
True if Borders is enabled.
FP_ViewDisplayUnits
MetricT
The MetricT equivalent of one unit in the
current Display Units. For example, if
Display Units is points, this returns
65536.
FP_ViewFontSize
Units
MetricT
The MetricT equivalent of one unit in the
current Font Size Unit. Font size units can
be either Points or Q. If Points, this returns
65536. If Q, this returns 47098
FP_ViewGrid
IntT
True if View Grid is enabled.
FP_ViewGridUnits
MetricT
Units for Grid Lines.
FP_ViewNoGraphics
IntT
True if Graphics is not enabled.
FDK Programmer’s Reference
Documents
Property
FP_ViewPage
Scrolling
Type
Meaning
IntT
Page scrolling:
...
The DOCTYPE system identifier for the source XML document.
FV_SCROLL_VARIABLE
FV_SCROLL_HORIZONTAL
FV_SCROLL_VERTICAL
FV_SCROLL_FACING
FP_ViewRulers
IntT
True if Rulers is enabled.
FP_ViewRulerUnits
MetricT
Units for rulers display.
FP_ViewTextSymbols
IntT
True if Text Symbols is enabled.
FP_Zoom
MetricT
Zoom percentage of document (metric
25% to 1600%).a
a. In the API, most percentages are represented as MetricT fractions. For zoom percentages, the MetricT
value 1<<16 or 0x10000 specifies 100%. For more information on MetricT values, see “MetricT
values” on page 954. For an example of setting the zoom percentage for a document, see
“F_ApiSetMetric()” on page 423.
Document View Only properties
FO_Doc objects have the following properties that apply to View Only documents.
Type
Meaning
FP_DocFluidFlow
F_ObjHandleT
The ID of a flow to set to fluid view. To
turn this off, set the value to 0.
FP_DocIsViewOnly
IntT
True if the document is a view-only
document
FP_ViewOnlyDeadCodes
F_UIntsT
F-codes that can’t be executed in the
document
FP_ViewOnlyMenuBar
F_ObjHandleT
If the document has a specific menu bar,
the ID of the menu bar for the document;
otherwise 0
Property
FDK Programmer’s Reference 827
4
The DOCTYPE system identifier for the source XML document.
Documents
Property
FP_ViewOnlySelect
Type
Meaning
IntT
Specifies whether user can select text or
graphics in the document:
FV_VOS_USER_ONLY: the user can
select text when pressing modifier keys,
and link targets (cross-reference sources
and newliniks) do not highlight
FV_VOS_NONE: the user can’t select
text, and links targets do not highlight
FV_VOS_YES: the user can select text
(using modifier keys) and link targets
are highlighted
FP_ViewOnlyWinBorders
IntT
True if the document has normal
document borders; False if the
document scroll bars and border buttons
are suppressed
FP_ViewOnlyWinMenubar
IntT
True if the document has a document
window menu bar
FP_ViewOnlyWinPalette
IntT
True if the document is a palette
FP_ViewOnlyWinPopup
IntT
True if the document window pop-up
menu is available
FP_ViewOnlyXRef
IntT
Specifies the behavior of crossreferences in the document:
FV_VOX_NOT_ACTIVE: crossreferences are not active
FV_VOX_GOTO_BEHAVIOR: internal
cross-references are active
FV_VOX_OPEN_BEHAVIOR: external
cross-references are active
FV_VOX_ALERT: alert appears when
cross-reference is clicked
828
FDK Programmer’s Reference
Documents
...
The DOCTYPE system identifier for the source XML document.
Document DITA properties
FO_Doc objects have the following DITA-related properties.
Type
Meaning
FP_FirstDITAConrefEle
mentInDoc
StringT
Gets the first Conref element in the
document
FP_DocIsViewOnly
StringT
FP_FirstDITALinkEleme
ntInDoc
StringT
Gets the first Conref element in the
document
FP_FirstDITATopicrefE
lementInDoc
StringT
Gets the first Topicref element in the
document
FP_FirstDITATopicsetr
efElementInDoc
StringT
Gets the first Topicsetref element in the
document
FP_FirstDITAXrefEleme
ntInDoc
StringT
Gets the first Xref element in the
document.
Property
Document Key Catalog properties
FO_Doc objects have the following Key Catalog properties.
Type
Meaning
FP_KeyCatalog
F_ObjHandleT
Key catalog being used for the
document based on the
KeyCatalogType setting.
FP_KeyCatalogType
IntT
Type of key catalog setting for the
document. Possible values are:
Property
FV_DocKeyCatalogTypeDefault
FV_DocKeyCatalogTypeSpecifi
ed
FV_DocKeyCatalogTypeNone
FP_SpecifiedKeyCatalog
F_ObjHandleT
Key catalog specified for using for the
document.
FDK Programmer’s Reference 829
4
The DOCTYPE system identifier for the source XML document.
Elements
Elements
See “Structural elements” on page 909.
Flows
The API uses an FO_Flow object to represent each flow in the document. For more
information on flows see the FDK Programmers Guide.
FO_Flow
FO_Flow objects have the following properties.
Type
Meaning
FP_FlowIsAutoConnect
IntT
True if Autoconnect is enabled.
FP_FlowIsFeathered
IntT
True if Feather is enabled.
FP_FlowIsPostScript
IntT
True if flow is PostScript code.
FP_FlowIsSynchronized
IntT
True if Baseline Synchronization is
enabled.
FP_FirstTextFrameIn
Flow†
F_ObjHandleT
First text frame in flow
(FO_TextFrame ID).
FP_LastTextFrameIn
Flow†
F_ObjHandleT
Last text frame in flow
(FO_TextFrame ID).
FP_MaxInterlinePadding
MetricT
Maximum interline spacing.
FP_MaxInterPgfPadding
MetricT
Maximum interparagraph spacing.
FP_MinHang
MetricT
Maximum character height for
synchronization of first line in column.
If characters exceed this height,
FrameMaker products don’t
synchronize the first line.
FP_Name
StringT
Name of flow tag.
FP_NextFlowInDoc†
F_ObjHandleT
Next flow in document
(FO_Flow ID).
FP_SideHeadRoomInFlow
IntT
True if Leave Room for Sideheads in
Flow is enabled.
Property
830
FDK Programmer’s Reference
Footnotes
Property
FP_Spacing
Type
Meaning
MetricT
Line spacing for synchronized
baselines.
Text
...
The DOCTYPE system identifier for the source XML document.
To get the text in a flow, call
F_ApiGetText() with objId set
to the flow ID. To add text to a flow,
call F_ApiAddText(). To delete text
from a flow, call
F_ApiDeleteText(). For more
information, see “F_ApiAddText()” on
page 80, “F_ApiDeleteText()” on
page 151, and “F_ApiGetText()” on
page 249.
Flow structure properties
FO_Flow objects have the following structure properties, which apply only to
structured flows in documents.
Property
FP_HighestLevel
Element†
Type
Meaning
F_ObjHandleT
Highest-level element in flow
(FO_Element ID)
Footnotes
The API uses an FO_Fn object to represent a footnote.
FO_Fn
FO_Fn objects have the following properties.
Type
Meaning
FP_ContentHeight†
MetricT
The distance between the top of the footnote
and the baseline of the last line in the
footnote
FP_Element†
F_ObjHandleT
If the footnote is in a Structured document,
the ID of the element containing the footnote
Property
FDK Programmer’s Reference 831
4
The DOCTYPE system identifier for the source XML document.
Format change lists
Type
Meaning
F_ObjHandleT
First paragraph in the footnote (FO_Pgf ID)
IntT
Footnote number
FP_InTextFrame†
F_ObjHandleT
Text frame containing the footnote
(FO_TextFrame ID)
FP_InTextObj†
F_ObjHandleT
Sub column that contains the footnote
(FO_SubCol)
FP_LastPgf†
F_ObjHandleT
Last paragraph in the footnote
(FO_Pgf ID)
FP_NextFnInDoc†
F_ObjHandleT
Next footnote (FO_Fn ID) in the document
FP_NextFn†
F_ObjHandleT
Next footnote in the text frame (FO_Fn ID)
FP_Overflowed†
IntT
True if the text in the footnote overflows
FP_PrevFn†
F_ObjHandleT
Previous footnote in the text frame (FO_Fn
ID)
FP_TextLoc†
F_TextLocT
Text location of the footnote symbol
FP_Unique†
IntT
Footnote’s UID
Property
FP_FirstPgf†
FP_FnNum
†
FO_Doc objects also have properties that specify how all the footnotes in the document
appear. For a list of these properties, see “Document footnote properties” on page 806.
Format change lists
The API uses FO_FmtChangeList objects to represent format change lists in a
Structured document.
FO_FmtChangeList
Unlike other objects, FO_FmtChangeList objects do not all have the same
properties. All FO_FmtChangeList objects have the properties listed in “Format
change list general properties,” next. However, each FO_FmtChangeList object can
have a different combination of the properties listed in the following sections. For more
information on change list properties and how to get and set them, see “Manipulating
format change list properties” on page 309 of the FDK Programmer’s Guide.
832
FDK Programmer’s Reference
Format change lists
...
The DOCTYPE system identifier for the source XML document.
Format change list general properties
All FO_FmtChangeList objects have the following general properties.
Type
Meaning
FP_BkColor
F_ObjHandleT
Text background color
FP_FmtChangeList
InCatalog
IntT
True if the format change list is in the
Format Change List Catalog. False if it is
in an element definition, as part of the text
format rules.
FP_Name
StringT
The name of the format change list if it is in
the Format Change List Catalog.
FP_NextFmtChange
ListInDoc
F_ObjHandleT
The ID of the next format change
list in the document (FO_FmtChangeList
ID).
FP_PgfCatalog
Reference
StringT
A paragraph format tag if the format change
list specifies one. If this property is set, you
can’t change any of the other format change
list properties, except FP_Name.
Property
Format change list advanced properties
FO_FmtChangeList objects can have the following advanced properties.
Type
Meaning
FP_AdjHyphens
IntT
Number of allowable adjacent hyphens
FP_BottomSeparator
StringT
Name of frame to put below paragraph
FP_BottomSepAt
Indent
IntT
True if the position of the frame specified by
FP_BottomSeparator is at the current left
indent
FP_Hyphenate
IntT
True if Automatic Hyphenation is enabled
FP_HyphMinPrefix
IntT
Minimum number of letters that must precede
hyphen
FP_HyphMinSuffix
IntT
Minimum number of letters that must follow a
hyphen
FP_HyphMinWord
IntT
Minimum length of a hyphenated word
FP_LetterSpace
IntT
True if Word Spacing is enabled
Property
FDK Programmer’s Reference 833
4
The DOCTYPE system identifier for the source XML document.
Format change lists
Type
Meaning
FP_MaxSpace
MetricT
Maximum word spacing (percentage of an
em space in current font)
FP_MinSpace
MetricT
Minimum word spacing (percentage of an
em space in current font)
FP_OptSpace
MetricT
Optimum word spacing
FP_TopSeparator
StringT
Name of frame to put above paragraph
FP_TopSepAtIndent
IntT
True if the position of the frame specified by
FP_TopSeparator is at the current left indent
Property
Format change list Asian character spacing properties
FO_FmtChangeList objects have the following Asian character spacing properties.
Type
Meaning
FP_MinJRomSpace
MetricT
Minimum Asian-Roman space
FP_OptJRomSpace
MetricT
Optimum Asian-Roman space
FP_MaxJRomSpace
MetricT
Maximum Asian-Roman space
FP_MinJLetSpace
MetricT
Minimum Asian letter space
FP_OptJLetSpace
MetricT
Optimum Asian letter space
FP_MaxJLetSpace
MetricT
Maximum Asian letter space
FP_YakumonoType
IntT
The Yakumono rules to handle punctuation characters;
can be one of
FV_FLOATING_YAKUMONO
FV_MONOSPACE_YAKUMONO
FV_FIXED_YAKUMONO
Property
834
FDK Programmer’s Reference
Format change lists
...
The DOCTYPE system identifier for the source XML document.
Format change list autonumber properties
FO_FmtChangeList objects can have the following autonumber properties.
Type
Meaning
FP_AutoNumChar
StringT
Character format for the automatic numbering
string specified by FP_AutoNumString; ""
if the default character format is used
FP_AutoNumString
StringT
Autonumber format string (for example,
.)
FP_NumAtEnd
IntT
True if numbering position is End of
Paragraph; False if it is Beginning of
Paragraph
FP_PgfIsAutoNum
IntT
True if autonumbering is enabled
Property
Format change list basic properties
FO_FmtChangeList objects can have the following basic properties.
Type
Meaning
FP_FirstIndent
MetricT
The paragraph’s first-line left margin,
measured from the left side of the current
text column
(0 cm to 100 cm ).
FP_FirstIndentChange
MetricT
Amount by which to increase or decrease
the first-line left margin.
FP_FirstIndentIs
Relative
IntT
True if the first indent is relative to the
left indent.
FP_FirstIndentRelPos
MetricT
Position relative to left indent
if FP_FirstIndentIsRelative
is True.
FP_Leading
MetricT
Space below each line in the paragraph.
FP_LeadingChange
MetricT
Amount by which to increase or decrease
the leading.
FP_LeftIndent
MetricT
The paragraph’s left margin, measured
from the left side of the current text
column (0 cm to 100 cm).
Property
FDK Programmer’s Reference 835
4
The DOCTYPE system identifier for the source XML document.
Format change lists
Type
Meaning
FP_LeftIndentChange
MetricT
Amount by which to increase or decrease
the left margin.
FP_LineSpacingFixed
IntT
True if the line spacing is fixed.
FP_MoveTabs
MetricT
Amount by which to move all tab positions
in the paragraph.
FP_NumTabs
IntT
The number of tabs in the paragraph. To
clear all the tabs
in the paragraph, set FP_NumTabs
to 0.
FP_PgfAlignment
IntT
Horizontal alignment of the paragraph:
Property
FV_PGF_LEFT
FV_PGF_RIGHT
FV_PGF_CENTER
FV_PGF_JUSTIFIED
836
FP_RightIndent
MetricT
The paragraph’s right margin, measured
from the right side of the current text
column.
FP_RightIndentChange
MetricT
Amount by which to increase or decrease
the right margin.
FP_SpaceAbove
MetricT
The space above the paragraph.
FP_SpaceAboveChange
MetricT
Amount by which to increase or decrease
the space above.
FP_SpaceBelow
MetricT
The space below the paragraph.
FP_SpaceBelowChange
MetricT
Amount by which to increase or decrease
the space below.
FP_Tabs
F_TabsT
An array of tab descriptions that specify
the positions and types of tab stops in the
paragraph. For an example of how to get
and set tabs in a paragraph, see
“F_ApiSetTabs()” on page 441.
FDK Programmer’s Reference
Format change lists
...
The DOCTYPE system identifier for the source XML document.
Format change list font properties
FO_FmtChangeList objects can have the following font properties.
Property
FP_Capitalization
Type
Meaning
IntT
Type of capitalization to use:
FV_CAPITAL_CASE_NORM
FV_CAPITAL_CASE_SMALL
FV_CAPITAL_CASE_LOWER
FV_CAPITAL_CASE_UPPER
FP_ChangeBar
IntT
True if Change Bars are on.
FP_Color
F_ObjHandle
T
Spot color (FO_Color ID).
FP_CombinedFontFamil
y
F_ObjHandle
T
Combined font definition
(FO_CombinedFontDefn)
FP_FontAngle
IntT
Font angle (specifies an index
into the array of font angles
provided by the session property
FP_FontAngleNames).
FP_FontFamily
IntT
Font family (specifies an index
into the array of font families provided by
the session property
FP_FontFamilyNames).
FDK Programmer’s Reference 837
4
The DOCTYPE system identifier for the source XML document.
Format change lists
Property
FP_Language
Type
Meaning
IntT
Hyphenation and spell-checking language
to use:a
FV_LANG_BRAZILIAN
FV_LANG_BRITISH
FV_LANG_CANADIAN_FRENCH
FV_LANG_CATALAN
FV_LANG_DANISH
FV_LANG_DUTCH
FV_LANG_ENGLISH
FV_LANG_FINNISH
FV_LANG_FRENCH
FV_LANG_GERMAN
FV_LANG_ITALIAN
FV_LANG_NOLANGUAGE
FV_LANG_NORWEGIAN
FV_LANG_NYNORSK
FV_LANG_PORTUGUESE
FV_LANG_SPANISH
FV_LANG_SWEDISH
FV_LANG_SWISS_GERMAN
FV_LANG_JAPANESE
FV_LANG_TRADITIONAL_CHINESE
FV_LANG_SIMPLIFIED_CHINESE
FV_LANG_KOREAN
838
FP_FontSize
MetricT
Font size (2 pt to 400 pt).
FP_FontSizeChange
MetricT
Amount by which to increase or decrease
the font size.
FP_FontVariation
IntT
Font variation (specifies an index into the
array of font variations provided by the
session property
FP_FontVariationNames).
FP_FontWeight
IntT
Font weight (specifies an index
into the array of font weights provided by
the session property
FP_FontWeightNames).
FDK Programmer’s Reference
Format change lists
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_KernX
MetricT
Horizontal kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%).b A positive value moves
a character right and a negative value
moves a character left.
FP_KernY
MetricT
Vertical kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%). A positive value moves
characters up and a negative value moves
characters down.
FP_Overline
IntT
True if Overline is enabled.
FP_PairKern
IntT
True if Pair Kern is enabled.
FP_Position
IntT
Specifies position relative to baseline of
text:
Property
FV_POS_NORM: Normal
FV_POS_SUB: Subscript
FV_POS_SUPER: Superscript
FP_Spread
MetricT
Obsolete property, but still functional. See
corresponding "tracking" property below.
FP_SpreadChange
MetricT
Obsolete property, but still functional. See
corresponding "tracking" property below.
FP_Stretch
MetricT
Character stretch (set width) expressed as a
percentage of normal stretch for the font
(metric –10% to 1000%).
FP_StretchChange
MetricT
Amount expressed as a percentage (metric
–10% to 1000%) by which to increase or
decrease the character stretch.
FP_Strikethrough
IntT
True if Strikethrough is enabled.
FP_Tracking
MetricT
Character tracking expressed as a
percentage of an em (metric –100% to
1000%).
FDK Programmer’s Reference 839
4
The DOCTYPE system identifier for the source XML document.
Format change lists
Type
Meaning
FP_TrackingChange
MetricT
Amount by which to increase or decrease
the character tracking.
FP_Underlining
IntT
Type of underlining:
Property
FV_CB_NO_UNDERLINE
FV_CB_SINGLE_UNDERLINE
FV_CB_DOUBLE_UNDERLINE
FV_CB_NUMERIC_UNDERLINE
a. The FDE provides a function that returns the language string associated with each of the language constants.
For more information, see “F_LanguageString()” on page 576.
b. In the API, most percentages are represented as MetricT fractions. For spread percentages, the MetricT
value 1<<16 or 0x10000 specifies 100% or 1. For more information on MetricT values, see
“MetricT values” on page 954.
Format change list pagination properties
FO_FmtChangeList objects can have the following pagination properties.
Type
Meaning
FP_BlockLines
IntT
The number of Widow/Orphan lines
FP_KeepWithNext
IntT
True if Keep With Next Paragraph is enabled
FP_KeepWithPrev
IntT
True if Keep With Previous Paragraph is
enabled
FP_Placement
IntT
Paragraph placement:
Property
FV_PGF_SIDEBODY
FV_PGF_SIDEHEAD_TOP
FV_PGF_SIDEHEAD_FIRST_BASELINE
FV_PGF_SIDEHEAD_LAST_BASELINE
FV_PGF_RUN_IN
FV_PGF_STRADDLE
FV_PGF_STRADDLE_NORMAL_ONLY
840
FDK Programmer’s Reference
Format change lists
Type
Meaning
FP_RunInSeparator
StringT
String for Run-In Head Default Punctuation
FP_Start
IntT
Vertical placement of paragraph:
Property
...
The DOCTYPE system identifier for the source XML document.
FV_PGF_ANYWHERE
FV_PGF_TOP_OF_COL
FV_PGF_TOP_OF_PAGE
FV_PGF_TOP_OF_LEFT_PAGE
FV_PGF_TOP_OF_RIGHT_PAGE
Format change list table cell properties
FO_FmtChangeList objects can have the following table cell properties.
Type
Meaning
FP_CellBottomMargin
MetricT
Amount added to default bottom margin of
table cell
FP_CellBottomMargin
Change
MetricT
Amount by which to increase or decrease the
cell bottom margin
FP_CellBottomMargin
Fixed
IntT
True if the cell bottom margin is fixed
FP_CellLeftMargin
MetricT
Amount added to default left margin of table
cell
FP_CellLeftMargin
Change
MetricT
Amount by which to increase or decrease the
cell left margin
FP_CellLeftMargin
Fixed
IntT
True if the cell left margin is fixed
FP_CellRightMargin
MetricT
Amount added to default right margin of table
cell
FP_CellRightMargin
Change
MetricT
Amount by which to increase or decrease the
cell right margin
FP_CellRightMargin
Fixed
IntT
True if the cell right margin is fixed
FP_CellTopMargin
MetricT
Amount added to default top margin of table
cell
Property
FDK Programmer’s Reference 841
4
The DOCTYPE system identifier for the source XML document.
Format rules
Type
Meaning
FP_CellTopMargin
Change
MetricT
Amount by which to increase or decrease the
cell top margin
FP_CellTopMarginFixed
IntT
True if the cell top margin is fixed
FP_CellVAlignment
IntT
Vertical alignment of a paragraph when it is the
first one in a cell:
Property
FV_PGF_V_ALIGN_TOP
FV_PGF_V_ALIGN_MIDDLE
FV_PGF_V_ALIGN_BOTTOM
Format rules
The API uses FO_FmtRule objects to represent format rules in a Structured
document. It uses an FO_FmtRuleClause object to represent each rule clause in a
format rule.
FO_FmtRule
FO_FmtRule objects have the following properties.
Type
Meaning
FP_CountElements
F_StringsT
If the format rule is a level rule, the list
of element tags to count among the
element’s ancestors; the tags are
specified by the Count ancestors
named element of the format rule.
FP_ElementDef
F_ObjHandleT
If the format rule is not
nested, the ID of the element definition
that contains it (FO_ElementDef
ID).
FP_FmtRuleClause
F_ObjHandleT
If the format rule is nested,
the ID of the format rule
clause that contains it
(FO_FmtRuleClause ID).
FP_FmtRuleClauses†
F_IntsT
IDs of the format rule’s format rule
clause objects (FO_FmtRuleClause
IDs).
Property
842
FDK Programmer’s Reference
Format rules
Property
FP_FmtRuleType
Type
Meaning
IntT
The format rule’s type:
...
The DOCTYPE system identifier for the source XML document.
FV_CONTEXT_RULE
FV_LEVEL_RULE
FP_StopCountingAt
StringT
If the format rule is a level rule, the tag
of the element at which to stop
counting elements (the tag specified by
the Stop counting at first ancestor
named element.
FO_FmtRuleClause
FO_FmtRuleClause objects have the following properties.
Property
FP_ContextLabel
Type
Meaning
StringT
The context label for generated files.
It cannot contain white-space
characters or any of these special
characters:
( ) & | , * + ? < > % [
] = ! ; : { } "
When a user displays the Set Up
dialog box to set up a generated file,
the label appears next to elements to
which the rule clause applies.
FP_ElemPrefixSuffix
StringT
The text of the prefix or suffix.
FP_ElemPrefixSuffix specifies
NULL if there is no prefix or suffix.
FP_FmtChangeList†
F_ObjHandleT
If the format rule clause specifies a
format change list
(FP_RuleClauseType specifies
FV_RC_CHANGELIST), the ID of
the format change list
(FO_FmtChangeList ID).
To change the FP_FmtChangeList
property, use
F_ApiNewFmtRuleObject().
FDK Programmer’s Reference 843
4
The DOCTYPE system identifier for the source XML document.
Format rules
Type
Meaning
FP_FmtChangeListTag
StringT
If the format rule clause specifies a
change list (FP_RuleClauseType
specifies
FV_RC_CHANGELIST_TAG) , the
change list’s tag.
FP_FmtRule†
F_ObjHandleT
The ID of the format rule containing
the format rule clause (FO_FmtRule
ID).
FP_FormatTag
StringT
The format tag if the format
rule clause specifies one
(FP_RuleClauseType
specifies FV_RC_TAG). If
FP_IsTextRange is True,
FP_FormatTag specifies
a character format tag; otherwise it
specifies a paragraph tag, table tag,
marker type, cross-reference format,
or equation size.
FP_IsTextRange
IntT
True if the container element is
formatted as a text range instead of a
paragraph.
FP_RuleClauseType†
IntT
The type of rule clause:
Property
FV_RC_TAG
FV_RC_CHANGELIST_TAG
FV_RC_CHANGELIST
FV_RC_SUB_FMTRULE
FP_Specification
StringT
The format clause’s context or level
specification.
FP_SubFmtRule†
F_ObjHandleT
If the format rule clause contains a
nested format
rule (FP_RuleClauseType
specifies FV_RC_SUB_FMTRULE),
the format rule’s ID (FO_FmtRule
ID).
To change the FP_SubFmtRule
property, use
F_ApiNewFmtRuleObject().
844
FDK Programmer’s Reference
Frames
...
The DOCTYPE system identifier for the source XML document.
Frames
Frames are a type of graphics. For information on anchored frames, see “FO_AFrame”
on page 849. For information on unanchored frames, see “FO_UnanchoredFrame” on
page 867.
Graphics
Each type of API graphic object (such as FO_TextFrame or FO_Rectangle) has a
set of properties common to all graphic objects and a set of properties that are specific
to it.
FDK Programmer’s Reference 845
4
The DOCTYPE system identifier for the source XML document.
Graphics
Common graphics properties
All API graphic objects, except FO_AFrame objects, have the following properties.
FO_AFrame objects have all the following properties except those marked with a ■
symbol.
Type
Meaning
FP_Angle
MetricT
Angle of the object’s rotation.
FP_ArrowBaseAngle
IntT
Arrowhead base angle in degrees.
FP_ArrowLength
MetricT
Arrowhead length (always rounded down
to the nearest 1/256 point).
FP_ArrowScaleFactor
MetricT
Factor by which arrowhead is scaled as
line width changes (always rounded down
to nearest 1/16 point). It is not used if
FP_ArrowScaleHead is False.
FP_ArrowScaleHead
IntT
True if arrowhead is scaled as the line
width changes.
FP_ArrowTipAngle
IntT
Arrowhead tip angle in degrees.
FP_ArrowType
IntT
Arrowhead style:
Property
FV_ARROW_STICK
FV_ARROW_HOLLOW
FV_ARROW_FILLED
FP_BorderWidth
MetricT
Border width (0.015 pt to 360 pt).
FP_Color
F_ObjHandleT
The spot color (FO_Color ID).
FP_Dash
F_MetricsT
Dash style (see the description below).
FP_Fill
IntT
The fill pattern (numbers between 0 and
15; see Figure 3-2 on page 848). The FDK
provides constants for several fill patterns:
FV_FILL_BLACK
FV_FILL_WHITE
FV_FILL_CLEAR
846
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_FrameParent
F_ObjHandleT
Frame containing the graphic
object (FO_AFrame or
FO_UnanchoredFrame ID).
FP_GraphicCantBe
Selected
IntT
True if the graphic object can’t be
selected.
FP_GraphicIs
Selected
IntT
True if the graphic object is selected.
■
F_ObjHandleT
Group that the object is in
(FO_Group ID). Anchored and
unanchored frames do not have this
property.
FP_HeadArrow
IntT
Arrowhead at end of line (True if line has
arrowhead).
FP_Height
MetricT
Height of object (0.125 pt to 3600 pt).
FP_HotspotCmdStr
StringT
The command string for a hotspot. This
must be a valid hypertext command string.
FP_HotspotTitle
StringT
The tooltip text for the hotspot in the
outputs that support it (for example
HTML). This property is optional.
FP_IsHotspot
BoolT
Whether the object is a hotspot or not. If
this property is turned off, the object is no
longer a hotspot even if command string is
non-empty.
FP_LineCap
IntT
Type of line end:
Property
FP_GroupParent
FV_CAP_BUTT
FV_CAP_ROUND
FV_CAP_SQUARE
FP_LocX
MetricT
Distance from the left side of the parent
frame (–216 inches to 216 inches).
If the graphic object is an anchored frame,
the distance is calculated from the left side
of the page frame. You can’t set FP_LocX
for anchored frames.
FDK Programmer’s Reference 847
4
The DOCTYPE system identifier for the source XML document.
Graphics
Property
FP_LocY
Type
Meaning
MetricT
Distance from the top of the parent frame
(–216 inches to 216 inches).
If the graphic object is an anchored frame,
the distance is calculated from the top of
the page frame. You can’t set FP_LocY
for anchored frames.
FP_NextGraphic
InDoc†
F_ObjHandleT
Next graphic object in the document.
■
FP_NextGraphic
InFrame
F_ObjHandleT
Next graphic object in the frame.
■
FP_NextGraphic
InGroup†
F_ObjHandleT
Next graphic object in the group.
FP_NextSelected
GraphicInDoc†
F_ObjHandleT
Next selected graphic object in document.
FP_Overprint
IntT
Specifies the overprint settings for the
object
FV_OVERPRINT
FV_KNOCKOUT
FV_FROMCOLOR
FP_Pen
IntT
The pen pattern (numbers between 0 and
15; see Figure 3-2 on page 848). The FDK
provides constants for several pen patterns:
FV_FILL_BLACK
FV_FILL_WHITE
FV_FILL_CLEAR
■
FP_PrevGraphic
InFrame
F_ObjHandleT
Previous graphic object in the frame.
■
FP_PrevGraphic
InGroup†
F_ObjHandleT
Previous graphic object in the group.
■
IntT
Specifies whether text can flow around the
object and, if so, whether the text follows
the contour of the object or a box shape
surrounding the object
FP_Runaround
FV_TR_NONE
FV_TR_CONTOUR
FV_TR_BBOX
848
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
MetricT
If the object is a runaround object, the
width of the runaround gap.
FP_TailArrow
IntT
Arrowhead at beginning of line (True if
enabled).
FP_TintPercent
MetricT
The tint percentage
IntT
The graphic object’s UID.
MetricT
Width of object (0.125 pt to 3600 pt).
Property
■
FP_RunaroundGap
FP_Unique
†
FP_Width
FV_FILL_BLACK (0)
2
3
5
6
8
9
11
12
14
FV_FILL_WHITE (7)
FV_FILL_CLEAR (15)
Figure 3-2 Pen and fill patterns
The FP_Dash property specifies a dash pattern that is repeated for the length of an
object’s border. The pattern is stored in an F_MetricsT structure. The 0th element of
the F_MetricsT.F_MetricsT_val array stores the length of the first dash; the 1st
element stores the following space; the 2nd element stores the next dash; and so on for
an even number of elements. For an example of how to set a dashed line for an object,
see “F_ApiSetMetrics()” on page 426.
FDK Programmer’s Reference 849
4
The DOCTYPE system identifier for the source XML document.
Graphics
FO_AFrame
An FO_AFrame object represents an anchored frame. FO_AFrame objects have the
following properties.
Property
Type
Common graphic object properties
Meaning
See page 845
FP_AFrameIsCropped
IntT
True if Cropped is enabled
FP_AFrameIsFloating
IntT
True if Floating is enabled
FP_Alignment
IntT
Type of alignment:
FV_ALIGN_CENTER
FV_ALIGN_INSIDE
FV_ALIGN_OUTSIDE
FV_ALIGN_LEFT
FV_ALIGN_RIGHT
FP_AnchorType
IntT
Where frame is anchored:
FV_ANCHOR_BELOW
FV_ANCHOR_BOTTOM
FV_ANCHOR_INLINE
FV_ANCHOR_RUN_INTO_
PARAGRAPH
FV_ANCHOR_SUBCOL_
FARTHEST
FV_ANCHOR_SUBCOL_INSIDE
FV_ANCHOR_SUBCOL_LEFT
FV_ANCHOR_SUBCOL_NEAREST
FV_ANCHOR_SUBCOL_OUTSIDE
FV_ANCHOR_SUBCOL_RIGHT
FV_ANCHOR_TEXTFRAME_
FARTHEST
FV_ANCHOR_TEXTFRAME_
INSIDE
FV_ANCHOR_TEXTFRAME_LEFT
FV_ANCHOR_TEXTFRAME_
NEAREST
FV_ANCHOR_TEXTFRAME_
OUTSIDE
FV_ANCHOR_TEXTFRAME_
RIGHT
FV_ANCHOR_TOP
FP_BaselineOffset
850
FDK Programmer’s Reference
MetricT
Baseline offset
Graphics
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
F_ObjHandleT
If the anchored frame is in a
structured flow in a document, the ID
of the element containing the
anchored frame
F_ObjHandleT
First object in frame
F_ObjHandleT
Text frame in which
anchored frame appears
(FO_TextFrame ID)
FP_InTextObj†
F_ObjHandleT
Column or text frame in
which anchored frame
appears (FO_SubCol or
FO_TextFrame ID)
FP_LastGraphicInFrame†
F_ObjHandleT
Last object in frame
FP_NextAFrame†
F_ObjHandleT
Next anchored frame in text frame
(FO_AFrame ID)
FP_PrevAFrame†
F_ObjHandleT
Previous anchored frame in text
frame (FO_AFrame ID)
FP_SideOffset
MetricT
Near side offset
FP_TextLoc†
F_TextLocT
Text location of the anchor symbol
Property
FP_Element†
FP_FirstGraphicInFrame†
FP_InTextFrame
†
For different anchored frame types (FP_AnchorType), certain properties of the
FO_AFrame object mus have specific values. For example, if the FP_AnchorType is
FV_ANCHOR_RUN_INTO_PARAGRAPH, the FP_SideOffset must be 0. The
following table lists the constraints on properties for different anchored frame types:
FP_AnchorType
Property constraints
FV_ANCHOR_INLINE
FP_SideOffset = 0
FV_ANCHOR_TOP
FP_SideOffset = 0
FV_ANCHOR_BELOW
FP_BaselineOffset = 0
FV_ANCHOR_BOTTOM
FDK Programmer’s Reference 851
4
The DOCTYPE system identifier for the source XML document.
Graphics
Property constraints
FP_AnchorType
FV_ANCHOR_RUN_INTO_PARAGRAPH
FP_SideOffset = 0
FP_BaselineOffset = 0
FP_AFrameIsFloating = 0
FP_AFrameIsCropped = 0
FV_ANCHOR_SUBCOL_FARTHEST
FP_AFrameIsFloating = 0
FV_ANCHOR_SUBCOL_INSIDE
FP_AFrameIsCropped = 0
FV_ANCHOR_SUBCOL_LEFT
FV_ANCHOR_SUBCOL_NEAREST
FV_ANCHOR_SUBCOL_OUTSIDE
FV_ANCHOR_SUBCOL_RIGHT
FV_ANCHOR_TEXTFRAME_FARTHEST
FV_ANCHOR_TEXTFRAME_INSIDE
FV_ANCHOR_TEXTFRAME_LEFT
FV_ANCHOR_TEXTFRAME_NEAREST
FV_ANCHOR_TEXTFRAME_OUTSIDE
FV_ANCHOR_TEXTFRAME_RIGHT
FO_Arc
An FO_Arc object represents an arc. FO_Arc objects have the following properties.
Property
Type
Common graphic object properties
852
Meaning
See page 845
FP_DTheta
MetricT
Arc angle length (–360 degree to
360 degree)
FP_Theta
MetricT
Start angle (0 degree to 360 degree)
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
FO_Ellipse
An FO_Ellipse object represents an ellipse. FO_Ellipse objects have the
following properties.
Type
Property
Common graphic object properties
FP_RectangleIsSmoothed
†
Meaning
See page 845.
IntT
True if smoothing is enabled. This
property is always True for
FO_Ellipse objects.
FO_Group
An FO_Group object represents a set of grouped objects. FO_Group objects have
the following properties.
Type
Property
Common graphic object properties
Meaning
See page 845
FP_FirstGraphicInGroup†
F_ObjHandleT
First object in the group
FP_LastGraphicInGroup†
F_ObjHandleT
Last object in the group
FO_Inset
An FO_Inset object represents an imported graphic. FO_Inset objects have the
following properties.
Property
Type
Meaning
Common graphic object
properties
See page 845.
Facets
Graphic insets have one or more named
properties, called facets. For more information,
see “Graphic inset properties” on page 489 of the
FDK Programmer’s Guide.
FDK Programmer’s Reference 853
4
The DOCTYPE system identifier for the source XML document.
Graphics
Type
Meaning
FP_InsetDpi
IntT
Scaling information for bitmap file (corresponds
to the value specified in the Image File Scaling
Options dialog box when the graphics file is
imported).
FP_ImportHint
StringT
Record identifying the filter used to import the
graphic. The FrameMaker product uses this
record to find the filter to use when updating the
inset. For a complete description of the syntax of
this string, see “Syntax of FP_ImportHint
strings” on page 855.
FP_InsetEditor
StringT
Name of application to call to edit inset or
imported object.
FP_InsetFile
StringT
Platform-specific pathname if the inset is an
external inset, or a null string (" ") if it is internal.
The pathname can be document-relative.
Property
Using F_ApiGetPropVal() or
F_ApiGetSring() for FP_InsetFile
property for an object returns the disk path for
non-HTTP objects and the URL string for HTTP
objects. Similarly, using APIs
F_ApiSetPropVal() and
F_ApiSetSring() will set the original path of
the object whether the string is the disk path or a
URL.
854
FP_InsetGfxActiveIn
Pdf
BoolT
If this property is set, on publishing a document
to PDF, the inset object that has facets FLV, U3D,
or SWF will be activated as soon as the page
containing the graphic object is visible. In PDF
the graphic objects are called annotation.
FP_InsetGfxName
StringT
Assigns a name to a graphic object. It will work
only in case of inset objects that have an FLV,
U3D or SWF facet. The name of the graphic
should not contain any special characters or
spaces.
FP_InsetGfxPlayWind
owInPdf
BoolT
If this property is set, on publishing a document
to PDF, the inset object that has facets FLV, U3D,
or SWF will be activated in a new window in a
PDF file. In PDF, the graphic objects are called
annotation.
FP_INSETinfo
StringT
Record used to provide general informationa
associated with the inset.
FP_InsetIsFixedSize
IntT
True if scaling of bitmap file is inhibited.
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_InsetIsFlipped
Sideways
IntT
True if inset is flipped about the vertical axis.
FP_InsetJavaScriptA
ttached
BoolT
Denotes whether or not Javascript is attached
with the graphic object that has a U3D facet.
FP_InsetJavaScriptF
ile
StringT
Attaches the given Javascript file to the graphic
object that has a U3D facet. If the value of the file
path is null, the Javascript attached to the inset is
removed.
FP_InsetMonikerFile
Path†
StringT
Provides the file path of the moniker of an inset
object that has an OLE2 facet.
FP_InsetMonikerPath
StringT
Provides the path of the moniker of an inset
object that has an OLE2 facet.
FP_InsetPosterFile
IntT
This is used to get and set the path of the poster
applied on a graphic object. If the graphic is
import by copy, the value is NULL.
Property
†
FP_InsetSaveFacetTo
File
Saves the given facet of an inset to a given file.
This is set-only property and no get operations
are possible.
The input to the API call contains docid,
objId, property name and list of strings. In the
list of strings the, first strings is the facet name
and the second string is the filename where the
facet is to be saved.
Sample usage:
F_StringsT fileArgList;
fileArgList.val =
(StringT*)F_Alloc((2) *
sizeof(StringT), DSE);
fileArgList.val[0] =
F_StrCopyString("JS");
fileArgList.val[1] =
F_StrCopyString(afrmObjp
->jsFileName);
fileArgList.len = 2;
F_ApiSetStrings( docId, insetid,
FP_InsetSaveFacetToFile,
&fileArgList );
FDK Programmer’s Reference 855
4
The DOCTYPE system identifier for the source XML document.
Graphics
Type
Meaning
FP_InsetU3dAnimatio
nList†
StringT
Provides the list of "animations" defined on the
U3D facet of an inset object.
FP_InsetU3dPartList
StringT
Provides the list of "parts" defined in the U3D
facet of an inset object.
FP_InsetU3dViewList
StringT
Retrieves the list of "views" defined in the U3D
facet of an inset object.
FP_InsetUpdater
StringT
Not currently implemented.
FP_InsetURL
StringT
Returns the URL of the inset.
Property
†
†
Using F_ApiGetPropVal() or
F_ApiGetSring() for FP_InsetURL
property for an object returns the disk path for
non-HTTP objects and the URL string for HTTP
objects. Similarly, using APIs
F_ApiSetPropVal() and
F_ApiSetSring() for will set the original path
of the object whether the string is the disk path or
a URL.
FP_No3DInPDF
IntT
If True, then U3D files are not embedded in the
PDF and ony the poster is embedded in the PDF
file created from the FrameMaker file.
FP_NoFlashInPDF
IntT
If True, then Adobe Flash files are not embedded
in the PDF and ony the poster is embedded in the
PDF file created from the FrameMaker file.
Syntax of FP_ImportHint strings
The FP_ImportHint property of an FO_Inset object specifies a record that
identifies the filter used to import a graphic. FrameMaker products use this record to
find the correct filter to reimport the graphic when the document is reopened or the inset
is manually updated.
The FP_ImportHint property does not apply to graphics imported by copy.
FrameMaker products use the facet name stored with the graphic to identify the filter
that filtered a graphic imported by copy.
The syntax of the record specified by the FP_ImportHint property is:
record_vers vendor format_id platform filter_vers filter_name
Note that the fields in the record are not separated by spaces. For example:
0001PGRFPICTMAC61.0 Built-in PICT reader
856
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
..............................................................................
IMPORTANT: If you are setting an FP_ImportHint property, the string you are
using should be terminated with NULL. The string itself must not contain NULL or
undisplayable characters.
..............................................................................
Each field of the record (except filter_name ) specifies a four-byte code. If a code
contains fewer than four alphanumeric characters, the remaining bytes must be filled out
with spaces.
The rest of this section describes each field in the record.
record_vers specifies the version of the record, currently 0001.
vendor is a code specifying the filter’s vendor. The code is a string of four characters.
The following table lists the possible codes.
Code
Meaning
PGRF
Built-in Frame filters
FAPI
External Frame FDK client filter
FFLT
External Frame filters
IMAG
External ImageMark filters
XTND
External XTND filters
This is not a comprehensive list of codes. Codes may be added to this list by Frame or
by developers at your site.
format_id is a code specifying the format that the filter translates. The code is a
string of four characters. The following table lists some of the possible codes.
Code
Meaning
CDR
CorelDRAW
CGM
Computer Graphics Metafile
DIB
Device-independent bitmap (Windows)
DRW
Micrografx CAD
DXF
Autodesk Drawing eXchange file (CAD files)
EMF
Enhanced Metafile (Windows)
FDK Programmer’s Reference 857
4
The DOCTYPE system identifier for the source XML document.
Graphics
Code
858
Meaning
EPSB
Encapsulated PostScript Binary (Windows)
EPSD
Encapsulated PostScript with
Desktop Control Separations (DCS)
EPSF
Encapsulated PostScript (Macintosh)
EPSI
Encapsulated PostScript Interchange
FRMI
FrameImage
FRMV
FrameVector
G4IM
CCITT Group 4 to Image
GEM
GEM file (Windows)
GIF
Graphics Interchange Format (Compuserve)
HPGL
Hewlett-Packard Graphics Language
IGES
Initial Graphics Exchange Specification (CAD files)
IMG4
Image to CCITT Group 4 (UNIX)
MooV
QuickTime Movie
OLE
Object Linking and Embedding Client (Microsoft)
PCX
PC Paintbrush
PICT
QuickDraw PICT
PNTG
MacPaint
SNRF
Sun Raster File
SRGB
SGI RGB
TIFF
Tag Image File Format
WMF
Windows Metafile
WPG
WordPerfect Graphics
XWD
X Windows System Window Dump file
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
platform is a code specifying the platform on which the filter was run.
The code is a string of four characters. The following table lists the possible codes.
Code
Meaning
WINT
Windows NT
WIN3
Windows 3.1
WIN4
Windows 95
filter_vers is a string of four characters identifying the version of the filter on that
platform. For example, version 1.0 of a filter is represented by the string 1.0.
filter_name is a text string (up to 31 characters long) that describes the filter.
FO_Iterator
FO_Iteratgor represents an Iterator object. This allows the user to iterate through the
components of the DITAMap or FrameMaker book based on the configuration
parameters provided.
FDK Programmer’s Reference 859
4
The DOCTYPE system identifier for the source XML document.
Graphics
FO_KeyCatalog
An FO_KeyCatalog object represents the Key Catalogs in FrameMaker.
FO_KeyCatalog objects have the following properties.
Property
FP_IsDefault
Type
Meaning
BoolT
If True, the key catalog is the default one for
the current workflow.
If False, key catalog is not the default one
for the current workflow.
FP_IsStale
BoolT
If True, the key catalog is maked as stale and
needs to be re-loaded before using.
If False, the key catalog is not stale and can
be used.
FP_NextKeyCatalog
InSession
F_ObjHandleT
Next key catalog in the session.
FP_NotLoaded
BoolT
If True, the key catalog is not loaded and
cannot be used.
If False, the key catalog is loaded and can be
used.
FP_Source
StringT
Complete path of the file conatining the key
catalog.
FP_SourceType
FV_KeySrcTyp
eNone
Type of the file conatining the key catalog.
FV_KeySrcTyp
eDitamap
860
FP_KeyCount
IntT
Number of keys in the key catalog including
duplicate definitons.
FP_KeyCatalogClie
ntName
StringT
Name of the client owning the key catalog.
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
FO_Line
An FO_Line object represents a line. FO_Line objects have the following
properties.
Type
Property
Meaning
Common graphic object
properties
See page 845.
FP_NumPoints†
IntT
Number of vertices. The default is 2 (the
line’s start point and end point).
FP_Points
F_PointsT
Array of x-y coordinate pairs that specify the
line’s vertices. The default coordinate pairs
are for the line’s start point and end point.
FO_Math
An FO_Math object represents an equation. The FP_MathFullForm property
corresponds to the MIF statement that defines the mathematical
structure of an equation. Each expression defines a component of the equation and can
be nested within other expressions, as in string1[string2].
For example, to create the equation x y, you specify the following string for the
FO_Math object’s FP_MathFullForm property:
greaterthan[char[x],char[y]]
For more information on the MIF statement, see the online MIF
Reference.
FO_Doc objects have properties that specify how all the equations in a document
appear. For a list of these properties, see “Document equation properties” on page 798.
Property
Type
Common graphic
object properties
Meaning
See page 845
FP_BasePointX
MetricT
Horizontal placement of text line base point relative to
left side of frame
FP_BasePointY
MetricT
Vertical placement of text line base point relative to top
of frame
FP_MathFullForm
StringT
String representing the expression
FDK Programmer’s Reference 861
4
The DOCTYPE system identifier for the source XML document.
Graphics
Property
FP_MathSize
Type
Meaning
IntT
Equation size:
FV_MATH_LARGE
FV_MATH_MEDIUM
FV_MATH_SMALL
FP_TextLineType
Type of text line:
IntT
FV_TEXTLINE_LEFT
FV_TEXTLINE_RIGHT
FV_TEXTLINE_CENTER
FV_TEXTLINE_MATHD
FO_Polygon
An FO_Polygon object represents a polygon. FO_Polygon objects have the
following properties.
Property
Type
Common graphic object
properties
Meaning
See page 845
FP_NumPoints
IntT
Number of the polygon’s vertices
FP_Points†
F_PointsT
Array of x-y coordinate pairs that specify the
polygon’s vertices
FP_PolyIsBezier
IntT
True if polygon is smoothed
FO_Polyline
An FO_Polyline object represents a polyline. FO_Polyline objects have the
following properties.
Property
Type
Common graphic object
properties
FP_NumPoints
862
FDK Programmer’s Reference
Meaning
See page 845
IntT
Number of the polyline’s vertices
Graphics
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_Points†
F_PointsT
Array of x-y coordinate pairs that specify the
polyline’s vertices
FP_PolyIsBezier
IntT
True if polyline is a Bezier curve
Property
FO_Rectangle
An FO_Rectangle object represents a rectangle. FO_Rectangle objects have the
following properties.
Type
Property
Common graphic object
properties
Meaning
See page 845
FP_RectangleIsSmoothed
IntT
True if smoothing is enabled
FO_RoundRect
An FO_RoundRect object represents a rounded rectangle. FO_RoundRect objects
have the following properties.
Property
Type
Common graphic object
properties
FP_Radius
Meaning
See page 845
MetricT
Radius of corner; 0 for a square corner
FDK Programmer’s Reference 863
4
The DOCTYPE system identifier for the source XML document.
Graphics
FO_TextFrame
An FO_TextFrame object represents a text frame. FO_TextFrame objects have the
following properties.
Property
Type
Common graphic object properties
864
Meaning
See page 845.
FP_ColGapWidth
MetricT
Gap between columns
(0 to 50 inches).
FP_ColumnsAreBalanced
IntT
True if terminal and underfilled
columns in the flow are balanced.
FP_FirstAFrame†
F_ObjHandleT
First anchored frame in the text
frame (FO_AFrame ID).
FP_FirstCell†
F_ObjHandleT
First table cell in the text frame
(FO_Cell ID).
FP_FirstFn†
F_ObjHandleT
First footnote in the text frame
(FO_Fn ID).
FP_FirstPgf†
F_ObjHandleT
First paragraph in the text frame
(FO_Pgf ID).
FP_FirstSubCol†
F_ObjHandleT
First column in the text frame
(FO_SubCol ID).
FP_Flow†
F_ObjHandleT
Flow containing the text frame
(FO_Flow ID).
FP_GraphicIsButton
IntT
True if the text frame is a
hypertext button.
FP_LastAFrame†
F_ObjHandleT
Last anchored frame in the text
frame (FO_AFrame ID).
FP_LastCell†
F_ObjHandleT
Last table cell in the text frame
(FO_Cell ID).
FP_LastFn†
F_ObjHandleT
Last footnote in the text frame
(FO_Fn ID).
FP_LastPgf†
F_ObjHandleT
Last paragraph in the text frame
(FO_Pgf ID).
FP_LastSubCol†
F_ObjHandleT
Last column in the text frame
(FO_SubCol ID).
FP_NextTextFrameInFlow
F_ObjHandleT
Next text frame in the flow
(FO_TextFrame ID).
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_NumColumns
IntT
The number of columns
in the underlying column
grid (1–10).
FP_PrevTextFrameInFlow
F_ObjHandleT
Previous text frame in the flow
(FO_TextFrame ID).
FP_SideHeadGap
MetricT
Gap between side head
area and body text area
(0 to 50 inches).
FP_SideHeadPlacement
IntT
Placement of side heads relative to
columns in the
text frame:
Property
FV_SH_LEFT
FV_SH_RIGHT
FV_SH_INSIDE
FV_SH_OUTSIDE
FP_SideHeadWidth
Text
MetricT
Width of side head area
for the text frame
(0 to 50 inches).
To get the text in a text frame, call
F_ApiGetText() with objId
set to the text frame ID. To add
text to a text frame, call
F_ApiAddText(). To delete text
from a text frame, call
F_ApiDeleteText(). For more
information, see
“F_ApiAddText()” on page 80,
“F_ApiDeleteText()” on
page 151, and “F_ApiGetText()”
on page 249.
FDK Programmer’s Reference 865
4
The DOCTYPE system identifier for the source XML document.
Graphics
FO_TextLine
An FO_TextLine object represents a text line. FO_TextLine objects have the
following properties.
Property
Type
Common graphic
object properties
866
Meaning
See page 845.
FP_BasePointX
MetricT
Horizontal placement of text line base point relative to
left side of frame.
FP_BasePointY
MetricT
Vertical placement of text line base point relative to top
of frame.
FDK Programmer’s Reference
Graphics
Property
FP_Language
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Obsolete, but still functional. Hyphenation and spellchecking language to use for the first character in the
text line.
Because language can be specified for a character
format, you should get FP_Language from the
FO_CharFmt objects in the text of the text line object.
The possible values for a text line are:
FV_LANG_BRAZILIAN
FV_LANG_BRITISH
FV_LANG_CANADIAN_FRENCH
FV_LANG_CATALAN
FV_LANG_DANISH
FV_LANG_DUTCH
FV_LANG_ENGLISH
FV_LANG_FINNISH
FV_LANG_FRENCH
FV_LANG_GERMAN
FV_LANG_ITALIAN
FV_LANG_NOLANGUAGE
FV_LANG_NORWEGIAN
FV_LANG_NYNORSK
FV_LANG_PORTUGUESE
FV_LANG_SPANISH
FV_LANG_SWEDISH
FV_LANG_SWISS_GERMAN
FV_LANG_JAPANESE
FV_LANG_TRADITIONAL_CHINESE
FV_LANG_SIMPLIFIED_CHINESE
FV_LANG_KOREAN
FDK Programmer’s Reference 867
4
The DOCTYPE system identifier for the source XML document.
Graphics
Property
FP_TextLineType
Type
Meaning
IntT
Type of text line:
FV_TEXTLINE_LEFT
FV_TEXTLINE_RIGHT
FV_TEXTLINE_CENTER
FV_TEXTLINE_MATH
Text
To get the text in a text line, call F_ApiGetText()
with objId set to the
text line ID. To add text to a text line, call
F_ApiAddText(). To delete text from a text
line, call F_ApiDeleteText(). For more
information, see “F_ApiAddText()” on page 80,
“F_ApiDeleteText()” on page 151, and
“F_ApiGetText()” on page 249.
FO_UnanchoredFrame
An FO_UnanchoredFrame object represents an unanchored frame.
FO_UnanchoredFrame objects have the following properties.
Property
Type
Common graphic object properties
868
Meaning
See page 845.
FP_FirstGraphicInFrame†
F_ObjHandleT
First object in the frame (backmost
object).
FP_LastGraphicInFrame†
F_ObjHandleT
Last object in the frame (frontmost
object).
FP_Name
StringT
If a reference frame, the frame’s
name.
FP_PageFramePage†
F_ObjHandleT
If the unanchored frame is a page
frame, the page that it belongs to
(FO_HiddenPage,
FO_BodyPage,
FO_MasterPage, or
FO_RefPage ID).
FDK Programmer’s Reference
Graphics
...
The DOCTYPE system identifier for the source XML document.
FO_Graphicsfmt
The FO_Graphicsfmt object is used with the API F_APInewNamedObject() to
create a new graphics style.
FO_Graphicsfmt objects have the following properties.
Type
Meaning
FP_UseColumnsAreBalanced
IntT
True if terminal and underfilled
columns in the flow are balanced.
FP_UseSideHeadPlacement
IntT
Placement of side heads relative to
columns in the
text frame:
Property
FV_SH_LEFT
FV_SH_RIGHT
FV_SH_INSIDE
FV_SH_OUTSIDE
FP_UseRadius
MetricT
Radius of corner; 0 for a square
corner
FP_UseFlowIsAutoConnect
IntT
True if Autoconnect is enabled.
FP_UseFlowIsPostScript
IntT
True if flow is PostScript code.
FP_UseBorderWidth
MetricT
Border width (0.015 pt to 360 pt).
FP_UseFill
IntT
The fill pattern (numbers between 0
and 15; see Figure 3-2). The FDK
provides constants for several fill
patterns:
FV_FILL_BLACK
FV_FILL_WHITE
FV_FILL_CLEAR
FP_UsePen
IntT
The pen pattern (numbers between
0 and 15; see Figure 3-2). The FDK
provides constants for several pen
patterns:
FV_FILL_BLACK
FV_FILL_WHITE
FV_FILL_CLEAR
FP_UseRunaroundGap
MetricT
If the object is a runaround object,
the width of the runaround gap.
FDK Programmer’s Reference 869
4
The DOCTYPE system identifier for the source XML document.
Graphics
Type
Meaning
FP_UseTintPercent
MetricT
The tint percentage
FP_UseOverprint
IntT
Specifies the overprint settings for
the object
Property
FV_OVERPRINT
FV_KNOCKOUT
FV_FROMCOLOR
870
FP_UseAngle
MetricT
Angle of the object’s rotation.
FP_UseLocX
MetricT
Distance from the left side of the
parent frame
FP_UseLocY
MetricT
Distance from the top side of the
parent frame
FP_UseWidth
MetricT
Width of object
FP_UseHeight
MetricT
Height of Object
FP_UseRunaround
MetricT
If the object is a runaround object,
the width of the runaround gap.
FDK Programmer’s Reference
Graphics
Property
FP_UseAnchorType
Type
Meaning
IntT
Where frame is anchored:
...
The DOCTYPE system identifier for the source XML document.
FV_ANCHOR_BELOW
FV_ANCHOR_BOTTOM
FV_ANCHOR_INLINE
FV_ANCHOR_RUN_INTO_
PARAGRAPH
FV_ANCHOR_SUBCOL_
FARTHEST
FV_ANCHOR_SUBCOL_INSIDE
FV_ANCHOR_SUBCOL_LEFT
FV_ANCHOR_SUBCOL_NEARES
T
FV_ANCHOR_SUBCOL_OUTSID
E
FV_ANCHOR_SUBCOL_RIGHT
FV_ANCHOR_TEXTFRAME_
FARTHEST
FV_ANCHOR_TEXTFRAME_
INSIDE
FV_ANCHOR_TEXTFRAME_LEF
T
FV_ANCHOR_TEXTFRAME_
NEAREST
FV_ANCHOR_TEXTFRAME_
OUTSIDE
FV_ANCHOR_TEXTFRAME_
RIGHT
FV_ANCHOR_TOP
FP_UseAFrameIsFloating
IntT
True if Floating is enabled
FP_UseAFrameIsCropped
IntT
True if Cropped is enabled
FP_UseSideOffset
MetricT
Near side offset
FP_UseBaselineOffset
MetricT
Baseline offset
FP_UseAlignment
IntT
Type of alignment:
FV_ALIGN_CENTER
FV_ALIGN_INSIDE
FV_ALIGN_OUTSIDE
FV_ALIGN_LEFT
FV_ALIGN_RIGHT
FDK Programmer’s Reference 871
4
The DOCTYPE system identifier for the source XML document.
Graphics
Type
Meaning
FP_UseNumColumns
IntT
The number of columns
in the underlying column
grid (1–10).
FP_UseColGapWidth
MetricT
Gap between columns
(0 to 50 inches).
FP_UseSideHeadWidth
MetricT
Width of side head area
for the text frame
(0 to 50 inches).
FP_UseSideHeadGap
MetricT
Gap between side head
area and body text area
(0 to 50 inches).
FP_UseTheta
MetricT
Start angle (0 degree to 360 degree)
FP_UseDTheta
MetricT
Arc angle length (–360 degree to
360 degree)
FP_UseTextLineType
IntT
Type of text line:
Property
FV_TEXTLINE_LEFT
FV_TEXTLINE_RIGHT
FV_TEXTLINE_CENTER
FV_TEXTLINE_MATHD
FP_UseMathSize
IntT
Equation size:
FV_MATH_LARGE
FV_MATH_MEDIUM
FV_MATH_SMALL
872
FP_UseInsetDpi
IntT
Scaling information for bitmap file
(corresponds to the value specified
in the Image File Scaling Options
dialog box when the graphics file is
imported).
FP_FirstGraphicsFmtInDo
c
F_ObjHandleT
First graphics format object in the
list of the document’s
graphic format objects
FP_NextGraphicsFmtInDoc
F_ObjHandleT
Next graphic object in the
document.
FP_StyleTag
StringT
FDK Programmer’s Reference
Name of character format tag applied
to text location.)
Insets
...
The DOCTYPE system identifier for the source XML document.
Insets
For graphic insets, see “FO_Inset” on page 852. For text insets, see “Text insets” on
page 937.
Markers
An FO_Marker object represents a marker.
FO_Marker
FO_Marker objects have the following properties.
Type
Meaning
FP_Element†
F_ObjHandleT
If the marker is a structured marker in a
document, the ID of the element
containing the marker.
FP_MarkerText
StringT
The marker’s text string.
FP_MarkerTypeId
F_ObjHandleT
The ID of the current marker’s type
(FO_MarkerType).
FP_NextMarkerInDoc†
F_ObjHandleT
Next marker (FO_Marker ID).
FP_TextLoc†
F_TextLocT
Text location of the marker’s symbol.
FP_Unique†
IntT
The marker’s UID.
Property
FDK Programmer’s Reference 873
4
The DOCTYPE system identifier for the source XML document.
Marker types
Marker types
An FO_MarkerType object represents a marker type. Marker types are stored in the
document.
FO_MarkerType
FO_MarkerType objects have the following properties.
Type
Meaning
FP_NextMarkerType
InDoc
F_ObjHandleT
Next marker type (FO_MarkerType ID)
FP_Name
StringT
The name of this marker type, as it appears
in the user interface.
FP_InvariantName
StringT
An internal name for the marker type. By
default, this is the same as FP_Name,.
However, this can differ from FP_Name if
the user interface is in another language.
FP_OldTypeNum
ShortT
A number to map markers from documents
earlier than version 5.5 to this marker type.
Property
For example, assume the name of a marker
type is MyMarkerType, and the
FP_OltTypeNum is 11. Then markers of
type 11 from earlier documents will
import as markers of type
MyMarkerType.
FP_Public
BoolT
True if the marker type should appear in
the user interface. The default is True.
FP_Transient
BoolT
True if markers of this type shoud not be
saved to files. The default is False.
FP_Required†
BoolT
True if the marker type is required by
FrameMaker products. The default is
False.
Menus
See “Commands, menus, menu items, and menu item separators” on page 760.
874
FDK Programmer’s Reference
Menu items
...
The DOCTYPE system identifier for the source XML document.
Menu items
See “Commands, menus, menu items, and menu item separators” on page 760.
Pages
There are four types of pages. The API uses FO_BodyPage, FO_HiddenPage,
FO_MasterPage, and FO_RefPage objects to represent them.
FO_BodyPage
An FO_BodyPage object represents a body page. FO_BodyPage objects have the
following properties.
Type
Meaning
FP_MasterPage
StringT
Name of master page background for body
page if FP_PageBackground is set to
FV_BGD_OTHER. It is NULL if
FP_PageBackground is set to
FV_BGD_DEFAULT or FV_BGD_NONE.
FP_PageBackground
IntT
Type of master page background:
Property
FV_BGD_DEFAULT: The page has a Left or
Right master page background if the
document is double-sided, or a Right master
page background if the document is singlesided.a
FV_BGD_NONE: The page has no master
page background.
FV_BGD_OTHER: The page has the custom
master page background specified by
FP_MasterPage.
FP_PageFrame†
F_ObjHandleT
The page’s page frame
(FO_UnanchoredFrame ID).
FP_PageHeight†
MetricT
Height of page.
FP_PageIsRecto†
IntT
True if right body page or False if left
body page.
FP_PageNext†
F_ObjHandleT
Next body page (FO_BodyPage ID) in the
document.
FP_PageNum†
IntT
Page number.
FDK Programmer’s Reference 875
4
The DOCTYPE system identifier for the source XML document.
Pages
Type
Meaning
StringT
Page number string.
F_ObjHandleT
Previous body page (FO_BodyPage ID) in
the document.
FP_PageWidth†
MetricT
Width of page.
FP_PointPageNum†
IntT
Number of point page.
Property
FP_PageNumString†
FP_PagePrev
†
a. To determine if a body page has a Left or a Right master page background when its FP_PageBackground
property is set to FV_BGD_DEFAULT, query its FP_PageIsRecto property.
FO_HiddenPage
An FO_HiddenPage object represents a hidden page. FO_HiddenPage objects
have the following properties.
Type
Meaning
FP_Name†
StringT
Name of hidden page
FP_PageFrame†
F_ObjHandleT
Page frame (FO_UnanchoredFrame ID)
FP_PageHeight†
MetricT
Height of page
FP_PageWidth†
MetricT
Width of page
Property
FO_MasterPage
An FO_MasterPage object represents a master page. FO_MasterPage objects
have the following properties.
Type
Meaning
FP_Name
StringT
Name of master page (for example, Right or
Left)
FP_PageFrame†
F_ObjHandleT
Page frame (FO_UnanchoredFrame ID)
FP_PageHeight†
MetricT
Height of page
FP_PageNext†
F_ObjHandleT
Next master page (FO_MasterPage ID) in the
document
Property
876
FDK Programmer’s Reference
Pages
Property
FP_PageNum†
FP_PagePrev
†
FP_PageWidth†
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Page number
F_ObjHandleT
Previous master page (FO_MasterPage ID) in
the document
MetricT
Width of page
FO_RefPage
An FO_RefPage object represents a reference page. FO_RefPage objects have the
following properties.
Type
Meaning
FP_Name
StringT
Name of reference page
FP_PageFrame†
F_ObjHandleT
Page frame (FO_UnanchoredFrame ID)
FP_PageHeight†
MetricT
Height of page
FP_PageNext†
F_ObjHandleT
Next reference page (FO_RefPage ID)
in the document
FP_PageNum†
IntT
Page number
FP_PagePrev†
F_ObjHandleT
Previous reference page (FO_RefPage ID) in
the document
FP_PageWidth†
MetricT
Width of page
Property
FDK Programmer’s Reference 877
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Paragraphs
The API uses an FO_Pgf object to represent a paragraph instance and an FO_PgfFmt
object to represent a paragraph format in the Paragraph Catalog. FO_Pgf and
FO_PgfFmt objects have many of the same properties.
FO_Pgf
FO_Pgf objects have the following properties.
Paragraph Asian character spacing properties
FO_Pgf objects have the following Asian charactrer spacing properties.
Type
Meaning
FP_BkColor
F_ObjHandleT
Text background color
FP_MinJRomSpace
MetricT
Minimum Asian-Roman space
FP_OptJRomSpace
MetricT
Optimum Asian-Roman space
FP_MaxJRomSpace
MetricT
Maximum Asian-Roman space
FP_MinJLetSpace
MetricT
Minimum Asian letter space
FP_OptJLetSpace
MetricT
Optimum Asian letter space
FP_MaxJLetSpace
MetricT
Maximum Asian letter space
FP_YakumonoType
IntT
The Yakumono rules to handle punctuation
characters; can be one of
FV_FLOATING_YAKUMONO
FV_MONOSPACE_YAKUMONO
FV_FIXED_YAKUMONO
Property
878
FDK Programmer’s Reference
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Paragraph autonumbering properties
FO_Pgf objects have the following autonumbering properties.
Type
Meaning
FP_AutoNumChar
StringT
Character Format for the automatic numbering string
specified by FP_AutoNumString; "" if the default
character format is used
FP_AutoNumString
StringT
Autonumber Format string; for example,
"."
FP_NumAtEnd
IntT
True if numbering position is End of Paragraph;
False if it is Beginning of Paragraph
FP_PgfIsAutoNum
IntT
True if autonumbering is enabled
FP_PgfNumber†
StringT
The formatted string representation of the paragraph
number; for example, 1.2 for a paragraph whose
FP_AutoNumString property is set to .
Property
Paragraph default font properties
FO_Pgf objects have the following default font properties. Most of these properties are
the same as text properties.
Property
FP_Capitalization
Type
Meaning
IntT
Type of capitalization to use:
FV_CAPITAL_CASE_NORM
FV_CAPITAL_CASE_SMALL
FV_CAPITAL_CASE_LOWER
FV_CAPITAL_CASE_UPPER
FP_ChangeBar
IntT
True if Change Bars are on.
FP_Color
F_ObjHandle
T
Spot color (FO_Color ID).
FP_CombinedFontFamil
y
F_ObjHandle
T
Combined font definition
(FO_CombinedFontDefn)
FP_FontAngle
IntT
Font angle (specifies an index
into the array of font angles
provided by the session property
FP_FontAngleNames).
FDK Programmer’s Reference 879
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Type
Meaning
FP_FontEncodingName†
StringT
The font’s encoding
FP_FontFamily
IntT
Font family (specifies an index
into the array of font families provided by
the session property
FP_FontFamilyNames).
FP_FontPlatform
Name
StringT
Name that uniquely identifies a font on a
specific platform (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontPostScript
Name
StringT
Name given to a font when it is sent to a
PostScript printer (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontSize
MetricT
Font size (2 pt to 400 pt).
FP_FontVariation
IntT
Font variation (specifies an index into the
array of font variations provided by the
session property
FP_FontVariationNames).
FP_FontWeight
IntT
Font weight (specifies an index
into the array of font weights provided by
the session property
FP_FontWeightNames).
FP_KernX
MetricT
Horizontal kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%).a A positive value
moves a character right and a negative
value moves a character left.
FP_KernY
MetricT
Vertical kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%). A positive value moves
characters up and a negative value moves
characters down.
FP_Overline
IntT
True if Overline is enabled.
FP_PairKern
IntT
True if Pair Kern is enabled.
Property
880
FDK Programmer’s Reference
Paragraphs
Property
FP_Position
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Specifies position relative to baseline of
text:
FV_POS_NORM: Normal
FV_POS_SUB: Subscript
FV_POS_SUPER: Superscript
FP_Spread
MetricT
Obsolete property, but still functional. See
corresponding "tracking" property below.
FP_Stretch
MetricT
Character stretch (set width) expressed as a
percentage of normal stretch for the font
(metric –10% to 1000%).
FP_Strikethrough
IntT
True if Strikethrough is enabled.
FP_Tracking
MetricT
Character tracking expressed as a
percentage of an em (metric –100% to
1000%).
FP_Underlining
IntT
Type of underlining:
FV_CB_NO_UNDERLINE
FV_CB_SINGLE_UNDERLINE
FV_CB_DOUBLE_UNDERLINE
FV_CB_NUMERIC_UNDERLINE
a. In the API, most percentages are represented as MetricT fractions. For spread percentages, the MetricT
value 1<<16 or 0x10000 specifies 100% or 1. For more information on MetricT values, see “MetricT
values” on page 954.
FDK Programmer’s Reference 881
Paragraph formats in a table cell
FO_Pgf objects have the following properties that specify how a paragraph appears in
a table cell.
Type
Meaning
FP_CellBottomMargin
MetricT
Amount added to default bottom margin of table
cell.
FP_CellLeftMargin
MetricT
Amount added to default left margin of table cell.
FP_CellMarginsFixed
IntT
Specifies which cell margins are fixed. The
following values can be ORed into it:
Property
FV_PGF_FIXED_B_MARGIN: the bottom margin
is fixed
FV_PGF_FIXED_L_MARGIN: the left margin is
fixed
FV_PGF_FIXED_R_MARGIN: the right margin is
fixed
FV_PGF_FIXED_T_MARGIN: the top margin is
fixed
If the margin for a cell is fixed, the
margin property specifies the absolute value of
the cell margin. For example,
if FV_PGF_FIXED_B_MARGIN is set,
FP_CellBottomMargin specifies the absolute
value of the cell’s bottom margin, overriding the
cell margin specified by the table format. If
FV_PGF_FIXED_B_MARGIN is not set,
FP_CellBottomMargin is added to the
margin specified by the table format.
FP_CellRightMargin
MetricT
Amount added to default right margin of table
cell.
FP_CellTopMargin
MetricT
Amount added to default top margin of table cell.
FP_CellVAlignment
IntT
Vertical alignment of a paragraph when it is the
first one in a cell:
FV_PGF_V_ALIGN_TOP
FV_PGF_V_ALIGN_MIDDLE
FV_PGF_V_ALIGN_BOTTOM
Paragraph general properties
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
FO_Pgf objects have the following general properties.
Type
Meaning
FP_Locked
IntT
True if the paragraph is part of a text inset that
retains formatting information from the source
document. The paragraph is not affected by global
formatting performed on the document.
FP_FormatOverride
IntT
True if the paragraph contains a paragraph format
override.
Property
Paragraph hyphenation properties
FO_Pgf objects have the following hyphenation properties.
Type
Meaning
FP_AdjHyphens
IntT
Number of allowable adjacent hyphens
FP_Hyphenate
IntT
True if Automatic Hyphenation is enabled
FP_HyphMinPrefix
IntT
Minimum number of letters that must precede hyphen
FP_HyphMinSuffix
IntT
Minimum number of letters that must follow a hyphen
FP_HyphMinWord
IntT
Minimum length of a hyphenated word
Property
FDK Programmer’s Reference 883
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Paragraph hyphenation and spell-checking languages
FO_Pgf objects have the following language properties.
Property
FP_Language
Type
Meaning
IntT
Hyphenation and spell-checking language to use:a
FV_LANG_BRAZILIAN
FV_LANG_BRITISH
FV_LANG_CANADIAN_FRENCH
FV_LANG_CATALAN
FV_LANG_DANISH
FV_LANG_DUTCH
FV_LANG_ENGLISH
FV_LANG_FINNISH
FV_LANG_FRENCH
FV_LANG_GERMAN
FV_LANG_ITALIAN
FV_LANG_NOLANGUAGE
FV_LANG_NORWEGIAN
FV_LANG_NYNORSK
FV_LANG_PORTUGUESE
FV_LANG_SPANISH
FV_LANG_SWEDISH
FV_LANG_SWISS_GERMAN
FV_LANG_JAPANESE
FV_LANG_TRADITIONAL_CHINESE
FV_LANG_SIMPLIFIED_CHINESE
FV_LANG_KOREAN
FP_PgfSpellChecked
IntT
True if paragraph has been spell-checked
a. The FDE provides a function that returns the language string associated with each of the language constants.
For more information, see “F_LanguageString()” on page 576.
884
FDK Programmer’s Reference
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Paragraph identifiers
FO_Pgf objects have the following identification property.
Property
FP_Unique†
Type
Meaning
IntT
The paragraph’s UID
Paragraph indents
FO_Pgf objects have the following indentation properties.
Type
Meaning
FP_FirstIndent
MetricT
First-line left margin, measured from left side of current
text column (0 cm to 100 cm)
FP_LeftIndent
MetricT
Left margin, measured from left side of current text
column (0 cm to 100 cm)
FP_RightIndent
MetricT
Right margin, measured from right side of current text
column
Property
Paragraph line spacing
FO_Pgf objects have the following line-spacing properties.
Type
Meaning
FP_Leading
MetricT
Space below each line in a paragraph
FP_LineSpacing
IntT
Space between lines in a paragraph measured from
baseline to baseline:
Property
FV_PGF_FIXED: default font size
FV_PGF_PROPORTIONAL: largest font in line
FV_PGF_FLOATING: largest ascender in line
FDK Programmer’s Reference 885
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Paragraph placement properties
FO_Pgf objects have the following placement properties.
Type
Meaning
FP_BlockLines
IntT
The number of Widow/Orphan lines
FP_KeepWithNext
IntT
True if Keep With Next Paragraph is enabled
FP_KeepWithPrev
IntT
True if Keep With Previous Paragraph is enabled
FP_PgfAlignment
IntT
Horizontal alignment of paragraph:
Property
FV_PGF_LEFT
FV_PGF_RIGHT
FV_PGF_CENTER
FV_PGF_JUSTIFIED
FP_Placement
IntT
Paragraph placement:
FV_PGF_SIDEBODY
FV_PGF_SIDEHEAD_TOP
FV_PGF_SIDEHEAD_FIRST_BASELINE
FV_PGF_SIDEHEAD_LAST_BASELINE
FV_PGF_RUN_IN
FV_PGF_STRADDLE
FV_PGF_STRADDLE_NORMAL_ONLY
FP_RunInSeparator
StringT
String for Run-In Head Default Punctuation
FP_SpaceAbove
MetricT
Space above paragraph
FP_SpaceBelow
MetricT
Space below paragraph
FP_Start
IntT
Vertical placement of paragraph:
FV_PGF_ANYWHERE
FV_PGF_TOP_OF_COL
FV_PGF_TOP_OF_PAGE
FV_PGF_TOP_OF_LEFT_PAGE
FV_PGF_TOP_OF_RIGHT_PAGE
886
FDK Programmer’s Reference
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Paragraph object pointer properties
FO_Pgf objects have the following properties that specify the IDs of other objects.
Type
Meaning
FP_InTextFrame†
F_ObjHandleT
Text frame containing the paragraph
(FO_TextFrame ID)
FP_InTextObj†
F_ObjHandleT
Subcolumn, footnote, or table cell the
paragraph begins in (FO_SubCol, FO_Fn,
or FO_Cell ID)
FP_NextPgfInDoc†
F_ObjHandleT
Next paragraph in the document (FO_Pgf
ID)
FP_NextPgfInFlow†
F_ObjHandleT
Next paragraph in the flow (FO_Pgf ID)
FP_PrevPgfInFlow†
F_ObjHandleT
Previous paragraph in the flow (FO_Pgf ID)
Property
Paragraph reference frame
FO_Pgf has the following properties that specify reference frames.
Type
Meaning
FP_BottomSeparator
StringT
Name of frame to put below paragraph
FP_TopSeparator
StringT
Name of frame to put above paragraph
Property
Paragraph tabs
FO_Pgf objects have the following tab properties.
Type
Meaning
FP_NumTabs†
IntT
Number of tabs in the paragraph.
FP_Tabs
F_TabsT
Array of tab descriptions that specify the positions and types
of tab stops. For an example of how to get and set tabs in a
paragraph, see “F_ApiSetTabs()” on page 441.
Property
FDK Programmer’s Reference 887
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Paragraph tagging
FO_Pgf objects have the following format tag properties.
Type
Meaning
FP_Name
StringT
Name of paragraph format
FP_NextTag
StringT
Tag for new next paragraph
FP_UseNextTag
IntT
True if Next Paragraph Tag is enabled
Property
Paragraph text
The API does not use properties to represent the text in a paragraph. To get the text in a
paragraph, call F_ApiGetText() with objId set to the paragraph’s ID. To add text
to a paragraph, call F_ApiAddText(). To delete text from a paragraph, call
F_ApiDeleteText(). For more information, see “F_ApiAddText()” on page 80,
“F_ApiDeleteText()” on page 151, and “F_ApiGetText()” on page 249.
Paragraph word spacing
FO_Pgf objects have the following word spacing properties.
Type
Meaning
FP_LetterSpace
IntT
True if Word Spacing is enabled
FP_MaxSpace
MetricT
Maximum word spacing (percentage of an em space in
current font)
FP_MinSpace
MetricT
Minimum word spacing (percentage of an em space in
current font)
FP_OptSpace
MetricT
Optimum word spacing
Property
FO_PgfFmt
FO_PgfFmt objects (paragraph formats in the Paragraph Catalog) have the following
properties.
888
FDK Programmer’s Reference
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Paragraph format PDF properties
FO_PgfFmt objects have the following PDF properties.
Type
Meaning
FP_AcrobatLevel
IntT
Retained in Version 6.0 or later for backward
compatibility. Use FP_PDFLevel instead.
FP_BkColor
F_ObjHa
ndleT
Text background color
FP_MarkedForNamed
Destination
IntT
If True, this paragraph will have a corresponding
Named Destination in the generated PDF.
FP_PDFLevel
IntT
The outline level of paragraphs with this format
when the FrameMaker product generates PDF data.
Property
The value for this property can be between 0 and
100, where greater values are deeper in the
hierarchy. If FP_AcrobatLevel is 0, the
FrameMaker product does not generate bookmarks
for paragraphs with the format.
If FP_AcrobatLevel is greater than 0,
the FrameMaker product sets the outline level of
paragraphs with this format to the specified level.
FP_PDFStructure
Level
IntT
The PDF structure level of paragraphs with the
current format. This property is used when the
FP_PDFStructure property is True for the
document, and the FrameMaker product generates
PDF data.
The value for this property can be between 0 and
100, where greater values are deeper in the
hierarchy. If FP_PDFStructureLevel is 0, the
FrameMaker product does not include paragraphs of
this format in the PDF structure.
Paragraph format Asian character spacing properties
FO_Pgf objects have the following Asian character spacing properties.
Type
Meaning
FP_MinJRomSpace
MetricT
Minimum Asian-Roman space
FP_OptJRomSpace
MetricT
Optimum Asian-Roman space
FP_MaxJRomSpace
MetricT
Maximum Asian-Roman space
Property
FDK Programmer’s Reference 889
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Type
Meaning
FP_MinJLetSpace
MetricT
Minimum Asian letter space
FP_OptJLetSpace
MetricT
Optimum Asian letter space
FP_MaxJLetSpace
MetricT
Maximum Asian letter space
FP_YakumonoType
IntT
The Yakumono rules to handle punctuation characters;
can be one of
FV_FLOATING_YAKUMONO
FV_MONOSPACE_YAKUMONO
FV_FIXED_YAKUMONO
Property
Paragraph format autonumbering properties
FO_PgfFmt objects have the following autonumbering properties.
Type
Meaning
FP_AutoNumChar
StringT
Character format for the automatic numbering string
specified by FP_AutoNumString; "" if the
default character format is used
FP_AutoNumString
StringT
Autonumber format string (for example, .)
FP_NumAtEnd
IntT
True if numbering position is End of Paragraph;
False if it is Beginning of Paragraph
FP_PgfIsAutoNum
IntT
True if autonumbering is enabled
Property
Paragraph format default font properties
FO_PgfFmt objects have the following default font properties.
Property
FP_Capitalization
Type
Meaning
IntT
Type of capitalization to use:
FV_CAPITAL_CASE_NORM
FV_CAPITAL_CASE_SMALL
FV_CAPITAL_CASE_LOWER
FV_CAPITAL_CASE_UPPER
FP_ChangeBar
890
FDK Programmer’s Reference
IntT
True if Change Bars is on.
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_Color
F_ObjHandle
T
Spot color (FO_Color ID).
FP_CombinedFontFamil
y
F_ObjHandle
T
Combined font definition
(FO_CombinedFontDefn)
FP_FontAngle
IntT
Font angle (specifies an index
into the array of font angles
provided by the session property
FP_FontAngleNames).
FP_FontEncodingName†
StringT
The font’s encoding
FP_FontFamily
IntT
Font family (specifies an index
into the array of font families provided by
the session property
FP_FontFamilyNames).
FP_FontPlatform
Name
StringT
Name that uniquely identifies a font on a
specific platform (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontPostScript
Name
StringT
Name given to a font when it is sent to a
PostScript printer (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontSize
MetricT
Font size (2 pt to 400 pt).
FP_FontVariation
IntT
Font variation (specifies an index into the
array of font variations provided by the
session property
FP_FontVariationNames).
FP_FontWeight
IntT
Font weight (specifies an index
into the array of font weights provided by
the session property
FP_FontWeightNames).
FP_KernX
MetricT
Horizontal kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%).a A positive value
moves a character right and a negative
value moves a character left.
Property
FDK Programmer’s Reference 891
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Type
Meaning
FP_KernY
MetricT
Vertical kern value for manual kerning
expressed as a percentage of an em (metric
–100% to 1000%). A positive value moves
characters up and a negative value moves
characters down.
FP_Overline
IntT
True if Overline is enabled.
FP_PairKern
IntT
True if Pair Kern is enabled.
FP_Position
IntT
Specifies position relative to baseline of
text:
Property
FV_POS_NORM: Normal
FV_POS_SUB: Subscript
FV_POS_SUPER: Superscript
FP_Spread
MetricT
Character spread expressed as a percentage
of an em (metric –100% to 1000%).
FP_Stretch
MetricT
Character stretch (set width) expressed as a
percentage of normal stretch for the font
(metric –10% to 1000%).
FP_Strikethrough
IntT
True if Strikethrough is enabled.
FP_Tracking
MetricT
Character tracking expressed as a
percentage of an em (metric –100% to
1000%).
FP_Underlining
IntT
Type of underlining:
FV_CB_NO_UNDERLINE
FV_CB_SINGLE_UNDERLINE
FV_CB_DOUBLE_UNDERLINE
FV_CB_NUMERIC_UNDERLINE
a. In the API, most percentages are represented as MetricT fractions. For spread percentages, the MetricT
value 1<<16 or 0x10000 specifies 100% or 1. For more information on MetricT values, see “MetricT
values” on page 954.
892
FDK Programmer’s Reference
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Paragraph format hyphenation properties
FO_PgfFmt objects have the following properties that specify how words are
hyphenated.
Type
Meaning
FP_AdjHyphens
IntT
Number of allowable adjacent hyphens
FP_Hyphenate
IntT
True if Hyphenation is enabled
FP_HyphMinPrefix
IntT
Minimum number of letters that must precede hyphen
FP_HyphMinSuffix
IntT
Minimum number of letters that must follow a hyphen
FP_HyphMinWord
IntT
Minimum length of a hyphenated word
Property
FDK Programmer’s Reference 893
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Paragraph format spell-checking languages
FO_PgfFmt objects have the following language properties. The FDE provides a
function that returns the language string associated with each of the language constants.
For more information, see “F_LanguageString()” on page 576.
Property
FP_Language
Type
Meaning
IntT
Hyphenation and spell-checking language to use:
FV_LANG_BRAZILIAN
FV_LANG_BRITISH
FV_LANG_CANADIAN_FRENCH
FV_LANG_CATALAN
FV_LANG_DANISH
FV_LANG_DUTCH
FV_LANG_ENGLISH
FV_LANG_FINNISH
FV_LANG_FRENCH
FV_LANG_GERMAN
FV_LANG_ITALIAN
FV_LANG_NOLANGUAGE
FV_LANG_NORWEGIAN
FV_LANG_NYNORSK
FV_LANG_PORTUGUESE
FV_LANG_SPANISH
FV_LANG_SWEDISH
FV_LANG_SWISS_GERMAN
FV_LANG_JAPANESE
FV_LANG_TRADITIONAL_CHINESE
FV_LANG_SIMPLIFIED_CHINESE
FV_LANG_KOREAN
894
FDK Programmer’s Reference
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Paragraph format indents
FO_PgfFmt objects have the following indentation properties.
Type
Meaning
FP_FirstIndent
MetricT
First-line left margin, measured from left side of current
text column (0 pt to 360 pt)
FP_LeftIndent
MetricT
Left margin, measured from left side of current text
column (0 pt to 360 pt)
FP_RightIndent
MetricT
Right margin, measured from right side of current text
column
Property
Paragraph format line spacing
FO_PgfFmt objects have the following line-spacing properties.
Type
Meaning
FP_Leading
MetricT
Space below each line in a paragraph
FP_LineSpacing
IntT
Space between lines in a paragraph measured from
baseline to baseline:
Property
FV_PGF_FIXED: default font size
FV_PGF_PROPORTIONAL: largest font in line
FV_PGF_FLOATING: largest ascender in line
Paragraph format object pointer properties
FO_PgfFmt objects have the following property that specifies the ID of another
FO_PgfFmt object.
Property
FP_NextPgfFmtInDoc†
Type
Meaning
F_ObjHandleT
Next paragraph format in document
(FO_PgfFmt ID)
FDK Programmer’s Reference 895
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Paragraph format placement properties
FO_PgfFmt objects have the following placement properties.
Type
Meaning
FP_BlockLines
IntT
The number of Widow/Orphan lines
FP_KeepWithNext
IntT
True if Keep With Next Paragraph is enabled
FP_KeepWithPrev
IntT
True if Keep With Previous Paragraph is enabled
FP_PgfAlignment
IntT
Horizontal alignment of paragraph:
Property
FV_PGF_LEFT
FV_PGF_RIGHT
FV_PGF_CENTER
FV_PGF_JUSTIFIED
FP_Placement
IntT
Paragraph placement:
FV_PGF_SIDEBODY
FV_PGF_SIDEHEAD_TOP
FV_PGF_SIDEHEAD_FIRST_BASELINE
FV_PGF_SIDEHEAD_LAST_BASELINE
FV_PGF_RUN_IN
FV_PGF_STRADDLE
FV_PGF_STRADDLE_NORMAL_ONLY
FP_RunInSeparator
StringT
String for Run-In Head Default Punctuation
FP_SpaceAbove
MetricT
Space before paragraph
FP_SpaceBelow
MetricT
Space after paragraph
FP_Start
IntT
Vertical placement of paragraph:
FV_PGF_ANYWHERE
FV_PGF_TOP_OF_COL
FV_PGF_TOP_OF_PAGE
FV_PGF_TOP_OF_LEFT_PAGE
FV_PGF_TOP_OF_RIGHT_PAGE
896
FDK Programmer’s Reference
Paragraphs
...
The DOCTYPE system identifier for the source XML document.
Paragraph format reference frame properties
FO_PgfFmt objects have the following reference frame properties.
Type
Meaning
FP_BottomSeparator
StringT
Name of frame to put below paragraph
FP_TopSeparator
StringT
Name of frame to put above paragraph
Property
Paragraph format table cell properties
FO_PgfFmt objects have the following properties that specify how a paragraph
appears in a table cell.
Type
Meaning
FP_CellBottomMargin
MetricT
Amount added to table cell default bottom
margin
FP_CellLeftMargin
MetricT
Amount added to table cell default left margin
FP_CellMarginsFixed
IntT
Specifies which cell margins are added to
default table cell margins. The following values
can be ORed into it.
Property
FV_PGF_FIXED_B_MARGIN: the bottom
margin is added
FV_PGF_FIXED_L_MARGIN: the left margin is
added
FV_PGF_FIXED_R_MARGIN: the right margin
is added
FV_PGF_FIXED_T_MARGIN: the top margin is
added
FP_CellRightMargin
MetricT
Amount added to table cell default right margin
FP_CellTopMargin
MetricT
Amount added to table cell default top margin
FP_CellVAlignment
IntT
Vertical alignment of a paragraph when it is the
first one in a cell:
FV_PGF_V_ALIGN_TOP
FV_PGF_V_ALIGN_MIDDLE
FV_PGF_V_ALIGN_BOTTOM
FDK Programmer’s Reference 897
4
The DOCTYPE system identifier for the source XML document.
Paragraphs
Paragraph format tabs
FO_PgfFmt objects have the following format tab properties.
Type
Meaning
FP_NumTabs†
IntT
Number of tabs in the paragraph
FP_Tabs
F_TabsT
Array of tab descriptions that specify the positions and types
of tab stops
Property
Paragraph format tagging
FO_PgfFmt objects have the following format tag properties.
Type
Meaning
FP_Name
StringT
Name of paragraph format
FP_NextTag
StringT
Tag for following paragraph
FP_UseNextTag
IntT
True if Next Paragraph Tag is enabled
Property
Paragraph format word spacing
FO_PgfFmt objects have the following word-spacing properties.
Type
Meaning
FP_LetterSpace
IntT
True if Word Spacing is enabled
FP_MaxSpace
MetricT
Maximum word spacing (percentage of an em space in
current font)a
FP_MinSpace
MetricT
Minimum word spacing (percentage of an em space in
current font)
FP_OptSpace
MetricT
Optimum word spacing
Property
a. In the API, most percentages are represented as MetricT fractions. For word spacing percentages, the
MetricT value 1<<16 or 0x10000 specifies 100% or one em space. For more information on
MetricT values, see “MetricT values” on page 954.
898
FDK Programmer’s Reference
Rubi composites
...
The DOCTYPE system identifier for the source XML document.
Rubi composites
An FO_Rubi object represents a rubi composite.
FO_Rubi
FO_Rubi objects have the following properties.
Type
Meaning
FP_Element†
F_ObjHandleT
If the rubi group is in a structured
document, the object handle of the
associated FO_Element for the rubi group
element.
FP_OyamojiTextRange
F_TextRangeT
The text range the oyamoji text
encompasses.
FP_NextRubiInDoc†
F_TextRangeT
The next instance of a rubi composite
(FO_Rubi ID) in the document..
FP_RubiElement†
F_ObjHandleT
If the rubi group is in a structured
document, the object handle of the
associated FO_Element for the rubi
element.
FP_RubiTextRange†
F_TextRangeT
The text range the rubi text encompasses.
FP_Unique†
IntT
The rubi composite’s UID.
Property
†
FDK Programmer’s Reference 899
4
The DOCTYPE system identifier for the source XML document.
Table ruling formats
Table ruling formats
The API uses an FO_RulingFmt object to represent each ruling format in a
document. Tables and table formats specify rulings by specifying the IDs of
FO_RulingFmt objects.
FO_RulingFmt
FO_RulingFmt objects have the following properties.
Type
Meaning
FP_Name
StringT
Ruling format name.
FP_NextRuling
FmtInDoc†
F_ObjHandleT
Next ruling format in document
(FO_RulingFmt ID).
FP_Pen
IntT
The pen pattern (numbers between 0 and 15;
see Figure 3-2). The FDK provides constants
for several pen patterns:
Property
FV_FILL_BLACK
FV_FILL_WHITE
FV_FILL_CLEAR
FP_RulingGap
MetricT
Gap between double ruling lines (0.015 pt to
360 pt).
FP_RulingLines
IntT
Number of ruling lines
(0 to 2 lines).
FP_RulingPenWidth
MetricT
Ruling line thickness
(0.015 pt to 360 pt).
FP_RulingSep
F_ObjHandleT
Spot color of ruling format (FO_Color ID).
Separators
See “Commands, menus, menu items, and menu item separators” on page 760.
Session
The API uses an FO_Session object to represent a FrameMaker product session.
900
FDK Programmer’s Reference
Session
...
The DOCTYPE system identifier for the source XML document.
FO_Session
FO_Session objects have the following properties.
Type
Meaning
FP_ActiveBook
F_ObjHandleT
The book with input focus (FO_Book
ID).
FP_ActiveDoc
F_ObjHandleT
The document with input focus
(FO_Doc ID).
FP_ActiveView
StringT
Sets the current view. The view can be
one of:
Property
WYSIWYG View
Author View
XML View
To get the current view:
StringT activeView =
F_ApiGetString
(FV_SessionId,
FV_SessionId,
FP_ActiveView);
To set the current view:
StringT viewName =
"WYSIWYG View"
F_ApiSetString
(FV_SessionId,
FV_SessionId,
FP_ActiveView, viewName);
FP_AllowNewFileURL
IntT
If True, allows file URLs starting with
“file:” as well. Otherwise, only file
URLs starting with file:// are allowed.
FP_ApplyFormatRules
IntT
True if element reformatting is
enabled (Structured FrameMaker
only).
FP_AddMarkerTypeTo
StandardMarkers
StringT
The name of a marker type to add to
the standard list of marker types. Use
F_ApiSetString() to set a marker
type name to this property of the
FV_SessionId. See “The standard
list of marker types” on page 125 of
the FDK Programmer’s Guide.
FDK Programmer’s Reference 901
4
The DOCTYPE system identifier for the source XML document.
Session
Type
Meaning
FP_AutoBackup
IntT
True if Automatic Backup is enabled.
FP_AutoSave
IntT
True if Automatic Save is enabled.
FP_AutoSaveSeconds
IntT
Time between automatic saves in
seconds (60 seconds to
10800 seconds).
FP_DefaultVectorFormat
ForXMLExport
StringT
Used to set/get the default format
(such as CGM or MIF) that is used for
exporting the Anchored Frame or
Equation while exporting FrameMaker
document as XML. For example:
Property
F_ApiSetString(0,
FV_SessionId,
FP_DefaultVectorFormatForXM
LExport, "CGM");
902
FP_Displaying
IntT
False if screen refresh is completely
turned off.
FP_DoNotExportInvalidX
ML
IntT
If True, XML is not exported/saved if
it is invalid.
FP_DoPostXSLTValidatio
nOnExport
IntT
If True, XML is validated after doing
XSLT while exporting.
FP_EnableAutoSpellChec
k
IntT
If True, then enable auto spell check.
FP_FirstCommand
InSession
F_ObjHandleT
First command in the list of commands
in the session (FO_Command ID).
FP_FirstMenuItem
InSession†
F_ObjHandleT
First menu item or menu in the list of
menus, menu items, and menu item
separators in the session
(FO_Command, FO_Menu,
FO_MenuItemSeparator ID).
FP_FirstOpenBook†
F_ObjHandleT
First open book (FO_Book ID) in
session.
FP_FirstOpenDoc†
F_ObjHandleT
First open document (FO_Doc ID) in
session.
FP_FM_BinDir†
StringT
Directory pathname of
$FMHOME/bin
FP_FM_CurrentDir†
StringT
Name of the directory from which the
FrameMaker product was started
FDK Programmer’s Reference
Session
Type
Meaning
FP_FM_StructureDir†
StringT
Directory pathname of
$FMHOME/structure.
FP_CurrentMenuSet
IntT
Type of menu set:
Property
...
The DOCTYPE system identifier for the source XML document.
FV_MENU_QUICK
FV_MENU_COMPLETE
FV_MENU_CUSTOM
FP_DefaultKeyCatalog
F_ObjHandleT
Default key catalog for the current
workflow.
FP_ExportFilters
StringListT
List of export filters available in the
current session.
FP_FirstKeyCatalogInSe
ssion
F_ObjHandleT
First key catalog in the session.
FP_FMConsoleString
StringT
Get, append, or clear the FrameMaker
console string. Here are examples of
usage:
Get:
StringT str =
F_ApiGetString
(FV_SessionId,
FV_SessionId,
FP_FMConsoleString);
Append:
F_ApiSetString
(FV_SessionId,
FV_SessionId,
FP_FMConsoleString,
(StringT)"another line in
console");
Clear:
F_ApiSetString
(FV_SessionId,
FV_SessionId,
FP_FMConsoleString,
(StringT)"-1");
FP_FM_HelpDir†
StringT
Pathname of the FrameMaker product
help directory
FP_FM_HomeDir†
StringT
Pathname of $FMHOME .
FP_FM_InitDir†
StringT
Directory pathname of
$FMHOME/fminit .
FDK Programmer’s Reference 903
4
The DOCTYPE system identifier for the source XML document.
Session
Type
Meaning
FP_FontAngleNames†
F_StringsT
List of font angles available in the
current session.
FP_FontFamily
Attributes†
F_IntsT
An array of flags that indicate
attributes for each font family listed by
FP_FontFamilyNames. This array
of integers is indexed the same as the
list of font family names, and
corresponds directly to that list.
Property
Each IntT is a packed field; the high
order 16 bits indicate a surrogate font,
and the low order bits indicate
attributes for the font family. The
flags, their mask values, and their
meaning follow:
FV_FAMILY_VISIBLE
(0x00000001): Family is visible in
menu.
FV_FAMILY_SELECTABLE
(0x00000002): Family can be
selected in menu.
FV_FAMILY_MAPPED
(0x00000004): Family is is always
mapped to another family.
FV_FAMILY_SURROGATE
(0xFFFF0000): The family mapped
to if FV_FAMILY_MAPPED is True.
904
FP_FontFamilyNames†
F_StringsT
List of font family names available in
the current session. Note that this list
does not include combined fonts (see
“FO_CombinedFontDefn” on
page 759)
FP_FontVariation
Names†
F_StringsT
List of font variations available in the
current session.
FP_FontWeightNames†
F_StringsT
List of font weights available in the
current session.
FP_Gravity
IntT
True if Gravity is turned on for the
session.
FP_GreekSize
MetricT
Size at which to greek text.
FP_HostName†
StringT
Name of the host computer.
FDK Programmer’s Reference
Session
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_IconBarOn
IntT
True if the four icons that appear on
the upper-right side of the document
window are on. Changing this property
affects only documents that are opened
subsequently; it does not affect
documents that are already open.
FP_ImportFilters
StringListT
List of import filters available in the
current session.
FP_IsFMRunningAsServer
IntT
True if this instance of FrameMaker is
FrameMaker Server.
FP_IsIconified
IntT
True if the FrameMaker product
window is iconified.
FP_IsInFront
IntT
True if the FrameMaker product
window is in front of other application
windows. You can use this property to
bring the FrameMaker product to the
front or back.
FP_IsTempOpenSave
IntT
Gets whether temporary open/save is
in progress. Temporary open/save
happens during view switching
operations. Here is an example of
getting this value:
Property
IntT isTempOpenSave =
F_ApiGetInt
(FV_SessionId,
FV_SessionId,
FP_IsTempOpenSave);
FP_KeyCatalogWorkflow
IntT
Current workflow related to key
catalogs. The possible values are:
FV_KeyCatalogWorkflowAuthor
ing
FV_KeyCatalogWorkflowPublis
hing
FV_KeyCatalogWorkflowSearch
ing
FP_Label
StringT
The title in the FrameMaker product
window title bar.
FDK Programmer’s Reference 905
4
The DOCTYPE system identifier for the source XML document.
Session
Property
FP_Language†
Type
Meaning
IntT
Product language:
FV_LANG_BRITISH
FV_LANG_ENGLISH
FV_LANG_FRENCH
FV_LANG_GERMAN
FV_LANG_ITALIAN
FV_LANG_NOLANGUAGE
FV_LANG_SPANISH
FV_LANG_SWEDISH
FV_LANG_JAPANESE
FV_LANG_TRADITIONAL_CHINE
SE
FV_LANG_SIMPLIFIED_CHINES
E
FV_LANG_KOREAN
FP_MarkerNames†
F_StringsT
List of standard marker types for the
current session. For versions prior to
5.5, this returned the list of all marker
types for the current session. In version
5.5, marker types are assigned to the
document; use the
FP_MarkerTypeNames property of
FO_Doc to get the full list of marker
types.
FP_NoMultiMediaInPDF
IntT
If True, multimedia is not embedded
when creating PDF from FM.
FP_OpenDir
StringT
Directory pathname of the
FrameMaker product directory.
FP_OperatingSystem†
StringT
Operating system under which the
current session is running:
DOS
FP_Path†
StringT
Pathname to search to start the
FrameMaker product.
FP_Platform†
StringT
Name of the platform on which the
current session is running:
Intel
FP_ProductIsDemo
906
FDK Programmer’s Reference
BoolT
True if the current session is for a
demo version of FrameMaker
Session
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_ProductIsStructured
BoolT
True if FrameMaker is running in
structured mode for the current session
FP_ProductName†
StringT
FrameMaker product name: The
names for FrameMaker+SGML
indicate FrameMaker running under
the structured product interface.
FrameViewer is retained for backward
compatibility. Can be one of:
Property
FrameMaker
FrameMaker+SGML
FrameViewer
DemoMaker
DemoMaker+SGML
FP_ProgId
StringT
Returns the Program ID of the current
FrameMaker session
FP_Reformatting
IntT
True if reformatting is enabled.
FP_RememberMissing
FontNames
IntT
True if Remember Missing Font
Names is activated .
FP_RemoveExtraWhiteSpa
cesOnXMLImport
IntT
If True, removes extra whitespace
from the XML while importing.
FP_ScreenHeight
IntT
Height of the FrameMaker product
window in pixels.
FP_ScreenWidth
IntT
Width of the FrameMaker product
window in pixels.
FP_ScreenX
IntT
The offset of the FrameMaker product
window in pixels from the left side of
the screen.
If you set a value that would result in
the product window being off the
screen, that value is ignored and the
old value is retained.
FP_ScreenY
IntT
The offset of the FrameMaker product
window in pixels from the top of the
screen.
If you set a value that would result in
the product window being off the
screen, that value is ignored and the
old value is retained.
FDK Programmer’s Reference 907
4
The DOCTYPE system identifier for the source XML document.
Session
Type
Meaning
FP_Snap
IntT
True if Snap is turned on for the
session.
FP_TrackChangesOn
Boolean
Determines whether track changes in
On or Off for a document
FP_StackWarningLevel
IntT
Determines how warnings are
displayed when history-clearing
operations occur. It corresponds to an
option set in the Preferences dialog,
and to the preference-file flag
hpWarning. Use F_ApiSetInt to
set this property value, and
F_ApiGetInt to retrieve it.
Property
Allowed values are:
– FvWarnNever: Disables warnings
for history-clearing operations for the
session.
– FvWarnOnce: Displays a warning
when a particular history-clearing
command is issued,but does not warn
on subsequent uses of that command.
– FvWarnAlways: Displays warnings
every time a history-clearing
command is issued.
908
FP_StructAppAttrConfig
File
StringT
Set an attribute config file for a
structured application.
FP_TmpDir†
StringT
Pathname of temporary directory for
internal FrameMaker product
processes; the directory specified by
the DOS $TEMP environment
variable.
FP_UndoFDKRecording
IntT
Overrides the default value specified
in the initialization flag
EnableUndoInFDK. Use
F_ApiSetInt to set this property
value, and F_ApiGetInt to retrieve
it. Set the property to zero to disable
FDK Undo recording for a session, or
to a non-zero value to enable Undo
recording.
FP_UserLogin†
StringT
User login name.
FP_UserName†
StringT
User name.
FDK Programmer’s Reference
Session
Property
Type
Meaning
...
The DOCTYPE system identifier for the source XML document.
IntT
True if validation is enabled.
†
IntT
Frame version number (before the
decimal).
FP_VersionMinor†
IntT
Frame version number (after the
decimal).
FP_ViewQuickAccessBar
IntT
True if the QuickAccess bar is
visible.
FP_ViewFormattingBar
IntT
True if the formatting bar is visible.
FP_ViewFormattingBar is
available only on Windows platforms.
FP_WindowSystem†
StringT
Name of window system that the
FrameMaker product is running under:
FP_Validating
FP_VersionMajor
MSWindows
FP_FM_XmlDir†
StringT
Directory pathname of
$FMHOME/structure/xml.
FP_XSLTTransformationS
cenarioFile†
StringT
Returns the Transformation File path
specified in maker.ini.
FDK Programmer’s Reference 909
4
The DOCTYPE system identifier for the source XML document.
Structural elements
Structural elements
The API uses an FO_Element object to represent an element and an
FO_ElementDef object to represent an element definition in a Structured
FrameMaker document.
FO_Element
FO_Element objects have the following properties.
Element general properties
FO_Element objects have the following general properties.
Property
FP_AttrDisplay
Type
Meaning
IntT
Specifies element’s attribute display
properties:
FV_ATTR_DISP_NONE: don’t display
attributes
FV_ATTR_DISP_REQSPEC: display
required and specified attributes
FV_ATTR_DISP_ALL: display all
attributes
910
FP_Attributes
F_AttributesT
The element’s attributes.
FP_ContextLabel†
StringT
The context label (if any) applied to
the element.
FP_ElementIsCollapsed
IntT
True if element is collapsed in
Structure View.
FDK Programmer’s Reference
Structural elements
Property
FP_ElementType†
Type
Meaning
IntT
The type of element:
...
The DOCTYPE system identifier for the source XML document.
FV_FO_CONTAINER
FV_FO_TBL
FV_FO_MARKER
FV_FO_EQN
FV_FO_XREF
FV_FO_TBL_TITLE
FV_FO_TBL_HEADING
FV_FO_TBL_BODY
FV_FO_TBL_FOOTING
FV_FO_TBL_ROW
FV_FO_TBL_CELL
FV_FO_FOOTNOTE
FV_FO_GRAPHIC
FV_FO_SYS_VAR
FV_FO_RUBIGROUP
FV_FO_RUBI
The following values, which were
used in previous versions of
FrameMaker+SGML, are no longer
supported:
FV_FO_AFRAME
FV_FO_IMP_OBJECT
FV_FO_EMPTY
FV_FO_EMPTYPGF
FV_FO_VAR
FP_MatchingFirstPgf
Clauses†
F_IntsT
IDs of the first paragraph clauses
(FO_FmtRuleClause IDs) in the
element’s definition that apply to the
element.
FP_FormatOverride†
IntT
True if the element has a format
override.
FP_MarkedForNamed
Destination
IntT
Used for generatig PDF. If True, this
element will have a corresponding
Named Destination in the generated
PDF.
FDK Programmer’s Reference
911
4
The DOCTYPE system identifier for the source XML document.
Structural elements
Type
Meaning
FP_MatchingLastPgf
Clauses†
F_IntsT
IDs of the last paragraph clauses
(FO_FmtRuleClause IDs) in the
element’s definition that apply to the
element.a
FP_MatchingObject
Clauses†
F_IntsT
IDs of the object clauses
(FO_FmtRuleClause IDs) in the
element’s definition that apply to the
element.
FP_MatchingPrefix
Clauses†
F_IntsT
IDs of the prefix clauses
(FO_FmtRuleClause IDs) in the
element’s definition that apply to the
element.
FP_MatchingSuffix
Clauses†
F_IntsT
IDs of the suffix clauses
(FO_FmtRuleClause IDs) in the
element’s definition that apply to the
element.
FP_MatchingText
Clauses†
F_IntsT
IDs of the text clauses
(FO_FmtRuleClause IDs) in the
element’s definition that apply to the
element.
FP_TextRange†
F_TextRangeT
Text range that the element
encompasses (see the explanation
below).
FP_Unique†
IntT
The element’s UID.
FP_UserString
StringT
A string to which clients can store
private data.
Property
a. The FP_MatchingClauseTypeClauses properties specify only format rule clauses that are in the
element definition’s format rules (that is, the format rules specified by the element definition’s
FP_TextFormatRules and FP_ObjectFormatRules properties). Format rule clauses that the
element inherits from ancestor elements may also apply to it. To determine whether an element inherits
format rule clauses from ancestor elements, you must traverse up the structure tree and check the
FP_Matching
Clauses properties for each ancestor element.
912
FDK Programmer’s Reference
Structural elements
...
The DOCTYPE system identifier for the source XML document.
The FP_TextRange property for a structural element specifies an F_TextRangeT
structure. The text locations specified by the beg and end fields of the
F_TextRangeT structure depend on the element type, as shown in the following table.
Element type
FV_FO_CONTAINER
FV_FO_SYS_VAR
Text locations specified by the beg and end fields
beg specifies the beginning of the container element, variable,
or cross-reference; end specifies the end of the container
element, variable, or cross-reference
FV_FO_XREF
FV_FO_FOOTNOTE
beg and end both specify the anchor of the object (the
footnote, marker, table, graphic, or equation)
FV_FO_MARKER
FV_FO_TBL
FV_FO_GRAPHIC
FV_FO_EQN
FV_FO_TBL_TITLE
FV_FO_TBL_HEADING
beg and end both specify nothing (the
F_ApiGetTextRange() call fails with a
FE_BadOperation error)
FV_FO_TBL_BODY
FV_FO_TBL_FOOTING
FV_FO_TBL_ROW
FV_FO_TBL_CELL
Text element
beg specifies location of the first character (or other content) in
the dummy text element; end specifies the offset after the last
character (or other content) in the element
FDK Programmer’s Reference 913
4
The DOCTYPE system identifier for the source XML document.
Structural elements
Element ID properties
FO_Element objects have the following properties that specify the IDs of other
objects.
Type
Meaning
FP_BookComponent†
F_ObjHandleT
Component file in book
(FO_BookComponent ID).
FP_ElementDef
F_ObjHandleT
Element’s element definition
(FO_ElementDef ID).
FP_FirstChildElement†
F_ObjHandleT
If element is a container, element’s
first child element (FO_Element
ID).
FP_LastChildElement†
F_ObjHandleT
If element is a container, element’s
last child element (FO_Element
ID).
FP_NextSiblingElement†
F_ObjHandleT
Element’s next sibling element
(FO_Element ID).
FP_Object†
F_ObjHandleT
ID of the object that an element
contains. The type of object the ID
specifies depends on the element
definition as follows:
Property
FV_FO_TBL: FO_Tbl
FV_FO_MARKER: FO_Marker
FV_FO_EQN: FO_AFrame
(containing the equation)
FV_FO_XREF: FO_XRef
FV_FO_SYS_VAR: FO_Var
FV_FO_FOOTNOTE: FO_Fn
FV_FO_GRAPHIC: FO_AFrame
(containing the graphic)
FV_FO_TBL_TITLE: FO_Tbl
FV_FO_TBL_HEADING: FO_Tbl
FV_FO_TBL_BODY: FO_Tbl
FV_FO_TBL_FOOTING: FO_Tbl
FV_FO_TBL_ROW: FO_Row
FV_FO_TBL_CELL: FO_Cell
FV_FO_RUBIGROUP: FO_Rubi
FV_FO_RUBI: FO_Rubi
914
FDK Programmer’s Reference
Structural elements
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_ParentElement†
F_ObjHandleT
Element’s parent element
(FO_Element ID).
FP_PrevSiblingElement†
F_ObjHandleT
Element’s previous sibling element
(FO_Element ID).
Property
Element validation properties
FO_Element objects have the following validation properties.
Type
Meaning
FP_AllowAsSpecialCase
IntT
True if the element is treated as a
special case.
FP_AttributeValue
Invalid
IntT
True if the element contains an
attribute value that is invalid.
FP_BookComponentMissing
IntT
True if a component file is missing
from a book.
FP_ElementIsUndefined†
IntT
True if the element is undefined.
FP_ErrorInBookComponent
IntT
True if there is a validation error for
a component in a book.
FP_ContentIsLoosely
Valid†
IntT
True if the content is loosely valid (it
has some missing elements).
FP_ContentIsStrictly
Valid†
IntT
True if the content of the element is
strictly valid.
FP_ContentMustBeEmpty†
IntT
True if the element can’t have any
content.
FP_ContentNeededAt
Begin†
IntT
True if content is needed at the
beginning of the element.
FP_ContentNeededAtEnd†
IntT
True if content is needed at end of
the element.
Property
†
†
FP_ContentNeededAtEnd is
obsolete, but is supported for
backward compatibility.
FDK Programmer’s Reference 915
4
The DOCTYPE system identifier for the source XML document.
Structural elements
Type
Meaning
FP_ElementIsExcludedIn
Context†
IntT
True if the element is excluded.
FP_ElementIsInvalidIn
Parent†
IntT
True if the element cannot occur
anywhere in its current parent.
FP_ElementIsInvalidIn
Position†
IntT
True if the element is invalid in its
current position.
FP_HoleBeforeElement†
IntT
True if there are one or more missing
elements before the element within
the same parent.
FP_InvalidHighestLevel†
IntT
True if the element cannot be the
highest-level element in
the flow.
FP_NextInvalidElement†
F_ObjHandleT
Next invalid element in the document
(FO_Element ID).
FP_TextIsInvalidIn
Element†
IntT
True if the element contains only
text and the element definition
disallows it.
Property
FP_TextIsInvalidInElement is
obsolete and is no longer supported.
916
FDK Programmer’s Reference
Structural elements
Property
FP_ValidationFlags†
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
IntT
Bit flags specifying the element’s
validity. To determine all the ways in
which an element is invalid without
querying all the validation properties,
query
this property. Each bit flag in
the returned value represents the value
of the validation property with the
corresponding name. For example, if
the FP_ElementTypeMismatch
property is True, the
FV_ELEM_TYPE_MISMATCH flag
is set.
FV_ELEM_UNDEFINED
FV_ELEM_TYPE_MISMATCH
FV_ELEM_EXCLUDED
FV_ELEM_INVALID_IN_PARENT
FV_ELEM_INVALID_AT_POSITION
FV_ELEM_HAS_TEXT_INVALID
FV_ELEM_CONTENT_MUST_BE_EMP
TY
FV_ELEM_MISSING_CONTENT_BEF
ORE
FV_ELEM_MISSING_CONTENT_AT_
BEG
FV_ELEM_MISSING_CONTENT_AT_
END
FV_ELEM_NOT_VALID_AS_ROOT
FV_ELEM_BOOK_COMP_MISSING
FV_ELEM_BOOK_COMP_INVALID
FV_ELEM_ATTRVAL_REQUIRED
FV_ELEM_ATTRVAL_INVALID
FV_ELEM_CONTENT_STRICTLY_VA
LID
FV_ELEM_CONTENT_LOOSELY_VAL
ID
FDK Programmer’s Reference 917
4
The DOCTYPE system identifier for the source XML document.
Structural elements
Element DITA properties
FO_Element objects have the following DITA-related properties.
Type
Meaning
FP_NextDITAConrefElemen
tInDoc
StringT
The next Conref element in the
document
FP_NextDITAXrefElementI
nDoc
StringT
The next XRef element in the
document
FP_NextDITALinkElementI
nDoc
StringT
The next Link element in the
document
FP_NextDITATopicrefElem
entInDoc
StringT
The next Topicref element in the
document
FP_NextDITATopicsetrefE
lementInDoc
StringT
The next Topicsetref element in the
document
Property
FO_ElementDef
FO_ElementDef objects have the following properties.
Type
Meaning
FP_AlsoInsert
F_StringsT
The list of the tags of child elements
that are automatically inserted when
an element is initially added.. For
example, consider the case where
you set AlsoInserts property of
element definition of A to [[a1,
a11],[a2, a21]]. In this case, when A
is inserted, the following elements
are inserted: children of A are a1 and
a2, and children of a1 and a2 are a11
and a21 respectively.
FP_AttributeDefs
F_AttributeDefsT
The element definition’s attribute
definitions.
FP_BannerText
StringT
Text string of banner text associated
with an element definition object.
FP_Comment
StringT
Text string of comment.
Property
918
FDK Programmer’s Reference
Structural elements
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_DescriptiveTag
StringT
A small description about the
element. If specified in the EDD, the
user ca n view element description in
Element Catalog of the structured
document.
FP_InitStructure
Pattern
StringT
The initial structure pattern; for table
elements, a comma delimited string
that specifies the necessary child
elements to automatically insert.
Property
FDK Programmer’s Reference 919
4
The DOCTYPE system identifier for the source XML document.
Structural elements
Property
FP_ElementDefType
Type
Meaning
IntT
Type of formatter object represented
by the element with element
definition. FV_FO_CONTAINER
identifies a container element. Other
values identify object (noncontainer)
elements.
FV_FO_UNSPECIFIED
FV_FO_CONTAINER
FV_FO_TBL
FV_FO_MARKER
FV_FO_EQN
FV_FO_XREF
FV_FO_TBL_TITLE
FV_FO_TBL_HEADING
FV_FO_TBL_BODY
FV_FO_TBL_FOOTING
FV_FO_TBL_ROW
FV_FO_TBL_CELL
FV_FO_FOOTNOTE
FV_FO_GRAPHIC
FV_FO_SYS_VAR
The following values, which were
used in previous versions of
FrameMaker+SGML, are no longer
supported:
FV_FO_AFRAME
FV_FO_IMP_OBJECT
FV_FO_EMPTY
FV_FO_EMPTYPGF
FV_FO_VAR
FV_FO_RUBIGROUP
FV_FO_RUBI
920
FP_ElementIn
Catalog
IntT
True if the element is in the
Element Catalog.
FP_ElementPgf
Format
StringT
The name of the paragraph format
applied to the element.
FP_Exclusions
F_StringsT
List of excluded elements.
FDK Programmer’s Reference
Tables
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_FirstPgfRules†
F_IntsT
The IDs of the first
paragraph format rules
(FO_FmtRule IDs).a
FP_GeneralRule
StringT
Text of the element’s
general rule.
FP_GeneralRule
ErrorOffsets†
F_IntsT
Contains the error offsets (two
positions are specified only if the
content rule is ambiguous).
F_StringsT
List of included elements.
FP_LastPgfRules
F_IntsT
The IDs of the last paragraph format
rules (FO_FmtRule IDs).
FP_Name†
StringT
Name of the element definition.
FP_NextElementDefIn
Doc†
F_ObjHandleT
Next element definition
in the document’s list of element
definitions (FO_ElementDef ID).
FP_ObjectFmtRules†
F_IntsT
The IDs of the object format rules
(FO_FmtRule IDs).
FP_ObjectType
IntT
FP_ObjectType is obsolete and
no longer supported. Use
FP_ElementDefType instead.
FP_PrefixRules†
F_IntsT
The IDs of the prefix format rules
(FO_FmtRule IDs).
FP_SuffixRules†
F_IntsT
The IDs of the suffix format rules
(FO_FmtRule IDs).
FP_TableTagging
StringT
If the element is a table, the table
format for new instances of the
element.
FP_TextFmtRules†
F_IntsT
The IDs of the text format rules
(FO_FmtRule IDs).
FP_ValidHighest
Level
IntT
True if the element can be used as
the highest-level element for a flow
Property
FP_Inclusions
†
a. To set the format rules for an element definition, use F_ApiNewFmtRuleObject().
Tables
The API uses FO_Cell, FO_Row, and FO_Tbl objects to represent tables.
FDK Programmer’s Reference 921
4
The DOCTYPE system identifier for the source XML document.
Tables
FO_Cell
The API uses an FO_Cell object to represent each cell in a table. FO_Cell objects
have the following properties.
Type
Meaning
FP_CellAboveInCol†
F_ObjHandleT
Cell above current cell (FO_Cell
ID).
FP_CellAngle
IntT
Angle of rotation.
FP_CellBelowInCol†
F_ObjHandleT
Cell below current cell (FO_Cell
ID).
FP_CellColNum†
IntT
Cell’s column number.
FP_CellDefaultBottom
Ruling†
F_ObjHandleT
Cell’s default bottom ruling
(FO_RulingFmt ID).
FP_CellDefaultLeft
Ruling†
F_ObjHandleT
Cell’s default left ruling
(FO_RulingFmt ID).
FP_CellDefaultRight
Ruling†
F_ObjHandleT
Cell’s default right ruling
(FO_RulingFmt ID).
FP_CellDefaultTop
Ruling†
F_ObjHandleT
Cell’s default top ruling
(FO_RulingFmt ID).
FP_CellIsShown†
IntT
True if the cell is conditional and
is visible.
FP_CellIsStraddled†
IntT
If the cell is in a straddle but is not
the first cell,
FP_CellIsStraddled
specifies True. If the cell is the
first cell in a straddle, or it is not in
a straddle,
FP_CellIsStraddled
specifies False.
FP_CellNumColsStraddled†
IntT
If the cell is the first cell in a
horizontal straddle,
FP_CellNumColsStraddled
specifies the number of columns in
the straddle. Otherwise, it specifies
1.
FP_CellNumRowsStraddled†
IntT
If the cell is the first cell
in a vertical straddle,
FP_CellNumRowsStraddled
specifies the number of rows in the
straddle. Otherwise, it specifies 1.
Property
922
FDK Programmer’s Reference
Tables
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_ContentHeight†
MetricT
The distance between the top of
the cell and the baseline of the last
line in the cell.
FP_CellOverrideBottom
Ruling
F_ObjHandleT
Cell’s bottom ruling
(FO_RulingFmt ID). NULL
if there is no override.
FP_CellOverrideFill
IntT
Fill pattern. NULL if there is no
override fill pattern.
FP_CellOverrideLeft
Ruling
F_ObjHandleT
Cell’s left ruling (FO_RulingFmt
ID). NULL
if there is no override left ruling.
FP_CellOverrideRight
Ruling
F_ObjHandleT
Cell’s right ruling
(FO_RulingFmt ID). NULL
if there is no override right ruling.
FP_CellOverride
Shading
F_ObjHandleT
Spot color (FO_Color ID).
NULL if there is no override
shading.
FP_CellOverrideTop
Ruling
F_ObjHandleT
Cell’s top ruling (FO_RulingFmt
ID). NULL if there is no override
top ruling.
FP_CellRow†
F_ObjHandleT
Row containing the cell (FO_Row
ID).
FP_CellUseOverrideB
Ruling
IntT
True if the cell’s bottom ruling
(specified by
FP_CellOverrideBottom
Ruling) overrides the default
ruling specified by the table
format.
FP_CellUseOverrideFill
IntT
True if the cell’s fill pattern
(specified by
FP_CellOverrideFill)
overrides the default fill pattern
specified by the table format.
FP_CellUseOverride
LRuling
IntT
True if the cell’s left ruling
(specified by
FP_CellOverrideLeft
Ruling) overrides the ruling
specified by the table format.
Property
FDK Programmer’s Reference 923
4
The DOCTYPE system identifier for the source XML document.
Tables
Type
Meaning
FP_CellUseOverride
RRuling
IntT
True if the cell’s right ruling
(specified by
FP_CellOverrideRight
Ruling) overrides the ruling
specified by the table format.
FP_CellUseOverride
Shading
IntT
True if the cell’s shading
(specified by
FP_CellOverrideShading)
overrides the default shading
specified by the table format.
FP_CellUseOverride
TRuling
IntT
True if the cell’s top ruling
(specified by
FP_CellOverrideTopRuling)
overrides the default top ruling
specified by the table format.
FP_Element†
F_ObjHandleT
If the cell is in a Structured
FrameMaker document, the ID of
the element containing the cell.
FP_FirstPgf†
F_ObjHandleT
First paragraph in the cell
(FO_Pgf ID).
FP_HighestLevelElement†
F_ObjHandleT
Cell’s highest-level element if the
cell is in a structured document
(FO_Element ID).
Property
FP_HighestLevelElement is
obsolete but is supported for
backward compatibility.
924
FP_InTextFrame†
F_ObjHandleT
Text frame containing the cell
(FO_TextFrame ID).
FP_InTextObj†
F_ObjHandleT
Text object containing the cell
(FO_SubCol ID).
FP_LastPgf†
F_ObjHandleT
Last paragraph in the cell (FO_Pgf
ID).
FP_NextCellInRow†
F_ObjHandleT
Next cell in current row from left
to right (FO_Cell ID).
FP_NextCellInTbl†
F_ObjHandleT
Next cell from left to right
(FO_Cell ID). If the cell is at the
end of a row, the next cell is the
first cell in the next row.
FP_NextCell
F_ObjHandleT
Next cell in the text frame
(FO_Cell ID).
FDK Programmer’s Reference
Tables
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_Overflowed†
IntT
Specifies whether the text in the
cell overflows. True if the row
Height Limit Maximum is too low
to display all the text in the cell.
FP_PrevCellInRow†
F_ObjHandleT
Previous cell in current row
(FO_Cell ID).
FP_PrevCell†
F_ObjHandleT
Previous cell in the text frame
(FO_Cell ID).
FP_Unique†
IntT
The cell’s UID
Property
Text
To get the text in a table cell, call
F_ApiGetText() with objId
set to the cell ID. To add text to a
cell, call F_ApiAddText(). To
delete text from a cell, call
F_ApiDeleteText(). For more
information, see
“F_ApiAddText()” on page 80,
“F_ApiDeleteText()” on page 151,
and “F_ApiGetText()” on
page 249.
FO_Row
The API uses an FO_Row object to represent each row in a table. FO_Row objects
have the following properties.
Type
Meaning
FP_CondFmtIsShown
IntT
True if the condition is shown.
FP_Element†
F_ObjHandleT
If the row is in a Structured FrameMaker
document, the ID of the element containing
the row.
FP_FirstCellInRow†
F_ObjHandleT
First cell in row (FO_Cell ID).
FP_Height†
MetricT
Height of the row.
FP_InCond
F_IntsT
Condition tags for row (array of
FO_CondFmt IDs).
FP_LocX†
MetricT
Offset from the left side of the text frame
containing the row.
Property
FDK Programmer’s Reference 925
4
The DOCTYPE system identifier for the source XML document.
Tables
Type
Meaning
MetricT
Offset from the top of the page frame
containing the row.
FP_NextRowInTbl†
F_ObjHandleT
Next row (FO_Row ID) in the table.
†
F_ObjHandleT
Previous row (FO_Row ID) in
the table.
FP_RowIsShown†
IntT
True if the conditional row is shown.
FP_RowKeepWithNext
IntT
True if Keep With Next Row is enabled.
FP_RowKeepWithPrev
IntT
True if Keep With Previous Row is
enabled.
FP_RowMaxHeight
MetricT
Maximum row height.
FP_RowMinHeight
MetricT
Minimum row height.
FP_RowStart
IntT
Row placement:
Property
FP_LocY†
FP_PrevRowInTbl
FV_ROW_ANYWHERE
FV_ROW_TOP_OF_COL
FV_ROW_TOP_OF_PAGE
FV_ROW_TOP_OF_LEFT_PAGE
FV_ROW_TOP_OF_RIGHT_PAGE
FP_RowTbl†
F_ObjHandleT
Table containing the row (FO_Tbl ID).
FP_RowType†
IntT
Type of row:
FV_ROW_HEADING
FV_ROW_BODY
FV_ROW_FOOTING
FP_SepOverride
F_ObjHandleT
Color separation format override
(FO_Color ID).
FP_StyleOverrides
IntT
Style condition indicators for conditional
text:
FV_CS_DOUBLE_UNDERLINE
FV_CS_NO_OVERRIDE
FV_CS_OVERLINE
FV_CS_SINGLE_UNDERLINE
FV_CS_STRIKETHROUGH
All style condition indicators are
represented as hatched lines for the table
rows.
926
FDK Programmer’s Reference
Tables
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_UseSepOverride
IntT
True if FP_SepOverride property
overrides default from the table.
FP_Width†
MetricT
Width of the row.
Property
FO_Tbl
FO_Tbl objects have the following properties.
Table basic properties
FO_Tbl objects have the following properties that specify a table’s indents, alignment,
and other placement characteristics.
Type
Meaning
FP_ContentHeight†
MetricT
The height of the table title.
FP_Locked
IntT
True if the table is part of a text inset that
retains formatting information from the
source document. The table is not affected
by global formatting performed on the
document.
FP_OrphanRows
IntT
Number of orphan rows.
FP_Overflowed†
IntT
True if the table has cells that are not
shown because they extend beyond the text
frame boundaries.
FP_TblAlignment
IntT
Horizontal placement of table:
Property
FV_ALIGN_TBL_CENTER
FV_ALIGN_TBL_LEFT
FV_ALIGN_TBL_RIGHT
FP_TblCellBottom
Margin
MetricT
Default bottom cell margin for
the table
FP_TblCellLeft
Margin
MetricT
Default left cell margin for the table
FP_TblCellRight
Margin
MetricT
Default right cell margin for the table
FP_TblCellTop
Margin
MetricT
Default top cell margin for the table
FDK Programmer’s Reference 927
4
The DOCTYPE system identifier for the source XML document.
Tables
Type
Meaning
FP_TblLeftIndent
MetricT
Left indent for the table
FP_TblPlacement
IntT
Vertical placement of table on page:
Property
FV_TBL_ANYWHERE
FV_TBL_TOP_OF_COL
FV_TBL_TOP_OF_PAGE
FV_TBL_TOP_OF_LEFT_PAGE
FV_TBL_TOP_OF_RIGHT_PAGE
FV_TBL_FLOAT
FP_TblRightIndent
MetricT
Right indent for the table
FP_TblSpaceAbove
MetricT
Vertical space above the table
FP_TblSpaceBelow
MetricT
Vertical space below the table
FP_TextLoc
F_TextLocT
The text location of the table’s anchor
FP_Unique†
IntT
The table’s UID
Table general properties
FO_Tbl objects have the following properties that provide information about a table’s
width and its columns and rows.
Type
Meaning
FP_FirstRowInTbl†
F_ObjHandleT
First row in the table (FO_Row ID)
FP_LastRowInTbl†
F_ObjHandleT
Last row in the table (FO_Row ID)
FP_NextTblInDoc†
F_ObjHandleT
Next table (FO_Tbl ID) in the document
FP_TblCatalogEntry†
IntT
True if the table’s format is in the Table
Catalog
FP_TblColWidths
F_MetricsT
List of column widths
FP_TblNumbering
IntT
Direction of autonumbering for
the table:
Property
FV_TBL_NUM_BY_COL
FV_TBL_NUM_BY_ROW
FP_TblNumCols†
928
FDK Programmer’s Reference
IntT
Number of columns in the table
Tables
Type
Meaning
FP_TblNumRows†
IntT
Number of rows in the table
FP_TblTag
StringT
Name of table format
FP_TblWidth†
MetricT
Horizontal width of the table
Property
...
The DOCTYPE system identifier for the source XML document.
Table ruling properties
FO_Tbl objects have the following properties that specify the table rulings.
Type
Meaning
FP_TblBodyRowRuling
F_ObjHandleT
Ruling applied to body rows specified
by FP_TblBodyRowRulingPeriod
(FO_RulingFmt ID).
FP_TblBodyRowRuling
Period
IntT
The periodicity of the
ruling specified by
FP_TblBodyRowRuling.
For example, if
FP_TblBodyRowRulingPeriod is
set to 3, the ruling specified by
FP_TblBodyRowRuling is applied to
every third row.
FP_TblBottomRuling
IntT
Ruling applied to the bottom of the table
(FO_RulingFmt ID).
FP_TblColRuling
F_ObjHandleT
Ruling applied to table
columns specified by
FP_TblColRulingPeriod
(FO_RulingFmt ID).
FP_TblColRulingPeriod
IntT
The periodicity of the ruling specified
by FP_TblColRuling. For example,
if FP_TblColRulingPeriod is set
to 2, the ruling specified by
FP_TblColRuling is applied to
every other column.
FP_TblHFRowRuling
F_ObjHandleT
Ruling for table heading and footing
rows (FO_RulingFmt ID).
FP_TblHFSeparator
Ruling
F_ObjHandleT
Separator ruling for table heading and
footing rows (FO_RulingFmt ID).
Property
FDK Programmer’s Reference 929
4
The DOCTYPE system identifier for the source XML document.
Tables
Type
Meaning
FP_TblLastBodyRuling
IntT
True if Draw Bottom Ruling on Last
Sheet Only is enabled (FO_RulingFmt
ID).
FP_TblLeftRuling
F_ObjHandleT
Ruling for the left side of the table
(FO_RulingFmt ID).
FP_TblOtherBodyRow
Ruling
F_ObjHandleT
Ruling for body rows that
aren’t specified by
FP_TblBodyRowRulingPeriod
(FO_RulingFmt ID).
FP_TblOtherColRuling
F_ObjHandleT
Ruling for columns that
aren’t specified by
FP_TblColRulingPeriod
(FO_RulingFmt ID).
FP_TblRightRuling
F_ObjHandleT
Ruling for the right side of the table
(FO_RulingFmt ID).
FP_TblTopRuling
F_ObjHandleT
Ruling for the top of the table
(FO_RulingFmt ID).
Property
Table selection properties
FO_Tbl objects have the following properties that specify a table’s selected rows and
columns. All table selection properties are read-only. To select table rows or cells, use
F_ApiMakeTblSelection(). For more information, see
“F_ApiMakeTblSelection()” on page 297.
Type
Meaning
FP_BottomRow
Selection†
F_ObjHandleT
Bottom body row in selection, if table is
selected (FO_Row ID)
FP_LeftColNum†
IntT
Number of leftmost selected column, if table is
selected (columns are numbered from left to
right, starting with 0)
FP_RightColNum†
IntT
Number of rightmost selected column, if table is
selected (columns are numbered from left to
right, starting with 0)
Property
930
FDK Programmer’s Reference
Tables
Type
Meaning
FP_TblTitle
Selected†
IntT
True if table title is selected
FP_TopRow
Selection†
F_ObjHandleT
Top row in selection, if table is selected
(FO_Row ID)
Property
...
The DOCTYPE system identifier for the source XML document.
Table shading and color properties
FO_Tbl objects have the following properties that specify a table’s shading.
Type
Meaning
FP_TblBodyFirstColor
F_ObjHandleT
First spot color for table body
(FO_Color ID)
FP_TblBodyFirstFill
IntT
First fill pattern for table body
FP_TblBodyFirstPeriod
IntT
Number of columns or body
rows to which the first fill
pattern (specified by
FP_TblBodyFirstFill) is applied
FP_TblBodyNextColor
F_ObjHandleT
Exception color for columns or body
rows (FO_Color ID)
FP_TblBodyNextFill
IntT
Exception fill pattern for
table body
FP_TblBodyNextPeriod
IntT
Number of columns or body
rows to which the exception
fill pattern (specified by
FP_TblBodyNextFill) is applied
FP_TblBodyShadeBy
IntT
True if Shade By is set to Columns;
False if Shade By is set to Rows
FP_TblHFColor
F_ObjHandleT
Color for table heading and footing
FP_TblHFFill
IntT
Fill pattern for table heading and
footing (integer percentage)
Property
FDK Programmer’s Reference 931
4
The DOCTYPE system identifier for the source XML document.
Tables
Table structure properties
FO_Tbl objects have the following properties in structured documents.
Type
Meaning
FP_Element†
F_ObjHandleT
The ID of the element associated with
the table
FP_TblBodyElement†
F_ObjHandleT
The ID of the element containing the
table’s body rows
FP_TblElement†
F_ObjHandleT
The ID of the element containing the
table
FP_TblFooterElement†
F_ObjHandleT
The ID of the element containing the
table’s footer rows
FP_TblHeaderElement†
F_ObjHandleT
The ID of the element containing the
table’s header rows
FP_TblTitleElement†
F_ObjHandleT
The ID of the element containing the
table title
Property
Table title properties
FO_Tbl objects have the following properties that specify a table title’s characteristics.
Type
Meaning
FP_FirstPgf†
F_ObjHandleT
If table has a title, the first paragraph in the title
(FO_Pgf ID).
FP_HighestLevel
Element†
F_ObjHandleT
If table is in a structured document and has a
title, the title’s highest-level element
(FO_Element ID).
Property
FP_HighestLevelElement is obsolete but
is supported for backward compatibility.
932
FP_LastPgf†
F_ObjHandleT
If table has a title, the last paragraph in the title
(FO_Pgf ID).
FP_TblTitleGap
MetricT
Gap between the title and top or bottom row of
the table.
FDK Programmer’s Reference
Tables
Property
FP_TblTitle
Position
Type
Meaning
IntT
The placement of the table title:
...
The DOCTYPE system identifier for the source XML document.
FV_TBL_NO_TITLE: table has no title
FV_TBL_TITLE_BELOW: the title appears
below the table
FV_TBL_TITLE_ABOVE: the title appears
above the table
FP_TblTitle
Selected†
IntT
True if the table title is selected.
FDK Programmer’s Reference 933
4
The DOCTYPE system identifier for the source XML document.
Table formats
Table formats
The API uses an FO_TblFmt object to represent each table format in a document.
FO_TblFmt
FO_TblFmt objects have the following properties.
Table format basic properties
FO_TblFmt objects have the following properties that specify a table’s indents,
alignment, and other placement characteristics. Note that a FO_TblFmt object also
includes all the properties for a FO_PgfFmt object in order to describe the properties of
the table title. See “FO_PgfFmt” on page 887
Type
Meaning
FP_OrphanRows
IntT
Number of orphan rows
FP_TblAlignment
IntT
Horizontal placement of table:
Property
FV_ALIGN_TBL_CENTER
FV_ALIGN_TBL_LEFT
FV_ALIGN_TBL_RIGHT
934
FP_TblCellBottom
Margin
MetricT
Default bottom cell margin for the table.
FP_TblCellLeft
Margin
MetricT
Default left cell margin for the table.
FP_TblCellRight
Margin
MetricT
Default right cell margin for the table.
FP_TblCellTop
Margin
MetricT
Default top cell margin for the table.
FP_TblLeftIndent
MetricT
Left indent for the table
FP_TblLeftIndent
MetricT
Left indent for table
FDK Programmer’s Reference
Table formats
Property
FP_TblPlacement
Type
Meaning
IntT
Vertical placement of table on page:
...
The DOCTYPE system identifier for the source XML document.
FV_TBL_ANYWHERE
FV_TBL_TOP_OF_COL
FV_TBL_TOP_OF_PAGE
FV_TBL_TOP_OF_LEFT_PAGE
FV_TBL_TOP_OF_RIGHT_PAGE
FV_TBL_FLOAT
FP_TblRightIndent
MetricT
Right indent for table
FP_TblSpaceAbove
MetricT
Vertical space above table
FP_TblSpaceBelow
MetricT
Vertical space below table
FP_TblTitleGap
MetricT
Gap between title and top or bottom row
FP_TblTitle
Position
IntT
Placement of table title:
FV_TBL_NO_TITLE
FV_TBL_TITLE_BELOW
FV_TBL_TITLE_ABOVE
Table format general properties
FO_TblFmt objects have the following properties.
Type
Meaning
FP_TblCatalogEntry
IntT
True if format is in the Table Catalog
FP_Name
StringT
Name of the paragraph format of the table
title
FP_NextTblFmtInDoc†
F_ObjHandleT
Next table format in the document
(FO_TblFmt ID)
FP_TblNumbering
IntT
Direction of autonumbering for
the table:
Property
FV_TBL_NUM_BY_COL
FV_TBL_NUM_BY_ROW
FP_TblTag
StringT
Name of the table format
FDK Programmer’s Reference 935
4
The DOCTYPE system identifier for the source XML document.
Table formats
Table format new table properties
FO_TblFmt objects have the following properties that specify how many rows and
columns a new table will have when it is created.
Type
Meaning
FP_TblInitNumBodyRows
IntT
Number of body rows for new table
FP_TblInitNumCols
IntT
Number of columns for new table
FP_TblInitNumFRows
IntT
Number of footing rows for new table
FP_TblInitNumHRows
IntT
Number of heading rows for new table
Property
Table format ruling properties
FO_TblFmt objects have the following properties that specify a table’s rulings.
Type
Meaning
FP_TblBodyRowRuling
F_ObjHandleT
Ruling for body rows that
aren’t specified by
FP_TblBodyRowRulingPeriod
(FO_RulingFmt ID).
FP_TblBodyRowRuling
Period
IntT
The periodicity of the ruling specified
by FP_TblOtherBodyRowRuling.
For example, if
FP_TblBodyRowRulingPeriod is
set to 3, the ruling specified by
FP_TblOtherBodyRowRuling is
applied to every third row.
FP_TblBottomRuling
F_ObjHandleT
Ruling for the bottom of the table
(FO_RulingFmt ID).
FP_TblColRuling
F_ObjHandleT
Ruling for columns that aren’t
specified by
FP_TblColRulingPeriod
(FO_RulingFmt ID).
FP_TblColRulingPeriod
IntT
The periodicity of the ruling specified
by FP_TblOtherColRuling.
For example, if
FP_TblColRulingPeriod is set to
2, the ruling specified by
FP_TblOtherColRuling is applied
to every other column.
Property
936
FDK Programmer’s Reference
Table formats
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_TblHFRowRuling
F_ObjHandleT
Ruling for the heading and footing
rows (FO_RulingFmt ID).
FP_TblHFSeparator
Ruling
F_ObjHandleT
Separator ruling for the table heading
and footing rows (FO_RulingFmt
ID).
FP_TblLastBodyRuling
IntT
True if Draw Bottom Ruling on Last
Sheet Only is enabled
(FO_RulingFmt ID).
FP_TblLeftRuling
F_ObjHandleT
Ruling for the left side of the table
(FO_RulingFmt ID).
FP_TblOtherBodyRow
Ruling
F_ObjHandleT
Ruling applied to body rows specified
by FP_TblBodyRowRulingPeriod
(FO_RulingFmt ID).
FP_TblOtherColRuling
F_ObjHandleT
Ruling applied to table columns
specified by
FP_TblColRulingPeriod
(FO_RulingFmt ID).
FP_TblRightRuling
F_ObjHandleT
Ruling for the right side of the table
(FO_RulingFmt ID).
FP_TblTopRuling
F_ObjHandleT
Ruling for the top of the table
(FO_RulingFmt ID).
Property
Table format shading and color properties
FO_TblFmt objects have the following properties that specify a table’s shading.
Type
Meaning
FP_TblBodyFirstColor
F_ObjHandleT
First spot color for table body
(FO_Color ID)
FP_TblBodyFirstFill
IntT
First fill pattern for table body
FP_TblBodyFirstPeriod
IntT
Number of columns or body
rows to which the first fill pattern
(specified by
FP_TblBodyFirstFill) is applied
FP_TblBodyNextColor
F_ObjHandleT
Exception color for columns or body
rows (FO_Color ID)
Property
FDK Programmer’s Reference 937
4
The DOCTYPE system identifier for the source XML document.
Text columns
Type
Meaning
FP_TblBodyNextFill
IntT
Exception fill pattern for
table body
FP_TblBodyNextPeriod
IntT
Number of columns or body
rows to which the exception
fill pattern (specified by
FP_TblBodyNextFill) is applied
FP_TblBodyShadeBy
IntT
True if Shade By is set to Columns;
False if Shade By is
set to Rows
FP_TblHFColor
F_ObjHandleT
Color for table heading and footing
FP_TblHFFill
IntT
Fill pattern for table heading and footing
(integer percentage)
Property
Text columns
The API uses FO_TextFrame objects to represent text frames and FO_SubCol
objects to represent the text columns in them. For more information, see “Columns” on
page 757 and “FO_TextFrame” on page 863.
Text frames
Text frames are a type of graphics. For information on text frames, see
“FO_TextFrame” on page 863.
Text insets
The API uses FO_TiApiClient, FO_TiFlow, FO_TiText, and
FO_TiTextTable objects to represent text that is imported by reference (text insets).
Each type of text inset object has a set of properties that are common to all text inset
objects and a set of properties that are specific to it.
938
FDK Programmer’s Reference
Text insets
...
The DOCTYPE system identifier for the source XML document.
Common text inset properties
The following properties are common to all text inset objects.
Type
Meaning
FP_ImportHint
StringT
Record identifying the filter used to
import the text. The FrameMaker
product uses this record to find the filter
to use when updating the inset. For a
complete description of the syntax of this
string, see “Syntax of FP_ImportHint
strings” on page 939.
FP_TiLocked
IntT
True if the inset is locked. To change an
inset’s contents, you must unlock it.
Always relock an inset after you have
finished changing its contents.
FP_Name
StringT
A name assigned to the inset by an FDK
client. It is not automatically assigned by
the FrameMaker product.
FP_NextTiInDoc†
F_ObjHandleT
The ID of the next text inset in the list of
text insets in the document
(FO_TiApiClient, FO_TiText,
FO_TiTextTable, or
FO_TiFlow ID).
FP_TextRange†
F_TextRangeT
The text range, in the document
containing the text inset, occupied by the
text inset.
FP_TiAutomaticUpdate
IntT
True if the inset is updated
automatically.
FP_TiAutomaticUpdate has no
effect if the document’s
FP_DontUpdateTextInsets
property is set to True.
FP_TiFile
StringT
Pathname of the source file.
FP_TiFileModDate
StringT
The modification date of the text inste’s
source file.
FP_TiLastUpdate
IntT
Time when the inset was last updated,
expressed in seconds since 1 January,
1970.
IntT
The text inset’s UID.
Property
†
FP_Unique†
FDK Programmer’s Reference 939
4
The DOCTYPE system identifier for the source XML document.
Text insets
Syntax of FP_ImportHint strings
The FP_ImportHint property specifies a record that identifies the filter used to
import text by reference. FrameMaker products use this record to find the correct filter
to update a text inset. The syntax of this record is:
record_vers vendor format_id platform filter_vers filter_name
Note that the fields in the record are not separated by spaces.
0001XTNDWDBNMACP0002MS Word 4,5
..............................................................................
IMPORTANT: If you are setting an FP_ImportHint property, the string you are
using should be terminated with NULL. The string itself must not contain NULL or
undisplayable characters.
..............................................................................
You can determine which FP_ImportHint strings are registered by querying the
FP_ExportFilters property of the FO_Session object.
Each field of the record (except filter_name) specifies a four-byte code. If a code
contains fewer than four alphanumeric characters, the remaining bytes must be filled out
with spaces.
The rest of this section describes each field in the record.
record_vers specifies the version of the record, currently 0001.
vendor is a code specifying the filter’s vendor. The code is a string of four characters.
The following table lists some possible codes.
Code
Meaning
PGRF
Built-in Frame filters
FAPI
External Frame FDK client filter
FFLT
External Frame filters
IMAG
External ImageMark filters
XTND
External XTND filters
Note that this is not a comprehensive list of codes. Codes may be added to this list by
Frame or by developers at your site.
940
FDK Programmer’s Reference
Text insets
...
The DOCTYPE system identifier for the source XML document.
format_id is a code specifying the format that the filter translates.
The code is a string of four characters. The following table lists the
possible codes.
Code
Meaning
HTML
HTML document (for export, only)
XML
XML document (for export, only)
WDBN
Microsoft Word compound document
WPBN
WordPerfect compound document
RTF
Microsoft’s RTF compound document
IAF
Interleaf compound document
MRTF
MIF to RTF export
MIAF
MIF to IAF export
MWPB
MIF to WordPerfect export
MML
Maker Markup Language
CVBN
Corel Ventura compound document
Corel Ventura compound document (Windows)
TEXT
Plain text
TXIS
Text ISO Latin 1
TANS
Text ANSI (Windows)
TMAC
Text (Macintosh)
TASC
Text ASCII
TJIS
Japanese JIS
TSJS
Japanese Shift-JIS
FDK Programmer’s Reference 941
4
The DOCTYPE system identifier for the source XML document.
Text insets
Code
Meaning
TEUJ
Japanese EUC
TBG5
Traditional Chinese BIG 5
TEUH
Traditional Chinese EUC-CNS
TXHZ
Simplified Chinese HZ
TXGB
Simplified Chinese GB
TKOR
Korean
Note that this is not a comprehensive list of codes. Codes may be added to this list by
Frame or by developers at your site.
platform is a code specifying the platform on which the filter was run. The code is a
string of four characters. The following table lists the possible codes.
Code
Meaning
WINT
Windows NT
WIN3
Windows 3.1
WIN4
Windows 95
ilter_vers is a string of four characters identifying the version of the filter on that
platform. For example, version 1.0 of a filter is represented by the string 1.0 or the
string 0001.
filter_name is a C string (up to 31 characters long) that describes the filter.
For example, the following two records specify the HTML and XML filters on the
Windows 95 platform:
0001ADBEHTMLWIN40001HTML
0001ADBEXMLWIN40001XML
942
FDK Programmer’s Reference
Text insets
...
The DOCTYPE system identifier for the source XML document.
FO_TiApiClient properties
An FO_TiApiClient object represents text imported by an FDK client.
FO_TiApiClient objects have the following properties.
Property
Type
Common text inset properties
Meaning
See page 938.
FP_TiClientData
StringT
Data used by the client (for example, an
SQL query).
FP_TiClientName
StringT
The registered name of the client that
created the inset.
FP_TiClientSource
StringT
The name that appears as the
source in the Text Inset Properties dialog
box.
FP_TiClientType
StringT
The name that appears as the source type in
the Text Inset Properties dialog box.
FP_TiIsUnresolved
IntT
True if the inset is unresolved. A client
should set this property to True if it is
unable to resolve the inset.
FO_TiFlow properties
An FO_TiFlow object represents text imported from a FrameMaker product
document or a MIF file. FO_TiFlow objects have the following properties.
Property
Type
Common text inset properties
Meaning
See page 938.
FP_TiFlowName
StringT
The name of the imported flow if
FP_TiMainFlow is False.
FP_TiFlowPageSpace
IntT
The type of pages the imported flow is on:
FV_BODY_PAGE
FV_REFERENCE_PAGE
FDK Programmer’s Reference 943
4
The DOCTYPE system identifier for the source XML document.
Text insets
Property
FP_TiFormat
Type
Meaning
IntT
Source of the imported text’s format:
FV_SourceDoc: the text is formatted with
formats from the source document
FV_PlainText: the text is formatted as
plain text
FV_EnclosingDoc: the text is formatted
with formats from the document into
which it is imported
FP_TiMainFlow
IntT
True if the inset text is imported from the
main flow of the source document.
FP_TiRemovePageBreaks
IntT
True if page breaks are removed from the
text when FP_TiFormat is set to
FV_EnclosingDoc.
FP_TiRemoveOverrides
IntT
True if format overrides are removed
from the text when FP_TiFormat is set
to FV_EnclosingDoc.
FO_TiText properties
An FO_TiText object represents text imported from a text file. FO_TiText objects
have the following properties.
Property
Type
Common text inset properties
944
Meaning
See page 938.
FP_TiEOLisEOP
IntT
True if line ends in the imported text file
are treated as paragraph ends.
FP_TiTextEncoding†
StringT
The FP_ImportHintString for the text
inset. If this is not a FO_TiText or
FO_TiTextTable, the string is null.
FDK Programmer’s Reference
Text properties
...
The DOCTYPE system identifier for the source XML document.
FO_TiTextTable properties
An FO_TiTextTable object represents text imported from a text file into a table.
FO_TiTextTable objects have the following properties.
Property
Type
Common text inset
properties
Meaning
See page 938.
FP_TiByRows
IntT
True if each paragraph in the imported text is
converted to a row of table cells; False if each
paragraph in the imported text is converted to a
table cell.
FP_TiTblTag
StringT
The table format tag of the imported table.
FP_TiHeadersEmpty
IntT
True if the imported text is not used to fill the
heading rows.
FP_TiNumSeparators
IntT
If FP_TiSeparator specifies a space, the
number of spaces used as a separator to parse
the text into table cells.
FP_TiSeparator
StringT
If FP_TiByRows is True, a string specifying
a separator, such as a tab, used to parse the text
into table cells.
FP_TiNumCols
IntT
If FP_TiByRows is False, the number of
columns in the table.
FP_TiNumHeaderRows
IntT
The number of heading rows in the table.
FP_TiTextEncoding†
StringT
The FP_ImportHintString for the text
inset. If this is not a FO_TiText or
FO_TiTextTable, the string is null.
Text properties
Text has the following properties. To retrieve these properties for a text location, use
F_ApiGetTextPropVal() or F_ApiGetTextProps(). The properties these
functions return apply to the character to the right of the location you specify.
FDK Programmer’s Reference 945
4
The DOCTYPE system identifier for the source XML document.
Text properties
To set text properties for a text range, use F_ApiSetTextPropVal() or
F_ApiSetTextProps().
Property
FP_Capitalization
Type
Meaning
IntT
Type of capitalization:
FV_CAPITAL_CASE_NORM
FV_CAPITAL_CASE_SMALL
FV_CAPITAL_CASE_LOWER
FV_CAPITAL_CASE_UPPER
946
FP_ChangeBar
IntT
True if Change Bars is enabled at the
text location.
FP_CharTag
StringT
Name of character format tag applied to
text location.
FP_Color
F_ObjHandleT
Spot color (FO_Color ID).
FP_CombinedFontFamil
y
F_ObjHandleT
Combined font definition
(FO_CombinedFontDefn)
FP_FontAngle
IntT
Font angle (specifies an index
into the array of font angles
provided by the session property
FP_FontAngleNames).
FP_FontFamily
IntT
Font family (specifies an index
into the array of font families provided by
the session property
FP_FontFamilyNames).
FP_Font
PlatformName
StringT
Name that uniquely identifies a font on a
specific platform (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontPost
ScriptName
StringT
Name given to a font when it is sent to a
PostScript printer (for more information,
see “How the API represents fonts” on
page 107 of the FDK Programmer’s
Guide).
FP_FontSize
MetricT
Font size (2 pt to 400 pt).
FP_FontVariation
IntT
Font variation (specifies an
index into the array of font variations
provided by the session property
FP_FontVariationNames).
FDK Programmer’s Reference
Text properties
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_FontWeight
IntT
Font weight (specifies an index
into the array of font weights provided by
the session property
FP_FontWeightNames).
FP_Height†
MetricT
Height of text at text location.
FP_InCond
F_IntsT
Condition tags that apply to the text (array
of FO_CondFmt IDs).
FP_InTextFrame†
F_ObjHandleT
Text frame containing the text
(FO_TextFrame ID).
FP_InTextObj†
F_ObjHandleT
Text frame or text line in which text
appears (FO_TextFrame or
FO_TextLine ID).
FP_KernX
MetricT
Horizontal kern value for manual kerning
expressed as a percentage of an em
(metric –100% to 1000%).a A positive
value moves a character right, and a
negative value moves a character left.
FP_KernY
MetricT
Vertical kern value for manual kerning
expressed as a percentage of an em
(metric –100% to 1000%). A positive
value moves characters up, and a negative
value moves characters down.
FP_LineAscent†
MetricT
The ascent of the line containing the text,
measured from the line’s baseline.
FP_LineBaseLine†
MetricT
The location of the line containing the
text, measured from the top of the object
containing the text.
FP_LineDescent†
MetricT
The descent of the line containing the
text, measured from the line’s baseline.
FP_Locked
IntT
True if the text is included in a text inset
that gets its formatting from the source
document.
FP_LocX†
MetricT
Offset of the left side of a character from
the left side of the subcolumn
(FO_SubCol object) containing it.
FP_LocY†
MetricT
Offset of the top of a character from the
top of the subcolumn (FO_SubCol
object) containing it.
Property
FDK Programmer’s Reference 947
4
The DOCTYPE system identifier for the source XML document.
Text properties
Property
FP_Position
Type
Meaning
IntT
Position of the text:
FV_POS_SUPER: Superscript
FV_POS_NORM: Baseline
FV_POS_SUB: Subscript
FP_PairKern
IntT
True if Pair Kern is enabled.
FP_Overline
IntT
True if Overline is enabled.
FP_SepOverride
F_ObjHandleT
Color for separation override (FO_Color
ID).
FP_Spread
MetricT
Obsolete property, but still functional.
See corresponding "tracking" property
below.
FP_Stretch
MetricT
Character stretch (set width) expressed as
a percentage of normal stretch for the font
(metric –10% to 1000%).
FP_Strikethrough
IntT
True if Strikethrough is enabled.
FP_StyleOverrides
IntT
Bit flags that specify which overrides
(condition indicators) are used:
FV_CS_CHANGEBAR
FV_CS_NO_OVERRIDE
FV_CS_OVERLINE
FV_CS_STRIKETHROUGH
FV_CS_SINGLE_UNDERLINE
FV_CS_DOUBLE_UNDERLINE
FP_Tracking
MetricT
Character tracking expressed as a
percentage of an em (metric –100% to
1000%).
FP_Underlining
IntT
Type of underlining:
FV_CB_NO_UNDERLINE
FV_CB_SINGLE_UNDERLINE
FV_CB_DOUBLE_UNDERLINE
FV_CB_NUMERIC_UNDERLINE
948
FDK Programmer’s Reference
Text properties
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
FP_UseSepOverride
IntT
True if color specified for
FP_SepOverride overrides default.
FP_Width†
MetricT
Width of a character
Property
a. In the API, most percentages are represented as MetricT fractions. For spread percentages, the MetricT
value 1<<16 or 0x10000 specifies 100% or 1. For more information on MetricT values, see
“MetricT values” on page 954.
FDK Programmer’s Reference 949
4
The DOCTYPE system identifier for the source XML document.
Variables
Variables
The API uses an FO_Var object to represent a variable instance and an FO_VarFmt
object to represent a variable format.
FO_Var
FO_Var objects have the following properties.
Type
Meaning
FP_Element†
F_ObjHandleT
If the variable is in a Structured FrameMaker
document, the ID of the element associated
with the variable.
FP_Locked
IntT
True if the variable is included in a text inset
that gets its formatting from the source
document. The variable is not affected by
global formatting performed on the document.
FP_NextVarInDoc†
F_ObjHandleT
Next variable instance (FO_Var ID) in the
document.
FP_TextRange†
F_TextRangeT
The text range the variable instance
encompasses.
FP_VarFmt
F_ObjHandleT
The variable instance’s format (FO_VarFmt
ID).
FP_Unique†
IntT
The variable’s UID.
Property
FO_VarFmt
FO_VarFmt objects have the following properties.
Type
Meaning
FP_Fmt
StringT
The variable format definition; the
building blocks and text strings used to
create a variable instance with the variable
format.
FP_Name
StringT
The variable format’s name.
Property
950
FDK Programmer’s Reference
Variables
Property
FP_NextVarFmtInDoc†
...
The DOCTYPE system identifier for the source XML document.
Type
Meaning
F_ObjHandleT
Next variable format (FO_VarFmt ID) in
the document’s list of variable formats.
FDK Programmer’s Reference 951
4
The DOCTYPE system identifier for the source XML document.
Variables
Property
FP_SystemVar†
Type
Meaning
IntT
The variable format’s type.
FV_VAR_USER_VARIABLE: a userdefined variable format.
The following types specify system
variable formats:
FV_VAR_CURRENT_PAGE_NUM
FV_VAR_PAGE_COUNT
FV_VAR_CURRENT_DATE_LONG
FV_VAR_CURRENT_DATE_SHORT
FV_VAR_MODIFICATION_DATE_
LONG
FV_VAR_MODIFICATION_DATE_
SHORT
FV_VAR_CREATION_DATE_LONG
FV_VAR_CREATION_DATE_SHORT
FV_VAR_FILE_NAME_LONG
FV_VAR_FILE_NAME_SHORT
FV_VAR_HEADER_FOOTER_1
FV_VAR_HEADER_FOOTER_2
FV_VAR_HEADER_FOOTER_3
FV_VAR_HEADER_FOOTER_4
FV_VAR_HEADER_FOOTER_5
FV_VAR_HEADER_FOOTER_6
FV_VAR_HEADER_FOOTER_7
FV_VAR_HEADER_FOOTER_8
FV_VAR_HEADER_FOOTER_9
FV_VAR_HEADER_FOOTER_10
FV_VAR_HEADER_FOOTER_11
FV_VAR_HEADER_FOOTER_12
FV_VAR_HEADER_FOOTER_13
FV_VAR_HEADER_FOOTER_14
FV_VAR_HEADER_FOOTER_15
FV_VAR_HEADER_FOOTER_16
FV_VAR_HEADER_FOOTER_17
FV_VAR_HEADER_FOOTER_18
FV_VAR_TABLE_CONTINUATION
FV_VAR_TABLE_SHEET
952
FDK Programmer’s Reference
Variables
...
The DOCTYPE system identifier for the source XML document.
FDK Programmer’s Reference 953
5
Data Types and Structures Reference
..................................
.....
4
This chapter describes the data types and structures used in the API.
Data types
The following table lists primitive data types used in the API. For a list of all the data
types provided by the FDE, see “Replacing C primitive data types with FDE types” on
page 530 of the FDK Programmer’s Guide.
Frame API data type
Equivalent fundamental type
Size
BoolT
long
Signed 4 bytes
ByteT
char
Signed 1 byte
ErrorT
long
Signed 4 bytes
ConStringT
const unsigned char*
Pointer
F_ObjHandleT
long
Unsigned 4 bytes
FontEncIdT
unsigned short
Unsigned 2 bytes
GenericT
void* or int
4 bytes
IntT
long
Signed 4 bytes
MetricT
long
Signed 4 bytes
ShortT
short
Signed 2 bytes
StringT
unsigned char*
Pointer
UByteT
unsigned char
Unsigned 1 byte
UCharT
unsigned char
Unsigned 1 byte
UIntT
unsigned long
Unsigned 4 bytes
UShortT
unsigned short
Unsigned 2 bytes
VoidT
void
None
FDK Programmer’s Reference 953
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data types
MetricT values
The MetricT type is a 32-bit fixed-point number. The API and FDE use MetricT
values to express linear measurements, such as tab offsets and font sizes. They also use
MetricT values to express percentages and angular degrees when a high degree of
accuracy is required. MetricT values should not be confused with metric system
values, that is, with centimeters and meters.
Using MetricT values for linear measurements
When used for linear measurement, a MetricT unit represents a point (1/72 inch). The
16 most significant bits of a MetricT value represent the digits before the decimal;
the 16 least significant bits represent the digits after the decimal. Therefore, 1 point is
expressed as hexadecimal 0x10000 or decimal 65536.
The following table lists the units of the measurement systems FrameMaker products
support and their MetricT equivalents.
Measurement
unit
MetricT hex
value
MetricT decimal
value
Relationship to
other units
inch
0x480000
4718592
72 points
centimeter
0x1c58b1
1857713
2.54 cm per inch
millimeter
0x02d5ab
185771
25.4 mm per inch
pica
0x0c0000
786432
12 points
point
0x10000
65536
1/72 inch
didot
0x011159
69977
0.01483 inch
cicero
0x0cd02c
839724
12 didots
The FDK defines the following constants which you may prefer to use:
FV_METRIC_INCH
FV_METRIC_CM
FV_METRIC_MM
FV_METRIC_PICA
FV_METRIC_POINT
FV_METRIC_DIDOT
FV_METRIC_CICERO
With these constants, you can specify MetricT values in your client code in a way
that is easy to understand. For example, you can specify 5 inches with
5*FV_METRIC_INCH.
954
FDK Programmer’s Reference
Data structures
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
The FDE provides platform-independent utility functions that make it easy to
manipulate MetricT values without converting them. For more information on these
functions, see “Metric library” on page 551 of the FDK Programmer’s Guide.
Using MetricT values for percentages and angles
The API and FDE use MetricT values to represent percentages. For some properties,
such as the document property FP_Zoom and the character format property
FP_Spread, the decimal MetricT value 65536 specifies 100 percent. For other
properties, such as the color property FP_Black, 65536 specifies 1 percent. For
more information on specifying a particular MetricT percentage property, see
Chapter 3, “Object Reference.”
When MetricT values are used to represent angular degrees, 1 degree is expressed as
decimal 65536.
Data structures
The following structures, which are used for some FDE function parameters, are
incompletely defined in the FDK header files:
ChannelT
DirHandleT
FilePathT
HandleT
HashT
StringListT
These functions are incompletely defined because FDK clients should not directly
manipulate their fields. Their fields are not guaranteed to be the same for different
versions of the FDK. You should declare only pointers to the incompletely defined
structures. If you attempt to declare a variable with one of these structures as the type, it
will cause a compiler error.
The following sections describe data structures used by API functions.
ChannelT
Incompletely-defined structure used to specify a channel. For more information on
channels, see “” on page 539 of the FDK Programmer’s Guide.
FDK Programmer’s Reference 955
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
DirHandleT
Incompletely defined structure used to specify a directory handle. For information about
getting get a DirHandleT, see “F_FilePathOpenDir()” on page 551
FilePathT
Incompletely defined structure used to specify a filepath.
HandleT
Incompletely defined structure used to specify a memory handle. For more information
on allocating memory with memory handles, see “Allocating memory with handles” on
page 544 of the FDK Programmer’s Guide.
HashT
Incompletely defined structure used to specify a hash table. For more information on
using hash tables, see “The hash library” on page 549 of the FDK Programmer’s Guide.
StringListT
Incompletely-defined structure used to specify a string list. For more information on
using string lists, see “The string list library” on page 548 of the FDK Programmer’s
Guide.
F_AttributeDefsT
An F_AttributeDefsT structure specifies a set of attribute definitions.
typedef struct {
UIntT len;
F_AttributeDefT *val;
} F_AttributeDefsT;
956
FDK Programmer’s Reference
Data structures
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
F_AttributeDefT
The F_AttributeDefT structure describes a single attribute definition.
typedef struct {
StringT name; /* The attribute name. */
BoolT required; /* True if the attribute is required. */
UByteT flags; /* Attr value is read-only, hidden, or neither.
** See following table.
*/
IntT attrType; /* The attribute type. See following table. */
F_StringsT choices;/* Choices if attrType is FV_AT_CHOICES.*/
F_StringsT defValues;/* The default if attribute is not
** required. If attrType is
** FV_AT_INTS, FV_AT_STRINGS, etc
** the default can have multiple strings.
*/
StringT rangeMin; /* The minimum allowed value (if any). */
StringT rangeMax; /* The maximum allowed value (if any). */
} F_AttributeDefT;
The F_AttributeDefT.flags field determines whether an attribute is read-only,
hidden, of neither.
Value for flags
Means
FV_AF_READ_ONLY
The attribute value is read-only
FV_AF_HIDDEN
The attribute value is hidden
NULL
The attribute value is neither read-only nor hidden
The F_AttributeDefT.attrType identifies the attribute value’s type. It can
specify one of the following constants
attrType constant
Attribute value type
FV_AT_STRING
Any arbitrary text string
FV_AT_STRINGS
One or more arbitrary text strings
FV_AT_CHOICES
A value from a list of choices
FV_AT_INTEGER
A signed whole number (optionally restricted to a range of
values)
FV_AT_INTEGERS
One or more integers (optionally restricted to a range of
values)
FDK Programmer’s Reference 957
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
FV_AT_REAL
A real number (optionally restricted to a range of values)
FV_AT_REALS
One or more real numbers (optionally restricted to a range of
values)
FV_AT_UNIQUE_ID
A string that uniquely identifies the element
FV_AT_UNIQUE_IDREF
A reference to a UniqueID attribute
FV_AT_UNIQUE_IDREFS
One or more references to a UniqueID attribute
F_AttributesT
An F_AttributesT structure specifies a set of attributes.
typedef struct {
UIntT len;
F_AttributeT *val;
} F_AttributesT;
F_AttributeT
The F_AttributeT structure describes a single attribute.
typedef struct {
StringT name; /* The attribute name. */
F_StringsT values; /* The attribute values. */
UByteT valflags; /* Validation error flags. */
UByteT allow; /* Allow error as special case. */
} F_AttributeT;
F_CombinedFontsT
F_CombinedFontsT provides an array of F_CombinedFontT structures. The FDK
uses it to specify permutations of font characteristics for a combined font.
typedef struct {
UIntT len;
F_CombinedFontT *val;
} F_CombinedFontsT;
958
FDK Programmer’s Reference
Data structures
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
F_CombinedFontT
F_CombinedFontT specifies a set of font characteristics for a combined font. The
combinedFont field specifies the ID of a FO_CombinedFontDefn object. From this
object you can get information about the combined font such as the base and Western
font families, or the combined font name. For the list of properties for a combined font
definition, see “FO_CombinedFontDefn” on page 759.
The other fields each specify an index into a list of names in the FrameMaker product
session. For example, the weight field specifies the index of a name in the list of
names specified by the session property FP_FontWeightNames.
typedef struct {
F_ObjHandelT combinedFont; /* Combined font ID */
UIntT variation; /* Index of the font variation. */
UIntT weight; /* Index of the font weight. */
UIntT angle; /* Index of the font angle. */
} F_CombinedFontT;
F_CompareRetT
F_CompareRetT provides the results of a call to F_ApiCompare().
typedef struct {
F_ObjHandleT sumId; /* The ID of the summary document. */
F_ObjHandleT compId; /* The ID of the composite document. */
} F_CompareRetT;
F_ElementLocT
The F_ElementLocT structure specifies a location within a structural element. The
parent element is the element that contains the location. The child element is the child
of parent that immediately follows the location. The offset counts at what number of
characters into parent to set the location.
For example, assume an element named List that can contain elements named Item. To
set a location before the first Item in List, parent is the ID of the List element, child
is the ID of the first Item element in List, and offset is 0. To set the location after the
last Item in List, parent is the ID of the list element, child is 0, and offset is 0.
typedef struct {
F_ObjHandleT parentId; /* Parent element ID. */
F_ObjHandleT childId; /* Child element ID. */
IntT offset; /* Offset within child/parent element. */
} F_ElementLocT;
FDK Programmer’s Reference 959
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
F_ElementRangeT
An F_ElementRangeT structure specifies an element range.
typedef struct {
F_ElementLocT beg; /* Beginning of the element range. */
F_ElementLocT end; /* End of the element range. */
} F_ElementRangeT;
F_FontEncT
F_FontEncT stores information about the character set for a given encoding. The
encoding is specified by name, and can be one of FrameRoman,
JISX0208.ShiftJIS, BIG5, GB2312-80.EUC, or KSC5601-1992. Each element
in the arrays indicates whether its corresponding character code is a part of the font set
for the given encoding.
The FDE creates an initial set of F_FontEncTs for the session, and includes functions
to return an ID for each one. You should not have to inspect this structure directly.
typedef struct {
UCharT firstBytes[256]; /* First byte character information
*/
UCharT secondBytes[256]; /* Second byte character
information */
StringT name; /* The name of the encoding */
} F_FontEncT;
F_FontsT
F_FontsT provides an array of FontT structures. The FDK uses it to specify
permutations of font characteristics.
typedef struct {
UIntT len;
F_FontT *val;
} F_FontsT;
960
FDK Programmer’s Reference
Data structures
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
F_FontT
F_FontT specifies a combination of font characteristics. Each field specifies an index
into a list of names in the FrameMaker product session. For example, the family field
specifies the index of a name in the list of names specified by the session property
FP_FontFamilyNames. The weight field specifies the index of a name in the list
of names specified by the session property FP_FontWeightNames.
typedef struct {
UIntT family; /* Index of the font family. */
UIntT variation; /* Index of the font variation. */
UIntT weight; /* Index of the font weight. */
UIntT angle; /* Index of the font angle. */
} F_FontT;
F_ElementCatalogEntryT
F_ElementCatalogEntryT describes a catalog entry in an Element Catalog in
Structured FrameMaker
typedef struct {
F_ObjHandleT objId; /* ID of element definition */
IntT flags; /* Validation type */
} F_ElementCatalogEntryT;
The F_ElementCatalogEntryT.flags field can be one of the following
constants.
Flags constant
Meaning
FV_STRICTLY_VALID
Catalog entry is strictly valid
FV_LOOSELY_VALID
Catalog entry is loosely valid
FV_ALTERNATIVE
Catalog entry is an alternative
FV_INCLUSION
Catalog entry is valid because it is an inclusion
If no flags are set, the element is invalid at the current position.
FDK Programmer’s Reference 961
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
F_ElementCatalogEntriesT
F_ElementCatalogEntriesT describes the value of the Structured FrameMaker
Element Catalog for the current insertion point or text selection.
typedef struct {
UIntT len; /* Number of elements */
F_ElementCatalogEntryT *val;
} F_ElementCatalogEntriesT;
F_IntsT
F_IntsT provides an array of IntT values.
typedef struct {
UIntT len; /* Number of IntTs */
IntT *val; /* Array of IntTs */
} F_IntsT;
F_MetricsT
F_MetricsT provides a set of metric values.
typedef struct {
UIntT len; /* Number of metric values*/
MetricT *val; /* Array of metric values */
} F_MetricsT;
F_PointT
F_PointT describes an individual coordinate pair. FrameMaker products measure
coordinates from the upper-left corner of the parent frame.
typedef struct {
MetricT
x,y; /* The coordinate pair */
} F_PointT;
F_PointsT
F_PointsT describes a set of coordinate pairs. It is normally used to describe the
vertices of a graphic object, such as a polyline or polygon.
typedef struct {
UIntT len; /* Number of coordinate pairs */
F_PointT *val; /* Vector of coordinate pairs */
} F_PointsT;
962
FDK Programmer’s Reference
Data structures
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
F_PropIdentT
F_PropIdentT provides a property identifier. Properties can be identified by either a
name or a number (integer constant). The API provides defined constants for property
numbers (for example, FP_Fill and FP_Height). Only inset properties (facets) are
identified by names.
If a property is identified by a name, F_PropIdentT.num is set to 0.
If a property is identified by a number, F_PropIdentT.name is set to a
null string.
typedef struct {
IntT num; /* The property number */
StringT name; /* The property name */
}F_PropIdentT;
F_PropValT
F_PropValT describes a property-value pair.
typedef struct {
F_PropIdentT propIdent; /* The property identifier */
F_TypedValT propVal; /* The property value */
} F_PropValT;
F_PropValsT
F_PropValsT describes a property list (set of property-value pairs).
typedef struct {
UIntT len; /* Number of property-value pairs */
F_PropValT *val; /* Array of pairs */
} F_PropValsT;
F_StringsT
F_StringsT specifies a set of strings.
typedef struct {
UIntT len; /* Number of strings */
StringT *val; /* Array of strings */
} F_StringsT;
FDK Programmer’s Reference 963
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
F_TabT
F_TabT describes an individual tab. Note that the character specified by decimal
must be a single byte character.
typedef struct {
MetricT x; /* Offset from the left margin */
UCharT type; /* Type of tab (see following table) */
StringT leader; /* String that appears before the tab */
UCharT decimal; /* Character to align tab around, e.g. "," */
} F_TabT;
The F_TabT.type field can contain one of the following constants.
Type constant
Tab type
FV_TAB_LEFT
Left tab
FV_TAB_CENTER
Center tab
FV_TAB_RIGHT
Right tab
FV_TAB_DECIMAL
Decimal tab
FV_TAB_RELATIVE_LEFT
Relative center tab (allowed only for format change lists)
FV_TAB_RELATIVE_CENTER
Relative right tab (allowed only for format
change lists)
FV_TAB_RELATIVE_RIGHT
Relative decimal tab (allowed only for format change
lists)
FV_TAB_RELATIVE_DECIMAL
Relative center tab (allowed only for format change lists)
F_TabsT
F_TabsT specifies the set of tabs in a paragraph or Paragraph Catalog format.
typedef struct {
UIntT len; /* Number of tabs */
F_TabT *val; /* Array of tabs */
} F_TabsT;
F_TextItemT
F_TextItemT describes an individual text item or unit of text within a paragraph or
graphic text line. A text item can represent:
964
A string of characters with a common character format and condition tag
FDK Programmer’s Reference
Data structures
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
The beginning or end of a line, paragraph, flow, column, or page
An anchor for a table, footnote, marker, cross-reference, variable, or anchored frame
A text properties change
typedef struct {
IntT offset; /* From paragraph or text line beginning. */
IntT dataType; /* Text item type (see following table) */
union {
StringT sdata; /* String if text item is FTI_String */
IntT idata; /* ID of object if text item is object */
} u;
} F_TextItemT;
The following table lists the values the F_TextItemT.dataType field can have and
the types of data the corresponding text item provides.
Text item type (dataType)
What the text item represents
Text item data
FTI_TextObjId
The object that the offsets of all
the text items are relative to
ID of an FO_Pgf,
FO_Cell,
FO_TextLine,
FO_TiApiClient,
FO_TiFlow,
FO_TiText, or
FO_TiTextTable
FTI_String
A string of characters with the
same condition and character
format
A character string
FTI_LineBegin
The beginning of a line
Nothing
FTI_LineEnd
The end of a line and the lineend type
If the line end is a normal
line end, 0; if it is a forced
line end, the
FTI_HardLineEnd flag
is set; if it is a hyphen line
end, the
FTI_HyphenLineEnd
flag is set
FTI_PgfBegin
The beginning of a paragraph
ID of an FO_Pgf
FTI_PgfEnd
The end of a paragraph
ID of an FO_Pgf
FTI_FlowBegin
The beginning of a flow
ID of an FO_Flow
FTI_FlowEnd
The end of a flow
ID of an FO_Flow
FTI_PageBegin
The beginning of a page
ID of an FO_Page
FDK Programmer’s Reference 965
5
966
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
Text item type (dataType)
What the text item represents
Text item data
FTI_PageEnd
The end of a page
ID of an FO_Page
FTI_SubColBegin
The beginning of a column
ID of an FO_SubCol
FTI_SubColEnd
The end of a column
ID of an FO_SubCol
FTI_FrameAnchor
An anchored frame
ID of an FO_AFrame
FTI_FnAnchor
A footnote
ID of an FO_Fn
FTI_TblAnchor
A table
ID of an FO_Tbl
FTI_MarkerAnchor
A marker
ID of an FO_Marker
FTI_XRefBegin
The beginning of a
cross-reference
ID of an FO_XRef
FTI_XRefEnd
The end of a
cross-reference
ID of an FO_XRef
FTI_TextFrameBegin
The beginning of a text frame
ID of an FO_TextFrame
FTI_TextFrameEnd
The end of a text frame
ID of an FO_TextFrame
FTI_VarBegin
The beginning of a variable
ID of an FO_Var
FTI_VarEnd
The end of a variable
ID of an FO_Var
FTI_ElementBegin
The beginning of a structural
container element
ID of an FO_Element
FTI_ElementEnd
The end of a structural
container element
ID of an FO_Element
FTI_ElemPrefixBegi
n
The beginning of an element’s
prefix
ID of an FO_Element
FTI_ElemPrefixEnd
The end of an element’s prefix
ID of an FO_Element
FTI_ElemSuffixBegi
n
The beginning of an element’s
suffix
ID of an FO_Element
FTI_ElemSuffixEnd
The end of an element’s suffix
ID of an FO_Element
FTI_CharProps
Change
A change in the text properties
Flags indicating which
properties have changed
(see the table below)
FTI_RubiComposite
Begin
The beginning of a rubi
composite (and the beginning of
oyamoji text).
ID of an FO_Rubi
FTI_RubiComposite
End
The end of a rubi composite.
ID of an FO_Rubi
FDK Programmer’s Reference
Data structures
Text item type (dataType)
What the text item represents
Text item data
FTI_RubiTextBegin
The beginning of rubi text (and
the end of oyamoji text).
ID of an FO_Rubi
FTI_RubiTextEnd
The end of rubi text.
ID of an FO_Rubi
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
The following table lists the bit flags that a client can bitwise AND with the idata
field of an FTI_CharPropsChange text item. For example, to determine if the font
family changed, bitwise AND the FTF_FAMILY flag with the idata field.
Flag
Meaning
FTF_FAMILY
The font family has changed.
FTF_VARIATION
The font variation has changed.
FTF_WEIGHT
The font weight has changed.
FTF_ANGLE
The font angle has changed.
FTF_UNDERLINING
The underlining has changed.
FTF_STRIKETHROUGH
The strikethrough characteristic has changed.
FTF_OVERLINE
The overline characteristic has changed.
FTF_CHANGEBAR
The change bars have changed.
FTF_OUTLINE
The outline characteristic has changed.
FTF_SHADOW
The shadow characteristic has changed.
FTF_PAIRKERN
The pair kerning has changed.
FTF_SIZE
The font size has changed.
FTF_KERNX
The kern-x characteristic has changed.
FTF_KERNY
The kern-y characteristic has changed.
FTF_SPREAD
The font spread has changed.
FTF_COLOR
The color has changed.
FTF_CHARTAG
The Character Catalog format has changed.
FTF_CAPITALIZATION
The capitalization has changed.
FTF_POSITION
The character position has changed.
FTF_CONDITIONTAG
The condition tag has changed.
FTF_STRETCH
Font stretch value has changed
FDK Programmer’s Reference 967
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
Flag
Meaning
FTF_LANGUAGE
Character language has changed
FTF_TSUME
Tsume setting has changed
FTF_IIF
Inline input has changed
FTF_ENCODING
The text encoding has changed.
FTF_ALL
OR of all the flags listed above.
F_TextItemsT
F_TextItemsT provides the text items in a paragraph or a graphic text line.
typedef struct {
UIntT len; /* Number of text items */
F_TextItemT *val; /* Array of text items */
} F_TextItemsT;
F_TextLocT
F_TextLocT specifies a location within the text of a paragraph or a graphic text line.
typedef struct{
F_ObjHandleT objId; /* FO_Pgf or FO_TextLine */
IntT offset; /* Characters from beginning */
} F_TextLocT;
F_TextRangeT
F_TextRangeT specifies a text range. A text range can span paragraphs. It can’t span
graphic text lines or flows. Note that beg.offset and end.offset fields of a
F_TextRangeT can specify offsets relative to the beginning of an object, but they can
also use the special value FV_OBJ_END_OFFSET. FV_OBJ_END_OFFSET specifies
the offset of the last character in the object containing the text range.
typedef struct {
F_TextLocT beg; /* The beginning of the range */
F_TextLocT end; /* The end of the range */
} F_TextRangeT;
968
FDK Programmer’s Reference
Data structures
...
D a t a Ty p e s a n d St r u c t u r e s R e f e r e n c e
F_TypedValT
F_TypedValT specifies an individual property value.
typedef struct {
IntT valType; /* The type of value. See following table. */
union {
StringT sval; /* String value */
F_StringsT ssval; /* Set of strings */
F_MetricsT msval; /* Set of metrics */
F_PointsT psval; /* Set of points */
F_TabsT tsval; /* Set of tabs */
F_TextLocT tlval; /* Text location */
F_TextRangeT trval; /* Text range */
F_AttributeDefsT adsval;
F_AttributesT asval;
F_ElementCatalogEntriesT csval; /* Element Catalog */
F_IntsT isval; /* Set of integers */
F_UIntsT uisval; /* Set of unsigned integers */
IntT ival; /* integer */
} u;
} F_TypedValT;
The F_TypedValT.valType field indicates the type of value the structure
provides—that is, which field of the u union is used. The constants used in the
valType field are described in the following table.
valType constant
Property data type
u field
FT_AttributeDefs
F_AttributeDefsT
adsval
FT_Attributes
F_AttributesT
asval
FT_Integer
IntT
ival
FT_Ints
F_IntsT
isval
FT_Metric
MetricT
ival
FT_Metrics
F_MetricsT
msval
FT_String
StringT
sval
FT_Strings
F_StringsT
ssval
FT_Id
F_ObjHandleT
ival
FT_Points
F_PointsT
psval
FT_Tabs
F_TabsT
tsval
FDK Programmer’s Reference 969
5
D a t a Ty p e s a n d S t r u c t u r e s R e f e r e n c e
Data structures
valType constant
Property data type
u field
FT_TextLoc
F_TextLocT
tlval
FT_TextRange
F_TextRangeT
trval
FT_UInts
F_UIntsT
uisval
FT_ElementCatalog
F_ElementCatalogEntriesT
csval
FT_UBytes
F_UBytesT
No field
..............................................................................
IMPORTANT: Integer (IntT), metric (MetricT), and ID (F_ObjHandleT) values are
all put in the ival field of the u union.
..............................................................................
F_UBytesT
F_UBytesT provides an array of unsigned byte (UbyteT) values. It is used to provide
facet data for insets.
typedef struct {
UIntT len; /* Number of unsigned bytes */
UByteT *val; /* Array of unsigned bytes */
} F_UBytesT;
F_UIntsT
F_UIntsT provides an array of UIntT values.
typedef struct {
UIntT len; /* Number of UIntTs */
UIntT *val; /* Array of UIntTs */
} F_UIntsT;
970
FDK Programmer’s Reference
6
Error Codes
..................................
.....
5
If the API encounters an error condition, it assigns an error code to the global variable
FA_errno. The following table lists the error codes and their meanings. Error codes are
also listed in the fapidefs.h header file provided with the FDK.
Error code
Meaning
FE_AsianSystemRequired
The API expects an Asian operating system
FE_BadBaseColor
The client specified a tint as a base color, or specified
the actual color as a base color
FE_BadBookId
The client specified an invalid book ID.
FE_BadCompare
The document comparison failed.
FE_BadCompPath
The client specified an invalid path for a new book
component.
FE_BadDelete
The API can’t delete the specified object.
FE_BadDocId
The client specified an invalid document ID.
FE_BadElementDefId
The API expected the ID of an element definition
(FO_ElementDef).
FE_BadElementId
The API expected the ID of an element
(FO_Element).
FE_BadElementSelection
Invalid element range specified for
F_ApiSetElementSelection().
FE_BadFamilyName
The client specified a name of a color library that
doesn’t exist
FE_BadFileType
The file type expected by the API does not match the
type of file being imported or the type of the source
file for the text inset being updated.
FE_BadInkName
The specified color library does not have an ink of
this name
FE_BadInsertPos
The client specified an invalid insertion position for
text or a new object.
FDK Programmer’s Reference 971
6
972
Error Codes
Error code
Meaning
FE_BadMenuBar
The API expected the menu (FO_Menu) to contain
menus (FO_Menu) only.
FE_BadName
The application tried to name an object with an
illegal name.
FE_BadNew
There was an illegal call to a create a new object.
FE_BadNewFrame
The API can’t move the specified object to the
specified frame.
FE_BadNewGroup
The API can’t move the specified object to the
specified graphic object group (FO_Group).
FE_BadNewSibling
The API can’t make an object a sibling of the
specified object.
FE_BadNotificationNum
The application called F_ApiNotification()
with an invalid notification constant.
FE_BadObjId
The application specified an invalid object ID.
FE_BadOperation
The API tried to execute an illegal operation.
FE_BadPageDelete
The API can’t delete the specified page.
FE_BadParameter
The application attempted to call an API function
with an invalid parameter.
FE_BadPropNum
The application attempted to get or set a property that
the specified object doesn’t have.
FE_BadPropType
The application attempted to get or set a property
with the wrong function.
FE_BadRange
The specified text range is invalid (for example,
because two ends of a range are not in the same flow
or are hidden).
FE_BadSaveFileName
The API tried to save a file with an
illegal name.
FE_BadSelectionForOperation
The document selection is not valid for the operation.
FE_BadShortcut
The keyboard shortcut is invalid.
FE_BookUnStructured
Application called
F_ApiNewBookComponentInHierarchy() and
the specified book was unstructured.
FDK Programmer’s Reference
...
Error Codes
Error code
Meaning
FE_Busy
The FrameMaker product is in a busy state and
cannot process the API request (for example, because
a drag operation is in progress or because a modal
dialog box is currently displayed).
This error code is only returned to Windows
asynchronous clients (for example, clients initiated
by DDE callbacks or timer procedures).
FE_Canceled
An operation (such as Save or Open) was canceled.
FE_CanceledByClient
An FDK client cancelled the operation.
FE_CantSmooth
The API can’t smooth or unsmooth the specified
object.
FE_CantUpdateMacEdition
The specified text inset is a Macintosh edition, which
can’t be updated on the current, non-Macintosh
platform.
FE_CircularReference
Importing the document would cause a circular
reference.
FE_CompareTypes
The API attempted to compare files of different types
(for example, a book and a document).
FE_DocModified
The application attempted to close a modified
document without specifying
FF_CLOSE_MODIFIED.
FE_DupName
A same-type item with this name exists.
FE_EmptyTextObject
The object contains no text.
FE_FailedState
The API tried to access something that is missing; for
example, a dialog box or an
object ID.
FE_FileClosedByClient
The file was closed by an API client when it
processed a notification.
FE_FilterFailed
The filter failed to import or export a file
FE_GenRuleAmbiguous
A general rule in structured document is ambiguous.
FE_GenRuleConnectorExpected
A general rule in structured document is missing a
connector.
FE_GenRuleItemExpected
A general rule in structured document is missing a
rule item.
FE_GenRuleLeftBracketExpect
ed
A general rule in structured document is missing a
left bracket.
FDK Programmer’s Reference 973
6
974
Error Codes
Error code
Meaning
FE_GenRuleMixedConnectors
A general rule in structured document has mixed
connectors.
FE_GenRuleRightBracketExpec
ted
A general rule in structured document is missing a
right bracket.
FE_GenRuleSyntaxError
A general rule in structured document has a syntax
error.
FE_GroupSelect
The API can’t select or deselect an object in the
specified group.
FE_HiddenPage
The value must be the ID of a page that is not hidden.
FE_InvalidString
Specification has syntax error.
FE_InvAttribute
The F_AttributeT value is invalid.
FE_InvAttributeDef
The F_AttributeDefT value is invalid.
FE_MissingFile
The specified file no longer exists.
FE_NameNotFound
The API can’t find the object with the
specified name.
FE_NoColorFamily
The client tried to set an ink name without specifying
a color library
FE_NoSuchFlow
The specified flow does not exist in the source
document.
FE_NotApiCommand
The API expected the ID of a command defined by
an API client (FO_Command).
FE_NotBodyPage
The API expected the ID of a body page
(FO_BodyPage).
FE_NotBookComponent
The API expected a book component.
FE_NotCommand
The API expected the ID of a command
(FO_Command).
FE_NotFound
F_ApiFind() did not find an occurance of the
searched item
FE_NotFrame
The value must be the ID of a frame (FO_Frame).
FE_NotGraphic
The value must be the ID of a graphic object.
FE_NotGroup
The value must be the ID of a graphic object group
(FO_Group).
FE_NotInMenu
The specified menu item (FO_Command or
FO_Menu) is not in the menu.
FDK Programmer’s Reference
...
Error Codes
Error code
Meaning
FE_NotMenu
The API expected the ID of a menu (FO_Menu).
FE_NotPgf
The API expected the ID of a paragraph (FO_Pgf).
FE_NotPgfOrFlow
The API expected the ID of a paragraph (FO_Pgf) or
text flow (FO_Flow).
FE_NotTextFrame
The API expected the ID of a text frame
(FO_TextFrame).
FE_NotTextObject
The value must be the ID of a text object (FO_Pgf,
FO_TextLine, FO_Flow, FO_Cell,
FO_TextFrame, FO_SubCol, FO_Fn,
FO_Element, FO_XRef, FO_Var, FO_TiFlow,
FO_TiText, FO_TiTextTable,
FO_TiApiClient).
FE_OffsetNotFound
The specified offset couldn’t be found in the
specified paragraph or text line.
FE_OutOfRange
The specified value is not in the legal range for the
specified property.
FE_PageFrame
The page frame can’t be moved or selected.
FE_PropNotSet
Specified property is not set in the Format Change
List
FE_ReadOnly
The application attempted to set a read-only property.
FE_ReservedColor
The client tried to change a fixed property of a
reserved color
FE_SomeUnresolved
Some cross-references are unresolved.
FE_Success
The API function call was successful.
FE_SystemError
Unable to open the document due to
system error.
FE_TintedColor
The client tried to change a tinted color in a way that
is inappropriate for the tint’s base color
FE_Transport
Communication between the FrameMaker product
and the API application is not working correctly.
FE_TypeUnNamed
The API can’t use F_ApiGetNamedObject() or
F_ApiGetUnique() for the specified
object type.
FE_ViewOnly
The API tried to modify a View Only document.
FE_WantsCustom
The user clicked Custom in the New
dialog box.
FDK Programmer’s Reference 975
6
976
Error Codes
Error code
Meaning
FE_WantsLandscape
The user clicked Landscape in the New
dialog box.
FE_WantsPortrait
The user clicked Portrait in the New
dialog box.
FE_WithinFrame
Must move between frames before the requested
operation is possible.
FE_WrongProduct
The current FrameMaker product doesn’t support the
requested operation.
FDK Programmer’s Reference
7
Calling Clients Shipped with
FrameMaker
..................................
.....
6
A number of features in FrameMaker are implemented via FDK clients. For example,
table sorting and importing XML are implemented in this way. This chapter describes
how you can use F_ApiCallClient() to call various FDK clients that are shipped
with FrameMaker.
Calls to work with structured documents
Much of the structured document functionality FrameMaker provides is implemented
via FDK clients. To call this functionality programmatically, you use
F_ApiCallClient(). The following table lists some FrameMaker functionality
and the registered names of the clients you pass to F_ApiCallClient() to invoke
it programmatically.
Functionality
Registered client name
Element catalog manager
Element Catalog Manager
Structure generator
Structure Generator
Reading and writing markup documents and
reading, writing, and updating DTD and EDD
documents
FmDispatcher
To execute most operations with FrameMaker clients, you must make a sequence of
several F_ApiCallClient() calls. In each call, you set clname to the registered
name of the client and arg to a special string value. The following tables list the
sequence of calls for each operation.
To structure a document, use the following sequence of F_ApiCallClient() calls:
F_ApiCallClient() calls to structure a document
F_ApiCallClient("Structure Generator", "InputDocId objectID");
where objectID is the ID of the input document
FDK Programmer’s Reference 977
7
Calling Clients Shipped with FrameMaker
Calls to work with structured documents
F_ApiCallClient("Structure Generator", "RuleDocId objectID");
where objectID is the ID of the rule table document.
F_ApiCallClient("Structure Generator", "OutputDocName pathname");
where pathname is the full pathname of the output document. This command is optional. If
you do not specify a pathname, the structure generator leaves the document unsaved and
open.
F_ApiCallClient("Structure Generator", "LogName pathname"); where
pathname is the full pathname of a log file. If you do not specify a pathname, the structure
generator creates a log, but leaves the log file unsaved and open.
F_ApiCallClient("Structure Generator", "StructureDoc"); This call
instructs the structure generator to generate structure, using the parameters provided by the
calls listed above.
To structure a book, use the following sequence of F_ApiCallClient() calls:
F_ApiCallClient() calls to structure a book
F_ApiCallClient("Structure Generator", "InputBookId objectID");
where objectID is the ID of the input book.
F_ApiCallClient("Structure Generator", "RuleDocId objectID"); where
objectID is the ID of the rule table document.
F_ApiCallClient("Structure Generator", "OutputDirName dirpath");
where dirpath is the full pathname of the directory in which you want FrameMaker to save
the structured documents. This command is optional. If you do not specify a pathname, the
structure generator leaves the documents unsaved and open.
F_ApiCallClient("Structure Generator", "LogName pathname"); where
pathname is the full pathname of a log file. This command is optional. If you do not specify
a pathname, the structure generator leaves the log file unsaved and open.
F_ApiCallClient("Structure Generator", "GenerateBook");
This call instructs the structure generator to generate structure, using the parameters
provided by the calls listed above.
To generate a conversion table, use the following sequence of F_ApiCallClient()
calls:
978
FDK Programmer’s Reference
Calls to work with structured documents
...
Calling Clients Shipped with FrameMaker
F_ApiCallClient() calls to generate a conversion table
F_ApiCallClient("Structure Generator", "SourceDocId docId);
where docID is the ID of the document for which to generate the conversion table.
F_ApiCallClient("Structure Generator", "GenerateTable");
This call instructs the structure generator to generate the conversion table, using the
parameters provided by the call above.
To update a conversion table, use the following sequence of F_ApiCallClient()
calls:
F_ApiCallClient() calls to update a conversion table
F_ApiCallClient("Structure Generator", "SourceDocId docId);
where docID is the ID of the document with which to update the conversion table.
F_ApiCallClient("Structure Generator", "UpdateTable TableID");
where TableId is the ID of the conversion table document. This call instructs the structure
generator to update the conversion table, using the parameters provided by the call above.
To initialize FmDispatcher, use the following sequence of F_ApiCallClient()
calls:
F_ApiCallClient() calls to initialize FmDispatcher
F_ApiCallClient("FmDispatcher", "[SgmlInit | XmlInit]");
This call begins initialization of FmDispatcher for import/export of SGML or XML files.
Note that you need to initialize FmDispatcher separately for each type of markup you want
to import or export; SGML or XML.
F_ApiCallClient("FmDispatcher", "StructuredApps pathname");
where pathname is the full pathname of the sgmlapps file to read. This command is optional.
If you do not use it, FmDispatcher reads structapps.fm. For compatibility with earlier FDK
clients, FmDispatcher still recognizes SgmlApps.
FDK Programmer’s Reference 979
7
Calling Clients Shipped with FrameMaker
Calls to work with structured documents
F_ApiCallClient() calls to initialize FmDispatcher
F_ApiCallClient("FmDispatcher", "StructuredNoApp [SGML |
XML]");
or
F_ApiCallClient("FmDispatcher", "StructuredAppName appName");
where appname is the name of the structure application to use. If you call FmDispatcher
with StructuredNoApp, you should specify either SGML or XML. This determines
whether FmDispatcher runs using the SGML parser or the XML parser. If you don’t
specify SGML or XML, it assumes SGML by default.
For compatibility with earlier FDK clients, FmDispatcher still recognizes SgmlNoApp and
SgmlAppName.
F_ApiCallClient("FmDispatcher", "StructuredOutputDir dirName");
where dirName is the full pathname of the directory in which the client saves the filtered file.
For compatibility with earlier FDK clients, FmDispatcher still recognizes
SgmlOutputDir.
F_ApiCallClient("FmDispatcher", "StructuredOutputSuffix suffix");
where suffix is the suffix appended to the names of the filtered files. If you do not specify a
suffix, the client uses sgm for SGML files,, xml for XML files, fm for FrameMaker product
files, edd for EDD files, and dtd for DTD files. For compatibility with earlier FDK clients,
FmDispatcher still recognizes SgmlOutputSuffix.
F_ApiCallClient("FmDispatcher", "StructuredLog pathname");
where pathname is the full pathname of a log file. For compatibility with earlier FDK clients,
FmDispatcher still recognizes SgmlLog.
F_ApiCallClient("FmDispatcher", "StructuredFlow flowTag");
where flowtag is the tag of the flow to filter, if you are filtering a FrameMaker product
document to markup. For compatibility with earlier FDK clients, FmDispatcher still
recognizes SgmlFlow
To translate FrameMaker product documents to SGML or XML files, use the following
sequence of F_ApiCallClient() calls:
980
FDK Programmer’s Reference
Calls to work with structured documents
...
Calling Clients Shipped with FrameMaker
F_ApiCallClient() calls to translate FrameMaker documents to SGML or XML files
Calls to initialize FmDispatcher. See “F_ApiCallClient() calls to initialize
FmDispatcher” on page 979. Be sure to initialize FmDispatcher for SGML or
XML, as appropriate.
F_ApiCallClient("FmDispatcher", "StructuredStartList");
This call starts the list of input files. For compatibility with earlier FDK clients,
FmDispatcher still recognizes SgmlStartList.
F_ApiCallClient("FmDispatcher", "StructuredWriteSgml pathname");
or
F_ApiCallClient("FmDispatcher", "StructuredWriteXml pathname");
where pathname is the full pathname of the FrameMaker product file to translate. Repeat this
call for each FrameMaker product file you want to translate. For compatibility with earlier
FDK clients, FmDispatcher still recognizes SgmlWriteSgml.
F_ApiCallClient("FmDispatcher", "StructuredEndList");
This call ends the list of input files and starts file translation. For compatibility with earlier
FDK clients, FmDispatcher still recognizes SgmlEndList.
To translate SGML or XML files to FrameMaker product documents, use the following
sequence of F_ApiCallClient() calls:
F_ApiCallClient() calls to translate SGML or XML files to FrameMaker documents
Calls to initialize FmDispatcher. See “F_ApiCallClient() calls to initialize
FmDispatcher” on page 979. Be sure to initialize FmDispatcher for SGML or
XML, as appropriate.
F_ApiCallClient("FmDispatcher", "StructuredStartList");
This call starts the list of input files. For compatibility with earlier FDK clients,
FmDispatcher still recognizes SgmlStartList.
FDK Programmer’s Reference 981
7
Calling Clients Shipped with FrameMaker
Calls to work with structured documents
F_ApiCallClient() calls to translate SGML or XML files to FrameMaker documents
F_ApiCallClient("FmDispatcher", "StructuredReadSgml pathname");
or
F_ApiCallClient("FmDispatcher", "StructuredReadXml pathname");
where pathname is the full pathname of the FrameMaker product file to translate. Repeat this
call for each markup file you want to translate. For compatibility with earlier FDK clients,
FmDispatcher still recognizes SgmlWriteSgml.
F_ApiCallClient("FmDispatcher", "StructuredEndList");
This call ends the list of input files and starts file translation. For compatibility with earlier
FDK clients, FmDispatcher still recognizes SgmlEndList.
To translate a DTD file to an EDD file, use the following sequence of
F_ApiCallClient() calls:
F_ApiCallClient() calls to translate a DTD file to an EDD file
Calls to initialize FmDispatcher. See “F_ApiCallClient() calls to initialize FmDispatcher” on
page 979. Be sure to initialize FmDispatcher for SGML or XML, as appropriate.
F_ApiCallClient("FmDispatcher", "StructuredUpdateEDD
pathname");where pathname is the full pathname of an existing EDD file. This call is
optional. If you use it, FmDispatcher updates the existing EDD file instead of creating a
new file. For compatibility with earlier FDK clients, FmDispatcher still recognizes
SgmlUpdateEDD.
F_ApiCallClient("FmDispatcher", "StructuredReadDtd pathname");
where pathname is the full pathname of the DTD file you want to translate. For compatibility
with earlier FDK clients, FmDispatcher still recognizes SgmlReadDtd.
To translate an EDD file to a DTD file, use the following sequence of
F_ApiCallClient() calls:
F_ApiCallClient() calls to translate an EDD file to an DTD file
Calls to initialize FmDispatcher. See “F_ApiCallClient() calls to initialize FmDispatcher” on
page 979. Be sure to initialize FmDispatcher for SGML or XML, as appropriate.
F_ApiCallClient("FmDispatcher", "StructuredWriteDtd pathname");
where pathname is the full pathname of the DTD file you want to translate. For compatibility
with earlier FDK clients, FmDispatcher still recognizes SgmlReadDtd.
982
FDK Programmer’s Reference
Calls to work with structured documents
...
Calling Clients Shipped with FrameMaker
To export an EDD file from a structured FrameMaker product document or book, use
the following F_ApiCallClient() call:
F_ApiCallClient() call to generate an EDD file from a document or book
F_ApiCallClient("Element Catalog Manager", "ExportEDD objectId");
where objectId is the ID of the document or book from which you want to generate and EDD.
To create an EDD file, use the following F_ApiCallClient() call:
F_ApiCallClient() call to create an EDD file
F_ApiCallClient("Element Catalog Manager", "NewEDD");
This call creates a new, unnamed EDD.
To validate an XML document, use the following F_ApiCallClient() call:
F_ApiCallClient() call to validate an XML document
F_ApiCallClient("FmValidateXml", "XML pathname");
where pathname is the full pathname of the XML file you want to validate.
FDK Programmer’s Reference 983
7
Calling Clients Shipped with FrameMaker
Calls to Sort Tables
Calls to Sort Tables
To sort a table, you first select the rows you want to sort, then use the following
F_ApiCallClient() calls:
F_ApiCallClient() call to sort a table
F_ApiCallClient("TableSort",
"sort_by case index1 order1 index2 order2 index3 order3");
where:
sort_by is one of Row or Column.
case is one of Case or NoCase.
index1 is an integer (starting from 0) to determine the first sort index. If sorting by
rows, the column to use as the first sort index; if sorting by columns, the row to use
as the first sort index. To sort a table, this value must be greater than -1.
order1 is one of Ascending or Descending.
index2 and order2 specify the second sort index. A value of -1 for index indicates no
second sort index.
index3 and order3 specify the third sort index. A value of -1 for index indicates no
third sort index.
For example,
F_ApiCallClient("TableSort", "row nocase 0
descending 2 ascending -1 ascending");
tells TableSort to sort by rows, ignoring case. The left most column is the first
index (descending), the third column from the left is the second index (ascending),
and there is no third index.
The user can specify options for PDFSize via the Optimization Options dialog box,
which persist across product sessions. When you use F_ApiCallClient() to run PDFSize,
you can use the stored options, or you can specify option settings of your own. You must
also specify the file or files to process.
You can choose one of two ways to specify option settings and files to process:
Pass a pathname to a script file that sets the options and specifies the files to process
Pass a string that sets the options and specifies the files to process
To optimize PDF file size using options specified in a script file, use the following call:
984
FDK Programmer’s Reference
Calls to Sort Tables
...
Calling Clients Shipped with FrameMaker
F_ApiCallClient() call to optimize PDF size, passing a pathname to an options script
F_ApiCallClient("PDFSize",
"script=filename");
where filename is a string for the absolute path to a script file.
The script file includes keywords and values to specify options to use when optimizing
PDF file size. These keywords/value pairs correspond to the settings in the Optimization
Options dialog box; the FILE keyword specifies which documents to process. For any
options you do not specify, PDFSize will use the setting last made by the user. All file
names must be absolute paths, and must be platform specific.
The keywords and values you can specify in a script are:
Interactive = Yes|No
OptimizeAll = Yes|No
ForceOptimization = Yes|No
ClearOptimizationInfo = Yes|No
PromptWhenOpening = Yes|No
PromptWhenSaving = All|Optimized|No
SaveDirectory = directory name
CancelOnError = Yes|No
WarnUnoptimized = Yes|No
LogFile = file name
TraceMode = No|Error|Warning|Info
File = file name (You can specify any number of files to process)
To optimize PDF file size using options specified in a string, use the following call:
F_ApiCallClient() call to optimize PDF size, passing a string of options
F_ApiCallClient("PGFSize",
"string");
where string is a string that does not begin with the keyword script.
FDK Programmer’s Reference 985
7
Calling Clients Shipped with FrameMaker
Calls for WebDAV workgroup management
The string can include the same keywords and values you can specify for a script; each
keyword/value pair is separated by a newline character. For example, the string,
"interactive=No\nFile=usr\myDocs\myFile.fm" turns off interactive
processing and optimizes the file myFile.fm.
Calls for WebDAV workgroup management
The FrameMaker product includes support for WebDAV workgroup management,
which includes connecting to WebDAV servers, checking files in and out, and updating
files. This support is provided by an FDK client named WebDAV.
You execute WebDAV commands via F_ApiCallClient() calls. For each call to
the WebDAV client you pass a single string, but that string can contain a number of
arguments. Each argument in the string is separated by a NULL character. Using this
method to pass arguments avoids problems that might arise with spaces in an argument,
and it saves you from having to surround arguments in quotes.
Technically speaking, because of the NULL characters the passed string is really a
group of strings. But you store these strings in a single character buffer and pass that
buffer to the client. You must allocate a buffer that has room for your arguments, plus
the NULL characters that separate them, plus a terminating NULL character. Each
passed string includes a command name, and if necessary one or more arguments to the
command
To define a server mount point or delete a mount point from the current list of
definitions, use the following calls. To set up a new server mount point, you provide five
NULL-separated command arguments. If you omit a command argument you must still
include the NULL separator. To execute the SetServer command you must at least
provide a nickname, URL, and path. To connect to a currently defined mount point,
provide an existing nickname. If an existing mount point is set up without the user name
and password in its definition, the user may be prompted for this information for each
server access.
986
FDK Programmer’s Reference
Calls for WebDAV workgroup management
...
Calling Clients Shipped with FrameMaker
The commands to set and delete a WebDAV server are:
F_ApiCallClient() calls to set and delete a WebDAV server
F_ApiCallClient("WebDAV", "SetServer\0nickname\0URL\0name\0password\0path");
where the arguments are listed below, with its corresponding field in the Server Setup dialog
box:
nickname: the Server Nickname field
URL: the Server URL field
name: the User Name field
password: the Password field
path: the Workgroup Files Location field
F_ApiCallClient("WebDAV", "DeleteServer\0nickname");
To perform WebDAV actions on files use the following calls, where filename specifies
a FrameMaker document or book, or else a file created in some other application. In all
these calls, filename is a string expressing a path in the syntax for the current platform,
and URL is a string describing the URL to the file on the server.
F_ApiCallClient() calls to perform file actions
F_ApiCallClient("WebDAV", "SaveToServer\0filename");
Corresponds to the Workgroup > Save and Workgroup > Save As commands.
F_ApiCallClient("WebDAV", "Update\0filename");
Corresponds to the Workgroup > Update command.
F_ApiCallClient("WebDAV", "CheckOut\0filename");
Corresponds to the Workgroup > Check Out command.
F_ApiCallClient("WebDAV", "CheckIn\0filename");
Corresponds to the Workgroup > SaveCheck In command.
F_ApiCallClient("WebDAV", "CancelCheckOut\0filename");
Corresponds to the Workgroup > Cancel Check Out command.
F_ApiCallClient("WebDAV",
"SetDocManagementInfo\0filename\0URL\0Setting");
where Setting is one of CheckedIn or CheckedOut.
FDK Programmer’s Reference 987
7
Calling Clients Shipped with FrameMaker
Calls for WebDAV workgroup management
F_ApiCallClient() calls to perform file actions
F_ApiCallClient("WebDAV", "RemoveDocManagementInfo\0filename");
This command clears all document management information from the current document.
F_ApiCallClient("WebDAV", "GetFileFromServer\0URL");
This command corresponds to the Workgroup > Get File From Server command.
F_ApiCallClient("WebDAV", "PutFileOnServer\0filename\0URL");
This command corresponds to the Workgroup > Put File On Server command.
To manage links to the currently active document, use the following calls which
correspond to the menu of the Links palette:
F_ApiCallClient() calls to perform file actions
F_ApiCallClient("WebDAV", "SaveAllLinks");
F_ApiCallClient("WebDAV", "UpdateAllLinks");
F_ApiCallClient("WebDAV", "CheckInAllLinks");
F_ApiCallClient("WebDAV", "CheckOutAllLinks");
F_ApiCallClient("WebDAV", "CancelAllLinkCheckout");
To specify workgroup management preferences, use the following calls which
correspond to settings in the Workgroup Preferences dialog box. Each command can
take one of Always, Ask, or Never, or one of True or False as its argument.
F_ApiCallClient() calls to set preferences
F_ApiCallClient("WebDAV", "UpdateWhenOpening\0[Always | Ask |
Never]");
F_ApiCallClient("WebDAV", "CheckOutWhenOpening\0[Always | Ask |
Never]");
F_ApiCallClient("WebDAV","UpdateLinkWhenDocOpened\0[Always | Ask |
Never]");
F_ApiCallClient("WebDAV",
"CheckInLinkWhenDocCheckedIn\0[Always | Ask | Never]");
988
FDK Programmer’s Reference
Calls for WebDAV workgroup management
...
Calling Clients Shipped with FrameMaker
F_ApiCallClient() calls to set preferences
F_ApiCallClient("WebDAV",
"CheckInLinks\0[Always | Ask | Never]");
F_ApiCallClient("WebDAV",
"UpdateHypertextLinks\0[Always | Ask | Never]");
F_ApiCallClient("WebDAV",
"EnableWebDAV\0[True | False]");
To specify how FrameMaker handles error conditions fo workgroup commands, use the
following call. The command can take one of DoCancel, DoShowDialog, or DoOk
as its argument.
F_ApiCallClient() calls to set error handling
F_ApiCallClient("WebDAV",
"SetInteraction\0[DoCancel | DoShowDialog | DoOk]");
To perform an action equivalent to the user choosing a workgroup command from a
menu, use the following calls. For these calls you specify a space-separated string, as
described below. For example, to display the Links palette you would use the following
command:
F_ApiCallClient("WebDAV", "Command OpenLinksPalette");
FDK Programmer’s Reference 989
7
Calling Clients Shipped with FrameMaker
Call to work with book error logs
Following are the commands to display WebDAV menus:
F_ApiCallClient() call to perform file actions
F_ApiCallClient("WebDAV", "Command menu_command");
where menu_command is one of:
CancelAllLinkCheckOut
CancelCheckOut
CancelCheckOutAll
CancelLinkCheckOut
CancelSelectedLinkCheckOut
CheckIn
CheckInAll
CheckInAllLinks
CheckInLink
CheckInOutSelected
CheckInSelectedLinks
CheckOut
CheckOutAll
CheckOutAllLinks
CheckOutLink
CheckOutSelectedLinks
GetFileFromServer
Open
OpenLinksPalette
OpenOptionsDialog
OpenServersDialog
PutFileOnServer
Revert
RevertAll
RevertLink
Save
SaveAll
SaveAllLinks
SaveAllLinksAs
SaveAs
SaveLink
SaveLinkAs
SaveSelectedLinks
SaveSelectedLinksAs
Update
UpdateAll
UpdateAllLinks
UpdateLink
UpdateSelectedLinks
UpDownloadSelected
Call to work with book error logs
When FrameMaker updates a book, if there are error conditions it posts the errors to a
log file, and then displays the log. All log management is handled via the BookErrorLog
client that is included with the FrameMaker product. This section shows how to post
errors via F_ApiCallClient(). For more information about posting error messages
and displaying the error log, see ‘‘Using the book error log’’ in the FDK Programmer’s
Guide.
990
FDK Programmer’s Reference
Call to work with book error logs
...
Calling Clients Shipped with FrameMaker
To post a message in the book error log, use the following F_ApiCallClient() call:
F_ApiCallClient() calls to post message in book error log
F_ApiCallClient("BookErrorLog",
"log -b=[bookId] -d=[docId] -o=[objId] --[text]");
where:
log identifies this as a log message.
-b either the book ID or a document ID; typically the active book. The call creates a
unique log for each -b ID you pass; if you pass 0 you can create a log that is not
associated with any book.
-d either a document ID or an object ID; typically a document associated with a book
component. For document ID’s the call indents continuous errors for the same
document ID underneath the document’s filename. This continues until you pass a
different document ID. If you pass 0 for the document ID, the call will not indent
the errors.
-o is an object in the document represented by the -d argument. If you pass both a
document ID and an object ID, the call adds a hypertext link, from the error message
to the object you specified.
- - is the text of the message to appear in the log. To post a time stamp in the message,
pass the FM_PRINT_DATESTAMP token as the message string.
For example, following code shows how to pass a log entry via F_ApiCallClient(); it
assumes valid values for bookId, docId, and objId:
. . .
StringT log_msg;
log_msg = F_StrNew((UIntT)256);
F_StrTrunc(log_msg, (UIntT)0);
. . .
F_Sprintf(log_msg, "log -b=%d -d=%d -o=%d --%s",
bookId, docId, objId, (StringT)"An error ocurred.");
F_ApiCallClient("BookErrorLog", log_msg);
F_ApiDeallocateString(&log_msg);
. . .
FDK Programmer’s Reference 991
7
992
Calling Clients Shipped with FrameMaker
Call to work with book error logs
FDK Programmer’s Reference
8
CMS Connector FrameWork
..................................
.....
7
This chapter describes the structures and enum constants used in the CMS APIs.
CMS API Data Structures and Enum Constants
F_CMSResultT
F_CMSResultT structure specifies the state of a Command’s result for API
F_ApiCMSCommand
.typedef struct F_CMSResultT
{
StatusT status; /* Command’s status */
UIntT opResult;/* Operation's result. If CMS Command needs
CMSTree update, assign F_CMSOpResultT values (See following
enum),else can return any value depending on operation. e.g.
opResult = True/False for FA_CMSIsValidCommand , opResult =
CMSPropertyNewMaxOpCode for FA_CMSGetPropertyMaxOpCode. etc. */
StringT message; /* If operation fails, user can send error
message to FrameMaker.For FA_CMSObjectOpenReadOnly,
FA_CMSObjectEdit command, user can return file-name which is
downloaded. */
F_ObjHandlesT cmsItems;/* List of CMS object */
} F_CMSResultT;
F_CMSOpResultT
If F_ApiCMSCommand needs to update the CMS tree, use these enum constant values
as part of F_CMSResultT's opResult value.
FDK Programmer’s Reference 993
8
C M S C o n n e c t o r F r a m e Wo r k
CMS API Data Structures and Enum Constants
The possible values of the F_CMSResultT.opResult field are:
opResult constant
Meaning
FV_CMSOpNone
None
FV_CMSOpItemUpdated
CMS item is updated
FV_CMSOpDependentsUpdated
Depdendents are updated
FV_CMSOpDependentsDeleted
Depdendents are deleted
FV_CMSOpItemDeleted
CMS item is deleted
FV_CMSOpChildAdded
Child is sdded
FV_CMSOpRootUpdated
Root is updated
F_CMSPropertyT
The F_CMSPropertyT structure describes a single CMS object property definition
typedef struct F_CMSPropertyT
{
UIntT
prop; /* Property Id. Use the value of enum
F_CMSItemPropertyT (See following enum) or custom property added
by the user */
StringT label;/* Label of the property */
BoolT
isMultiValue; /* True if the property is multivalue.
*/
BoolT
isEditable; /* True if the property is editable. */
F_TypedValsT *values; /* Value of the property */
} F_CMSPropertyT;
F_CMSItemPropertyT
Enum constant values exposed for a CMS Object as Properties.
The F_CMSItemPropertyT enum specifies the following item properties:
994
Property
Meaning
FP_CMSItemProperty_ItemName
Name of the CMS item
FDK Programmer’s Reference
CMS API Data Structures and Enum Constants
...
C M S C o n n e c t o r F r a m e Wo r k
FP_CMSItemProperty_ItemServe
rPath
Server path of the CMS item
FP_CMSItemProperty_ItemLocal
Path
Local path of the CMS item
FP_CMSItemProperty_ItemIsChe
ckedOut
True if CMS item is checked out
FP_CMSItemProperty_ItemCheck
edOutByCurrentUser
True if CMS item is checked out by current
user
FP_CMSItemProperty_ItemIsCon
tainer
True if CMS item is a container
FP_CMSItemProperty_ItemType
Type of the CMS item:
FV_CMSItemTypeValue_Root
FV_CMSItemTypeValue_Folder
FV_CMSItemTypeValue_File
FV_CMSItemTypeValue_General
FP_CMSItemProperty_ItemFileT
ype
File Type of the CMS item:
FV_CMSItemFileTypeValue_Xml
FV_CMSItemFileTypeValue_FmDoc
FV_CMSItemFileTypeValue_Mif
FV_CMSItemFileTypeValue_DitaMap
FV_CMSItemFileTypeValue_FmBook
FV_CMSItemFileTypeValue_Text
FV_CMSItemFileTypeValue_Img
FV_CMSItemFileTypeValue_General
FP_CMSItemProperty_ItemVersi
on
Version of the CMS item
F_CMSItemTypeValueT
Enum constants used to determine type of CMS Object.
The possible values of the FP_CMSItemProperty_ItemType fields are:
Item Type Constant
Meaning
FV_CMSItemTypeValue_Root
Item type is Root
FDK Programmer’s Reference 995
8
C M S C o n n e c t o r F r a m e Wo r k
CMS API Data Structures and Enum Constants
FV_CMSItemTypeValue_Folder
Item type is Folder
FV_CMSItemTypeValue_File
Item type is File
FV_CMSItemTypeValue_General
Item type is General
F_CMSItemFileTypeValueT
Enum constants used to determine File-Type of a CMS Object.
The posssible values of the FP_CMSItemProperty_ItemFileType fields are:
File Type constant
Meaning
FV_CMSItemFileTypeValue_Xml
File type is XML
FV_CMSItemFileTypeValue_FmDo
c
File type is FM
FV_CMSItemFileTypeValue_Mif
File type is MIF
FV_CMSItemFileTypeValue_Dita
Map
File type is DitaMap
FV_CMSItemFileTypeValue_Dita
Topic
File type is DitaTopic
FV_CMSItemFileTypeValue_FmBo
ok
File type is Book
FV_CMSItemFileTypeValue_Text
File type is Txt
FV_CMSItemFileTypeValue_Img
File type is Image
FV_CMSItemFileTypeValue_Gene
ral
File type is General
F_CMSPropertiesT
An F_CMSPropertiesT structure specifies a set of CMS object propeties.
typedef struct F_CMSPropertiesT
{
IntT
len; /* Number of F_CMSPropertyT */
F_CMSPropertyT *val; /* Array of F_CMSPropertyT */
} F_CMSPropertiesT;
996
FDK Programmer’s Reference
CMS API Data Structures and Enum Constants
...
C M S C o n n e c t o r F r a m e Wo r k
F_CMSMenuItemT
The F_CMSMenuItemT structure describes a custom menu definition.
This structure is used for creating a custom menu entry in the context menu available in
CMS tree and CMS dialogs.
typedef struct F_CMSMenuItemT
{
IntT
id; /* ID of the Menu item */
StringT name; /* Name of the Menu item */
UIntT flags; /* The Menu Type. Use values of enum
F_CMSMenuTypeT (See following enum) */
}F_CMSMenuItemT;
F_CMSMenuTypeT
Enum constants used to determine type of a custom menu entry in context menu of a
CMS Object.
The user can specify one or more of the following flag constants (using the OR
expression for multiple flags) into the F_CMSMenuTypeT.flags field:
flags constant
Meaning
FV_CMSMenu_Is_Item
Custom menu is single item
FV_CMSMenu_Is_Disabled
Custom menu is disabled
FV_CMSMenu_Is_Separator
Custom menu is separator
FV_CMSMenu_Is_SubMenu
Custom menu is of type submenu
F_CMSCheckinParamT
The F_CMSCheckinParamT structure describes the checkin parameter.
This strcuture is returned by F_ApiCMSShowCheckinUI API for getting all the user
interface state after user accepts the dialog changes by pressing OK button.
FDK Programmer’s Reference 997
8
C M S C o n n e c t o r F r a m e Wo r k
CMS API Data Structures and Enum Constants
typedef struct F_CMSCheckinParamT
{
UIntT
version; /* Use values of enum
F_CMSVersioningStrategyT ( See
following enum ) */
StringT
versionLabel;
StringT
description;
StringT
checkinComment;
BoolT
makeThisCurrentVersion;
} F_CMSCheckinParamT;
F_CMSVersioningStrategyT
Enum constants used to determine type of versioning of a CMS Object.
The possible values of F_CMSCheckinParamT.version field are:
flags constant
Means
FV_CMSSameVersion
Same version
FV_CMSMinorVersion
Minor version
FV_CMSMajorVersion
Major version
F_CMSDeleteParamT
The F_CMSDeleteParamT structure describes the delete parameter.
This strcuture is returned by F_ApiCMSShowDeleteUI API for getting all the user
interface state after the user accepts the dialog changes by clicking OK.
998
FDK Programmer’s Reference
CMS API Data Structures and Enum Constants
...
C M S C o n n e c t o r F r a m e Wo r k
typedef struct F_CMSDeleteParamT
{
BoolT deleteAllVersion; /* True if user want to delete all
the version of a file.*/
BoolT deleteAllDependents; /* True if user want to delete
all the dependents of a file.*/
} F_CMSDeleteParamT;
F_CMSInfoT
The F_CMSInfoT structure describes a single CMS registration information definition
typedef struct F_CMSInfoT
{
StringT cmsName; /* Name of the CMS */
F_StringsT userFields; /* List of optional user fields. if
no user fields is specified then its value is NULL
BoolT userLoginUi; /* False if default Connection manager
dialog is used for login*/
} F_CMSInfoT;
F_CMSInfosT
An F_CMSInfosT structure specifies a set of CMS registration information.
typedef struct F_CMSInfosT
{
IntT len; /* Number of F_CMSInfoT */
F_CMSInfoT *val; /* Array of F_CMSInfoT */
} F_CMSInfosT;
FDK Programmer’s Reference 999
8
C M S C o n n e c t o r F r a m e Wo r k
Error Codes
Error Codes
If the CMS API encounters an error condition, the API assigns an error code to the
global variable FA_errno. The following table lists the error codes and their
meanings. Error codes are also listed in the fcmsapi.h header file provided with the
FDK .
Error code
1000
Meaning
FE_CMSNameAlreadyRegistered
The API attempted to register a CMS that is already
registered.
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid CMS object ID.
FE_CMSSessionFailed
The client failed to create a session.
FE_CMSBadCommandId
The client specified an invalid command ID.
FE_CMSObjectCreationFailed
The F_ApiCMSCreateObject API fails to create a
CMS object.
FE_CMSRootObjectExists
The API tried to set a root that already exists.
FE_CMSBadItemFileType
The file type expected by the CMS object does not
match the valid file type.
FE_CMSBadItemType
The item type expected by the CMS object does not
match the valid item type
FE_CMSBadItemContainerType
The container value expected by the cms object is
not properly set
FE_CMSSessionCreationFailed
If Session creation is fails, set status to this value.
FE_CMSIsValidCMSCommand
If user wants FrameMaker to take care of
IsValidCMSCommand, set opResult to this value.
FE_CMSFailedLogin
The F_ApiCMSLogin API fails to log into a CMS.
FE_CMSFailedLogout
The F_ApiCMSLogout API fails to log out from a
CMS.
FE_CMSFailedCheckout
The F_ApiCMSCheckout API failed to checkout a
file.
FE_CMSFailedCheckin
The F_ApiCMSCheckin API failed to check in a file
FE_CMSFailedCancelCheckout
The F_ApiCMSCancelCheckout API fails to cancel
checkout of a file.
FDK Programmer’s Reference
CMS API Functions
Error code
...
C M S C o n n e c t o r F r a m e Wo r k
Meaning
FE_CMSFailedDelete
The F_ApiCMSDelete API failed to delete a cms
object
FE_CMSFailedOpenFile
The F_ApiCMSOpenFile API failed to open a file
FE_CMSFailedUploadObject
The F_ApiCMSUploadObject API failed to upload a
file or folder.
FE_CMSFailedDownloadObject
The F_ApiCMSDownloadObject API failed to
download a file.
FE_CMSFailedGetItemFrompath
The F_ApiGetCMSObjectFromPath API failed to
return a CMS object from server path.
CMS API Functions
F_ApiAllocateCMSInfos
F_ApiAllocateCMSInfos allocates memory for an F_CMSInfosT structure and the
array of CMS info that it references
Synopsis
#include fcmsapi.h
. . .
F_CMSInfosT F_ApiAllocateCMSInfos (IntT numCMSInfos);
Arguments
numCMSInfos
The number of CMS info to allocate
Returns
An F_CMSInfosT data structure.
The returned F_CMSInfosT structure references memory that is
allocated by the API.
Use F_ApiDeallocateCMSInfos() to free this memory when you are
done with it.
If F_ApiAllocateCMSInfos() fails, the API sets the len field of
the returned structure to 0.
FDK Programmer’s Reference
1001
8
C M S C o n n e c t o r F r a m e Wo r k
F_ ApiDeallocateCMSInfos
Example
Example
The following code allocates a memory for a list of 5 CMS info:
. . .
F_CMSInfosT cmsinfo;
cmsinfo = F_ApiAllocateCMSInfos(5);
F_ ApiDeallocateCMSInfos
Deallocates memory referenced by F_CMSInfosT structure.
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiDeallocateCMSInfos (F_CMSInfosT *cmsInfop)
Arguments
cmsInfop
The F_CMSInfosT structure referencing memory that needs to be
deallocated
Returns
VoidT
Example
The following code deallocates a CMS info list:
. . .
F_CMSInfosT CMSInfo;
. . .
F_ApiDeallocateCMSInfos(&CMSInfo);
F_ ApiAllocateCMSProperties
F_ApiAllocateCMSProperties allocates memory for an F_CMSPropertiesT
structure and the array of CMS properties that it references
1002
FDK Programmer’s Reference
F_ApiDeallocateCMSProperties
...
C M S C o n n e c t o r F r a m e Wo r k
Synopsis
#include fcmsapi.h
. . .
F_CMSPropertiesT F_ApiAllocateCMSProperties (IntT
numCMSProperties);
Arguments
numCMSProper
ties
The number of properties in the CMS properties list
Returns
An F_CMSPropertiesT data structure.
The returned F_CMSPropertiesT structure references memory that
is allocated by the API.
Use F_ApiDeallocateCMSProperties() to free this memory when you
are done with it.
If F_ApiAllocateCMSProperties() fails, the API sets the len
field of the returned structure to 0.
Example
The following code allocates memory for 5 CMS property list:
. . .
F_CMSPropertiesT cmsProp;
cmsProp = F_ApiAllocateCMSProperties(5);
F_ApiDeallocateCMSProperties
Deallocates memory referenced by F_CMSPropertiesT structure
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiDeallocateCMSProperties (F_CMSPropertiesT
*cmsPropertiesp);
FDK Programmer’s Reference
1003
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSCommand
Arguments
cmsInfop
The F_CMSPropertiesT structure referencing memory that needs to
be deallocated
Returns
VoidT
Example
The following code deallocates a CMS properties list:
. . .
F_CMSPropertiesT cmsProp;
. . .
F_ApiDeallocateCMSProperties(&cmsProp);
F_ApiCMSCommand
F_ApiCMSCommand() is a callback that you must define to respond to the user
choosing a CMS menu command added by your client. This callback is used for
handling various CMS command including user custom commands. User gets multiple
objects: F_ObjHandlesT *objectIds
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiCMSCommand (F_ObjHandleT cmsSessionId,
const F_ObjHandlesT *objectIds,
IntT command,
const F_IdValuePairsT *arguments,
F_CMSResultT *statusp);
1004
FDK Programmer’s Reference
F_ApiCMSCommand
...
C M S C o n n e c t o r F r a m e Wo r k
Arguments
cmsSessionId
The ID of the CMS session
cmsObjectId
The ID of the CMS object
command
The CMS command parameter from the F_CMSCommandsT enum or
F_ApiCMSAddMenuEntry() call that creates the custom menu that
the use choose
arguments
Id value pairs to specify the command arguments. Id takes values from
F_CMSCommandArgsIdT enum
statusp
F_CMSResultT structure specifies the state of a command’s
result. This is also used to update the tree browser accourding to
the command
F_CMSCommandsT
Various Command enum constants available for CMS. All commands are valid for
F_ApiCMSCommand callback.
The F_CMSCommandsT enum specifies the following commands:
Command constants
Meaning
FA_CMSCreateConnection
Creates a new CMS connection.This command
is triggered when the user clicks Connect in the
Connection Manager UI after adding all the
credentials.
FA_CMSSetRootObject
Sets a root object of a CMS tree. After successful
creation of a session, root object is queried using
this command.
FA_CMSCreateConnMgrUI
Creates a user login UI for a particular cmsId.
This command will be triggered only if the user
has used F_ApiCMSConfigLoginUI with
userLoginUI flag as True).
FA_CMSGetItemFromPath
Validates whether an item is valid or not in a
server path. This command is triggered if the
user has deleted the file from Show common list
UI.
FA_CMSCloseConnection
Command to close a CMS connection. This
command is triggered when user clicks Close
connection in the repository browser.
FA_CMSGetCommandMaxOpCode
Adds a custom command
FDK Programmer’s Reference
1005
8
1006
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSCommand
FA_CMSGetPropertyMaxOpCode
Adds a custom property
FA_CMSObjectCheckout
Implements checkout functionality.This
command is triggered when user clicks checkout
FA_CMSObjectCheckin
Implements Checkin functionality. This
command is triggered when user clicks checkin.
FA_CMSObjectCancelCheckout
Implements CancelCheckout functionality. This
command is triggered when user clicks
CancelCheckout.
FA_CMSObjectEdit
Implements Edit functionality. This command is
triggered when user clicks Edit and checkout.
FA_CMSObjectOpenReadOnly
Implements OpenReadOnly functionality. This
command is triggered when user clicks
OpenReadOnly.
FA_CMSObjectDelete
Implements Delete functionality. This command
is triggered when user clicks Delete.
FA_CMSObjectShowVersion
Implements the ShowVersion functionality. This
command is triggered when user clicks
ShowVersion.
FA_CMSObjectShowDependents
Implements ShowDependents functionality.
This command is triggered when user clicks
ShowDependents.
FA_CMSObjectShowProperties
Implements ShowProperties functionality. This
command is triggered when user clicks
ShowProperties.
FA_CMSObjectShowCheckOutFile
s
Implements the ShowCheckOutFiles
functionality. This command is triggered when
user clicks ShowCheckOutFiles.
FA_CMSObjectDownload
Implements the Download functionality. User
gets this command from the Import dialogs.
FA_CMSObjectDownloadItem
Implements the Download functionality. User
gets this command from the Open dialog if the
file is checked out by the current user.
FA_CMSObjectDownloadForOpen
Implements the Download functionality. User
gets this command from Open dialog if file is
checked out by other user or not in checked out
state.
FA_CMSObjectUploadFile
Implements the Upload File functionality. This
command is triggered when user clicks Upload
Document.
FDK Programmer’s Reference
F_ApiCMSCommand
...
C M S C o n n e c t o r F r a m e Wo r k
FA_CMSObjectUploadFolder
Implements the Upload Folder functionality.
This command is triggered when user clicks
Upload Folder.
FA_CMSObjectGetChildren
Implements the Get Children functionality.
Children can be added to a CMS tree using this
command. This command is triggered after
FA_CMSSetRootObject command.
FA_CMSObjectIsSame
Command to validate that the two CMS Objects
are same.
FA_CMSObjectRefresh
Implements the Refresh functionality. This
command is triggered when user clicks Refresh.
FA_CMSSimpleSearch
Implements the Basic Search functionality. This
command is triggered when user clicks Search
Repository.
FA_CMSAdvancedSearch
Implements the Advance Search functionality.
This command is triggered when user clicks
Advance Search.
FA_CMSGetItems
Implements the Get item functionality. CMS
item to a show common list UI can be added
using this command. This is triggered from show
common list UI.
FA_CMSBuildContextMenu
Implements the Build context menu. When user
right clicks on tree browser of a node, this
command is triggered. This command can be
used to Enable/Disable command for a particular
object Id.
FA_CMSIsValidCommand
Command to validate a CMS command. This
command also contains the context as argument
string. If Menu is called for browser, context is
“”. Whereas for dialog, context is the name of
dialog, such as “Show Version.”
F_CMSCommandArgsIdT
Enum constants used to verify various arguments of F_ApiCMSCommand callback.
The F_CMSCommandArgsIdT enum specifies the following command arguments
Value for flags
Meaning
FV_CMSCommandNameId
F_ApiCMSLogin() uses this value to set
“Name of the CMS connection”
FDK Programmer’s Reference
1007
8
1008
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSCommand
FV_CMSCommandConnTypeId
F_ApiCMSLogin() uses this value to set
“Connection Type”
FV_CMSCommandServerId
F_ApiCMSLogin() uses this value to set
“Name of the Server”
FV_CMSCommandUserNameId
F_ApiCMSLogin() uses this value to set
“Name of the User”
FV_CMSCommandPasswordId
F_ApiCMSLogin() uses this value to set
“Password”
FV_CMSCommandUserField1
F_ApiCMSLogin() uses this value to set
“User Field1”
FV_CMSCommandUserField2
F_ApiCMSLogin() uses this value to set
“User Field2”
FV_CMSCommandFilePathId
Argument for File Path to upload
FV_CMSCommandSearchStringId
Argument for Basic Search String
FV_CMSCommandAdvancedSearchS
tringId
Argument for Advance Search String
FV_CMSCommandId
Argument for Command ID
FV_CMSContextMenuId
Argument for Context Menu ID
FV_CMSContextMenuString
Argument for Context Menu String
FV_CMSSilentOperation
CMS automation API’s uses this value to set
“Silent operation” parameter
FV_CMSCommandCheckoutWithDes
cendentId
F_ApiCMSCheckout() uses this value to set
“Checkout with descendent” parameter
FV_CMSCommandCheckinMakeCurr
entVersionId
F_ApiCMSCheckin() uses this value to set
“Make Current Version” parameter
FV_CMSCommandCheckinKeepLoca
lCopyId
F_ApiCMSCheckin() uses this value to set
“Keep Local Copy” parameter
FV_CMSCommandCheckinMinorVer
sionId
F_ApiCMSCheckin() uses this value to set
“Minor Version” parameter
FV_CMSCommandCheckinVersionL
abelId
F_ApiCMSCheckin() uses this value to set
“Version Label” parameter
FV_CMSCommandCheckinDescript
ionId
F_ApiCMSCheckin() uses this value to set
“Description” parameter
FV_CMSCommandCheckinCommentI
d
F_ApiCMSCheckin() uses this value to set
“Checkin Comment” parameter
FDK Programmer’s Reference
F_ApiCMSCommand
...
C M S C o n n e c t o r F r a m e Wo r k
FV_CMSCommandDeleteAllVersio
nId
F_ApiCMSDelete() uses this value to set
“Delete All Version” parameter
FV_CMSCommandDeleteAllDepend
entsId
F_ApiCMSDelete() uses this value to set
“Delete All Dependents” parameter
FV_CMSCommandOpenReadOnlyId
F_ApiCMSOpenFile() uses this value to set
“Oper Read Only” parameter
FV_CMSCommandSilentOpenId
F_ApiCMSOpenFile() uses this value to set
“Silent Open” parameter
Returns
VoidT
If F_ApiCMSCommand() fails, the API assigns following values to FA_errno:
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid CMS object ID.
FE_CMSBadCommandId
The client specified an invalid command ID.
FE_BadParameter
The function call specified an invalid parameter.
Responding to the user choosing a command
Whenever the user chooses a CMS menu item for a CMS command created by your
client, FrameMaker attempts to call your client’s F_ApiCMSCommand() function.
Example
The following code provides an F_ApiCMSCommand() function to respond to the user
choosing the CMS commands:
. . .
VoidT F_ApiCMSCommand(F_ObjHandleT cmsSessionId,const
F_ObjHandlesT *objectIds, IntT command, const F_IdValuePairsT
*arguments, F_CMSResultT *statusp)
FDK Programmer’s Reference
1009
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSRegister
switch(command)
{
case FA_CMSObjectOpenReadOnly: /* Code to open a file in read only
mode goes here. */
break;
case FA_CMSObjectDelete: /* Code to delete a CMS object goes here.
*/
break;
}
}
F_ApiCMSRegister
Registers a CMS client.
Call this API within the F_ApiInitialize() section of the FDK client. After the client is
registered in the [API Clients] section of the maker.ini file, the name of the CMS is
shown in “Choose Connection” drop-down of the Connection Manager dialog.
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSRegister (ConStringT cmsName);
Arguments
cmsName
Name of the CMS to register
Returns
Returns the ID of the new CMS if it succeeds, or an error code if an error occurs.
If F_ApiCMSRegister() fails, the API assigns following values to FA_errno
1010
FA_errno value
Meaning
FE_CMSNameAlrea
dyRegistered
The API attempt to register a CMS that is already registered.
FE_BadParameter
The function call specified an invalid parameter.
FDK Programmer’s Reference
F_ApiCMSCreateObject
...
C M S C o n n e c t o r F r a m e Wo r k
Example
The following code register a CMS “Adobe CQ”
. . .
VoidT F_ApiInitialize(IntT initialization)
{
F_ObjHandleT cmsId;
. . .
cmsId = F_ApiCMSRegister((ConStringT)"Adobe CQ");
}
F_ApiCMSCreateObject
Creates a CMS object.
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSCreateObject (F_ObjHandleT cmsSessionId);
Arguments
cmsSessionId
The ID of the CMS session
Returns
Returns the ID of the new CMS object if it succeeds, or an error code if an error occurs.
If F
_ApiCMSCreateObject() fails, the API assigns following values to FA_errno
FA_errno value
Meaning
FE_CMSBadSessio
nId
The client specified an invalid session ID.
FE_CMSObjectCre
ationFailed
API failed to create a cms object.
FDK Programmer’s Reference
1011
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSEnableCommand
Example
The following code creates a CMS object:
. . .
F_ObjHandlesT *objHandles = (F_ObjHandlesT
*)F_Alloc(sizeof(F_ObjHandlesT),DSE);
objHandles->val[0] = F_ApiCMSCreateObject(cmsSessionId);
. . .
F_ApiCMSEnableCommand
Enables the specified CMS command in the context menu of the CMS tree within
FrameMaker.
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiCMSEnableCommand (F_ObjHandleT cmsSessionId,
F_ObjHandleT objectId,
UIntT commandId);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
commandId
The command to enable
Returns
VoidT.
1012
FDK Programmer’s Reference
F_ApiCMSDisableCommand
...
C M S C o n n e c t o r F r a m e Wo r k
If F_ApiCMSEnableCommand() fails, the API assigns following values to
FA_errno
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid cms object ID.
FE_CMSBadCommandId
The client specified an invalid command ID.
Example
The following code enables Edit , Delete and Checkin command:
. . .
FA_errno=0;
F_ApiCMSEnableCommand(cmsSessionId,objectId,FA_CMSObjectEdit);
F_ApiCMSEnableCommand(cmsSessionId,objectId,FA_CMSObjectDelete);
F_ApiCMSEnableCommand(cmsSessionId,objectId,FA_CMSObjectCheckin)
;
F_ApiCMSDisableCommand
Disables the specified CMS command in the context menu of the CMS tree within
FrameMaker.
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiCMSDisableCommand (F_ObjHandleT cmsSessionId,
F_ObjHandleT objectId,
UIntT commandId);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
commandId
The command to disable
Returns
VoidT.
FDK Programmer’s Reference
1013
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSAddMenuEntry
If F_ApiCMSDisableCommand() fails, the API assigns following values to
FA_errno
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid cms object ID.
FE_CMSBadCommandId
The client specified an invalid command ID.
Example
The following code disables OpenReadOnly , Delete and Checkout command:
. . .
FA_errno=0;
F_ApiCMSDisableCommand(cmsSessionId,objectId,FA_CMSObjectOpenRea
dOnly);
F_ApiCMSDisableCommand(cmsSessionId,objectId,FA_CMSObjectDelete)
;
F_ApiCMSDisableCommand(cmsSessionId,objectId,FA_CMSObjectCheckou
t);
F_ApiCMSAddMenuEntry
Adds a custom menu entry in the context menu within the FrameMaker interface.
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSAddMenuEntry (F_ObjHandleT menuId,
const F_CMSMenuItemT *menuEntryp);
Arguments
menuId
menuEntryp
The ID of the Parent menu
The F_CMSMenuItemT structure describes a custom menu
definition
Returns
Returns the ID of the newly created custom menu entry if it succeeds, or an error code
if an error occurs.
1014
FDK Programmer’s Reference
F_ApiCMSGetProperties
...
C M S C o n n e c t o r F r a m e Wo r k
If F_ApiCMSAddMenuEntry() fails, the API assigns following values to FA_errno:
FA_errno value
Meaning
FE_CMSBadObject
Id
The client specified an invalid menu ID.
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code creates a custom menu “New Folder” inside a parent menu referred
by menuId.
. . .
F_CMSMenuItemT *menu = (F_CMSMenuItemT
*)F_Alloc(sizeof(F_CMSMenuItemT),DSE);
menu->id = FA_CMSCommandMax+1;;
menu->name = (StringT)"New Folder";
menu->flags = FV_CMSMenu_Is_Item;
F_ApiCMSAddMenuEntry(menuId,menu);
F_ApiCMSGetProperties
Gets the properties of a CMS object.
Synopsis
#include fcmsapi.h
. . .
F_PropValsT F_ApiCMSGetProperties (F_ObjHandleT cmsSessionId,
F_ObjHandleT objectId);
Arguments
cmsSessionId
The ID of the CMS Session
objectId
The ID of the CMS Object
Returns
Returns the property list (an F_PropValsT data structure) with the CMS properties if
it succeeds or an error code if an error occurs
FDK Programmer’s Reference
1015
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSGetProperty
If F_ApiCMSGetProperties() fails, the API assigns following values to
FA_errno:
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid cms object ID.
Example
The following code gets the properties of a CMS object:
. . .
IntT counter;
F_PropValsT propVals;
FA_errno = 0;
propVals=F_ApiCMSGetProperties(cmsSessionId,objectId);
F_Printf ((ChannelT )NULL,"Total properties=%d",propVals.len);
for (counter=0;counter<(IntT)propVals.len;counter++)
{
if (FT_String==propVals.val[counter].propVal.valType)
F_Printf ( (ChannelT )NULL,"[%s]=%s\n",propVals.val[counter].
propIdent.name,propVals.val[counter].propVal.u.sval);
else if (FT_Integer==propVals.val[counter].propVal.valType)
F_Printf ( (ChannelT )NULL, "[%s]=%d\n",propVals.val[counter].
propIdent.name,propVals.val[counter].propVal.u.ival);
}
F_ApiCMSGetProperty
Gets a specified property of a CMS object.
Synopsis
#include fcmsapi.h
. . .
F_PropValT F_ApiCMSGetProperty (F_ObjHandleT cmsSessionId,
F_ObjHandleT objectId,
const F_PropIdentT *propertyId);
1016
FDK Programmer’s Reference
F_ApiCMSSetProperties
...
C M S C o n n e c t o r F r a m e Wo r k
Arguments
cmsSessionId
The ID of the CMS Session.
objectId
The ID of the CMS Object.
propertyId
F_PropIdentT which allows user to specify property identifier as Integer
value OR string value based on the CMS. For e.g. Documentum works on
object name, whereas Generic CMS works on Integer based identifier ID
of the CMS Object.
Returns
Returns the specified property of a CMS object as a F_PropValT data structure if it
succeeds, or an error code if an error occurs.
If F_ApiCMSGetProperty() fails, the API assigns following values to FA_errno:
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid cms object ID.
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code gets the name of a CMS object:
. . .
FA_errno = 0;
F_PropIdentT propertyid;
propertyid.num=FP_CMSItemProperty_ItemName;
F_PropValT ItemName=F_ApiCMSGetProperty( cmsSessionId, objectId,
&propertyid);
F_Printf((ChannelT )NULL,"%s\n",ItemName.propVal.u.sval);
F_ApiCMSSetProperties
Sets multiple properties of a CMS object
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiCMSSetProperties (F_ObjHandleT cmsSessionId,
F_ObjHandleT objectId,
const F_PropValsT *propVals)
FDK Programmer’s Reference
1017
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSSetProperties
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
propVals
A property list that specifies the CMS properties . Properties are added
as propvals with the identifier as F_CMSItemPropertyT enum and
value.
Returns
VoidT
If F_ApiCMSSetProperties() fails, the API assigns following values to
FA_errno:
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid cms object ID.
FE_CMSRootObjectExists
The API tries to set a root which already exists.
FE_CMSBadItemFileType
The file type expected by the cms object does not match the
valid file type.
FE_CMSBadItemType
The item type expected by the cms object does not match
the valid item type
FE_CMSBadItemContainer
Type
The container value expected by the CMS object is not
properly set
Valid Scenarios for object properties
Following are the valid API scenarios of properties on a particular object.
1018
ItemType
ItemFileType
IsContainer
Root
General
True
Folder
General
True
File
Any Value
False
General
Any Value
Any Value
FDK Programmer’s Reference
F_ApiCMSSetProperty
...
C M S C o n n e c t o r F r a m e Wo r k
Example
The following code sets the properties of a CMS object:
. . .
F_PropValsT propVals;
F_ObjHandlesT *objHandles = (F_ObjHandlesT
*)F_Alloc(sizeof(F_ObjHandlesT),DSE);
objHandles->len = 1;
objHandles->val = (F_ObjHandleT *)F_Alloc(objHandles>len*sizeof(F_ObjHandleT),DSE);
objHandles->val[0] = F_ApiCMSCreateObject(cmsSessionId);
propVals = F_ApiAllocatePropVals(4);
if(propVals.len != 0)
{
propVals.val[0].propIdent.num = FP_CMSItemProperty_ItemName;
propVals.val[0].propIdent.name = F_StrCopyString("Name");
propVals.val[0].propVal.valType = FT_String;
propVals.val[0].propVal.u.sval = F_StrCopyString("root");
propVals.val[1].propIdent.num=FP_CMSItemProperty_ItemServerPath;
propVals.val[1].propIdent.name = F_StrCopyString("Server Path");
propVals.val[1].propVal.valType = FT_String;
propVals.val[1].propVal.u.sval = F_StrCopyString("/");
propVals.val[2].propIdent.num=FP_CMSItemProperty_ItemIsContainer
;
propVals.val[2].propIdent.name = F_StrCopyString("IsContainer");
propVals.val[2].propVal.valType = FT_Integer;
propVals.val[2].propVal.u.ival = True;
propVals.val[3].propIdent.num = FP_CMSItemProperty_ItemType;
propVals.val[3].propIdent.name = F_StrCopyString("Type");
propVals.val[3].propVal.valType = FT_Integer;
propVals.val[3].propVal.u.ival = FV_CMSItemTypeValue_Root;}
FA_errno = 0;
F_ApiCMSSetProperties(cmsSessionId,objHandles->val[0],
&propVals);
F_ApiCMSSetProperty
Sets a single property for a CMS object.
. . .
VoidT
F_ApiCMSSetProperty (F_ObjHandleT cmsSessionId,
F_ObjHandleT objectId,
const F_PropValT *propVal);
FDK Programmer’s Reference
1019
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSSetProperty
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
propVal
The specified property of a CMS object as a F_PropValT data
structure
Returns
VoidT
If F_ApiCMSSetProperty() fails, the API assigns following values to FA_errno:
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid cms object ID.
FE_CMSRootObjectExists
The API tries to set a root which already exists.
FE_CMSBadItemFileType
The file type expected by the cms object does not match the
valid file type.
FE_CMSBadItemType
The item type expected by the cms object does not match
the valid item type
FE_CMSBadItemContainer
Type
The container value expected by the cms object is not
properly set
Example
The following code gets the checkedout property of a CMS object:
. . .
F_PropValT *prop;
prop=(F_PropValT *)F_Alloc(sizeof(F_PropValT), NO_DSE);
prop->propIdent.num= FP_CMSItemProperty_ItemIsCheckedOut;
prop->propIdent.name = F_StrCopyString("ItemIsCheckedOut");
prop->propVal.valType = FT_Integer;
prop->propVal.u.ival =
TRUE;
FA_errno=0;
F_ApiCMSSetProperty(cmsSessionId,objectIds->val[0], prop);
1020
FDK Programmer’s Reference
F_ApiCMSConfigLoginUI
...
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSConfigLoginUI
Configures the CMS Connector Manager dialogs within the FrameMaker interface
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiCMSConfigLoginUI (F_ObjHandleT cmsId,
const F_StringsT *userFields,
BoolT userLoginUI);
Arguments
cmsId
The ID of the CMS
userFields
Optional user fields with strings. User can add upto two user fields.
userLoginUI
True if user want to impement his own custom connection manager dialog
Returns
VoidT
If F_ApiCMSConfigLoginUI() fails, the API assigns following values to
FA_errno
FA_errno value
Meaning
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code configure the connection manager dialog for “Adobe CQ”
. . .
VoidT F_ApiInitialize(IntT initialization)
{
F_StringsT *userFields = (F_StringsT
*)F_Alloc(sizeof(F_StringsT), NO_DSE);
userFields->len = 1;
userFields->val = (StringT *)F_Alloc(sizeof(StringT) *
userFields->len, NO_DSE);
userFields->val[0] =F_ApiCopyString((ConStringT)"WorkSpace:");
F_ObjHandleT cmsId = F_ApiCMSRegister((ConStringT)"Adobe CQ");
F_ApiCMSConfigLoginUI(cmsId,userFields, False);
F_Free(userFields);
}
FDK Programmer’s Reference
1021
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSShowCheckoutUI
F_ApiCMSShowCheckoutUI
Displays the checkout dialog for a CMS object
Synopsis
#include fcmsapi.h
. . .
BoolT F_ApiCMSShowCheckoutUI(F_ObjHandleT sessionId,
F_ObjHandleT objectId,
UIntT hideUiItems);
Arguments
sessionId
The ID of the CMS session
objectId
The ID of the CMS Object
hideUiItems
Parameter to customize the checkout dialog. It can take the values from
F_CMSCustomizeCheckoutUI enum
F_CMSCustomizeCheckoutUI
Enum constants used to customize CMS Object's Checkout user interface.
The possible values of the hideUiItems field are:
Value for flags
Meaning
FV_CMSCheckoutUI_Id_ShowDepe
ndents
Flag to hide “Show dependents” checkbox
Returns
Returns True if “Show dependents” option is checked if it succeeds or an error code if an
error occurs
If F_ApiCMSShowCheckoutUI() fails, the API assigns following values to
FA_errno:
1022
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID
FE_CMSBadObjectId
The client specified an invalid cms object ID
FE_BadParameter
The function call specified an invalid parameter.
FDK Programmer’s Reference
F_ApiCMSShowCheckinUI
...
C M S C o n n e c t o r F r a m e Wo r k
Example
The following code displays the checkout dialog with show dependents option:
. . .
BoolT Status;
FA_errno=0;
Status=F_ApiCMSShowCheckoutUI(cmsSessionId, objectIds->val[0],
0);
F_ApiCMSShowCheckinUI
Displays the Check-in dialog for a CMS object
Synopsis
#include fcmsapi.h
. . .
F_CMSCheckinParamT F_ApiCMSShowCheckinUI(F_ObjHandleT sessionId,
F_ObjHandleT objectId,
UIntT hideUiItems);
Arguments
sessionId
The ID of the CMS session
objectId
The ID of the CMS Object
hideUiItems
Parameter to customize the checkin dialog. It can take the values from
F_CMSCustomizeCheckinUI enum
F_CMSCustomizeCheckinUI
Enum constants used to customize CMS Object's Checkin user interface.
The user can specify one or more of the following flag constants (using the OR
expression for multiple flags) into the hideUiItems field:
hideUiItems constants
Meaning
FV_CMSCheckinUI_Id_SameVersion
Flag to hide “Same version” radio button
FV_CMSCheckinUI_Id_MinorVersion
Flag to hide “Minor version” radio button
FDK Programmer’s Reference
1023
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSShowCancelCheckoutUI
FV_CMSCheckinUI_Id_MajorVersion
Flag to hide “Major version” radio button
FV_CMSCheckinUI_Id_VersionLabel
Flag to hide “Version Label” text field
FV_CMSCheckinUI_Id_Description
Flag to hide “Description” text field
FV_CMSCheckinUI_Id_CheckinComme
nt
Flag to hide “Checkin comment” text field
FV_CMSCheckinUI_Id_MakeThisCurr
entVersion
Flag to hide “Make this current version”
checkbox
Returns
Retiurns the F_CMSCheckinParamT structure for further operation in the client if it
succeeds or an error code if an error occurs
If F_ApiCMSShowCheckinUI() fails, the API assigns following values to
FA_errno:
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID
FE_CMSBadObjectId
The client specified an invalid cms object ID
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code displays the checkin dialog with all fields:
. . .
F_CMSCheckinParamT param;
FA_errno=0;
param=F_ApiCMSShowCheckinUI( cmsSessionId,objectIds->val[0], 0);
F_ApiCMSShowCancelCheckoutUI
Displays the Cancel Check out dialog for a CMS object
Synopsis
#include fcmsapi.h
. . .
VoidT F_ApiCMSShowCancelCheckoutUI (F_ObjHandleT
sessionId,F_ObjHandleT objectId);
1024
FDK Programmer’s Reference
F_ApiCMSShowDeleteUI
...
C M S C o n n e c t o r F r a m e Wo r k
Arguments
cmsSessionId
The ID of the CMS session
cmsObjectId
The ID of the CMS object
Returns
VoidT
If F_ApiCMSShowCancelCheckoutUI() fails, the API assigns following values to
FA_errno
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID
FE_CMSBadObjectId
The client specified an invalid cms object ID
Example
The following code displays the cancel checkout dialog:
. . .
F_ApiCMSShowCancelCheckoutUI( cmsSessionId, objectIds->val[0]);
F_ApiCMSShowDeleteUI
Displays the Delete dialog for a CMS object
Synopsis
#include fcmsapi.h
. . .
F_CMSDeleteParamT F_ApiCMSShowDeleteUI (F_ObjHandleT
cmsSessionId,F_ObjHandleT
objectId,UIntT hideUiItems);
Arguments
sessionId
The ID of the CMS session
objectId
The ID of the CMS Object
hideUiItems
Parameter to customize the delete dialog. It can take the values from
F_CMSCustomizeDeleteUI enum
F_CMSCustomizeDeleteUI
FDK Programmer’s Reference
1025
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSShowCommonListUI
Enum constants used to customize CMS Object's Delete user interface.
The user can specify one or more of the following flag constants (using the OR
expression for multiple flags) into the hideUiItems field:
Value for flags
Meaning
FV_CMSDeleteUI_DeleteAllVersion
Flag to hide “Delete all the version of a file”
checkbox
FV_CMSDeleteUI_DeleteAllDependents
Flag to hide “Delete all the dependents of a file”
checkbox
Returns
Retiurns the F_CMSDeleteParamT structure for further operation in the client if it
succeeds or an error code if an error occurs
If F_ApiCMSShowDeleteUI() fails, the API assigns following values to
FA_errno:
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID
FE_CMSBadObjectId
The client specified an invalid cms object ID
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code displays the delete dialog with all fields:
. . .
F_CMSDeleteParamT param;
FA_errno=0;
param=F_ApiCMSShowDeleteUI( cmsSessionId, objectIds->val[0],0);
F_ApiCMSShowCommonListUI
Displays the list-based dialogs such as “Show Version”, “Show Checked out files”,
“Show dependents” and “Show result”. These items are fetched using the
F_ApiCMSGetItems CMS command.
1026
FDK Programmer’s Reference
F_ApiCMSShowCommonListUI
...
C M S C o n n e c t o r F r a m e Wo r k
Synopsis
#include fcmsapi.h
. . .
BoolT F_ApiCMSShowCommonListUI (F_ObjHandleT
cmsSessionId,F_ObjHandleT objectId,
UIntT commandId,ConStringT title,
const F_TypedValsT *columnProperties);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
commandId
The ID of the CMS command
title
The Title of the Show Dialog
columnProperties
Properties Columns to show
Returns
Returns FE_Success if it succeeds, or an error code if an error occurs.
If F_ApiCMSShowCommonListUI() fails, the API assigns following values to
FA_errno
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID.
FE_CMSBadObjectId
The client specified an invalid cms object ID.
FE_CMSBadCommandId
The client specified an invalid command ID.
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code displays the “Show Version” dialog with 2 column “Name” and
“Server Path”
. . .
F_TypedValsT columnProperties;
F_TypedValT columnProperty[2];
columnProperties.len = 2;
columnProperties.val = (F_TypedValT
*)F_Alloc(columnProperties.len * sizeof(F_TypedValT),DSE);
FDK Programmer’s Reference
1027
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSShowPropertyUI
for(IntT i=0;ilen = 2;
columnProperty[i].u.valsval->val = (F_TypedValT *)F_Alloc(2 *
sizeof(F_TypedValT),DSE);
switch(i)
{
case 0:
columnProperty[i].u.valsval->val[0].valType = FT_Integer;
columnProperty[i].u.valsval->val[0].u.ival =
FP_CMSItemProperty_ItemName;
columnProperty[i].u.valsval->val[1].valType = FT_String;
columnProperty[i].u.valsval->val[1].u.sval = F_StrCopyString(
(ConStringT) "Name");
break;
case 1:
columnProperty[i].u.valsval->val[0].valType = FT_Integer;
columnProperty[i].u.valsval->val[0].u.ival =
FP_CMSItemProperty_ItemServerPath;
columnProperty[i].u.valsval->val[1].valType = FT_String;
columnProperty[i].u.valsval->val[1].u.sval = F_StrCopyString(
(ConStringT) "Server Path");
break;
}
columnProperties.val[i] = columnProperty[i];
}
BoolT status=F_ApiCMSShowCommonListUI(cmsSessionId, objectId,
command, “Show Version“, &columnProperties);
F_ApiCMSShowPropertyUI
Displays the Property dialog for a CMS object
1028
FDK Programmer’s Reference
F_ApiCMSShowBrowseRepositoryUI
...
C M S C o n n e c t o r F r a m e Wo r k
Synopsis
#include fcmsapi.h
. . .
F_CMSPropertiesT F_ApiCMSShowPropertyUI(F_ObjHandleT
cmsSessionId,F_ObjHandleT objectId,
const F_CMSPropertiesT *props);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
props
F_CMSPropertiesT structure specifies a set of CMS object propeties.
Set NULL if user wants to show default properties
Returns
Returns F_CMSPropertiesT strucuture contaning a set of CMS object properties if it
succeeds, or an error code if an error occurs.
If F_ApiCMSShowPropertyUI() fails, the API assigns following values to
FA_errno
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID
FE_CMSBadObjectId
The client specified an invalid cms object ID
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code displays the “Show Property” dialog with default properties:
. . .
F_CMSPropertiesT retProps;
retProps = F_ApiCMSShowPropertyUI(cmsSessionId, objectIds>val[0], NULL);
F_ApiCMSShowBrowseRepositoryUI
Displays repository browser dialog based on flag “showContainerOnly”
FDK Programmer’s Reference
1029
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSGetCmsIdFromName
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSShowBrowseRepositoryUI(F_ObjHandleT
cmsSessionId, BoolT showContainerOnly);
Arguments
cmsSessionId
The ID of the CMS session
showContainerOnly
True if only container item is shown
False if all items are shown
Returns
Returns the ID of the selected CMS object
Example
The following code displays the repository browser dialog for only container items:
. . .
F_ObjHandleT cmsObj;
FA_errno=0;
cmsObj=F_ApiCMSShowBrowseRepositoryUI(cmsSessionId,(BoolT)1);
if (FA_errno==0)
{
if (cmsObj)
F_ApiAlert("item selected", FF_ALERT_CONTINUE_NOTE);;
else
F_ApiAlert("No item selected", FF_ALERT_CONTINUE_NOTE);
}
else
F_ApiAlert("Canceled button is clicked", FF_ALERT_CONTINUE_NOTE);
F_ApiCMSGetCmsIdFromName
Gets the CMS registration id from CMS name.
1030
FDK Programmer’s Reference
F_ApiCMSGetCMSInfo
...
C M S C o n n e c t o r F r a m e Wo r k
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSGetCmsIdFromName (ConStringT cmsName);
Arguments
cmsName
The Name of the CMS
Returns
Returns the registration ID of the specified CMS if it succeeds, or an error code if an
error occurs.
If F_ApiCMSGetCmsIdFromName() fails, the API assigns following values to
FA_errno:
FA_errno value
Meaning
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code gets the CMS registration id of "Adobe CQ"
. . .
F_ObjHandlesT cmsId;
cmsId = F_ApiCMSGetCmsIdFromName("Adobe CQ");
F_ApiCMSGetCMSInfo
Gets the CMS information for a particular CMS registration id.
Synopsis
#include fcmsapi.h
.. .
F_CMSInfoT
F_ApiCMSGetCMSInfo(F_ObjHandleT cmsId);
Arguments
cmsId
The registration ID of the CMS
Returns
Returns the F_CMSInfoT structure contaning a single CMS registration information
if it succeeds or an error code if an error occurs
FDK Programmer’s Reference
1031
8
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSGetCmsIdFromSession
If F_ApiCMSGetCMSInfo() fails, the API assigns following values to FA_errno:
FA_errno value
Meaning
FE_BadParameter
The function call specified an invalid parameter.
Example
The following code gets the CMS information for a particular registered CMS:
. . .
F_CMSInfoT CMSInfo= F_ApiCMSGetCMSInfo(cmsId);
F_ApiCMSGetCmsIdFromSession
Gets the CMS registration id from CMS Session id
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSGetCmsIdFromSession(F_ObjHandleT
cmsSessionId);
Returns
Returns the CMS registration ID if it succeeds, or an error code if an error occurs.
If F_ApiCMSGetCmsIdFromSession() fails, the API assigns following values to
FA_errno
FA_errno value
Meaning
FE_CMSBadSessionId
The client specified an invalid session ID
Example
The following code gets the CMS registration id from CMS session id
. . .
F_ObjHandlesT cmsId;
cmsId = F_ApiCMSGetCmsIdFromSession(cmsSessionId);
F_ApiCMSGetCmsInfoList
Gets entire list of CMS information for all registered CMS
1032
FDK Programmer’s Reference
F_ApiCMSGetCmsInfoList
...
C M S C o n n e c t o r F r a m e Wo r k
Synopsis
#include fcmsapi.h
. . .
F_CMSInfosT F_ApiCMSGetCmsInfoList ();
Arguments
None
Returns
Returns the F_CMSInfosT structure contaning CMS information for all registered
CMS.
Example
The following code gets the entire list of CMS information for all registered CMS:
. . .
F_CMSInfosT CMSInfo= F_ApiCMSGetCmsInfoList();
FDK Programmer’s Reference
1033
8
1034
C M S C o n n e c t o r F r a m e Wo r k
F_ApiCMSGetCmsInfoList
FDK Programmer’s Reference
9
APIs to automate the CMS connectors
functionality
..................................
.....
8
This chapter describes the CMS APIs used automate the CMS operations after a CMS
connector is integrated with FrameMaker.
F_ApiCMSLogin
Logs into a particular CMS based on the connection details
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSLogin(const F_IdValuePairsT *setVal);
Arguments
setVal
Id value pairs to specify the connection parameter. The valid Ids are:
FV_CMSCommandNameID - Name of the connection
FV_CMSCommandConnTypeId -Connection Type
FV_CMSCommandServerId -Server Name
FV_CMSCommandUserNameId -User Name
FV_CMSCommandPasswordId- Password
FV_CMSCommandUserField1- Optional User Field1
FV_CMSCommandRepositoryId- Repository name for documentum
FV_CMSCommandUserField2-Optional User Field2
Returns
Returns the handle of the new CMS connection if the operation is successful. Else sets
FA_errno to FE_CMSFailedLogin.
FDK Programmer’s Reference
1035
9
APIs to automate the CMS connectors functionality
F_ApiCMSLogout
Example
The following code logs into the CRX and returns CMS connection id:
. . .
#define ASSIGN_ID_STR(COUNT,ID,STR) tval->val[COUNT].id = ID;\
tval->val[COUNT].value.valType = FT_String; \
ASSIGN_ID_STR(0, FV_CMSCommandConnTypeId,"CRX");
ASSIGN_ID_STR(1, FV_CMSCommandNameId, "CRX");
ASSIGN_ID_STR(2, FV_CMSCommandServerId,
"http://localhost:7402/crx/server");
ASSIGN_ID_STR(3, FV_CMSCommandUserNameId, "admin");
ASSIGN_ID_STR(4, FV_CMSCommandPasswordId, "admin");
ASSIGN_ID_STR(5, FV_CMSCommandUserField1, "crx.default");
ASSIGN_ID_STR(6, FV_CMSCommandUserField2, "crx");
connId = F_ApiCMSLogin(tval);
F_ApiCMSLogout
Logs out the user from a particular CMS connection
Synopsis
#include fcmsapi.h
. . .
StatusT F_ApiCMSLogout(F_ObjHandleT cmsSessionId);
Arguments
cmsSessionId
The ID of the CMS session
Returns
Returns FE_Success if the operation is successful, else sets FA_errno to
FE_CMSFailedLogout
Example
The following code logs out the CMS connection:
. . .
FA_errno=0;
F_ObjHandleT connIdconnId = F_ApiCMSLogin(tval);
StatusT result=F_ApiCMSLogout(connId);
1036
FDK Programmer’s Reference
F_ApiCMSCheckout
...
APIs to automate the CMS connectors functionality
F_ApiCMSCheckout
Checks out a file from the CMS
Synopsis
#include fcmsapi.h
. . .
StatusT
F_ApiCMSCheckout(F_ObjHandleT cmsSessionId,
F_ObjHandleT cmsObjectId,BoolT rootWithDescendants);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
rootWithDescendants
True if checked out root with descendants
Returns
Returns FE_Success if the operation is successful. Else sets FA_errno to
FE_CMSFailedCheckout
Example
The following code checkouts a file with its descendants:
. . .
FA_errno=0;
F_ObjHandleT objectId = 0;
ConStringT urlPathOrObjId =
F_ApiCopyString((ConStringT)"/libs/source.fm");
F_ObjHandleT cmsObjId = F_ApiGetCMSObjectFromPath(ConnId,
urlPathOrObjId);
BoolT downloadDescendents = True;
if (cmsObjId)
{
StatusT result=F_ApiCMSCheckout(ConnId, cmsObjId,
downloadDescendents);
objectId=cmsObjId;
}
FDK Programmer’s Reference
1037
9
APIs to automate the CMS connectors functionality
F_ApiCMSCheckin
F_ApiCMSCheckin
Checks in a file into the CMS
Synopsis
#include fcmsapi.h
. . .
StatusT F_ApiCMSCheckin(F_ObjHandleT cmsSessionId,F_ObjHandleT
objectId,const F_IdValuePairsT *checkinParam);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
checkinParam
Id value pairs to specify the checkin parameter. The valid Ids are:
FV_CMSCommandCheckinMakeCurrentVersionId
FV_CMSCommandCheckinKeepLocalCopyId
FV_CMSCommandCheckinMinorVersionId
FV_CMSCommandCheckinVersionLabelId
FV_CMSCommandCheckinDescriptionId
FV_CMSCommandCheckinCommentId
Returns
Returns FE_Success if the operation is successful, else sets FA_errno to
FE_CMSFailedCheckin
Example
The following code checks in a file:
. . .
FA_errno=0;
if (ConnId > 0 && objectId)
{
F_IdValuePairsT *tval = (F_IdValuePairsT
*)F_Alloc(sizeof(F_IdValuePairsT), NO_DSE);
tval->len = 6;
tval->val = (F_IdValuePairT *)F_Alloc(sizeof(F_IdValuePairT) *
tval->len, NO_DSE);
ASSIGN_ID_INT(0, FV_CMSCommandCheckinMakeCurrentVersionId,1);
ASSIGN_ID_INT(1, FV_CMSCommandCheckinKeepLocalCopyId, 0);
1038
FDK Programmer’s Reference
F_ApiCMSCancelCheckout
...
APIs to automate the CMS connectors functionality
ASSIGN_ID_INT(2, FV_CMSCommandCheckinMinorVersionId, 1);
ASSIGN_ID_STR(3, FV_CMSCommandCheckinDescriptionId, "desc");
ASSIGN_ID_STR(4, FV_CMSCommandCheckinVersionLabelId, "label");
ASSIGN_ID_STR(5, FV_CMSCommandCheckinCommentId, "comment");
StatusT result=F_ApiCMSCheckin(ConnId, objectId, tval);
objectId = 0;
}
F_ApiCMSCancelCheckout
Cancels check out of a file from the CMS
Synopsis
#include fcmsapi.h
. . .
StatusT
F_ApiCMSCancelCheckout(F_ObjHandleT cmsSessionId,
F_ObjHandleT objectId);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
Returns
Returns FE_Success if the operation is successful, else sets FA_errno to
FE_CMSFailedCancelCheckout
Example
The following code cancels the check out of a file:
. . .
FA_errno=0;
if (ConnId > 0 && objectId)
{
StatusT result=F_ApiCMSCancelCheckout(ConnId, objectId);
objectId = 0;
}
FDK Programmer’s Reference
1039
9
APIs to automate the CMS connectors functionality
F_ApiCMSDelete
F_ApiCMSDelete
Deletes a file or a folder from CMS
Synopsis
#include fcmsapi.h
. . .
StatusT
F_ApiCMSDelete(F_ObjHandleT cmsSessionId,
F_ObjHandleT cmsObjectId,
const F_IdValuePairsT *deleteParams);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
deleteParams
Id value pairs to specify the delete parameter.The valid Ids are:
FV_CMSCommandDeleteAllVersionId
FV_CMSCommandDeleteAllDependentsId
Returns
Returns FE_Success if the operation is successful, else sets FA_errno to
FE_CMSFailedDelete
Example
The following code deletes a file with all its dependents:
. . .
FA_errno=0;
ConStringT urlPathOrObjId =
F_ApiCopyString((ConStringT)"/libs/source.fm");
F_ObjHandleT cmsObjId = F_ApiGetCMSObjectFromPath(ConnId,
urlPathOrObjId);
if (cmsObjId)
{
F_IdValuePairsT *tval = (F_IdValuePairsT
*)F_Alloc(sizeof(F_IdValuePairsT), NO_DSE);
tval->len = 2;
tval->val = (F_IdValuePairT *)F_Alloc(sizeof(F_IdValuePairT) *
tval->len, NO_DSE);
ASSIGN_ID_INT(0,FV_CMSCommandDeleteAllDependentsId,1);
1040
FDK Programmer’s Reference
F_ApiCMSOpenFile
...
APIs to automate the CMS connectors functionality
ASSIGN_ID_INT(1,FV_CMSCommandDeleteAllVersionId, 0);
StatusT result=F_ApiCMSDelete(ConnId, cmsObjId, tval);
}
F_ApiCMSOpenFile
Opens a file or a book from CMS in FrameMaker
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleT F_ApiCMSOpenFile(F_ObjHandleT cmsSessionId,
F_ObjHandleT cmsObjectId,
const F_IdValuePairsT *openParams);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
openParams
Id value pairs to specify the open parameter.The valid Ids are:
FV_CMSCommandOpenReadOnlyId
FV_CMSCommandSilentOpenId
Returns
Returns the handle of the file or book if the operation is successful. Else sets FA_errno
to FE_CMSFailedOpenFile
Example
The following code opens a file in open read only mode:
. . .
FA_errno=0;
ConStringT urlPathOrObjId =
F_ApiCopyString((ConStringT)"/libs/source.fm");
F_ObjHandleT cmsObjId = F_ApiGetCMSObjectFromPath(ConnId,
urlPathOrObjId);
if (cmsObjId)
{
FDK Programmer’s Reference
1041
9
APIs to automate the CMS connectors functionality
F_ApiCMSUploadObject
F_ObjHandleT docId;
F_IdValuePairsT *tval = (F_IdValuePairsT
*)F_Alloc(sizeof(F_IdValuePairsT), NO_DSE);
tval->len = 2;
tval->val = (F_IdValuePairT *)F_Alloc(sizeof(F_IdValuePairT) *
tval->len, NO_DSE);
ASSIGN_ID_INT(0,FV_CMSCommandOpenReadOnlyId,1);
ASSIGN_ID_INT(1,FV_CMSCommandSilentOpenId, 0);
docId = F_ApiCMSOpenFile(ConnId, cmsObjId , tval);
}
F_ApiCMSUploadObject
Uploads a file or a folder into the CMS
Synopsis
#include fcmsapi.h
. . .
StatusT
F_ApiCMSUploadObject(F_ObjHandleT cmsSessionId,
F_ObjHandleT cmsObjectId,
ConStringT localFilePath);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
localFilePath
The full pathname of the file or folder to upload
Returns
Returns FE_Success if the operation is successful. Else sets FA_errno to
FE_CMSFailedUploadObject
Example
The following code uploads a file into CMS
. . .
FA_errno=0;
ConStringT urlPathOrObjId =
F_ApiCopyString((ConStringT)"/libs/");
1042
FDK Programmer’s Reference
F_ApiCMSDownloadObject
...
APIs to automate the CMS connectors functionality
ConStringT uploadFilePath =
F_ApiCopyString((ConStringT)"C:\\Documents and
Settings\\aggrawal\\Desktop\\Generic CMS\\Book\\source.fm");
F_ObjHandleT cmsObjId = F_ApiGetCMSObjectFromPath(ConnId,
urlPathOrObjId);
if (cmsObjId)
StatusT result=F_ApiCMSUploadObject(ConnId,cmsObjId,
uploadFilePath);
F_ApiCMSDownloadObject
Downloads a file from the CMS
Synopsis
#include fcmsapi.h
. . .
StringT
F_ApiCMSDownloadObject(F_ObjHandleT cmsSessionId,
F_ObjHandleT cmsObjectId);
Arguments
cmsSessionId
The ID of the CMS Session
cmsObjectId
The ID of the CMS Object
Returns
Returns the local file path of the downloaded file if the operation is successful. Else sets
FA_errno to FE_CMSFailedDownloadObject
Example
The following code download a file from CMS:
. . .
FA_errno=0;
ConStringT urlPathOrObjId =
F_ApiCopyString((ConStringT)"/libs/book.book");
F_ObjHandleT cmsObjId = F_ApiGetCMSObjectFromPath(ConnId,
urlPathOrObjId);
if (cmsObjId)
StringT path=F_ApiCMSDownloadObject(ConnId,cmsObjId);
FDK Programmer’s Reference
1043
9
APIs to automate the CMS connectors functionality
F_ApiGetCMSObjectFromPath
F_ApiGetCMSObjectFromPath
Gets CMS object from a URL path
Synopsis
#include fcmsapi.h
. . .
F_ObjHandleTF_ApiGetCMSObjectFromPath(F_ObjHandleT cmsSessionId,
ConStringT urlPath);
Arguments
cmsSessionId
The ID of the CMS Session
urlPath
The url pathname of the file or folder
Returns
Returns the handle of a CMS object if the operation is successful. Else sets FA_errno to
FE_CMSFailedGetItemFrompath
Example
The following code returned a CMS object from a URL path:
. . .
FA_errno=0;
ConStringT urlPathOrObjId =
F_ApiCopyString((ConStringT)"/libs/book.book");
F_ObjHandleT cmsObjId = F_ApiGetCMSObjectFromPath(ConnId,
urlPathOrObjId);
1044
FDK Programmer’s Reference
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.6 Linearized : Yes Author : Adobe Systems Incorporated Create Date : 2012:11:07 12:37:33Z Keywords : FDK, Programmer’s Reference, Documentation, API, C, Plugins, Clients Modify Date : 2013:02:15 09:03:18+01:00 Subject : FDK Documentation Has XFA : No XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37 Creator Tool : FrameMaker 11.0 Metadata Date : 2013:02:15 09:03:18+01:00 Format : application/pdf Description : FDK Documentation Title : FDK Programmer’s Reference Creator : Adobe Systems Incorporated Producer : Acrobat Distiller 10.1.4 (Windows) Document ID : uuid:359a4458-48b4-4bf3-986a-996a10537d5d Instance ID : uuid:503860f2-d4fd-5c4d-a32e-373fbe73fa5e Page Mode : UseOutlines Page Count : 1049EXIF Metadata provided by EXIF.tools