Bump version to 6.4-15
[LibreOffice.git] / include / svx / sdr / attribute / sdrallfillattributeshelper.hxx
blob79b2689784da3b3061c1b312e3884ec4299a98cb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_SDR_ATTRIBUTE_SDRALLFILLATTRIBUTESHELPER_HXX
20 #define INCLUDED_SVX_SDR_ATTRIBUTE_SDRALLFILLATTRIBUTESHELPER_HXX
22 #include <svx/svxdllapi.h>
23 #include <drawinglayer/attribute/fillgradientattribute.hxx>
24 #include <drawinglayer/attribute/sdrfillattribute.hxx>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <svl/itemset.hxx>
27 #include <memory>
29 //////////////////////////////////////////////////////////////////////////////
31 class Color;
33 namespace drawinglayer
35 namespace attribute
37 class SVX_DLLPUBLIC SdrAllFillAttributesHelper
39 private:
40 basegfx::B2DRange maLastPaintRange;
41 basegfx::B2DRange maLastDefineRange;
42 std::shared_ptr< drawinglayer::attribute::SdrFillAttribute > maFillAttribute;
43 std::shared_ptr< drawinglayer::attribute::FillGradientAttribute > maFillGradientAttribute;
44 drawinglayer::primitive2d::Primitive2DContainer maPrimitives;
46 void createPrimitive2DSequence(
47 const basegfx::B2DRange& rPaintRange,
48 const basegfx::B2DRange& rDefineRange);
50 public:
51 SdrAllFillAttributesHelper(const Color& rColor);
52 SdrAllFillAttributesHelper(const SfxItemSet& rSet);
53 ~SdrAllFillAttributesHelper();
55 bool isUsed() const;
56 bool hasSdrFillAttribute() const { return maFillAttribute.get(); }
57 bool isTransparent() const;
59 const drawinglayer::attribute::SdrFillAttribute& getFillAttribute() const;
60 const drawinglayer::attribute::FillGradientAttribute& getFillGradientAttribute() const;
61 const drawinglayer::primitive2d::Primitive2DContainer& getPrimitive2DSequence(
62 const basegfx::B2DRange& rPaintRange,
63 const basegfx::B2DRange& rDefineRange) const;
65 // get average fill color; tries to calculate a 'medium' color
66 // which e.g. may be used as comparison to decide if other
67 // colors are visible
68 basegfx::BColor getAverageColor(const basegfx::BColor& rFallback) const;
70 // return if a repaint of this content needs a complete repaint. This
71 // is e.g. not needed for no fill or color fill (a partial repaint
72 // will do the trick), but necessary for everything that is not top-left
73 // oriented
74 bool needCompleteRepaint() const;
76 } // end of namespace attribute
77 } // end of namespace drawinglayer
79 //////////////////////////////////////////////////////////////////////////////
81 namespace drawinglayer
83 namespace attribute
85 typedef std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr;
86 } // end of namespace attribute
87 } // end of namespace drawinglayer
89 //////////////////////////////////////////////////////////////////////////////
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */