1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the LibreOffice project. 4 * 5 * This Source Code Form is subject to the terms of the Mozilla Public 6 * License, v. 2.0. If a copy of the MPL was not distributed with this 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 * 9 * This file incorporates work covered by the following license notice: 10 * 11 * Licensed to the Apache Software Foundation (ASF) under one or more 12 * contributor license agreements. See the NOTICE file distributed 13 * with this work for additional information regarding copyright 14 * ownership. The ASF licenses this file to you under the Apache 15 * License, Version 2.0 (the "License"); you may not use this file 16 * except in compliance with the License. You may obtain a copy of 17 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 18 */ 19 20 #ifndef INCLUDED_SVX_XGRAD_HXX 21 #define INCLUDED_SVX_XGRAD_HXX 22 23 #include <tools/color.hxx> 24 #include <svx/svxdllapi.h> 25 #include <com/sun/star/awt/GradientStyle.hpp> 26 27 class Gradient; 28 29 class SAL_WARN_UNUSED SVX_DLLPUBLIC XGradient final 30 { 31 css::awt::GradientStyle eStyle; 32 Color aStartColor; 33 Color aEndColor; 34 long nAngle; 35 sal_uInt16 nBorder; 36 sal_uInt16 nOfsX; 37 sal_uInt16 nOfsY; 38 sal_uInt16 nIntensStart; 39 sal_uInt16 nIntensEnd; 40 sal_uInt16 nStepCount; 41 42 public: 43 XGradient(); 44 XGradient( const Color& rStart, const Color& rEnd, 45 css::awt::GradientStyle eStyle = css::awt::GradientStyle_LINEAR, long nAngle = 0, 46 sal_uInt16 nXOfs = 50, sal_uInt16 nYOfs = 50, sal_uInt16 nBorder = 0, 47 sal_uInt16 nStartIntens = 100, sal_uInt16 nEndIntens = 100, 48 sal_uInt16 nSteps = 0 ); 49 50 bool operator==(const XGradient& rGradient) const; 51 SetGradientStyle(css::awt::GradientStyle eNewStyle)52 void SetGradientStyle(css::awt::GradientStyle eNewStyle) { eStyle = eNewStyle; } SetStartColor(const Color & rColor)53 void SetStartColor(const Color& rColor) { aStartColor = rColor; } SetEndColor(const Color & rColor)54 void SetEndColor(const Color& rColor) { aEndColor = rColor; } SetAngle(long nNewAngle)55 void SetAngle(long nNewAngle) { nAngle = nNewAngle; } SetBorder(sal_uInt16 nNewBorder)56 void SetBorder(sal_uInt16 nNewBorder) { nBorder = nNewBorder; } SetXOffset(sal_uInt16 nNewOffset)57 void SetXOffset(sal_uInt16 nNewOffset) { nOfsX = nNewOffset; } SetYOffset(sal_uInt16 nNewOffset)58 void SetYOffset(sal_uInt16 nNewOffset) { nOfsY = nNewOffset; } SetStartIntens(sal_uInt16 nNewIntens)59 void SetStartIntens(sal_uInt16 nNewIntens) { nIntensStart = nNewIntens; } SetEndIntens(sal_uInt16 nNewIntens)60 void SetEndIntens(sal_uInt16 nNewIntens) { nIntensEnd = nNewIntens; } SetSteps(sal_uInt16 nSteps)61 void SetSteps(sal_uInt16 nSteps) { nStepCount = nSteps; } 62 GetGradientStyle() const63 css::awt::GradientStyle GetGradientStyle() const { return eStyle; } GetStartColor() const64 const Color& GetStartColor() const { return aStartColor; } GetEndColor() const65 const Color& GetEndColor() const { return aEndColor; } GetAngle() const66 long GetAngle() const { return nAngle; } GetBorder() const67 sal_uInt16 GetBorder() const { return nBorder; } GetXOffset() const68 sal_uInt16 GetXOffset() const { return nOfsX; } GetYOffset() const69 sal_uInt16 GetYOffset() const { return nOfsY; } GetStartIntens() const70 sal_uInt16 GetStartIntens() const { return nIntensStart; } GetEndIntens() const71 sal_uInt16 GetEndIntens() const { return nIntensEnd; } GetSteps() const72 sal_uInt16 GetSteps() const { return nStepCount; } 73 }; 74 75 #endif 76 77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 78