xref: /AOO41X/main/svx/inc/svx/xgrad.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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__XGRADIENT_HXX
29 #define _SVX__XGRADIENT_HXX
30 
31 #include <svx/xenum.hxx>
32 #include <tools/color.hxx>
33 #include "svx/svxdllapi.h"
34 
35 //-----------------
36 // class XGradient
37 //-----------------
38 
39 class SVX_DLLPUBLIC XGradient
40 {
41 protected:
42 	XGradientStyle  eStyle;
43 	Color           aStartColor;
44 	Color           aEndColor;
45 	long            nAngle;
46 	sal_uInt16          nBorder;
47 	sal_uInt16          nOfsX;
48 	sal_uInt16          nOfsY;
49 	sal_uInt16          nIntensStart;
50 	sal_uInt16          nIntensEnd;
51 	sal_uInt16          nStepCount;
52 
53 public:
54 	XGradient();
55 	XGradient( const Color& rStart, const Color& rEnd,
56 			   XGradientStyle eStyle = XGRAD_LINEAR, long nAngle = 0,
57 			   sal_uInt16 nXOfs = 50, sal_uInt16 nYOfs = 50, sal_uInt16 nBorder = 0,
58 			   sal_uInt16 nStartIntens = 100, sal_uInt16 nEndIntens = 100,
59 			   sal_uInt16 nSteps = 0 );
60 
61 	bool operator==(const XGradient& rGradient) const;
62 
63 	void SetGradientStyle(XGradientStyle eNewStyle) { eStyle = eNewStyle; }
64 	void SetStartColor(const Color& rColor)         { aStartColor = rColor; }
65 	void SetEndColor(const Color& rColor)           { aEndColor = rColor; }
66 	void SetAngle(long nNewAngle)                   { nAngle = nNewAngle; }
67 	void SetBorder(sal_uInt16 nNewBorder)               { nBorder = nNewBorder; }
68 	void SetXOffset(sal_uInt16 nNewOffset)              { nOfsX = nNewOffset; }
69 	void SetYOffset(sal_uInt16 nNewOffset)              { nOfsY = nNewOffset; }
70 	void SetStartIntens(sal_uInt16 nNewIntens)          { nIntensStart = nNewIntens; }
71 	void SetEndIntens(sal_uInt16 nNewIntens)            { nIntensEnd = nNewIntens; }
72 	void SetSteps(sal_uInt16 nSteps)                    { nStepCount = nSteps; }
73 
74 	XGradientStyle GetGradientStyle() const         { return eStyle; }
75 	Color          GetStartColor() const            { return aStartColor; }
76 	Color          GetEndColor() const              { return aEndColor; }
77 	long           GetAngle() const                 { return nAngle; }
78 	sal_uInt16         GetBorder() const                { return nBorder; }
79 	sal_uInt16         GetXOffset() const               { return nOfsX; }
80 	sal_uInt16         GetYOffset() const               { return nOfsY; }
81 	sal_uInt16         GetStartIntens() const           { return nIntensStart; }
82 	sal_uInt16         GetEndIntens() const             { return nIntensEnd; }
83 	sal_uInt16         GetSteps() const                 { return nStepCount; }
84 };
85 
86 #endif
87