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 <tools/color.hxx>
25#include <tools/degree.hxx>
26#include <tools/long.hxx>
27#include <o3tl/cow_wrapper.hxx>
28
29#include <vcl/dllapi.h>
30#include <vcl/vclenum.hxx>
31#include <com/sun/star/awt/GradientStyle.hpp>
32
33namespace tools { class Rectangle; }
34
35class Point;
36class SvStream;
37class GDIMetaFile;
38
40{
41private:
42 class Impl;
44
45public:
47 Gradient( const Gradient& rGradient );
48 Gradient( Gradient&& rGradient );
49 Gradient( css::awt::GradientStyle eStyle,
50 const Color& rStartColor,
51 const Color& rEndColor );
53
54 void SetStyle( css::awt::GradientStyle eStyle );
55 css::awt::GradientStyle GetStyle() const;
56
57 void SetStartColor( const Color& rColor );
58 const Color& GetStartColor() const;
59 void SetEndColor( const Color& rColor );
60 const Color& GetEndColor() const;
61 void MakeGrayscale();
62
63 void SetAngle( Degree10 nAngle );
64 Degree10 GetAngle() const;
65
66 void SetBorder( sal_uInt16 nBorder );
67 sal_uInt16 GetBorder() const;
68 void SetOfsX( sal_uInt16 nOfsX );
69 sal_uInt16 GetOfsX() const;
70 void SetOfsY( sal_uInt16 nOfsY );
71 sal_uInt16 GetOfsY() const;
72
73 void SetStartIntensity( sal_uInt16 nIntens );
74 sal_uInt16 GetStartIntensity() const;
75 void SetEndIntensity( sal_uInt16 nIntens );
76 sal_uInt16 GetEndIntensity() const;
77
78 void SetSteps( sal_uInt16 nSteps );
79 sal_uInt16 GetSteps() const;
80
81 void GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle &rBoundRect, Point& rCenter ) const;
82
83 void AddGradientActions(tools::Rectangle const& rRect, GDIMetaFile& rMetaFile);
84
85 Gradient& operator=( const Gradient& rGradient );
86 Gradient& operator=( Gradient&& rGradient );
87 bool operator==( const Gradient& rGradient ) const;
88 bool operator!=( const Gradient& rGradient ) const
89 { return !(Gradient::operator==( rGradient )); }
90
91private:
92 tools::Long GetMetafileSteps(tools::Rectangle const& rRect) const;
93
94 void DrawComplexGradientToMetafile(tools::Rectangle const& rRect, GDIMetaFile& rMetaFile) const;
95 void DrawLinearGradientToMetafile(tools::Rectangle const& rRect, GDIMetaFile& rMetaFile) const;
96};
97
98#endif // INCLUDED_VCL_GRADIENT_HXX
99
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Gradient(Gradient &&rGradient)
bool operator!=(const Gradient &rGradient) const
Definition: gradient.hxx:88
Gradient & operator=(Gradient &&rGradient)
bool operator==(const Gradient &rGradient) const
Gradient & operator=(const Gradient &rGradient)
::o3tl::cow_wrapper< Impl > mpImplGradient
Definition: gradient.hxx:42
Gradient(const Gradient &rGradient)
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
long Long
SVXCORE_DLLPUBLIC Degree100 GetAngle(const Point &rPnt)
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:175