00001 /* AbiWord 00002 * Copyright (C) 1998 AbiSource, Inc. 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 00021 #ifndef PX_CHANGERECORD_GLOB_H 00022 #define PX_CHANGERECORD_GLOB_H 00023 00024 #include "ut_types.h" 00025 #include "px_ChangeRecord.h" 00026 00027 // PX_ChangeRecord_Glob describes an insertSpan or 00028 // deleteSpan change made to the document. 00029 // This description should be sufficient to allow undo to 00030 // work and sufficient to allow the formatter to do a 00031 // partial format and screen update (if appropriate). 00032 // The change record must be free of pointers, since it 00033 // represents what was done to the document -- and not 00034 // how it was done (that is, not what was done to various 00035 // intermediate data structures). this also lets it be 00036 // cached to disk (for autosave and maybe multi-session 00037 // undo). 00038 // 00039 // m_position contains the absolute document position of 00040 // the text span at the time the change was made. 00041 // m_bufIndex,m_length describe the actual contents 00042 // of the text span. 00043 00044 00045 class ABI_EXPORT PX_ChangeRecord_Glob : public PX_ChangeRecord 00046 { 00047 public: 00048 typedef enum _PXFlags { PXF_Null= 0x00, 00049 PXF_MultiStepStart= 0x01, /* display-atomic */ 00050 PXF_MultiStepEnd= 0x02, 00051 PXF_UserAtomicStart= 0x04, /* user-level-atomic */ 00052 PXF_UserAtomicEnd= 0x08 } PXFlags; 00053 00054 PX_ChangeRecord_Glob(PXType type, 00055 UT_Byte flags); 00056 ~PX_ChangeRecord_Glob(); 00057 00058 virtual PX_ChangeRecord * reverse(void) const; 00059 00060 UT_Byte getFlags(void) const; 00061 UT_Byte getRevFlags(void) const; 00062 00063 #ifdef PT_TEST 00064 virtual void __dump(FILE * fp) const; 00065 #endif 00066 00067 protected: 00068 UT_Byte m_flags; /* see PXFlags above */ 00069 }; 00070 00071 #endif /* PX_CHANGERECORD_GLOB_H */