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