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 59 void SetGradientStyle(XGradientStyle eNewStyle) { eStyle = eNewStyle; } 60 void SetStartColor(const Color& rColor) { aStartColor = rColor; } 61 void SetEndColor(const Color& rColor) { aEndColor = rColor; } 62 void SetAngle(long nNewAngle) { nAngle = nNewAngle; } 63 void SetBorder(sal_uInt16 nNewBorder) { nBorder = nNewBorder; } 64 void SetXOffset(sal_uInt16 nNewOffset) { nOfsX = nNewOffset; } 65 void SetYOffset(sal_uInt16 nNewOffset) { nOfsY = nNewOffset; } 66 void SetStartIntens(sal_uInt16 nNewIntens) { nIntensStart = nNewIntens; } 67 void SetEndIntens(sal_uInt16 nNewIntens) { nIntensEnd = nNewIntens; } 68 void SetSteps(sal_uInt16 nSteps) { nStepCount = nSteps; } 69 70 XGradientStyle GetGradientStyle() const { return eStyle; } 71 Color GetStartColor() const { return aStartColor; } 72 Color GetEndColor() const { return aEndColor; } 73 long GetAngle() const { return nAngle; } 74 sal_uInt16 GetBorder() const { return nBorder; } 75 sal_uInt16 GetXOffset() const { return nOfsX; } 76 sal_uInt16 GetYOffset() const { return nOfsY; } 77 sal_uInt16 GetStartIntens() const { return nIntensStart; } 78 sal_uInt16 GetEndIntens() const { return nIntensEnd; } 79 sal_uInt16 GetSteps() const { return nStepCount; } 80 }; 81 82 #endif 83