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 "bookmrk.hxx"
24 #include <rtl/ustring.hxx>
25 #include <vcl/keycod.hxx>
26 
27 namespace sw::mark {
29  : public Bookmark
30  {
31  public:
32  CrossRefBookmark(const SwPaM& rPaM,
33  const vcl::KeyCode& rCode,
34  const OUString& rName,
35  const OUString& rPrefix);
36 
37  // getters
38  virtual SwPosition& GetOtherMarkPos() const override;
39  virtual SwPosition& GetMarkStart() const override
40  { return *m_pPos1; }
41  virtual SwPosition& GetMarkEnd() const override
42  { return *m_pPos1; }
43  virtual bool IsExpanded() const override
44  { return false; }
45 
46  virtual void SetMarkPos(const SwPosition& rNewPos) override;
47  virtual void SetOtherMarkPos(const SwPosition&) override
48  {
49  assert(false &&
50  "<CrossRefBookmark::SetOtherMarkPos(..)>"
51  " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set." );
52  }
53  virtual void ClearOtherMarkPos() override
54  {
55  assert(false &&
56  "<SwCrossRefBookmark::ClearOtherMarkPos(..)>"
57  " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set or cleared." );
58  }
59  };
60 
62  : public CrossRefBookmark
63  {
64  public:
65  CrossRefHeadingBookmark(const SwPaM& rPaM,
66  const vcl::KeyCode& rCode,
67  const OUString& rName);
68  static bool IsLegalName(const OUString& rName);
69  };
70 
72  : public CrossRefBookmark
73  {
74  public:
75  CrossRefNumItemBookmark(const SwPaM& rPaM,
76  const vcl::KeyCode& rCode,
77  const OUString& rName);
78  static bool IsLegalName(const OUString& rName);
79  };
80 }
81 
82 #endif
83 
84 /* 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
static bool IsLegalName(const OUString &rName)
std::unique_ptr< SwPosition > m_pPos1
Definition: bookmrk.hxx:111
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
CrossRefBookmark(const SwPaM &rPaM, const vcl::KeyCode &rCode, const OUString &rName, const OUString &rPrefix)
virtual void ClearOtherMarkPos() override
static bool IsLegalName(const OUString &rName)
virtual void SetMarkPos(const SwPosition &rNewPos) override
virtual void SetOtherMarkPos(const SwPosition &) override