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 INCLUDED_SW_SOURCE_CORE_INC_CROSSREFBOOKMARK_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_INC_CROSSREFBOOKMARK_HXX
22 :
23 : #include <IMark.hxx>
24 : #include <bookmrk.hxx>
25 : #include <rtl/ustring.hxx>
26 : #include <vcl/keycod.hxx>
27 :
28 : namespace sw {
29 : namespace mark {
30 94 : class CrossRefBookmark
31 : : public Bookmark
32 : {
33 : public:
34 : CrossRefBookmark(const SwPaM& rPaM,
35 : const vcl::KeyCode& rCode,
36 : const OUString& rName,
37 : const OUString& rShortName,
38 : const OUString& rPrefix);
39 :
40 : // getters
41 : virtual SwPosition& GetOtherMarkPos() const SAL_OVERRIDE;
42 10832 : virtual SwPosition& GetMarkStart() const SAL_OVERRIDE
43 10832 : { return *m_pPos1; }
44 123 : virtual SwPosition& GetMarkEnd() const SAL_OVERRIDE
45 123 : { return *m_pPos1; }
46 2926 : virtual bool IsExpanded() const SAL_OVERRIDE
47 2926 : { return false; }
48 :
49 : virtual void SetMarkPos(const SwPosition& rNewPos) SAL_OVERRIDE;
50 0 : virtual void SetOtherMarkPos(const SwPosition&) SAL_OVERRIDE
51 : {
52 : assert(false &&
53 : "<CrossRefBookmark::SetOtherMarkPos(..)>"
54 : " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set." );
55 0 : }
56 0 : virtual void ClearOtherMarkPos() SAL_OVERRIDE
57 : {
58 : assert(false &&
59 : "<SwCrossRefBookmark::ClearOtherMarkPos(..)>"
60 : " - misusage of CrossRefBookmark: other bookmark position isn't allowed to be set or cleared." );
61 0 : }
62 : };
63 :
64 170 : class CrossRefHeadingBookmark
65 : : public CrossRefBookmark
66 : {
67 : public:
68 : CrossRefHeadingBookmark(const SwPaM& rPaM,
69 : const vcl::KeyCode& rCode,
70 : const OUString& rName,
71 : const OUString& rShortName);
72 : static bool IsLegalName(const OUString& rName);
73 : };
74 :
75 18 : class CrossRefNumItemBookmark
76 : : public CrossRefBookmark
77 : {
78 : public:
79 : CrossRefNumItemBookmark(const SwPaM& rPaM,
80 : const vcl::KeyCode& rCode,
81 : const OUString& rName,
82 : const OUString& rShortName);
83 : static bool IsLegalName(const OUString& rName);
84 : };
85 : }
86 : }
87 :
88 : #endif
89 :
90 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|