1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _CROSSREFBOOKMRK_HXX 28 #define _CROSSREFBOOKMRK_HXX 29 30 #include <IMark.hxx> 31 #include <bookmrk.hxx> 32 #include <rtl/ustring.hxx> 33 34 35 namespace sw { namespace mark 36 { 37 class CrossRefBookmark 38 : public Bookmark 39 { 40 public: 41 CrossRefBookmark(const SwPaM& rPaM, 42 const KeyCode& rCode, 43 const ::rtl::OUString& rName, 44 const ::rtl::OUString& rShortName, 45 const ::rtl::OUString& rPrefix); 46 47 // getters 48 virtual SwPosition& GetOtherMarkPos() const; 49 virtual SwPosition& GetMarkStart() const 50 { return *m_pPos1; } 51 virtual SwPosition& GetMarkEnd() const 52 { return *m_pPos1; } 53 virtual bool IsExpanded() const 54 { return false; } 55 56 // setters 57 virtual void SetMarkPos(const SwPosition& rNewPos); 58 virtual void SetOtherMarkPos(const SwPosition&) 59 { 60 OSL_PRECOND(false, 61 "<CrossRefBookmark::SetOtherMarkPos(..)>" 62 " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set." ); 63 } 64 virtual void ClearOtherMarkPos() 65 { 66 OSL_PRECOND(false, 67 "<SwCrossRefBookmark::ClearOtherMarkPos(..)>" 68 " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set or cleared." ); 69 } 70 }; 71 72 class CrossRefHeadingBookmark 73 : public CrossRefBookmark 74 { 75 public: 76 CrossRefHeadingBookmark(const SwPaM& rPaM, 77 const KeyCode& rCode, 78 const ::rtl::OUString& rName, 79 const ::rtl::OUString& rShortName); 80 static ::rtl::OUString GenerateNewName(); 81 static bool IsLegalName(const ::rtl::OUString& rName); 82 static const ::rtl::OUString our_sNamePrefix; 83 }; 84 85 class CrossRefNumItemBookmark 86 : public CrossRefBookmark 87 { 88 public: 89 CrossRefNumItemBookmark(const SwPaM& rPaM, 90 const KeyCode& rCode, 91 const ::rtl::OUString& rName, 92 const ::rtl::OUString& rShortName); 93 static ::rtl::OUString GenerateNewName(); 94 static bool IsLegalName(const ::rtl::OUString& rName); 95 static const ::rtl::OUString our_sNamePrefix; 96 }; 97 98 }} 99 #endif 100