LibreOffice Module editeng (master) 1
shaditem.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_EDITENG_SHADITEM_HXX
20#define INCLUDED_EDITENG_SHADITEM_HXX
21
22#include <tools/color.hxx>
23#include <tools/mapunit.hxx>
24#include <svl/cenumitm.hxx>
25
26#include <editeng/svxenum.hxx>
28
29
30// class SvxShadowItem ---------------------------------------------------
31
32/* [Description]
33
34 This item describes the shadow attribute (color, width and position).
35*/
37
39{
41 sal_uInt16 nWidth;
43public:
44 static SfxPoolItem* CreateDefault();
45
46 explicit SvxShadowItem( const sal_uInt16 nId ,
47 const Color *pColor = nullptr, const sal_uInt16 nWidth = 100 /*5pt*/,
49
50 // "pure virtual Methods" from SfxPoolItem
51 virtual bool operator==( const SfxPoolItem& ) const override;
52 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
53 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
54
55 virtual bool GetPresentation( SfxItemPresentation ePres,
56 MapUnit eCoreMetric,
57 MapUnit ePresMetric,
58 OUString &rText, const IntlWrapper& ) const override;
59
60 virtual SvxShadowItem* Clone( SfxItemPool *pPool = nullptr ) const override;
61 virtual void ScaleMetrics( tools::Long nMult, tools::Long nDiv ) override;
62 virtual bool HasMetrics() const override;
63
64 const Color& GetColor() const { return aShadowColor;}
65 void SetColor( const Color &rNew ) { aShadowColor = rNew; }
66
67 sal_uInt16 GetWidth() const { return nWidth; }
68 SvxShadowLocation GetLocation() const { return eLocation; }
69
70 void SetWidth( sal_uInt16 nNew ) { nWidth = nNew; }
71 void SetLocation( SvxShadowLocation eNew ) { eLocation = eNew; }
72
73 // Calculate width of the shadow on the page.
74 sal_uInt16 CalcShadowSpace( SvxShadowItemSide nShadow ) const;
75
76 virtual sal_uInt16 GetValueCount() const override;
77 virtual sal_uInt16 GetEnumValue() const override;
78 virtual void SetEnumValue( sal_uInt16 nNewVal ) override;
79 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
80};
81
82#endif // INCLUDED_EDITENG_SHADITEM_HXX
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_uInt16 GetValueCount() const=0
virtual sal_uInt16 GetEnumValue() const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8) override
virtual bool operator==(const SfxPoolItem &rItem) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8=0) const override
virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &) const override
virtual void SetEnumValue(sal_uInt16 nValue)=0
virtual void ScaleMetrics(tools::Long lMult, tools::Long lDiv)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
virtual bool HasMetrics() const
sal_uInt16 GetWidth() const
Definition: shaditem.hxx:67
const Color & GetColor() const
Definition: shaditem.hxx:64
sal_uInt16 nWidth
Definition: shaditem.hxx:41
void SetLocation(SvxShadowLocation eNew)
Definition: shaditem.hxx:71
SvxShadowLocation GetLocation() const
Definition: shaditem.hxx:68
SvxShadowLocation eLocation
Definition: shaditem.hxx:42
Color aShadowColor
Definition: shaditem.hxx:40
void SetWidth(sal_uInt16 nNew)
Definition: shaditem.hxx:70
void SetColor(const Color &rNew)
Definition: shaditem.hxx:65
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
struct _xmlTextWriter * xmlTextWriterPtr
MapUnit
const sal_uInt32 LEFT
const sal_uInt32 TOP
const sal_uInt32 BOTTOM
const sal_uInt32 RIGHT
long Long
SfxItemPresentation
SvxShadowItemSide
Definition: shaditem.hxx:36
SvxShadowLocation
Definition: svxenum.hxx:43
unsigned char sal_uInt8