lok: Hide file linking in section
[LibreOffice.git] / sw / inc / IMark.hxx
blobb8ee6a4a20981d5d23cbc666db2de56435634745
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_IMARK_HXX
20 #define INCLUDED_SW_INC_IMARK_HXX
22 #include <vcl/keycod.hxx>
23 #include "calbck.hxx"
24 #include "pam.hxx"
25 #include <map>
26 #include <memory>
27 #include "swdllapi.h"
29 namespace sw { namespace mark
31 enum class InsertMode
33 New,
34 CopyText,
37 class SW_DLLPUBLIC IMark
38 : virtual public sw::BroadcastingModify // inherited as interface
40 protected:
41 IMark() = default;
43 public:
44 //getters
45 virtual const SwPosition& GetMarkPos() const =0;
46 // GetOtherMarkPos() is only guaranteed to return a valid
47 // reference if IsExpanded() returned true
48 virtual const SwPosition& GetOtherMarkPos() const =0;
49 virtual const SwPosition& GetMarkStart() const =0;
50 virtual const SwPosition& GetMarkEnd() const =0;
51 virtual const OUString& GetName() const =0;
52 virtual bool IsExpanded() const =0;
53 virtual bool IsCoveringPosition(const SwPosition& rPos) const =0;
55 //setters
56 // not available in IMark
57 // inside core, you can cast to MarkBase and use its setters,
58 // make sure to update the sorting in Markmanager in this case
60 virtual OUString ToString( ) const =0;
61 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const = 0;
62 private:
63 IMark(IMark const &) = delete;
64 IMark &operator =(IMark const&) = delete;
67 class SW_DLLPUBLIC IBookmark
68 : virtual public IMark
70 protected:
71 IBookmark() = default;
73 public:
74 virtual const OUString& GetShortName() const =0;
75 virtual const vcl::KeyCode& GetKeyCode() const =0;
76 virtual void SetShortName(const OUString&) =0;
77 virtual void SetKeyCode(const vcl::KeyCode&) =0;
78 virtual bool IsHidden() const =0;
79 virtual const OUString& GetHideCondition() const =0;
80 virtual void Hide(bool hide) =0;
81 virtual void SetHideCondition(const OUString&) =0;
82 private:
83 IBookmark(IBookmark const &) = delete;
84 IBookmark &operator =(IBookmark const&) = delete;
87 class SW_DLLPUBLIC IFieldmark
88 : virtual public IMark
90 protected:
91 IFieldmark() = default;
93 public:
94 typedef std::map< OUString, css::uno::Any> parameter_map_t;
95 //getters
96 virtual OUString GetFieldname() const =0;
97 virtual OUString GetFieldHelptext() const =0;
98 virtual parameter_map_t* GetParameters() =0;
99 virtual const parameter_map_t* GetParameters() const =0;
101 //setters
102 virtual void SetFieldname(const OUString& rFieldname) =0;
103 virtual void SetFieldHelptext(const OUString& rFieldHelptext) =0;
104 virtual void Invalidate() = 0;
105 private:
106 IFieldmark(IFieldmark const &) = delete;
107 IFieldmark &operator =(IFieldmark const&) = delete;
110 class SW_DLLPUBLIC ICheckboxFieldmark
111 : virtual public IFieldmark
113 protected:
114 ICheckboxFieldmark() = default;
116 public:
117 virtual bool IsChecked() const =0;
118 virtual void SetChecked(bool checked) =0;
119 private:
120 ICheckboxFieldmark(ICheckboxFieldmark const &) = delete;
121 ICheckboxFieldmark &operator =(ICheckboxFieldmark const&) = delete;
124 class SW_DLLPUBLIC IDateFieldmark
125 : virtual public IFieldmark
127 protected:
128 IDateFieldmark() = default;
130 public:
131 virtual OUString GetContent() const = 0;
132 virtual void ReplaceContent(const OUString& sNewContent) = 0;
134 virtual std::pair<bool, double> GetCurrentDate() const = 0;
135 virtual void SetCurrentDate(double fDate) = 0;
136 virtual OUString GetDateInStandardDateFormat(double fDate) const = 0;
138 private:
139 IDateFieldmark(ICheckboxFieldmark const &) = delete;
140 IDateFieldmark &operator =(ICheckboxFieldmark const&) = delete;
143 OUString ExpandFieldmark(IFieldmark* pBM);
146 #endif
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */