LibreOffice Module svx (master)  1
drawitem.cxx
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 
20 #include <svx/svxids.hrc>
21 #include <svx/drawitem.hxx>
22 #include <svx/xtable.hxx>
23 
24 using namespace ::com::sun::star;
25 
26 
34 
36 {
37 }
38 
39 
40 SvxColorListItem::SvxColorListItem( XColorListRef const & pTable, sal_uInt16 nW ) :
41  SfxPoolItem( nW ),
42  pColorList( pTable )
43 {
44 }
45 
46 
48  SfxPoolItem( rItem ),
49  pColorList( rItem.pColorList )
50 {
51 }
52 
54 (
55  SfxItemPresentation /*ePres*/,
56  MapUnit /*eCoreUnit*/,
57  MapUnit /*ePresUnit*/,
58  OUString& rText, const IntlWrapper&
59 ) const
60 {
61  rText.clear();
62  return false;
63 }
64 
65 bool SvxColorListItem::operator==( const SfxPoolItem& rItem ) const
66 {
67  assert(SfxPoolItem::operator==(rItem));
68  return static_cast<const SvxColorListItem&>(rItem).pColorList == pColorList;
69 }
70 
72 {
73  return new SvxColorListItem( *this );
74 }
75 
76 
77 // Should be a template class but ...
78 #define QUERY_PUT_IMPL(svtype, xtype) \
79 bool svtype::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const \
80 { \
81  rVal <<= uno::Reference< uno::XWeak >( p##xtype.get() ); \
82  return true; \
83 } \
84 \
85 bool svtype::PutValue( const css::uno::Any& rVal, sal_uInt8 ) \
86 { \
87  uno::Reference< uno::XWeak > xRef; \
88  if( rVal >>= xRef ) { \
89  p##xtype = X##xtype##Ref(dynamic_cast<X##xtype *>(xRef.get())); \
90  return true; \
91  } \
92  return false; \
93 }
94 
96 
98 {
99 }
100 
102  SfxPoolItem( nW ),
103  pGradientList( pList )
104 {
105 }
106 
107 
109  SfxPoolItem( rItem ),
110  pGradientList( rItem.pGradientList )
111 {
112 }
113 
114 
116 (
117  SfxItemPresentation /*ePres*/,
118  MapUnit /*eCoreUnit*/,
119  MapUnit /*ePresUnit*/,
120  OUString& rText, const IntlWrapper&
121 ) const
122 {
123  rText.clear();
124  return false;
125 }
126 
127 
129 {
130  assert(SfxPoolItem::operator==(rItem));
131  return static_cast<const SvxGradientListItem&>(rItem).pGradientList == pGradientList;
132 }
133 
134 
136 {
137  return new SvxGradientListItem( *this );
138 }
139 
140 
141 QUERY_PUT_IMPL( SvxGradientListItem, GradientList )
142 
144 {
145 }
146 
147 
148 SvxHatchListItem::SvxHatchListItem( XHatchListRef const & pList, sal_uInt16 nW ) :
149  SfxPoolItem( nW ),
150  pHatchList( pList )
151 {
152 }
153 
154 
156  SfxPoolItem( rItem ),
157  pHatchList( rItem.pHatchList )
158 {
159 }
160 
161 
163 (
164  SfxItemPresentation /*ePres*/,
165  MapUnit /*eCoreUnit*/,
166  MapUnit /*ePresUnit*/,
167  OUString& rText, const IntlWrapper&
168 ) const
169 {
170  rText.clear();
171  return false;
172 }
173 
174 
175 bool SvxHatchListItem::operator==( const SfxPoolItem& rItem ) const
176 {
177  assert(SfxPoolItem::operator==(rItem));
178  return static_cast<const SvxHatchListItem&>(rItem).pHatchList == pHatchList;
179 }
180 
181 
183 {
184  return new SvxHatchListItem( *this );
185 }
186 
187 QUERY_PUT_IMPL( SvxHatchListItem, HatchList )
188 
190 {
191 }
192 
193 SvxBitmapListItem::SvxBitmapListItem( XBitmapListRef const & pList, sal_uInt16 nW ) :
194  SfxPoolItem( nW ),
195  pBitmapList( pList )
196 {
197 }
198 
200  SfxPoolItem( rItem ),
201  pBitmapList( rItem.pBitmapList )
202 {
203 }
204 
206 (
207  SfxItemPresentation /*ePres*/,
208  MapUnit /*eCoreUnit*/,
209  MapUnit /*ePresUnit*/,
210  OUString& rText, const IntlWrapper&
211 ) const
212 {
213  rText.clear();
214  return false;
215 }
216 
217 bool SvxBitmapListItem::operator==( const SfxPoolItem& rItem ) const
218 {
219  assert(SfxPoolItem::operator==(rItem));
220  return static_cast<const SvxBitmapListItem&>(rItem).pBitmapList == pBitmapList;
221 }
222 
224 {
225  return new SvxBitmapListItem( *this );
226 }
227 
228 QUERY_PUT_IMPL( SvxBitmapListItem, BitmapList )
229 
231 {
232 }
233 
235  SfxPoolItem( nW ),
236  pPatternList( pList )
237 {
238 }
239 
241  SfxPoolItem( rItem ),
242  pPatternList( rItem.pPatternList )
243 {
244 }
245 
247 (
248  SfxItemPresentation /*ePres*/,
249  MapUnit /*eCoreUnit*/,
250  MapUnit /*ePresUnit*/,
251  OUString& rText, const IntlWrapper&
252 ) const
253 {
254  rText.clear();
255  return false;
256 }
257 
258 bool SvxPatternListItem::operator==( const SfxPoolItem& rItem ) const
259 {
260  assert(SfxPoolItem::operator==(rItem));
261  return static_cast<const SvxPatternListItem&>(rItem).pPatternList == pPatternList;
262 }
263 
265 {
266  return new SvxPatternListItem( *this );
267 }
268 
269 QUERY_PUT_IMPL( SvxPatternListItem, PatternList )
270 
272 {
273 }
274 
275 SvxDashListItem::SvxDashListItem( XDashListRef const & pList, sal_uInt16 nW ) :
276  SfxPoolItem( nW ),
277  pDashList( pList )
278 {
279 }
280 
282  SfxPoolItem( rItem ),
283  pDashList( rItem.pDashList )
284 {
285 }
286 
288 (
289  SfxItemPresentation /*ePres*/,
290  MapUnit /*eCoreUnit*/,
291  MapUnit /*ePresUnit*/,
292  OUString& rText, const IntlWrapper&
293 ) const
294 {
295  rText.clear();
296  return false;
297 }
298 
299 bool SvxDashListItem::operator==( const SfxPoolItem& rItem ) const
300 {
301  assert(SfxPoolItem::operator==(rItem));
302  return static_cast<const SvxDashListItem&>(rItem).pDashList == pDashList;
303 }
304 
306 {
307  return new SvxDashListItem( *this );
308 }
309 
310 QUERY_PUT_IMPL( SvxDashListItem, DashList )
311 
313 {
314 }
315 
317  SfxPoolItem( nW ),
318  pLineEndList( pList )
319 {
320 }
321 
323  SfxPoolItem( rItem ),
324  pLineEndList( rItem.pLineEndList )
325 {
326 }
327 
329 (
330  SfxItemPresentation /*ePres*/,
331  MapUnit /*eCoreUnit*/,
332  MapUnit /*ePresUnit*/,
333  OUString& rText, const IntlWrapper&
334 ) const
335 {
336  rText.clear();
337  return false;
338 }
339 
340 bool SvxLineEndListItem::operator==( const SfxPoolItem& rItem ) const
341 {
342  assert(SfxPoolItem::operator==(rItem));
343  return static_cast<const SvxLineEndListItem&>(rItem).pLineEndList == pLineEndList;
344 }
345 
347 {
348  return new SvxLineEndListItem( *this );
349 }
350 
351 QUERY_PUT_IMPL( SvxLineEndListItem, LineEndList )
352 
353 
354 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:305
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:30
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:299
XGradientListRef pGradientList
Definition: drawitem.hxx:53
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:340
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:258
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:217
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:223
#define QUERY_PUT_IMPL(svtype, xtype)
Definition: drawitem.cxx:78
std::vector< NamedColor > ColorList
Definition: palettes.hxx:26
XHatchListRef pHatchList
Definition: drawitem.hxx:78
XColorListRef pColorList
Definition: drawitem.hxx:28
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:329
SfxItemPresentation
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:247
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:175
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:54
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:288
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:33
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:182
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:28
XPatternListRef pPatternList
Definition: drawitem.hxx:127
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:206
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:163
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:264
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:128
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:27
XLineEndListRef pLineEndList
Definition: drawitem.hxx:176
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:346
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:29
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:71
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:31
MapUnit
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:65
XBitmapListRef pBitmapList
Definition: drawitem.hxx:102
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:135
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:32
XDashListRef pDashList
Definition: drawitem.hxx:151
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:116