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