xref: /aoo41x/main/svx/inc/svx/xflgrit.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SVX_XFLGRIT_HXX
29 #define _SVX_XFLGRIT_HXX
30 
31 #include <svx/xit.hxx>
32 #include <svx/xgrad.hxx>
33 #include "svx/svxdllapi.h"
34 
35 class SdrModel;
36 
37 //------------------------
38 // class XFillGradientItem
39 //------------------------
40 class SVX_DLLPUBLIC XFillGradientItem : public NameOrIndex
41 {
42 	XGradient   aGradient;
43 
44 public:
45 			TYPEINFO();
46 			XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
47 			XFillGradientItem(sal_Int32 nIndex, const XGradient& rTheGradient);
48 			XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
49 			XFillGradientItem(SfxItemPool* pPool, const XGradient& rTheGradient);
50 			XFillGradientItem(SfxItemPool* pPool );
51 			XFillGradientItem(const XFillGradientItem& rItem);
52 			XFillGradientItem(SvStream& rIn, sal_uInt16 nVer = 0);
53 
54 	virtual int             operator==(const SfxPoolItem& rItem) const;
55 	virtual SfxPoolItem*    Clone(SfxItemPool* pPool = 0) const;
56 	virtual SfxPoolItem*    Create(SvStream& rIn, sal_uInt16 nVer) const;
57 	virtual SvStream&       Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
58 	virtual sal_uInt16          GetVersion( sal_uInt16 nFileFormatVersion ) const;
59 
60 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
61 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
62 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
63 									SfxMapUnit eCoreMetric,
64 									SfxMapUnit ePresMetric,
65                                     String &rText, const IntlWrapper * = 0 ) const;
66 	const XGradient&		GetGradientValue(const XGradientTable* pTable = 0) const; // GetValue -> GetGradientValue
67 	void					SetGradientValue(const XGradient& rNew) { aGradient = rNew; Detach(); } // SetValue -> SetGradientValue
68 
69 	static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
70 	XFillGradientItem* checkForUniqueItem( SdrModel* pModel ) const;
71 };
72 
73 #endif
74 
75