1 /* AbiWord 2 * Copyright (C) 2001 Tomas Frydrych 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 #ifndef BOOKMARK_H 20 #define BOOKMARK_H 21 22 #include "ut_types.h" 23 #include "ut_xml.h" 24 #include "pf_Frag_Object.h" 25 #include "pf_Frag_Text.h" 26 #include "pt_Types.h" 27 28 class fl_BlockLayout; 29 class pf_Frag_Object; 30 31 /*! 32 \note This class will eventually have subclasses to implement the different 33 types of fields. 34 */ 35 36 class ABI_EXPORT po_Bookmark 37 { 38 public: 39 // TBD: convention for naming 40 typedef enum _bookmarkType 41 { 42 POBOOKMARK_START, 43 POBOOKMARK_END, 44 __last_field_dont_use__ 45 } BookmarkType; 46 47 po_Bookmark(pf_Frag_Object& fO, pt_PieceTable * pt, BookmarkType type, const gchar* name); 48 virtual ~po_Bookmark(void); 49 void setBlock(fl_BlockLayout * pBlock); 50 fl_BlockLayout * getBlock( void) const; 51 BookmarkType getBookmarkType(void) const; 52 const gchar * getName(void) const; 53 void setName(const gchar * szValue); 54 // probably need different types of update 55 // which are overridden in the appropriate subclass 56 // eg positionChangeUpdate 57 // referenceChangeUpdate 58 59 private: 60 fl_BlockLayout * m_pBlock; 61 // will need some more helper functions in here eg. to test 62 // whether text has changed to avoid unnecessary updates 63 pf_Frag_Object& m_fragObject; 64 pt_PieceTable * m_pPieceTable; 65 BookmarkType m_iBookmarkType; 66 gchar * m_pName; 67 }; 68 69 #endif 70 71 72 73 74