xref: /trunk/main/svx/inc/svx/xgrad.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX__XGRADIENT_HXX
25cdf0e10cSrcweir #define _SVX__XGRADIENT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/xenum.hxx>
28cdf0e10cSrcweir #include <tools/color.hxx>
29cdf0e10cSrcweir #include "svx/svxdllapi.h"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir //-----------------
32cdf0e10cSrcweir // class XGradient
33cdf0e10cSrcweir //-----------------
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class SVX_DLLPUBLIC XGradient
36cdf0e10cSrcweir {
37cdf0e10cSrcweir protected:
38cdf0e10cSrcweir 	XGradientStyle  eStyle;
39cdf0e10cSrcweir 	Color           aStartColor;
40cdf0e10cSrcweir 	Color           aEndColor;
41cdf0e10cSrcweir 	long            nAngle;
42cdf0e10cSrcweir 	sal_uInt16          nBorder;
43cdf0e10cSrcweir 	sal_uInt16          nOfsX;
44cdf0e10cSrcweir 	sal_uInt16          nOfsY;
45cdf0e10cSrcweir 	sal_uInt16          nIntensStart;
46cdf0e10cSrcweir 	sal_uInt16          nIntensEnd;
47cdf0e10cSrcweir 	sal_uInt16          nStepCount;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir 	XGradient();
51cdf0e10cSrcweir 	XGradient( const Color& rStart, const Color& rEnd,
52cdf0e10cSrcweir 			   XGradientStyle eStyle = XGRAD_LINEAR, long nAngle = 0,
53cdf0e10cSrcweir 			   sal_uInt16 nXOfs = 50, sal_uInt16 nYOfs = 50, sal_uInt16 nBorder = 0,
54cdf0e10cSrcweir 			   sal_uInt16 nStartIntens = 100, sal_uInt16 nEndIntens = 100,
55cdf0e10cSrcweir 			   sal_uInt16 nSteps = 0 );
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	bool operator==(const XGradient& rGradient) const;
58cdf0e10cSrcweir 
SetGradientStyle(XGradientStyle eNewStyle)59cdf0e10cSrcweir 	void SetGradientStyle(XGradientStyle eNewStyle) { eStyle = eNewStyle; }
SetStartColor(const Color & rColor)60cdf0e10cSrcweir 	void SetStartColor(const Color& rColor)         { aStartColor = rColor; }
SetEndColor(const Color & rColor)61cdf0e10cSrcweir 	void SetEndColor(const Color& rColor)           { aEndColor = rColor; }
SetAngle(long nNewAngle)62cdf0e10cSrcweir 	void SetAngle(long nNewAngle)                   { nAngle = nNewAngle; }
SetBorder(sal_uInt16 nNewBorder)63cdf0e10cSrcweir 	void SetBorder(sal_uInt16 nNewBorder)               { nBorder = nNewBorder; }
SetXOffset(sal_uInt16 nNewOffset)64cdf0e10cSrcweir 	void SetXOffset(sal_uInt16 nNewOffset)              { nOfsX = nNewOffset; }
SetYOffset(sal_uInt16 nNewOffset)65cdf0e10cSrcweir 	void SetYOffset(sal_uInt16 nNewOffset)              { nOfsY = nNewOffset; }
SetStartIntens(sal_uInt16 nNewIntens)66cdf0e10cSrcweir 	void SetStartIntens(sal_uInt16 nNewIntens)          { nIntensStart = nNewIntens; }
SetEndIntens(sal_uInt16 nNewIntens)67cdf0e10cSrcweir 	void SetEndIntens(sal_uInt16 nNewIntens)            { nIntensEnd = nNewIntens; }
SetSteps(sal_uInt16 nSteps)68cdf0e10cSrcweir 	void SetSteps(sal_uInt16 nSteps)                    { nStepCount = nSteps; }
69cdf0e10cSrcweir 
GetGradientStyle() const70cdf0e10cSrcweir 	XGradientStyle GetGradientStyle() const         { return eStyle; }
GetStartColor() const71cdf0e10cSrcweir 	Color          GetStartColor() const            { return aStartColor; }
GetEndColor() const72cdf0e10cSrcweir 	Color          GetEndColor() const              { return aEndColor; }
GetAngle() const73cdf0e10cSrcweir 	long           GetAngle() const                 { return nAngle; }
GetBorder() const74cdf0e10cSrcweir 	sal_uInt16         GetBorder() const                { return nBorder; }
GetXOffset() const75cdf0e10cSrcweir 	sal_uInt16         GetXOffset() const               { return nOfsX; }
GetYOffset() const76cdf0e10cSrcweir 	sal_uInt16         GetYOffset() const               { return nOfsY; }
GetStartIntens() const77cdf0e10cSrcweir 	sal_uInt16         GetStartIntens() const           { return nIntensStart; }
GetEndIntens() const78cdf0e10cSrcweir 	sal_uInt16         GetEndIntens() const             { return nIntensEnd; }
GetSteps() const79cdf0e10cSrcweir 	sal_uInt16         GetSteps() const                 { return nStepCount; }
80cdf0e10cSrcweir };
81cdf0e10cSrcweir 
82cdf0e10cSrcweir #endif
83