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
|
/************************************************************************/
/* */
/* Document Editing. */
/* */
/************************************************************************/
# ifndef DOC_EDIT_H
# define DOC_EDIT_H
# include "docScreenFontList.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 eoChangedRect;
int eoChangedRectSet;
int eoOldBackY1;
int eoIBarSelectionOld;
int eoMultiParagraphSelectionOld;
/**/
int eoParaAdjustParagraphNumber;
int eoParaAdjustFromLine;
int eoParaAdjustStroffShift;
int eoParaAdjustStroffUpto;
/**/
EditRange eoReformatRange;
EditRange eoSelectedRange;
/**/
int eoNotesDeleted;
int eoNotesAdded;
int eoBulletsChanged;
int eoParagraphsInserted;
unsigned int eoFieldUpdate;
/**/
BufferDocument * eoBd;
ScreenFontList * eoScreenFontList;
void * eoVoidadd;
DOC_CLOSE_OBJECT eoCloseObject;
/**/
BufferItem * eoParaBi;
int eoParticule;
int eoStroff;
} EditOperation;
/************************************************************************/
/* */
/* For copying information from one location to another. Possibly */
/* between different documents. */
/* */
/************************************************************************/
typedef struct DocumentCopyJob
{
BufferDocument * dcjBdTo;
BufferDocument * dcjBdFrom;
int * dcjFieldMap;
int * dcjFontMap;
int * dcjColorMap;
int * dcjListStyleMap;
char * dcjRefFileName;
int dcjRefFileSize;
int dcjCurrentTextAttributeNumberFrom;
int dcjCurrentTextAttributeNumberTo;
int dcjNotesCopied;
int dcjBulletsCopied;
} DocumentCopyJob;
/************************************************************************/
/* */
/* Routine Declarations. */
/* */
/************************************************************************/
extern int docParaReplaceText( EditOperation * eo,
BufferItem * bi,
unsigned int stroffBegin,
int * pPartShift,
int * pStroffShift,
unsigned int stroffEnd,
const unsigned char * addedText,
unsigned int addedLength,
int addedAttributeNumber );
extern int docSplitParaItem( EditOperation * eo,
BufferItem ** pNewBi,
BufferItem * oldBi,
int stroff,
int splitLevel );
extern int docRemoveSelectionTail(
EditOperation * eo,
const DocumentSelection * ds );
extern void docEditDeleteItems( EditOperation * eo,
int * pSectionsDeleted,
int * pFirstParaDeleted,
int * pParagraphsDeleted,
BufferItem * bi,
int first,
int count );
extern void docCleanItemObjects( int * pNoteCount,
int * pBulletsDeleted,
int * pParagraphCount,
BufferDocument * bd,
BufferItem * bi,
void * voidadd,
DOC_CLOSE_OBJECT closeObject );
extern TextParticule * docParaSpecialParticule(
BufferDocument * bd,
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,
int addedAttributeNumber );
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 docEditIncludeRowsInReformatRange(
EditOperation * eo,
BufferItem * sectBi,
int row0,
int row1 );
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 );
extern int docChangeParticuleAttributes(PropertyMask * pTaAllMask,
BufferDocument * bd,
BufferItem * bi,
int part,
int partUpto,
const TextAttribute * taSet,
const PropertyMask * taSetMask );
extern int docMapTextAttributeNumber(
DocumentCopyJob * dcj,
int attributeNumberFrom );
extern BufferItem * docCopyParaItem( DocumentCopyJob * dcj,
EditOperation * eo,
BufferItem * biCellTo,
int n,
BufferItem * biParaFrom,
int inTable );
extern BufferItem * docCopyRowItem( DocumentCopyJob * dcj,
EditOperation * eo,
int * pParasCopied,
BufferItem * biSectTo,
int n,
BufferItem * biRowFrom,
int inTable );
extern BufferItem * docCopySectItem( DocumentCopyJob * dcj,
EditOperation * eo,
BufferItem * biParentTo,
int n,
BufferItem * biSectFrom,
const SelectionScope * ss );
extern int docCopyParticules( DocumentCopyJob * dcj,
EditOperation * eo,
BufferItem * biTo,
const BufferItem * biFrom,
int partTo,
int partFrom,
int countFrom,
int * pParticulesInserted,
int * pCharactersCopied );
extern int docCopyParticuleData( DocumentCopyJob * dcj,
EditOperation * eo,
BufferItem * biTo,
const BufferItem * biFrom,
TextParticule * tpTo,
const TextParticule * tpFrom );
extern void docInitDocumentCopyJob( DocumentCopyJob * dcj );
extern void docCleanDocumentCopyJob( DocumentCopyJob * dcj );
extern int docSet1DocumentCopyJob( DocumentCopyJob * dcj,
BufferDocument * bd );
extern int docSet2DocumentCopyJob(
DocumentCopyJob * dcj,
BufferDocument * bdTo,
BufferDocument * bdFrom,
const PostScriptFontList * psfl,
const char * refFileName );
extern int docCopyFieldRelative( DocumentCopyJob * dcj,
EditOperation * eo,
BufferItem * biTo,
const BufferItem * biFrom,
TextParticule * tpTo,
const TextParticule * tpFrom );
extern int docCopyParticuleAndData( TextParticule ** pTpTo,
DocumentCopyJob * dcj,
EditOperation * eo,
BufferItem * paraBiTo,
int partTo,
int stroffTo,
int strlenTo,
const BufferItem * paraBiFrom,
const TextParticule * tpFrom );
extern int docInsertTableRows( BufferItem * sectBi,
BufferItem ** pNewBi,
const BufferItem * refRowBi,
const RowProperties * rp,
int textAttributeNumber,
int n,
int paraNr,
int rows,
EditOperation * eo );
extern int docSplitColumnInRows( BufferItem ** pNewParaBi,
EditOperation * eo,
BufferItem * sectBi,
int row0,
int row,
int row1,
int col,
int after );
extern void docChangeTableLayout( EditOperation * eo,
BufferItem * sectBi,
int row0,
int row1,
int col0,
int col1,
const PropertyMask * rpSetMask,
const PropertyMask * cpSetMask,
const RowProperties * rpSet );
extern int docDeleteColumnsFromRows( EditOperation * eo,
BufferItem * sectBi,
int delRow0,
int delRow1,
int delCol0,
int delCol1 );
extern int docChangeCellSpans( int * pRowChanged1,
BufferItem * sectBi,
int row0,
int col0,
int rowspan,
int colspan );
extern void docEditShiftReferences( BufferDocument * bd,
int paraFrom,
int isSplit,
int stroffFrom,
int sectShift,
int paraShift,
int stroffShift );
extern void docIncludeRectangleInChange( EditOperation * eo,
const DocumentRectangle * dr );
extern int docEditUpdParaProperties(
EditOperation * eo,
PropertyMask * pPpChgPask,
BufferItem * paraBi,
const PropertyMask * ppUpdMask,
const ParagraphProperties * ppNew,
const int * colorMap,
const int * listStyleMap );
# endif /* DOC_EDIT_H */
|