update credits
[LibreOffice.git] / include / editeng / shaditem.hxx
blobe76c77a7ec4ed0617797ad7aeb65150c98e72057
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 _SVX_SHADITEM_HXX
20 #define _SVX_SHADITEM_HXX
22 #include <tools/color.hxx>
23 #include <svl/eitem.hxx>
24 #include <editeng/svxenum.hxx>
25 #include <editeng/editengdllapi.h>
28 // class SvxShadowItem ---------------------------------------------------
30 /* [Description]
32 This item describes the shadow attribute (color, width and position).
35 #define SHADOW_TOP ((sal_uInt16)0)
36 #define SHADOW_BOTTOM ((sal_uInt16)1)
37 #define SHADOW_LEFT ((sal_uInt16)2)
38 #define SHADOW_RIGHT ((sal_uInt16)3)
40 class EDITENG_DLLPUBLIC SvxShadowItem : public SfxEnumItemInterface
42 Color aShadowColor;
43 sal_uInt16 nWidth;
44 SvxShadowLocation eLocation;
45 public:
46 TYPEINFO();
48 explicit SvxShadowItem( const sal_uInt16 nId ,
49 const Color *pColor = 0, const sal_uInt16 nWidth = 100 /*5pt*/,
50 const SvxShadowLocation eLoc = SVX_SHADOW_NONE );
52 inline SvxShadowItem& operator=( const SvxShadowItem& rFmtShadow );
54 // "pure virtual Methods" from SfxPoolItem
55 virtual int operator==( const SfxPoolItem& ) const;
56 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
57 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
59 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
60 SfxMapUnit eCoreMetric,
61 SfxMapUnit ePresMetric,
62 OUString &rText, const IntlWrapper * = 0 ) const;
64 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
65 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
66 virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
67 virtual bool ScaleMetrics( long nMult, long nDiv );
68 virtual bool HasMetrics() const;
70 const Color& GetColor() const { return aShadowColor;}
71 void SetColor( const Color &rNew ) { aShadowColor = rNew; }
73 sal_uInt16 GetWidth() const { return nWidth; }
74 SvxShadowLocation GetLocation() const { return eLocation; }
76 void SetWidth( sal_uInt16 nNew ) { nWidth = nNew; }
77 void SetLocation( SvxShadowLocation eNew ) { eLocation = eNew; }
79 // Calculate width of the shadow on the page.
80 sal_uInt16 CalcShadowSpace( sal_uInt16 nShadow ) const;
82 virtual sal_uInt16 GetValueCount() const;
83 virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
84 virtual sal_uInt16 GetEnumValue() const;
85 virtual void SetEnumValue( sal_uInt16 nNewVal );
88 inline SvxShadowItem &SvxShadowItem::operator=( const SvxShadowItem& rFmtShadow )
90 aShadowColor = rFmtShadow.aShadowColor;
91 nWidth = rFmtShadow.GetWidth();
92 eLocation = rFmtShadow.GetLocation();
93 return *this;
96 #endif // #ifndef _SVX_SHADITEM_HXX
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */