Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _CROSSREFBOOKMRK_HXX
21 : #define _CROSSREFBOOKMRK_HXX
22 :
23 : #include <IMark.hxx>
24 : #include <bookmrk.hxx>
25 : #include <rtl/ustring.hxx>
26 :
27 : namespace sw {
28 : namespace mark {
29 0 : class CrossRefBookmark
30 : : public Bookmark
31 : {
32 : public:
33 : CrossRefBookmark(const SwPaM& rPaM,
34 : const KeyCode& rCode,
35 : const ::rtl::OUString& rName,
36 : const ::rtl::OUString& rShortName,
37 : const ::rtl::OUString& rPrefix);
38 :
39 : virtual SwPosition& GetOtherMarkPos() const;
40 0 : virtual SwPosition& GetMarkStart() const
41 0 : { return *m_pPos1; }
42 0 : virtual SwPosition& GetMarkEnd() const
43 0 : { return *m_pPos1; }
44 0 : virtual bool IsExpanded() const
45 0 : { return false; }
46 :
47 : virtual void SetMarkPos(const SwPosition& rNewPos);
48 0 : virtual void SetOtherMarkPos(const SwPosition&)
49 : {
50 : OSL_PRECOND(false,
51 : "<CrossRefBookmark::SetOtherMarkPos(..)>"
52 : " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set." );
53 0 : }
54 0 : virtual void ClearOtherMarkPos()
55 : {
56 : OSL_PRECOND(false,
57 : "<SwCrossRefBookmark::ClearOtherMarkPos(..)>"
58 : " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set or cleared." );
59 0 : }
60 : };
61 :
62 0 : class CrossRefHeadingBookmark
63 : : public CrossRefBookmark
64 : {
65 : public:
66 : CrossRefHeadingBookmark(const SwPaM& rPaM,
67 : const KeyCode& rCode,
68 : const ::rtl::OUString& rName,
69 : const ::rtl::OUString& rShortName);
70 : static ::rtl::OUString GenerateNewName();
71 : static bool IsLegalName(const ::rtl::OUString& rName);
72 : };
73 :
74 0 : class CrossRefNumItemBookmark
75 : : public CrossRefBookmark
76 : {
77 : public:
78 : CrossRefNumItemBookmark(const SwPaM& rPaM,
79 : const KeyCode& rCode,
80 : const ::rtl::OUString& rName,
81 : const ::rtl::OUString& rShortName);
82 : static ::rtl::OUString GenerateNewName();
83 : static bool IsLegalName(const ::rtl::OUString& rName);
84 : };
85 : }
86 : }
87 :
88 : #endif
89 :
90 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|