LibreOffice Module sw (master)  1
crossrefbookmark.hxx
Go to the documentation of this file.
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 INCLUDED_SW_SOURCE_CORE_INC_CROSSREFBOOKMARK_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_CROSSREFBOOKMARK_HXX
22 
23 #include <sal/config.h>
24 
25 #include <string_view>
26 
27 #include "bookmrk.hxx"
28 #include <rtl/ustring.hxx>
29 #include <vcl/keycod.hxx>
30 
31 namespace sw::mark {
33  : public Bookmark
34  {
35  public:
36  CrossRefBookmark(const SwPaM& rPaM,
37  const vcl::KeyCode& rCode,
38  const OUString& rName,
39  std::u16string_view rPrefix);
40 
41  // getters
42  virtual SwPosition& GetOtherMarkPos() const override;
43  virtual SwPosition& GetMarkStart() const override
44  { return *m_pPos1; }
45  virtual SwPosition& GetMarkEnd() const override
46  { return *m_pPos1; }
47  virtual bool IsExpanded() const override
48  { return false; }
49 
50  virtual void SetMarkPos(const SwPosition& rNewPos) override;
51  virtual void SetOtherMarkPos(const SwPosition&) override
52  {
53  assert(false &&
54  "<CrossRefBookmark::SetOtherMarkPos(..)>"
55  " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set." );
56  }
57  virtual void ClearOtherMarkPos() override
58  {
59  assert(false &&
60  "<SwCrossRefBookmark::ClearOtherMarkPos(..)>"
61  " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set or cleared." );
62  }
63  };
64 
66  : public CrossRefBookmark
67  {
68  public:
69  CrossRefHeadingBookmark(const SwPaM& rPaM,
70  const vcl::KeyCode& rCode,
71  const OUString& rName);
72  static bool IsLegalName(const OUString& rName);
73  };
74 
76  : public CrossRefBookmark
77  {
78  public:
79  CrossRefNumItemBookmark(const SwPaM& rPaM,
80  const vcl::KeyCode& rCode,
81  const OUString& rName);
82  static bool IsLegalName(const OUString& rName);
83  };
84 }
85 
86 #endif
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Marks a position in the document model.
Definition: pam.hxx:35
virtual SwPosition & GetMarkStart() const override
virtual SwPosition & GetOtherMarkPos() const override
CrossRefHeadingBookmark(const SwPaM &rPaM, const vcl::KeyCode &rCode, const OUString &rName)
CrossRefNumItemBookmark(const SwPaM &rPaM, const vcl::KeyCode &rCode, const OUString &rName)
virtual SwPosition & GetMarkEnd() const override
CrossRefBookmark(const SwPaM &rPaM, const vcl::KeyCode &rCode, const OUString &rName, std::u16string_view rPrefix)
static bool IsLegalName(const OUString &rName)
std::unique_ptr< SwPosition > m_pPos1
Definition: bookmrk.hxx:114
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual bool IsExpanded() const override
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual void ClearOtherMarkPos() override
static bool IsLegalName(const OUString &rName)
virtual void SetMarkPos(const SwPosition &rNewPos) override
virtual void SetOtherMarkPos(const SwPosition &) override