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_STRUXCHANGE_H 00022 #define PX_CHANGERECORD_STRUXCHANGE_H 00023 00024 #include "ut_types.h" 00025 #include "px_ChangeRecord.h" 00026 #include "pt_Types.h" 00027 00028 // PX_ChangeRecord_StruxChange describes a PXT_ChangeStrux 00029 // made to the document (a formatting change). 00030 // This description should be sufficient to allow undo to 00031 // work and sufficient to allow the formatter to do a 00032 // partial format and screen update (if appropriate). 00033 // The change record must be free of pointers, since it 00034 // represents what was done to the document -- and not 00035 // how it was done (that is, not what was done to various 00036 // intermediate data structures). this also lets it be 00037 // cached to disk (for autosave and maybe multi-session 00038 // undo). 00039 // 00040 // m_position contains the absolute document position of 00041 // the strux at the time the change was made. 00042 00043 00044 class ABI_EXPORT PX_ChangeRecord_StruxChange : public PX_ChangeRecord 00045 { 00046 public: 00047 PX_ChangeRecord_StruxChange(PXType type, 00048 PT_DocPosition position, 00049 PT_AttrPropIndex indexOldAP, 00050 PT_AttrPropIndex indexNewAP, 00051 PTStruxType pts, 00052 bool bRevisionDelete); 00053 00054 ~PX_ChangeRecord_StruxChange(); 00055 00056 virtual PX_ChangeRecord * reverse(void) const; 00057 PT_AttrPropIndex getOldIndexAP(void) const; 00058 PTStruxType getStruxType(void) const 00059 { return m_pts;} 00060 00061 bool isRevisionDelete() const {return m_bRevisionDelete;} 00062 00063 protected: 00064 PT_AttrPropIndex m_indexOldAP; 00065 PTStruxType m_pts; 00066 00067 // used in revisions mode to indicate if fmt change record represents deletion 00068 bool m_bRevisionDelete; 00069 }; 00070 00071 #endif /* PX_CHANGERECORD_STRUXCHANGE_H */