1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
29 namespace sw
{ namespace mark
37 class SW_DLLPUBLIC IMark
38 : virtual public sw::BroadcastingModify
// inherited as interface
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;
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;
63 IMark(IMark
const &) = delete;
64 IMark
&operator =(IMark
const&) = delete;
67 class SW_DLLPUBLIC IBookmark
68 : virtual public IMark
71 IBookmark() = default;
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;
83 IBookmark(IBookmark
const &) = delete;
84 IBookmark
&operator =(IBookmark
const&) = delete;
87 class SW_DLLPUBLIC IFieldmark
88 : virtual public IMark
91 IFieldmark() = default;
94 typedef std::map
< OUString
, css::uno::Any
> parameter_map_t
;
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;
102 virtual void SetFieldname(const OUString
& rFieldname
) =0;
103 virtual void SetFieldHelptext(const OUString
& rFieldHelptext
) =0;
104 virtual void Invalidate() = 0;
106 IFieldmark(IFieldmark
const &) = delete;
107 IFieldmark
&operator =(IFieldmark
const&) = delete;
110 class SW_DLLPUBLIC ICheckboxFieldmark
111 : virtual public IFieldmark
114 ICheckboxFieldmark() = default;
117 virtual bool IsChecked() const =0;
118 virtual void SetChecked(bool checked
) =0;
120 ICheckboxFieldmark(ICheckboxFieldmark
const &) = delete;
121 ICheckboxFieldmark
&operator =(ICheckboxFieldmark
const&) = delete;
124 class SW_DLLPUBLIC IDateFieldmark
125 : virtual public IFieldmark
128 IDateFieldmark() = default;
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;
139 IDateFieldmark(ICheckboxFieldmark
const &) = delete;
140 IDateFieldmark
&operator =(ICheckboxFieldmark
const&) = delete;
143 OUString
ExpandFieldmark(IFieldmark
* pBM
);
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */