LibreOffice Module vcl (master)  1
gradient.hxx
Go to the documentation of this file.
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_VCL_GRADIENT_HXX
21 #define INCLUDED_VCL_GRADIENT_HXX
22 
23 #include <sal/types.h>
24 #include <vcl/dllapi.h>
25 #include <tools/color.hxx>
26 
27 #include <vcl/vclenum.hxx>
28 #include <o3tl/cow_wrapper.hxx>
29 
30 
31 namespace tools
32 {
33 class Rectangle;
34 }
35 class Point;
36 class SvStream;
37 
39 {
40 public:
44  sal_uInt16 mnAngle;
45  sal_uInt16 mnBorder;
46  sal_uInt16 mnOfsX;
47  sal_uInt16 mnOfsY;
48  sal_uInt16 mnIntensityStart;
49  sal_uInt16 mnIntensityEnd;
50  sal_uInt16 mnStepCount;
51 
52  Impl_Gradient();
53  Impl_Gradient( const Impl_Gradient& rImplGradient );
54 
55  bool operator==( const Impl_Gradient& rImpl_Gradient ) const;
56 };
57 
58 
60 {
61 private:
63 
64 public:
65  Gradient();
66  Gradient( const Gradient& rGradient );
67  Gradient( Gradient&& rGradient );
68  Gradient( GradientStyle eStyle,
69  const Color& rStartColor,
70  const Color& rEndColor );
71  ~Gradient();
72 
73  void SetStyle( GradientStyle eStyle );
74  GradientStyle GetStyle() const { return mpImplGradient->meStyle; }
75 
76  void SetStartColor( const Color& rColor );
77  const Color& GetStartColor() const { return mpImplGradient->maStartColor; }
78  void SetEndColor( const Color& rColor );
79  const Color& GetEndColor() const { return mpImplGradient->maEndColor; }
80 
81  void SetAngle( sal_uInt16 nAngle );
82  sal_uInt16 GetAngle() const { return mpImplGradient->mnAngle; }
83 
84  void SetBorder( sal_uInt16 nBorder );
85  sal_uInt16 GetBorder() const { return mpImplGradient->mnBorder; }
86  void SetOfsX( sal_uInt16 nOfsX );
87  sal_uInt16 GetOfsX() const { return mpImplGradient->mnOfsX; }
88  void SetOfsY( sal_uInt16 nOfsY );
89  sal_uInt16 GetOfsY() const { return mpImplGradient->mnOfsY; }
90 
91  void SetStartIntensity( sal_uInt16 nIntens );
92  sal_uInt16 GetStartIntensity() const { return mpImplGradient->mnIntensityStart; }
93  void SetEndIntensity( sal_uInt16 nIntens );
94  sal_uInt16 GetEndIntensity() const { return mpImplGradient->mnIntensityEnd; }
95 
96  void SetSteps( sal_uInt16 nSteps );
97  sal_uInt16 GetSteps() const { return mpImplGradient->mnStepCount; }
98 
99  void GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle &rBoundRect, Point& rCenter ) const;
100 
101  Gradient& operator=( const Gradient& rGradient );
102  Gradient& operator=( Gradient&& rGradient );
103  bool operator==( const Gradient& rGradient ) const;
104  bool operator!=( const Gradient& rGradient ) const
105  { return !(Gradient::operator==( rGradient )); }
106 };
107 
108 #endif // INCLUDED_VCL_GRADIENT_HXX
109 
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
GradientStyle GetStyle() const
Definition: gradient.hxx:74
const Color & GetStartColor() const
Definition: gradient.hxx:77
sal_uInt16 GetOfsY() const
Definition: gradient.hxx:89
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
sal_uInt16 GetBorder() const
Definition: gradient.hxx:85
sal_uInt16 mnOfsY
Definition: gradient.hxx:47
bool operator==(const Impl_Gradient &rImpl_Gradient) const
Color maStartColor
Definition: gradient.hxx:42
bool operator!=(const Gradient &rGradient) const
Definition: gradient.hxx:104
GradientStyle
GradientStyle meStyle
Definition: gradient.hxx:41
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:203
sal_uInt16 GetAngle() const
Definition: gradient.hxx:82
Color maEndColor
Definition: gradient.hxx:43
sal_uInt16 GetOfsX() const
Definition: gradient.hxx:87
sal_uInt16 mnBorder
Definition: gradient.hxx:45
sal_uInt16 mnStepCount
Definition: gradient.hxx:50
sal_uInt16 GetEndIntensity() const
Definition: gradient.hxx:94
bool operator==(const Gradient &rGradient) const
sal_uInt16 mnIntensityStart
Definition: gradient.hxx:48
sal_uInt16 GetSteps() const
Definition: gradient.hxx:97
::o3tl::cow_wrapper< Impl_Gradient > mpImplGradient
Definition: gradient.hxx:62
sal_uInt16 mnAngle
Definition: gradient.hxx:44
sal_uInt16 GetStartIntensity() const
Definition: gradient.hxx:92
sal_uInt16 mnOfsX
Definition: gradient.hxx:46
sal_uInt16 mnIntensityEnd
Definition: gradient.hxx:49
const Color & GetEndColor() const
Definition: gradient.hxx:79