1 # ifndef DOC_SELECTION_DESCRIPTION_H 2 # define DOC_SELECTION_DESCRIPTION_H 3 4 # include <docLayoutPosition.h> 5 # include <docSelectionScope.h> 6 # include <textAttribute.h> 7 # include <docObject.h> 8 # include <docEditPosition.h> 9 # include <docEditRange.h> 10 # include <docTableRectangle.h> 11 # include <docSelect.h> 12 13 /************************************************************************/ 14 /* */ 15 /* Describe a selection and its relevance for application tools. */ 16 /* */ 17 /************************************************************************/ 18 19 typedef struct SelectionDescription 20 { 21 unsigned int sdDocumentId; 22 23 unsigned char sdIsSet; 24 unsigned char sdDocumentReadonly; 25 unsigned char sdIsIBarSelection; 26 unsigned char sdIsSingleParagraph; 27 unsigned char sdInContiguousParagraphs; 28 unsigned char sdIsSingleFrame; 29 unsigned char sdHeadInFrame; 30 unsigned char sdHeadInTable; 31 unsigned char sdTailInTable; 32 unsigned char sdHeadInTableHeader; 33 unsigned char sdHeadInMultiColumnSection; 34 /** 35 * The selection is in a single table. 36 */ 37 unsigned char sdInOneTable; 38 /** 39 * The selection is a rectangular block in a single 40 * table. 41 */ 42 unsigned char sdIsTableSlice; 43 /** 44 * The selection is an object or image. 45 */ 46 unsigned char sdIsObjectSelection; 47 48 int sdHeadPage; 49 int sdTailPage; 50 int sdDocumentPages; 51 52 int sdHeadSection; 53 int sdTailSection; 54 int sdDocumentSections; 55 56 int sdCanReplace; 57 int sdInTreeType; 58 int sdInDocumentBody; 59 int sdInHeaderFooter; 60 int sdHeaderTypeForSelection; 61 int sdFooterTypeForSelection; 62 63 unsigned char sdHeadInField; 64 unsigned char sdHeadInHyperlink; 65 unsigned char sdHeadInBookmark; 66 unsigned char sdHeadFieldKind; 67 68 unsigned char sdIsListBullet; 69 unsigned char sdHasNote; 70 unsigned char sdInNote; 71 72 unsigned char sdHasLists; 73 int sdFirstListParaNr; 74 int sdListOverride; 75 int sdListLevel; 76 int sdMultiList; 77 int sdMultiLevel; 78 79 /** 80 * The block in a table that holds the selection. 81 * Is also set if we have a selection inside a single 82 * cell. 83 */ 84 TableRectangle sdTableRectangle; 85 86 TextAttribute sdTextAttribute; 87 PropertyMask sdTextAttributeMask; 88 int sdTextAttributeNumber; 89 } SelectionDescription; 90 91 /************************************************************************/ 92 /* */ 93 /* Routine Declarations. */ 94 /* */ 95 /************************************************************************/ 96 97 extern void docInitSelectionDescription( SelectionDescription * sd ); 98 99 extern void docDescribeSelection( 100 SelectionDescription * sd, 101 const DocumentSelection * ds, 102 struct BufferDocument * bd, 103 int headPage, 104 int tailPage, 105 unsigned int documentId, 106 int documentRo ); 107 108 extern void docEnableEditCommands( 109 unsigned char * cmdEnabled, 110 const SelectionDescription * sd ); 111 112 # endif /* DOC_SELECTION_DESCRIPTION_H */ 113