1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304
|
/************************************************************************/
/* */
/* Text Editor Buffer structure. */
/* */
/************************************************************************/
# ifndef DOC_BUF_H
# define DOC_BUF_H
# include <time.h>
# include <bitmap.h>
# include <utilDocFont.h>
# include <psFont.h>
# include "docShape.h"
# include <geo2DInteger.h>
# include <sioGeneral.h>
# include <utilMemoryBuffer.h>
# include <utilTextAttributeAdmin.h>
# include "docParaProperties.h"
# include "docRowProperties.h"
# include "docSectProperties.h"
# include "docStyleSheet.h"
# include "docDocumentProperties.h"
# include "docShapeProperties.h"
# include "docField.h"
# include "docObject.h"
# include "docSelect.h"
# include "docExternalItem.h"
# include "docListTable.h"
# include "docListNumberTree.h"
/************************************************************************/
/* */
/* Forward declarations of structs. */
/* */
/************************************************************************/
struct BufferDocument;
struct BufferItem;
struct DocumentField;
/************************************************************************/
/* */
/* An homogenous piece of text. Without hyphenation, it will not be */
/* divided over lines. */
/* It consists of some characters and then some spaces. */
/* */
/************************************************************************/
typedef enum DocParticuleKind
{
DOCkindUNKNOWN= 0,
DOCkindTEXT,
DOCkindTAB,
DOCkindOBJECT,
DOCkindFIELDSTART,
DOCkindFIELDEND,
DOCkindNOTE,
DOCkindTC,
DOCkindXE,
DOCkindLINEBREAK,
DOCkindPAGEBREAK,
DOCkindCOLUMNBREAK,
DOCkindCHFTNSEP,
DOCkindCHFTNSEPC,
DOCkind_COUNT
} DocParticuleKind;
# define DOCkindBETWEEN_TEXT(k) \
( \
(k) == DOCkindFIELDSTART || \
(k) == DOCkindFIELDEND || \
(k) == DOCkindNOTE \
)
# define DOCkind_BITS 6
typedef struct TextParticule
{
unsigned int tpStroff:16;
unsigned int tpStrlen:14;
unsigned int tpX0:12;
unsigned int tpPixelsWide:12;
unsigned int tpKind:DOCkind_BITS;
unsigned int tpInField:1;
short int tpObjectNumber;
int tpTextAttributeNumber;
} TextParticule;
/************************************************************************/
/* */
/* Used to lay out the text on the page. */
/* A text line consists of a series of particules. */
/* */
/* 1) What part of the string in the paragraph. */
/* 2) What particules. */
/* 3) Where is it geo/typographically? */
/* 4) Postscript geometry information. */
/* lineSpacing includes the leading that is irrelevant for the */
/* last line of a page. */
/* 5) Screen geometry. */
/* */
/* 6) The width of the column for which the line was last formatted. */
/* When the line is shifted to a column with the same width, it */
/* is sufficient to change the coordinates of the line and its */
/* contents during a reformat of the document. When the column */
/* width is diffrerent, the line must be reformatted. (and most */
/* probably subsequent lines as well). */
/* */
/************************************************************************/
typedef struct TextLine
{
/* 1,2 */
int tlStroff;
int tlFirstParticule;
short int tlStrlen;
short int tlParticuleCount;
short int tlWordCount;
/* 3 */
LayoutPosition tlTopPosition;
/* 4 */
short int tlLineAscentTwips;
short int tlLineHeightTwips;
short int tlLineSpacingTwips;
/* 5 */
short int tlHasPageBreak;
short int tlX0Pixels;
short int tlX1Pixels;
short int tlColumnWidthTwips; /* 6 */
} TextLine;
/************************************************************************/
/* */
/* A Paragraph. */
/* */
/************************************************************************/
typedef struct BufferPara
{
unsigned char * btString;
unsigned int btStrlen;
int btParticuleCount;
TextParticule * btParticules;
int btObjectCount;
InsertedObject * btObjects;
int btLineCount;
TextLine * btLines;
int btShapeCount;
DrawingShape * btShapes;
ParagraphProperties btProperties;
int btAscentTwips;
int btDescentTwips;
int btLeadingTwips;
const BorderProperties * btBorderAboveParagraph;
const BorderProperties * btBorderBelowParagraph;
} BufferPara;
/************************************************************************/
/* */
/* Type dependent part of a BufferItem of 'Section' level. */
/* */
/* Section level BufferItems are the sections of the document and the */
/* 'External Items' that are not part of the regular tree of items */
/* that forms the document. Examples of 'External Items' are the page */
/* headers and footers and the footnotes and endnotes in the document. */
/* */
/* The root of external items are recognised by the fact that */
/* bi->biInExternalItem != DOCinBODY. In practice there are no parents */
/* to the section level items in external items. This is accidental */
/* and should not be used as a recognition criterion. */
/* */
/* 1) Formatting properties of the section. */
/* 2) Page Headers. */
/* 3) Page Footers. */
/* 5) Number of the section in the document tree that an external */
/* item belongs to. */
/* */
/************************************************************************/
typedef struct BufferSect
{
/* 1 */
SectionProperties bsProperties;
/* 2 */
ExternalItem bsHeader;
ExternalItem bsFirstPageHeader;
ExternalItem bsLeftPageHeader;
ExternalItem bsRightPageHeader;
/* 3 */
ExternalItem bsFooter;
ExternalItem bsFirstPageFooter;
ExternalItem bsLeftPageFooter;
ExternalItem bsRightPageFooter;
/* 5 */
SelectionScope bsSelectionScope;
/****************************************/
/* */
/* Not used in the body of a document: */
/* */
/* A) Normally not set. Is set by the */
/* formatter to pass information */
/* to calculate page numbers. */
/* B) Normally not set. In headers */
/* and footers it is the number of */
/* the page it is formatted for. */
/* [ Either during the formatting */
/* process or after formatting has */
/* been finished.] */
/* */
/****************************************/
const struct BufferItem * bsUseForSectBi; /* A */
int bsUseForPage; /* B */
/* A */
# define biSectHeaderFooterUseForSectBi \
BIU.biuSect.bsUseForSectBi
/* B */
# define biSectHeaderFooterUseForPage \
BIU.biuSect.bsUseForPage
} BufferSect;
/************************************************************************/
/* */
/* Row specific information. */
/* */
/* 1) The rtf file format does not really support tables. Keep an */
/* administration of the set of rows that looks like a table. */
/* 2) Properties of the row. */
/* 3) Cells with a rowspan can protrude below the actual row: To */
/* optimize position lookups and to delimit areas to redraw */
/* correctly, the position below all 'rowspan' columns is */
/* remembered. */
/* 4) If a row is a table header, it might be repeated on every page */
/* where the table is continued. When the row is drawn on a */
/* different page. A separate administration must be kept to */
/* handle the case where a row starts on a new page and the header */
/* appears above it. Additionally we need to know on what page the */
/* header apprears in the normal text flow. */
/* 6) The top position of the table header row that appears above an */
/* ordinary row. (This must be kept with ordinary rows at the top */
/* of a page.) */
/* 7) A flag indicating that this row is preceded by a table header */
/* that does not appear at its home position. */
/* */
/************************************************************************/
typedef struct BufferRow
{
/* 1 */
int brTableFirst;
int brTablePast;
int brTableFirstIsHeader;
/* 2 */
RowProperties brRowProperties;
/* 3 */
LayoutPosition brBelowAllPosition;
/* 4,6 */
LayoutPosition brAboveHeaderPosition;
/* 4,7 */
int brPrecededByHeader;
} BufferRow;
/************************************************************************/
/* */
/* Levels of nesting. */
/* */
/************************************************************************/
typedef enum ItemLevel
{
DOClevANY,
DOClevOUT,
/****************************************/
/* Ignore; Garbage values. */
/****************************************/
DOClevDOC,
/****************************************/
/* */
/* Document. */
/* */
/* * biGroupChildren */
/* * biGroupChildCount */
/****************************************/
DOClevSECT,
/****************************************/
/* */
/* Section. */
/* */
/* * biGroupChildren */
/* * biGroupChildCount */
/* */
/****************************************/
# define biSectHeader BIU.biuSect.bsHeader
# define biSectFirstPageHeader BIU.biuSect.bsFirstPageHeader
# define biSectLeftPageHeader BIU.biuSect.bsLeftPageHeader
# define biSectRightPageHeader BIU.biuSect.bsRightPageHeader
# define biSectFooter BIU.biuSect.bsFooter
# define biSectFirstPageFooter BIU.biuSect.bsFirstPageFooter
# define biSectLeftPageFooter BIU.biuSect.bsLeftPageFooter
# define biSectRightPageFooter BIU.biuSect.bsRightPageFooter
# define biSectSelectionScope BIU.biuSect.bsSelectionScope
# define biSectProperties BIU.biuSect.bsProperties
# define biSectDocumentGeometry biSectProperties.spDocumentGeometry
# define biSectPageWideTwips biSectProperties.spPageWideTwips
# define biSectPageHighTwips biSectProperties.spPageHighTwips
# define biSectLeftMarginTwips biSectProperties.spLeftMarginTwips
# define biSectTopMarginTwips biSectProperties.spTopMarginTwips
# define biSectRightMarginTwips biSectProperties.spRightMarginTwips
# define biSectBottomMarginTwips biSectProperties.spBottomMarginTwips
# define biSectHeaderYTwips biSectProperties.spHeaderYTwips
# define biSectFooterYTwips biSectProperties.spFooterYTwips
# define biSectHasTitlePage biSectProperties.spHasTitlePage
# define biSectBreakKind biSectProperties.spBreakKind
# define biSectPageNumberStyle biSectProperties.spPageNumberStyle
# define biSectRestartPageNumbers \
biSectProperties.spRestartPageNumbers
# define biSectStartPageNumber biSectProperties.spStartPageNumber
# define biSectParagraphNumbers biSectProperties.spParagraphNumbers
# define biSectParagraphNumberCount \
biSectProperties.spParagraphNumberCount
/****************************************/
DOClevROW,
/****************************************/
/* Row. */
/* * biGroupChildren */
/* * biGroupChildCount */
/****************************************/
# define biRowTableFirst BIU.biuRow.brTableFirst
# define biRowTablePast BIU.biuRow.brTablePast
# define biRowTableFirstIsHeader BIU.biuRow.brTableFirstIsHeader
# define biRowPrecededByHeader BIU.biuRow.brPrecededByHeader
# define biRowBelowAllPosition BIU.biuRow.brBelowAllPosition
# define biRowAboveHeaderPosition \
BIU.biuRow.brAboveHeaderPosition
# define biRowProperties BIU.biuRow.brRowProperties
# define biRowHasTableParagraphs biRowProperties.rpHasTableParagraphs
# define biRowHalfGapWidthTwips biRowProperties.rpHalfGapWidthTwips
# define biRowHalfGapWidthPixels biRowProperties.rpHalfGapWidthPixels
# define biRowLeftIndentTwips biRowProperties.rpLeftIndentTwips
# define biRowLeftIndentPixels biRowProperties.rpLeftIndentPixels
# define biRowHeightTwips biRowProperties.rpHeightTwips
# define biRowIsTableHeader biRowProperties.rpIsTableHeader
# define biRowKeepOnOnePage biRowProperties.rpKeepOnOnePage
# define biRowKeepWithNext biRowProperties.rpKeepWithNext
# define biRowAutofit biRowProperties.rpAutofit
# define biRowCells biRowProperties.rpCells
# define biRowCellCount biRowProperties.rpCellCount
# define biRowAlignment biRowProperties.rpAlignment
# define biRowTopBorder biRowProperties.rpTopBorder
# define biRowBottomBorder biRowProperties.rpBottomBorder
# define biRowLeftBorder biRowProperties.rpLeftBorder
# define biRowRightBorder biRowProperties.rpRightBorder
# define biRowVerticalBorder biRowProperties.rpVerticalBorder
# define biRowHorizontalBorder biRowProperties.rpHorizontalBorder
DOClevCELL,
/****************************************/
/* Cell. */
/* * biGroupChildren */
/* * biGroupChildCount */
/****************************************/
/* No.. Information is stored with the row.
define biCellProperties BIU.biuGroup.BGU.bguCellProperties
*/
DOClevPARA,
/****************************************/
/* Paragraph. */
/****************************************/
# define biParaString BIU.biuPara.btString
# define biParaStrlen BIU.biuPara.btStrlen
# define biParaParticuleCount BIU.biuPara.btParticuleCount
# define biParaParticules BIU.biuPara.btParticules
# define biParaObjectCount BIU.biuPara.btObjectCount
# define biParaObjects BIU.biuPara.btObjects
# define biParaLineCount BIU.biuPara.btLineCount
# define biParaLines BIU.biuPara.btLines
# define biParaShapeCount BIU.biuPara.btShapeCount
# define biParaShapes BIU.biuPara.btShapes
# define biParaAscentTwips BIU.biuPara.btAscentTwips
# define biParaDescentTwips BIU.biuPara.btDescentTwips
# define biParaLeadingTwips BIU.biuPara.btLeadingTwips
# define biParaBorderAboveParagraph \
BIU.biuPara.btBorderAboveParagraph
# define biParaBorderBelowParagraph \
BIU.biuPara.btBorderBelowParagraph
# define biParaProperties BIU.biuPara.btProperties
# define biParaInTable biParaProperties.ppInTable
# define biParaLineSpacingIsMultiple \
biParaProperties.ppLineSpacingIsMultiple
# define biParaStartsOnNewPage biParaProperties.ppStartsOnNewPage
# define biParaFirstIndentTwips biParaProperties.ppFirstIndentTwips
# define biParaLeftIndentTwips biParaProperties.ppLeftIndentTwips
# define biParaRightIndentTwips biParaProperties.ppRightIndentTwips
# define biParaSpaceBeforeTwips biParaProperties.ppSpaceBeforeTwips
# define biParaSpaceAfterTwips biParaProperties.ppSpaceAfterTwips
# define biParaLineSpacingTwips biParaProperties.ppLineSpacingTwips
# define biParaAlignment biParaProperties.ppAlignment
# define biParaTabStopList biParaProperties.ppTabStopList
# define biParaKeepOnPage biParaProperties.ppKeepOnPage
# define biParaKeepWithNext biParaProperties.ppKeepWithNext
# define biParaShadingLevel biParaProperties.ppShadingLevel
# define biParaShadingPattern biParaProperties.ppShadingPattern
# define biParaOutlineLevel biParaProperties.ppOutlineLevel
# define biParaListLevel biParaProperties.ppListLevel
# define biParaTopBorder biParaProperties.ppTopBorder
# define biParaBottomBorder biParaProperties.ppBottomBorder
# define biParaLeftBorder biParaProperties.ppLeftBorder
# define biParaRightBorder biParaProperties.ppRightBorder
# define biParaBoxBorder biParaProperties.ppBoxBorder
# define biParaBetweenBorder biParaProperties.ppBetweenBorder
# define biParaBar biParaProperties.ppBar
# define biParaStyle biParaProperties.ppStyle
# define biParaListOverride biParaProperties.ppListOverride
# define biParaWidowControl biParaProperties.ppWidowControl
# define biParaTabStopCount biParaTabStopList.tslTabStopCount
# define biParaTabStops biParaTabStopList.tslTabStops
DOClevTEXT
/****************************************/
/* Handeled inside TEXT. */
/****************************************/
} ItemLevel;
/************************************************************************/
/* */
/* A BufferItem. */
/* */
/* A BufferItem is a node in what we fashionably call the document */
/* object model. */
/* */
/* 1) Fields for managing the hierarchy. */
/* 2) Geometry information that is set by the formatter. */
/* The insets are an amount of space that the item claims for */
/* itself. The content of the item (children, or lines) appears */
/* between the insets. Typically, the insets are used for spacing */
/* or borders. */
/* 3) Information that is specific to the kind of item. */
/* */
/************************************************************************/
typedef struct BufferItem
{
/* 1 */
short int biLevel;
unsigned char biInExternalItem;
struct BufferItem * biParent;
struct BufferItem ** biChildren;
short int biChildCount;
short int biNumberInParent;
int biLeftParagraphs;
/* 2 */
LayoutPosition biTopPosition;
LayoutPosition biBelowPosition;
int biTopInsetTwips;
int biBottomInsetTwips;
/* 3 */
union BufferItemUnion
{
BufferPara biuPara;
BufferSect biuSect;
BufferRow biuRow;
} BIU;
} BufferItem;
/************************************************************************/
/* */
/* The document as a whole. */
/* */
/************************************************************************/
typedef struct BufferDocument
{
TextAttributeList bdTextAttributeList;
BufferItem bdItem;
DocumentProperties bdProperties;
DocumentStyleSheet bdStyleSheet;
DocumentFieldList bdFieldList;
DocumentNote * bdNotes;
int bdNoteCount;
ListNumberTreeNode * bdListNumberTrees;
int bdListNumberTreeCount;
ExternalItem bdEiFtnsep;
ExternalItem bdEiFtnsepc;
ExternalItem bdEiFtncn;
ExternalItem bdEiAftnsep;
ExternalItem bdEiAftnsepc;
ExternalItem bdEiAftncn;
} BufferDocument;
/************************************************************************/
/* */
/* Statistics about a document. Used in the 'Document Properties' */
/* dialog. */
/* */
/************************************************************************/
typedef struct DocumentStatistics
{
int dsPageCount;
int dsParagraphCount;
int dsLineCount;
int dsWordCount;
int dsCharacterCount;
} DocumentStatistics;
/************************************************************************/
/* */
/* Routine declarations. */
/* */
/************************************************************************/
extern BufferDocument * docPlainReadFile( SimpleInputStream * sis,
int * pMxL,
int docCharset,
int ansiCodepage,
const DocumentGeometry * dg );
extern BufferDocument * docRtfReadFile( SimpleInputStream * sis,
int defAnsigpg );
extern BufferDocument * docLeafReadFile( SimpleInputStream * sis );
extern BufferDocument * docWordReadFile( SimpleInputStream * sis );
extern BufferDocument * docNewFile(
TextAttribute * taDefault,
const char * defaultFont,
int docCharset,
int ansiCodepage,
const PostScriptFontList * psfl,
const DocumentGeometry * dg );
extern int docRtfSaveDocument( SimpleOutputStream * sos,
BufferDocument * bd,
const DocumentSelection * bs,
int saveBookmarks );
extern int docRtfSaveSelectionAsLink(
SimpleOutputStream * sos,
const BufferDocument * bd,
const DocumentSelection * ds,
int asRef,
int asPageref,
const unsigned char * fileName,
int fileSize,
const unsigned char * markName,
int markSize );
extern int docHtmlSaveDocument( SimpleOutputStream * sos,
BufferDocument * bd,
int asMimeAggr,
const char * mimeBoundary,
const char * filename );
extern int docPlainSaveDocument(SimpleOutputStream * sos,
BufferDocument * bd,
const DocumentSelection * ds,
int fold,
int closed );
extern int docRtfSaveRuler( SimpleOutputStream * sos,
const ParagraphProperties * pp );
extern int docRtfReadRuler( SimpleInputStream * sis,
ParagraphProperties * pp );
extern int docInflateTextString( BufferItem * bi,
int by );
extern void docInitTextLine( TextLine * tl );
extern TextLine * docInsertTextLine( BufferItem * bi,
int line );
extern void docCleanItem( BufferDocument * bd,
BufferItem * bi );
extern void docFreeItem( BufferDocument * bd,
BufferItem * bi );
extern void docFreeDocument( BufferDocument * bd );
extern void docInitDocument( BufferDocument * bd );
extern BufferItem * docInsertItem( const BufferDocument * bd,
BufferItem * parent,
int n,
ItemLevel level );
extern void docDeleteItems( BufferDocument * bd,
BufferItem * bi,
int first,
int count );
extern TextParticule * docInsertTextParticule( BufferItem * bi,
int n,
int off,
int len,
int kind,
int textAttrNr );
extern TextParticule * docCopyParticule( BufferItem * bi,
int n,
int off,
int len,
int kind,
const TextParticule * from );
extern int docSplitTextParticule(
TextParticule ** pTpPart,
TextParticule ** pTpNext,
BufferItem * paraBi,
int part,
int stroff );
extern void docDeleteParticules( BufferItem * bi,
int first,
int count );
extern void docDeleteLines( BufferItem * bi,
int first,
int count );
extern void docInitSelectionScope( SelectionScope * ss );
extern void docInitTableRectangle( TableRectangle * tr );
extern int docSplitGroupItem( const BufferDocument * bd,
BufferItem ** pNewBi,
BufferItem ** pOldBi,
BufferItem * oldBi,
int n,
int level );
extern BufferItem * docNextParagraph( BufferItem * bi );
extern BufferItem * docPrevParagraph( BufferItem * bi );
extern BufferItem * docNextSection( BufferItem * bi );
extern BufferItem * docPrevSection( BufferItem * bi );
extern int docNextPosition( DocumentPosition * dp );
extern int docPrevPosition( DocumentPosition * dp );
extern int docNextWord( DocumentPosition * dp );
extern int docPrevWord( DocumentPosition * dp );
extern int docParaBegin( DocumentPosition * dp );
extern int docParaEnd( DocumentPosition * dp );
extern int docLineDown( TextLine ** pTl,
DocumentPosition * dp,
int line );
extern int docLineUp( TextLine ** pTl,
DocumentPosition * dp,
int line );
extern int docFirstPosition( DocumentPosition * dp,
BufferItem * bi );
extern int docLastPosition( DocumentPosition * dp,
BufferItem * bi );
extern int docFirstDocumentPosition( DocumentPosition * dp,
BufferDocument * bd );
extern int docLastDocumentPosition( DocumentPosition * dp,
BufferDocument * bd );
extern void docSetParaSelection( DocumentSelection * ds,
BufferItem * bi,
int direction,
int start,
int length );
extern int docComparePositions( const DocumentPosition * dp1,
const DocumentPosition * dp2 );
extern int docCompareItemPositions( const BufferItem * bi1,
const BufferItem * bi2 );
extern int docSetDocumentPosition( DocumentPosition * dp,
BufferItem * bi,
int stroff );
extern int docFindParticule( int * pPart,
const BufferItem * bi,
int stroff,
int lastOne );
extern int docFindParticuleOfPosition(
int * pPart,
const DocumentPosition * dp,
int lastOne );
extern int docFindLineOfPosition(
int * pLine,
const DocumentPosition * dp,
int lastOne );
extern void docDeleteItem( BufferDocument * bd,
BufferItem * bi );
extern void docListItem( int indent,
const BufferItem * bi );
extern int docCheckItem( const BufferItem * bi );
extern void docListParticule( int indent,
const char * label,
int n,
const BufferItem * bi,
const TextParticule * tp );
extern void docListTextLine( int indent,
const char * label,
int n,
const BufferItem * bi,
const TextLine * tl );
extern void docInitItem( BufferItem * bi,
BufferItem * parent,
const BufferDocument * bd,
int numberInParent,
int level,
int inExternalItem );
extern const char * docKindStr( int kind );
extern const char * docLevelStr( int level );
extern const char * docExternalKindStr( int level );
extern const char * docFieldKindStr( int kind );
extern const char * docAttributeStr( const TextAttribute * ta );
extern void docListNotes( const BufferDocument * bd );
extern TextParticule * docInsertObject( BufferDocument * bd,
BufferItem * paraBi,
InsertedObject ** pIo,
int n,
int off,
const TextAttribute * ta );
extern void docCleanParticuleObject( BufferItem * bi,
TextParticule * tp );
extern InsertedObject * docClaimObject( int * pNr,
BufferItem * bi );
extern InsertedObject * docClaimObjectCopy( BufferItem * bi,
int * pNr,
const InsertedObject * ioFrom );
extern DocumentField * docClaimField( int * pNr,
DocumentFieldList * dfl );
extern int docSetFieldInst( DocumentField * df,
const unsigned char * bytes,
int size );
extern int docAddToFieldInst( DocumentField * df,
const unsigned char * bytes,
int size );
extern int docDelimitTable( BufferItem * paraBi,
BufferItem ** pSectBi,
int * pCol,
int * pRow0,
int * pRow,
int * pRow1 );
extern void docTableDetermineCellspans( int * pRowspan,
int * pColspan,
const BufferItem * rowBi,
int col );
extern int docGetBookmarkForPosition(
const BufferDocument * bd,
const DocumentPosition * dp,
DocumentSelection * dsBookmark,
int * pPart,
int * pEndPart,
const char ** pMarkName,
int * pMarkSize );
extern int docGetHyperlinkForPosition(
const BufferDocument * bd,
const DocumentPosition * dp,
DocumentSelection * dsHyperlink,
int * pStartPart,
int * pEndPart,
const char ** pFileName,
int * pFileSize,
const char ** pMarkName,
int * pMarkSize );
extern void docInitShape( DrawingShape * ds );
extern void docCleanShape( DrawingShape * ds );
extern DrawingShape * docClaimShape( int * pNr,
BufferItem * bi );
extern int docPositionInField( const DocumentPosition * dp,
const BufferDocument * bd );
extern int docSaveParticules( BufferDocument * bd,
BufferItem * paraBi,
const TextAttribute * ta,
const unsigned char * map,
const unsigned char * text,
int len );
extern int docSaveSpecialParticule( BufferDocument * bd,
BufferItem * paraBi,
int atBegin,
const TextAttribute * ta,
int kind );
extern void docLogRectangle( const char * label,
const DocumentRectangle * dr );
extern void docLogRectangles( const char * label1,
const DocumentRectangle * dr1,
const char * label2,
const DocumentRectangle * dr2 );
extern void docInitLayoutPosition( LayoutPosition * lp );
extern void docLineSelection( DocumentSelection * dsLine,
int * pPartLineBegin,
int * pPartLineEnd,
const BufferItem * bi,
int line );
extern void docWordSelection(
DocumentSelection * dsWord,
int * pIsObject,
const DocumentPosition * dpAround );
extern void docInitDocumentStatistics( DocumentStatistics * ds );
extern void docCollectDocumentStatistics( DocumentStatistics * ds,
const BufferDocument * bd );
extern int docWhatPageHeader( ExternalItem ** pHf,
BufferItem * sectBi,
int page,
const DocumentProperties * dp );
extern int docWhatPageFooter( ExternalItem ** pHf,
BufferItem * sectBi,
int page,
const DocumentProperties * dp );
extern BufferItem * docGetSelectionRoot(
ExternalItem ** pEi,
BufferItem ** pBodySectBi,
BufferDocument * bd,
const DocumentSelection * ds );
extern void docInitParagraphNumber( ParagraphNumber * pn );
extern int docRecalculateTextLevelFields( RecalculateFields * rf,
BufferItem * bi );
extern int docRecalculateTextLevelFieldsInExternalItem(
RecalculateFields * rf,
ExternalItem * ei,
const BufferItem * sectBi,
int page );
extern int docRedivideStringInParticules(
BufferItem * bi,
int strOff,
int strLen,
int part,
int partsFree,
int textAttributeNumber );
extern int docSplitFieldInstructions( const MemoryBuffer * mb,
FieldInstructionsComponent * fic,
int count );
extern int docGetHeaderFooter( ExternalItem ** pHf,
BufferItem ** pBodySectBi,
const DocumentSelection * ds,
BufferDocument * bd,
int which );
extern BufferItem * docMakeExternalItem(
BufferDocument * bd,
const SelectionScope * ss,
const SectionProperties * sp );
extern BufferItem * docMakeExternalparagraph(
BufferDocument * bd,
ExternalItem * ei,
const BufferItem * bodyBi,
int txtAttrNr,
int noteIndex,
int inExtIt );
extern BufferItem * docInsertEmptyParagraph(
BufferDocument * bd,
BufferItem * bi,
int textAttributeNumber );
extern int docIntersectTableRectangle( TableRectangle * tr,
const TableRectangle * tr1,
const TableRectangle * tr2 );
extern void docExpandTableRectangleToWholeTable( TableRectangle * tr );
extern void docExpandTableRectangleToWholeRows( TableRectangle * tr );
extern void docExpandTableRectangleToWholeColumns( TableRectangle * tr );
extern int docShiftTableRectangleByRows( TableRectangle * tr,
int rows );
extern int docShiftTableRectangleByColumns( TableRectangle * tr,
int columns );
extern int docTableRectangleSelection( DocumentSelection * ds,
BufferItem ** pSelSectBi,
BufferDocument * bd,
const TableRectangle * tr );
extern int docMergeDocumentLists(
int ** pFontMap,
int ** pColorMap,
int ** pListStyleMap,
BufferDocument * bdTo,
BufferDocument * bdFrom,
const PostScriptFontList * psfl );
extern int docFindBookmarkInDocument( DocumentSelection * ds,
BufferDocument * bd,
const char * markName,
int markSize );
extern int docSurroundTextSelectionByField(
DocumentField ** pDf,
BufferDocument * bd,
int * pStartPart,
int * pEndPart,
const DocumentSelection * ds,
const PropertyMask * taSetMask,
const TextAttribute * taSet );
extern void docConstrainSelectionToOneParagraph( int * pBeginMoved,
int * pEndMoved,
DocumentSelection * ds );
extern void docUnionParaSelections( DocumentSelection * ds,
const DocumentSelection * ds1,
const DocumentSelection * ds2 );
extern int * docAllocateFieldMap( const BufferDocument * bdFrom );
extern int docParaStringReplace( int * pStroffShift,
BufferItem * bi,
int stroffBegin,
int stroffEnd,
const unsigned char * addedString,
int addedStrlen );
extern int docInsertNote( DocumentNote ** pDn,
BufferDocument * bd,
BufferItem * paraBi,
int stroff,
int autoNumber );
extern int docGetNote( DocumentNote ** pDn,
const BufferDocument * bd,
const BufferItem * paraBi,
int stroff );
extern int docMakeNote( DocumentNote ** pDn,
BufferDocument * bd,
BufferItem * paraBi,
int part,
int stroff,
int extItKind );
int docGetSelectedNote( DocumentNote ** pDn,
int * pFieldNr,
unsigned char * fixedText,
int fixedTextSize,
BufferDocument * bd,
const DocumentSelection * ds );
extern void docNoteGetTextAtHead( unsigned char * fixedText,
int * pFixedLen,
int fixedTextSize,
const BufferItem * paraBi );
extern void docNoteGetTextBefore( unsigned char * fixedText,
int * pFixedLen,
int * pTextAttrNr,
int fixedTextSize,
const BufferItem * paraBi,
int stroff );
extern int docDelimitNoteReference(
int * pFieldNr,
int * pPartBegin,
int * pPartEnd,
int * pStroffBegin,
int * pStroffEnd,
const BufferItem * paraBi,
int stroff,
const BufferDocument * bd );
extern void docRenumberNotes( int * pChanged,
BufferDocument * bd );
extern ExternalItem * docSectionHeaderFooter( BufferItem * sectBi,
int which );
ExternalItem * docDocumentNoteSeparator(
BufferDocument * bd,
int which );
extern int docGetExternalItem( ExternalItem ** pEi,
BufferItem ** pBodySectBi,
BufferDocument * bd,
BufferItem * bi );
extern int docGetRootOfSelectionScope( ExternalItem ** pEi,
BufferItem ** pSelRootBi,
BufferItem ** pBodySectBi,
BufferDocument * bd,
const SelectionScope * ss );
extern int docGetTopOfColumn( DocumentPosition * dp,
int * pPartTop,
BufferDocument * bd,
int page,
int column );
extern int docGetFirstInColumnForItem(
DocumentPosition * dp,
int * pLineTop,
int * pPartTop,
BufferItem * bi,
int page,
int column );
extern int docGetBottomOfColumn(DocumentPosition * dp,
int * pPartBot,
BufferDocument * bd,
int page,
int column );
extern int docGetLastInColumnForItem(
DocumentPosition * dp,
int * pLineBot,
int * pPartBot,
BufferItem * bi,
int page,
int column );
extern BufferItem * docInsertRowItem(
BufferDocument * bd,
BufferItem * sectBi,
int n,
const RowProperties * rp,
int textAttributeNumber );
extern int docCopyRowColumnAttributes( BufferItem * rowBi,
const BufferItem * refRowBi );
extern void docSetSelectionScope( DocumentSelection * ds,
const BufferItem * bi );
extern int docSelectionDifferentRoot(
const DocumentSelection * dsOld,
const BufferItem * biSet );
extern int docSectionHeaderFooterFirstPage(
int * pExists,
const BufferItem * bodySectBi,
int which,
const DocumentProperties * dp );
extern int docSelectWholeSection( DocumentSelection * bs,
BufferDocument * bd,
int direction );
extern int docSelectAll( DocumentSelection * ds,
BufferDocument * bd );
extern int docNumberOfParagraph( const BufferItem * paraBi );
extern BufferItem * docGetParagraphByNumber( BufferItem * bi,
int n );
extern int docShiftParticuleOffsets( BufferDocument * bd,
BufferItem * paraBi,
int partFrom,
int partUpto,
int stroffShift );
extern void docShiftNoteReferences( BufferDocument * bd,
int paraFrom,
int stroffFrom,
int sectShift,
int paraShift,
int stroffShift );
extern void docInitNote( DocumentNote * dn );
extern void docCleanNote( BufferDocument * bd,
DocumentNote * dn );
extern int docDeleteNoteOfParticule( BufferDocument * bd,
const BufferItem * paraBi,
const TextParticule * tp );
extern int docCountNotes( const BufferDocument * bd );
extern int docGetFirstNoteFromPage( DocumentNote ** pDn,
const BufferDocument * bd,
int page,
int extItKind );
extern int docGetFirstNoteOnPage( DocumentNote ** pDn,
const BufferDocument * bd,
int page,
int extItKind );
extern int docGetFirstNoteOfSection( DocumentNote ** pDn,
const BufferDocument * bd,
int sect,
int extItKind );
extern int docGetFirstNoteOfDocument( DocumentNote ** pDn,
const BufferDocument * bd,
int extItKind );
extern void docSetExternalItemKind( BufferItem * bi,
int extItKind );
extern int docCheckNoteSeparatorItem( BufferDocument * bd,
int extItKind );
extern int docCountParticulesInField( const BufferItem * bi,
int part,
int partUpto );
extern int docGetSolidRgbShadeOfItem( int * pIsSolid,
int * pRed,
int * pGreen,
int * pBlue,
const BufferDocument * bd,
const ItemShading * is );
extern void docSectDelimitTables( BufferItem * sectBi );
extern void docGetCellTopBorder(
const BorderProperties ** pBpTop,
int * pUseAbove,
const BufferItem * rowBi,
int col,
int atTopOfPage );
extern void docGetCellBottomBorder(
const BorderProperties ** pBpButtom,
int * pUseBelow,
const BufferItem * rowBi,
int col,
int atBottomOfPage );
extern int docTextAttributeNumber( BufferDocument * bd,
const TextAttribute * ta );
extern int docInsertAdminParticule( BufferDocument * bd,
BufferItem * paraBi,
int off,
int n,
int objectNumber,
const TextAttribute * ta,
int kind );
extern int docBalanceFieldSelection( int * pBeginMoved,
int * pEndMoved,
const BufferDocument * bd,
DocumentPosition * dpBegin,
DocumentPosition * dpEnd );
extern int docGetListOfParagraph( ListOverride ** pLo,
ListNumberTreeNode ** pRoot,
DocumentList ** pDl,
int ls,
BufferDocument * bd );
extern int docGetListOfOverride( ListOverride * lo,
const DocumentListTable * dlt );
extern int docListGetFormatPath(int * startPath,
int * formatPath,
const DocumentListLevel ** pDll,
int ilvl,
const DocumentList * dl,
const ListOverride * lo );
extern int docInsertListtextField( BufferItem * paraBi,
BufferDocument * bd );
extern int docRemoveParagraphFromList( BufferItem * paraBi,
BufferDocument * bd );
extern int docParaHeadFieldKind( const BufferItem * paraBi,
const BufferDocument * bd );
extern int docDelimitParaHeadField(
int * pFieldNr,
int * pPartBegin,
int * pPartEnd,
int * pStroffBegin,
int * pStroffEnd,
const BufferItem * paraBi,
const BufferDocument * bd );
extern int docFindListOfSelection(
int * pLs,
int * pLevel,
int * pMultiList,
int * pMultiLevel,
int * pParaNr,
const DocumentSelection * ds );
extern int docApplyListRuler( const ListNumberTreeNode * root,
const DocumentList * dl,
const ListOverride * lo,
BufferDocument * bd );
extern void docGetSelectionAttributes(
BufferDocument * bd,
const DocumentSelection * ds,
PropertyMask * pUpdMask,
TextAttribute * pTaNew );
extern int docInsertParaHeadField(
BufferItem * paraBi,
BufferDocument * bd,
int fieldKind,
int textAttrNr );
extern int docGetNotePosition( DocumentPosition * dp,
BufferDocument * bd,
const DocumentNote * dn );
extern int docNextSimilarRoot( DocumentPosition * dp,
BufferDocument * bd );
extern int docPrevSimilarRoot( DocumentPosition * dp,
BufferDocument * bd );
# endif
|