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