LibreOffice Module sc (master) 1
condformatuno.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
10#pragma once
11
12#include <types.hxx>
13
14#include <com/sun/star/beans/XPropertySet.hpp>
15#include <com/sun/star/sheet/XConditionalFormats.hpp>
16#include <com/sun/star/sheet/XConditionalFormat.hpp>
17#include <com/sun/star/sheet/XConditionEntry.hpp>
18#include <com/sun/star/sheet/XColorScaleEntry.hpp>
19#include <com/sun/star/sheet/XDataBarEntry.hpp>
20#include <com/sun/star/sheet/XIconSetEntry.hpp>
21
23#include <svl/itemprop.hxx>
24#include <svl/lstner.hxx>
25#include <rtl/ref.hxx>
26
27class ScDocShell;
30class ScIconSetFormat;
31class ScDataBarFormat;
36
37using namespace com::sun::star;
38
39namespace com::sun::star::sheet { class XSheetCellRanges; }
40
41class ScCondFormatsObj : public cppu::WeakImplHelper<css::sheet::XConditionalFormats>,
42 public SfxListener
43{
44public:
45 ScCondFormatsObj(ScDocShell* pDocShell, SCTAB nTab);
46
47 virtual ~ScCondFormatsObj() override;
48
49 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
50
51 // XConditionalFormats
52 virtual sal_Int32 SAL_CALL createByRange(const uno::Reference<sheet::XSheetCellRanges>& xRanges) override;
53
54 virtual void SAL_CALL removeByID( const sal_Int32 nID ) override;
55
56 virtual uno::Sequence< uno::Reference< sheet::XConditionalFormat > > SAL_CALL getConditionalFormats() override;
57
58 virtual sal_Int32 SAL_CALL getLength() override;
59
61
62private:
65};
66
67class ScCondFormatObj : public cppu::WeakImplHelper<css::sheet::XConditionalFormat,
68 css::beans::XPropertySet>
69{
70public:
71 ScCondFormatObj(ScDocShell* pDocShell, rtl::Reference<ScCondFormatsObj> xCondFormats, sal_Int32 nKey);
72
73 virtual ~ScCondFormatObj() override;
74
76
77 // XConditionalFormat
78 virtual void SAL_CALL createEntry(const sal_Int32 nType, const sal_Int32 nPos) override;
79
80 virtual void SAL_CALL removeByIndex(const sal_Int32 nIndex) override;
81
82 // XIndexAccess
83
84 virtual uno::Type SAL_CALL getElementType() override;
85
86 virtual sal_Bool SAL_CALL hasElements() override;
87
88 virtual sal_Int32 SAL_CALL getCount() override;
89
90 virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
91
92 // XPropertySet
93 virtual css::uno::Reference< css::beans::XPropertySetInfo >
94 SAL_CALL getPropertySetInfo() override;
95 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
96 const css::uno::Any& aValue ) override;
97 virtual css::uno::Any SAL_CALL getPropertyValue(
98 const OUString& PropertyName ) override;
99 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
100 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
101 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
102 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
103 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
104 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
105 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
106 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
107
109
110private:
114 sal_Int32 mnKey;
115};
116
117class ScConditionEntryObj : public cppu::WeakImplHelper<css::beans::XPropertySet,
118 css::sheet::XConditionEntry>
119{
120public:
121
123 const ScCondFormatEntry* pFormat);
124 virtual ~ScConditionEntryObj() override;
125
127
128 // XConditionEntry
129 virtual sal_Int32 SAL_CALL getType() override;
130
131 // XPropertySet
132 virtual css::uno::Reference< css::beans::XPropertySetInfo >
133 SAL_CALL getPropertySetInfo() override;
134 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
135 const css::uno::Any& aValue ) override;
136 virtual css::uno::Any SAL_CALL getPropertyValue(
137 const OUString& PropertyName ) override;
138 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
139 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
140 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
141 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
142 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
143 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
144 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
145 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
146
147private:
152};
153
154class ScColorScaleFormatObj : public cppu::WeakImplHelper<css::beans::XPropertySet,
155 css::sheet::XConditionEntry>
156{
157public:
158
160 virtual ~ScColorScaleFormatObj() override;
161
162 // XConditionEntry
163 virtual sal_Int32 SAL_CALL getType() override;
164
165
167
168 // XPropertySet
169 virtual css::uno::Reference< css::beans::XPropertySetInfo >
170 SAL_CALL getPropertySetInfo() override;
171 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
172 const css::uno::Any& aValue ) override;
173 virtual css::uno::Any SAL_CALL getPropertyValue(
174 const OUString& PropertyName ) override;
175 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
176 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
177 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
178 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
179 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
180 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
181 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
182 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
183
184private:
188};
189
190class ScColorScaleEntryObj : public cppu::WeakImplHelper<css::sheet::XColorScaleEntry>
191{
192public:
194
195 virtual ~ScColorScaleEntryObj() override;
196
197 virtual sal_Int32 SAL_CALL getColor() override;
198
199 virtual void SAL_CALL setColor(sal_Int32 aColor) override;
200
201 virtual sal_Int32 SAL_CALL getType() override;
202
203 virtual void SAL_CALL setType(sal_Int32 nType) override;
204
205 virtual OUString SAL_CALL getFormula() override;
206
207 virtual void SAL_CALL setFormula(const OUString& rString) override;
208
209private:
211
213 size_t mnPos;
214};
215
216class ScDataBarFormatObj : public cppu::WeakImplHelper<css::beans::XPropertySet,
217 css::sheet::XConditionEntry>
218{
219public:
221 const ScDataBarFormat* pFormat);
222 virtual ~ScDataBarFormatObj() override;
223
225
226 // XConditionEntry
227 virtual sal_Int32 SAL_CALL getType() override;
228
229 // XPropertySet
230 virtual css::uno::Reference< css::beans::XPropertySetInfo >
231 SAL_CALL getPropertySetInfo() override;
232 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
233 const css::uno::Any& aValue ) override;
234 virtual css::uno::Any SAL_CALL getPropertyValue(
235 const OUString& PropertyName ) override;
236 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
237 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
238 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
239 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
240 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
241 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
242 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
243 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
244
245private:
249};
250
251class ScDataBarEntryObj : public cppu::WeakImplHelper<css::sheet::XDataBarEntry>
252{
253public:
255
256 virtual ~ScDataBarEntryObj() override;
257
258 virtual sal_Int32 SAL_CALL getType() override;
259
260 virtual void SAL_CALL setType(sal_Int32 nType) override;
261
262 virtual OUString SAL_CALL getFormula() override;
263
264 virtual void SAL_CALL setFormula(const OUString& rString) override;
265
266private:
268
270 size_t mnPos;
271};
272
273class ScIconSetFormatObj : public cppu::WeakImplHelper<css::beans::XPropertySet,
274 css::sheet::XConditionEntry>
275{
276public:
278 const ScIconSetFormat* pFormat);
279 virtual ~ScIconSetFormatObj() override;
280
282
283 // XConditionEntry
284 virtual sal_Int32 SAL_CALL getType() override;
285
286 // XPropertySet
287 virtual css::uno::Reference< css::beans::XPropertySetInfo >
288 SAL_CALL getPropertySetInfo() override;
289 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
290 const css::uno::Any& aValue ) override;
291 virtual css::uno::Any SAL_CALL getPropertyValue(
292 const OUString& PropertyName ) override;
293 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
294 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
295 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
296 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
297 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
298 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
299 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
300 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
301
302private:
306};
307
308class ScIconSetEntryObj : public cppu::WeakImplHelper<css::sheet::XIconSetEntry>
309{
310public:
312
313 virtual ~ScIconSetEntryObj() override;
314
315 virtual sal_Int32 SAL_CALL getType() override;
316
317 virtual void SAL_CALL setType(sal_Int32 nType) override;
318
319 virtual OUString SAL_CALL getFormula() override;
320
321 virtual void SAL_CALL setFormula(const OUString& rString) override;
322
323private:
325
327 size_t mnPos;
328};
329
330class ScCondDateFormatObj : public cppu::WeakImplHelper<css::beans::XPropertySet,
331 css::sheet::XConditionEntry>
332{
333public:
335 const ScCondDateFormatEntry* pFormat);
336
337 virtual ~ScCondDateFormatObj() override;
338
340
341 // XConditionEntry
342 virtual sal_Int32 SAL_CALL getType() override;
343
344 // XPropertySet
345 virtual css::uno::Reference< css::beans::XPropertySetInfo >
346 SAL_CALL getPropertySetInfo() override;
347 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
348 const css::uno::Any& aValue ) override;
349 virtual css::uno::Any SAL_CALL getPropertyValue(
350 const OUString& PropertyName ) override;
351 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
352 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
353 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
354 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
355 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
356 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
357 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
358 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
359
360private:
364};
365
366/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Int32 SAL_CALL getType() override
ScColorScaleEntry * getCoreObject()
virtual ~ScColorScaleEntryObj() override
virtual OUString SAL_CALL getFormula() override
virtual void SAL_CALL setColor(sal_Int32 aColor) override
virtual void SAL_CALL setType(sal_Int32 nType) override
virtual sal_Int32 SAL_CALL getColor() override
ScColorScaleEntryObj(rtl::Reference< ScColorScaleFormatObj > xParent, size_t nPos)
rtl::Reference< ScColorScaleFormatObj > mxParent
virtual void SAL_CALL setFormula(const OUString &rString) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
rtl::Reference< ScCondFormatObj > mxParent
virtual ~ScColorScaleFormatObj() override
ScColorScaleFormat * getCoreObject()
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual sal_Int32 SAL_CALL getType() override
ScColorScaleFormatObj(rtl::Reference< ScCondFormatObj > xParent, const ScColorScaleFormat *pFormat)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
const ScColorScaleFormat * mpFormat
SfxItemPropertySet maPropSet
const ScCondDateFormatEntry * mpFormat
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual ~ScCondDateFormatObj() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
ScCondDateFormatEntry * getCoreObject()
SfxItemPropertySet maPropSet
ScCondDateFormatObj(rtl::Reference< ScCondFormatObj > xParent, const ScCondDateFormatEntry *pFormat)
rtl::Reference< ScCondFormatObj > mxParent
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual sal_Int32 SAL_CALL getType() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual ~ScCondFormatObj() override
virtual void SAL_CALL createEntry(const sal_Int32 nType, const sal_Int32 nPos) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual sal_Int32 SAL_CALL getCount() override
SfxItemPropertySet maPropSet
virtual void SAL_CALL removeByIndex(const sal_Int32 nIndex) override
ScCondFormatObj(ScDocShell *pDocShell, rtl::Reference< ScCondFormatsObj > xCondFormats, sal_Int32 nKey)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
ScDocShell * getDocShell()
ScConditionalFormat * getCoreObject()
virtual uno::Type SAL_CALL getElementType() override
rtl::Reference< ScCondFormatsObj > mxCondFormatList
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual sal_Bool SAL_CALL hasElements() override
ScDocShell * mpDocShell
virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
virtual sal_Int32 SAL_CALL createByRange(const uno::Reference< sheet::XSheetCellRanges > &xRanges) override
ScDocShell * mpDocShell
virtual sal_Int32 SAL_CALL getLength() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual ~ScCondFormatsObj() override
virtual void SAL_CALL removeByID(const sal_Int32 nID) override
ScCondFormatsObj(ScDocShell *pDocShell, SCTAB nTab)
virtual uno::Sequence< uno::Reference< sheet::XConditionalFormat > > SAL_CALL getConditionalFormats() override
ScConditionalFormatList * getCoreObject()
virtual sal_Int32 SAL_CALL getType() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual ~ScConditionEntryObj() override
ScConditionEntryObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScCondFormatEntry *pFormat)
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
SfxItemPropertySet maPropSet
ScCondFormatEntry * getCoreObject()
const ScCondFormatEntry * mpFormat
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
ScDocShell * mpDocShell
rtl::Reference< ScCondFormatObj > mxParent
virtual sal_Int32 SAL_CALL getType() override
virtual OUString SAL_CALL getFormula() override
virtual ~ScDataBarEntryObj() override
ScColorScaleEntry * getCoreObject()
virtual void SAL_CALL setType(sal_Int32 nType) override
ScDataBarEntryObj(rtl::Reference< ScDataBarFormatObj > xParent, size_t nPos)
virtual void SAL_CALL setFormula(const OUString &rString) override
rtl::Reference< ScDataBarFormatObj > mxParent
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
ScDataBarFormatObj(rtl::Reference< ScCondFormatObj > xParent, const ScDataBarFormat *pFormat)
rtl::Reference< ScCondFormatObj > mxParent
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
ScDataBarFormat * getCoreObject()
const ScDataBarFormat * mpFormat
virtual sal_Int32 SAL_CALL getType() override
virtual ~ScDataBarFormatObj() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
SfxItemPropertySet maPropSet
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
ScColorScaleEntry * getCoreObject()
rtl::Reference< ScIconSetFormatObj > mxParent
virtual sal_Int32 SAL_CALL getType() override
ScIconSetEntryObj(rtl::Reference< ScIconSetFormatObj > xParent, size_t nPos)
virtual void SAL_CALL setType(sal_Int32 nType) override
virtual void SAL_CALL setFormula(const OUString &rString) override
virtual ~ScIconSetEntryObj() override
virtual OUString SAL_CALL getFormula() override
virtual ~ScIconSetFormatObj() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
const ScIconSetFormat * mpFormat
SfxItemPropertySet maPropSet
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
ScIconSetFormatObj(rtl::Reference< ScCondFormatObj > xParent, const ScIconSetFormat *pFormat)
virtual sal_Int32 SAL_CALL getType() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
rtl::Reference< ScCondFormatObj > mxParent
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
ScIconSetFormat * getCoreObject()
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
sal_Int32 nIndex
sal_uInt16 nPos
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
unsigned char sal_Bool
sal_Int16 SCTAB
Definition: types.hxx:22