LibreOffice Module sw (master) 1
IMark.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#ifndef INCLUDED_SW_INC_IMARK_HXX
20#define INCLUDED_SW_INC_IMARK_HXX
21
22#include <vcl/keycod.hxx>
23#include "calbck.hxx"
24#include "pam.hxx"
25#include <map>
26#include <memory>
27#include "swdllapi.h"
28
29namespace sw::mark
30{
31 enum class InsertMode
32 {
33 New,
35 };
36
38 : virtual public sw::BroadcastingModify // inherited as interface
39 {
40 protected:
41 IMark() = default;
42
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;
54
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
59
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;
65 };
66
68 : virtual public IMark
69 {
70 protected:
71 IBookmark() = default;
72
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;
85 };
86
87 class SW_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") IFieldmark
88 : virtual public IMark
89 {
90 protected:
91 IFieldmark() = default;
92
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;
100
101 //setters
102 virtual void SetFieldname(const OUString& rFieldname) =0;
103 virtual void SetFieldHelptext(const OUString& rFieldHelptext) =0;
104 virtual void Invalidate() = 0;
105
106 virtual OUString GetContent() const { return OUString(); }
107 virtual void ReplaceContent(const OUString& /*sNewContent*/) {}
108
109 private:
110 IFieldmark(IFieldmark const &) = delete;
111 IFieldmark &operator =(IFieldmark const&) = delete;
112 };
113
115 : virtual public IFieldmark
116 {
117 protected:
119
120 public:
121 virtual bool IsChecked() const =0;
122 virtual void SetChecked(bool checked) =0;
123 private:
125 ICheckboxFieldmark &operator =(ICheckboxFieldmark const&) = delete;
126 };
127
129 : virtual public IFieldmark
130 {
131 protected:
133
134 public:
135 virtual OUString GetContent(sal_Int32* pIndex) const = 0;
136 virtual OUString GetContent() const override = 0;
137 virtual void AddContent(const OUString& rText, sal_Int32* pIndex = nullptr) = 0;
138 virtual void DelContent(sal_Int32 nDelIndex = -1) = 0;
139 virtual void ReplaceContent(const OUString* pText, sal_Int32* pIndex) = 0;
140 virtual void ReplaceContent(const OUString& sNewContent) override = 0;
141
142 private:
144 IDropdownFieldmark &operator =(IDropdownFieldmark const&) = delete;
145 };
146
148 : virtual public IFieldmark
149 {
150 protected:
151 IDateFieldmark() = default;
152
153 public:
154 virtual OUString GetContent() const override = 0;
155 virtual void ReplaceContent(const OUString& sNewContent) override = 0;
156
157 virtual std::pair<bool, double> GetCurrentDate() const = 0;
158 virtual void SetCurrentDate(double fDate) = 0;
159 virtual OUString GetDateInStandardDateFormat(double fDate) const = 0;
160
161 private:
163 IDateFieldmark &operator =(ICheckboxFieldmark const&) = delete;
164 };
165
166 OUString ExpandFieldmark(IFieldmark* pBM);
167
168}
169#endif
170
171/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Hide(bool hide)=0
virtual const vcl::KeyCode & GetKeyCode() const =0
IBookmark(IBookmark const &)=delete
virtual void SetHideCondition(const OUString &)=0
virtual void SetShortName(const OUString &)=0
virtual void SetKeyCode(const vcl::KeyCode &)=0
virtual const OUString & GetHideCondition() const =0
virtual const OUString & GetShortName() const =0
virtual bool IsHidden() const =0
virtual void SetChecked(bool checked)=0
virtual bool IsChecked() const =0
ICheckboxFieldmark(ICheckboxFieldmark const &)=delete
IDateFieldmark(ICheckboxFieldmark const &)=delete
virtual std::pair< bool, double > GetCurrentDate() const =0
virtual void ReplaceContent(const OUString &sNewContent) override=0
virtual void SetCurrentDate(double fDate)=0
virtual OUString GetContent() const override=0
virtual OUString GetDateInStandardDateFormat(double fDate) const =0
virtual void DelContent(sal_Int32 nDelIndex=-1)=0
virtual OUString GetContent(sal_Int32 *pIndex) const =0
virtual void ReplaceContent(const OUString *pText, sal_Int32 *pIndex)=0
virtual void AddContent(const OUString &rText, sal_Int32 *pIndex=nullptr)=0
virtual OUString GetContent() const override=0
virtual void ReplaceContent(const OUString &sNewContent) override=0
IDropdownFieldmark(IDropdownFieldmark const &)=delete
virtual const SwPosition & GetOtherMarkPos() const =0
virtual bool IsExpanded() const =0
virtual OUString ToString() const =0
virtual bool IsCoveringPosition(const SwPosition &rPos) const =0
virtual const SwPosition & GetMarkEnd() const =0
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const =0
virtual const SwPosition & GetMarkStart() const =0
IMark()=default
IMark(IMark const &)=delete
virtual const OUString & GetName() const =0
virtual const SwPosition & GetMarkPos() const =0
struct _xmlTextWriter * xmlTextWriterPtr
class SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") SwFlowFrame
Base class that provides the general functionalities for frames that are allowed at page breaks (flow...
Definition: flowfrm.hxx:59
OUString ExpandFieldmark(IFieldmark *pBM)
Definition: itrform2.cxx:1120
InsertMode
Definition: IMark.hxx:32
Marks a position in the document model.
Definition: pam.hxx:38
#define SW_DLLPUBLIC
Definition: swdllapi.h:28