Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_SHADITEM_HXX
29 : : #define _SVX_SHADITEM_HXX
30 : :
31 : : #include <tools/color.hxx>
32 : : #include <svl/eitem.hxx>
33 : : #include <editeng/svxenum.hxx>
34 : : #include <editeng/editengdllapi.h>
35 : :
36 : : namespace rtl
37 : : {
38 : : class OUString;
39 : : }
40 : :
41 : : // class SvxShadowItem ---------------------------------------------------
42 : :
43 : : /* [Description]
44 : :
45 : : This item describes the shadow attribute (color, width and position).
46 : : */
47 : :
48 : : #define SHADOW_TOP ((sal_uInt16)0)
49 : : #define SHADOW_BOTTOM ((sal_uInt16)1)
50 : : #define SHADOW_LEFT ((sal_uInt16)2)
51 : : #define SHADOW_RIGHT ((sal_uInt16)3)
52 : :
53 [ - + ]: 1908 : class EDITENG_DLLPUBLIC SvxShadowItem : public SfxEnumItemInterface
54 : : {
55 : : Color aShadowColor;
56 : : sal_uInt16 nWidth;
57 : : SvxShadowLocation eLocation;
58 : : public:
59 : : TYPEINFO();
60 : :
61 : : SvxShadowItem( const sal_uInt16 nId ,
62 : : const Color *pColor = 0, const sal_uInt16 nWidth = 100 /*5pt*/,
63 : : const SvxShadowLocation eLoc = SVX_SHADOW_NONE );
64 : :
65 : : inline SvxShadowItem& operator=( const SvxShadowItem& rFmtShadow );
66 : :
67 : : // "pure virtual Methods" from SfxPoolItem
68 : : virtual int operator==( const SfxPoolItem& ) const;
69 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
70 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
71 : :
72 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
73 : : SfxMapUnit eCoreMetric,
74 : : SfxMapUnit ePresMetric,
75 : : String &rText, const IntlWrapper * = 0 ) const;
76 : :
77 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
78 : : virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
79 : : virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
80 : : virtual bool ScaleMetrics( long nMult, long nDiv );
81 : : virtual bool HasMetrics() const;
82 : :
83 : 78 : const Color& GetColor() const { return aShadowColor;}
84 : 0 : void SetColor( const Color &rNew ) { aShadowColor = rNew; }
85 : :
86 : 11912 : sal_uInt16 GetWidth() const { return nWidth; }
87 : 230705 : SvxShadowLocation GetLocation() const { return eLocation; }
88 : :
89 : 0 : void SetWidth( sal_uInt16 nNew ) { nWidth = nNew; }
90 : 6 : void SetLocation( SvxShadowLocation eNew ) { eLocation = eNew; }
91 : :
92 : : // Calculate width of the shadow on the page.
93 : : sal_uInt16 CalcShadowSpace( sal_uInt16 nShadow ) const;
94 : :
95 : : virtual sal_uInt16 GetValueCount() const;
96 : : virtual rtl::OUString GetValueTextByPos( sal_uInt16 nPos ) const;
97 : : virtual sal_uInt16 GetEnumValue() const;
98 : : virtual void SetEnumValue( sal_uInt16 nNewVal );
99 : : };
100 : :
101 : 0 : inline SvxShadowItem &SvxShadowItem::operator=( const SvxShadowItem& rFmtShadow )
102 : : {
103 : 0 : aShadowColor = rFmtShadow.aShadowColor;
104 : 0 : nWidth = rFmtShadow.GetWidth();
105 : 0 : eLocation = rFmtShadow.GetLocation();
106 : 0 : return *this;
107 : : }
108 : :
109 : : #endif // #ifndef _SVX_SHADITEM_HXX
110 : :
111 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|