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
|
/************************************************************************/
/* */
/* Document Editing. */
/* */
/************************************************************************/
# ifndef DOC_EDIT_H
# define DOC_EDIT_H
# include "docBuf.h"
/************************************************************************/
/* */
/* Describes an edit operation. Part is only used for interactive edit */
/* operations. */
/* */
/************************************************************************/
typedef struct EditPosition
{
int epParagraphNumber;
int epStroff;
} EditPosition;
typedef struct EditRange
{
int erParagraphCount;
int erBottomLevel;
EditPosition erStartPosition;
EditPosition erEndPosition;
} EditRange;
typedef struct EditOperation
{
SelectionScope eoSelectionScope;
DocumentRectangle eoChangedRectangle;
int eoOldBackY1;
int eoIBarSelectionOld;
int eoMultiParagraphSelectionOld;
/**/
int eoParaAdjustParagraphNumber;
int eoParaAdjustFromLine;
int eoParaAdjustStroffShift;
int eoParaAdjustStroffUpto;
/**/
EditRange eoReformatRange;
/**/
int eoNotesDeleted;
int eoNotesAdded;
int eoParagraphsDeleted;
int eoParagraphsInserted;
unsigned int eoFieldUpdate;
/**/
BufferDocument * eoBd;
void * eoVoidadd;
DOC_CLOSE_OBJECT eoCloseObject;
} EditOperation;
/************************************************************************/
/* */
/* Routine Declarations. */
/* */
/************************************************************************/
extern int docParaReplaceText( EditOperation * eo,
BufferItem * bi,
int part,
unsigned int stroffBegin,
int * pPartShift,
int * pStroffShift,
unsigned int stroffEnd,
const unsigned char * addedText,
unsigned int addedLength,
TextAttribute addedAttribute );
extern int docSplitParaItem( BufferDocument * bd,
BufferItem ** pNewBi,
BufferItem * oldBi,
int stroff );
extern int docRemoveSelectionTail(
EditOperation * eo,
const DocumentSelection * ds );
extern void docEditDeleteItems( EditOperation * eo,
BufferItem * bi,
int first,
int count );
extern void docCloseItemObjects( int * pNoteCount,
int * pParagraphCount,
BufferDocument * bd,
BufferItem * bi,
void * voidadd,
DOC_CLOSE_OBJECT closeObject );
extern TextParticule * docParaSpecialParticule( BufferItem * bi,
int kind,
int part,
int stroff,
int * pPartShift,
int * pStroffShift );
extern int docReplaceSelection(
EditOperation * eo,
const DocumentSelection * bs,
int * pPartShift,
int * pStroffShift,
const unsigned char * addedText,
int addedLength,
TextAttribute addedAttribute );
extern void docInitEditOperation( EditOperation * eo );
extern void docInitEditPosition( EditPosition * ep );
extern void docInitEditRange( EditRange * er );
extern void docIncludePositionInReformat(
EditOperation * eo,
const BufferItem * paraBi,
int stroff );
extern void docEditIncludeItemInReformatRange( EditOperation * eo,
BufferItem * bi );
extern void docEditShiftReformatRangeParaNr(
EditOperation * eo,
int from,
int by );
extern void docSetParagraphAdjust( EditOperation * eo,
BufferItem * paraBi,
int fromLine,
int stroffShift,
int stroffUpto );
extern void docExtendParagraphAdjust( EditOperation * eo,
BufferItem * paraBi,
int stroffShift );
extern int docEditMakeParagraphEmpty( BufferItem * paraBi,
EditOperation * eo );
# endif /* DOC_EDIT_H */
|