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 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
23 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
24 
25 #include <drawinglayer/drawinglayerdllapi.h>
26 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
27 #include <basegfx/color/bcolormodifier.hxx>
28 
29 //////////////////////////////////////////////////////////////////////////////
30 
31 namespace drawinglayer
32 {
33     namespace primitive2d
34     {
35         /** ModifiedColorPrimitive2D class
36 
37             This primitive is a grouping primitive and allows to define
38             how the colors of it's child content shall be modified for
39             visualisation. This can be (and is) used e.g. for generic shadow
40             visualisation by forcing all color usages of the contained
41             sub-content to the shadow color.
42 
43             For the possibilities of color modifications, please refer
44             to the basegfx::BColorModifier definitions in basegfx. For
45             processing there is tooling in basegfx to build a stack of
46             BColorModifierSharedPtrs to always be able to proccess the correct
47             colors.
48 
49             If a renderer does not handle this primitive, the content will
50             be visualized unchanged.
51          */
52         class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive2D : public GroupPrimitive2D
53         {
54         private:
55             /// The ColorModifier to use
56             basegfx::BColorModifierSharedPtr        maColorModifier;
57 
58         public:
59             /// constructor
60             ModifiedColorPrimitive2D(
61                 const Primitive2DSequence& rChildren,
62                 const basegfx::BColorModifierSharedPtr& rColorModifier);
63 
64             /// data read access
getColorModifier() const65             const basegfx::BColorModifierSharedPtr& getColorModifier() const { return maColorModifier; }
66 
67             /// compare operator
68             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
69 
70             /// provide unique ID
71             DeclPrimitrive2DIDBlock()
72         };
73     } // end of namespace primitive2d
74 } // end of namespace drawinglayer
75 
76 //////////////////////////////////////////////////////////////////////////////
77 
78 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
79 
80 //////////////////////////////////////////////////////////////////////////////
81 // eof
82