1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_CROSSREFBOOKMARK_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_CROSSREFBOOKMARK_HXX
23 #include <sal/config.h>
25 #include <string_view>
27 #include "bookmark.hxx"
28 #include <rtl/ustring.hxx>
29 #include <vcl/keycod.hxx>
32 class CrossRefBookmark
36 CrossRefBookmark(const SwPaM
& rPaM
,
37 const vcl::KeyCode
& rCode
,
38 const OUString
& rName
,
39 std::u16string_view rPrefix
);
42 virtual SwPosition
& GetOtherMarkPos() const override
;
43 virtual SwPosition
& GetMarkStart() const override
44 { return const_cast<SwPosition
&>(*m_oPos1
); }
45 virtual SwPosition
& GetMarkEnd() const override
46 { return const_cast<SwPosition
&>(*m_oPos1
); }
47 virtual bool IsExpanded() const override
50 virtual void SetMarkPos(const SwPosition
& rNewPos
) override
;
51 virtual void SetOtherMarkPos(const SwPosition
&) override
54 "<CrossRefBookmark::SetOtherMarkPos(..)>"
55 " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set." );
57 virtual void ClearOtherMarkPos() override
60 "<SwCrossRefBookmark::ClearOtherMarkPos(..)>"
61 " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set or cleared." );
65 class CrossRefHeadingBookmark final
66 : public CrossRefBookmark
69 CrossRefHeadingBookmark(const SwPaM
& rPaM
,
70 const vcl::KeyCode
& rCode
,
71 const OUString
& rName
);
72 static bool IsLegalName(std::u16string_view rName
);
75 class CrossRefNumItemBookmark final
76 : public CrossRefBookmark
79 CrossRefNumItemBookmark(const SwPaM
& rPaM
,
80 const vcl::KeyCode
& rCode
,
81 const OUString
& rName
);
82 static bool IsLegalName(std::u16string_view rName
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */