| 1 | /* AbiWord |
| 2 | * Copyright (C) 1998 AbiSource, Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 | * 02110-1301 USA. |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | #ifndef PX_CHANGERECORD_GLOB_H |
| 22 | #define PX_CHANGERECORD_GLOB_H |
| 23 | |
| 24 | #include "ut_types.h" |
| 25 | #include "px_ChangeRecord.h" |
| 26 | |
| 27 | // PX_ChangeRecord_Glob describes an insertSpan or |
| 28 | // deleteSpan change made to the document. |
| 29 | // This description should be sufficient to allow undo to |
| 30 | // work and sufficient to allow the formatter to do a |
| 31 | // partial format and screen update (if appropriate). |
| 32 | // The change record must be free of pointers, since it |
| 33 | // represents what was done to the document -- and not |
| 34 | // how it was done (that is, not what was done to various |
| 35 | // intermediate data structures). this also lets it be |
| 36 | // cached to disk (for autosave and maybe multi-session |
| 37 | // undo). |
| 38 | // |
| 39 | // m_position contains the absolute document position of |
| 40 | // the text span at the time the change was made. |
| 41 | // m_bufIndex,m_length describe the actual contents |
| 42 | // of the text span. |
| 43 | |
| 44 | |
| 45 | class ABI_EXPORT PX_ChangeRecord_Glob : public PX_ChangeRecord |
| 46 | { |
| 47 | public: |
| 48 | typedef enum _PXFlags { PXF_Null= 0x00, |
| 49 | PXF_MultiStepStart= 0x01, /* display-atomic */ |
| 50 | PXF_MultiStepEnd= 0x02, |
| 51 | PXF_UserAtomicStart= 0x04, /* user-level-atomic */ |
| 52 | PXF_UserAtomicEnd= 0x08 } PXFlags; |
| 53 | |
| 54 | PX_ChangeRecord_Glob(PXType type, |
| 55 | UT_Byte flags); |
| 56 | ~PX_ChangeRecord_Glob(); |
| 57 | |
| 58 | virtual PX_ChangeRecord * reverse(void) const; |
| 59 | |
| 60 | UT_Byte getFlags(void) const; |
| 61 | UT_Byte getRevFlags(void) const; |
| 62 | |
| 63 | #ifdef PT_TEST |
| 64 | virtual void __dump(FILE * fp) const; |
| 65 | #endif |
| 66 | |
| 67 | protected: |
| 68 | UT_Byte m_flags; /* see PXFlags above */ |
| 69 | }; |
| 70 | |
| 71 | #endif /* PX_CHANGERECORD_GLOB_H */ |