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