bump product version to 7.2.5.1
[LibreOffice.git] / oox / inc / drawingml / misccontexts.hxx
blob495b3bce906cd05bbeaea087909953986a677699
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 .
20 #ifndef INCLUDED_OOX_DRAWINGML_MISCCONTEXTS_HXX
21 #define INCLUDED_OOX_DRAWINGML_MISCCONTEXTS_HXX
23 #include <drawingml/colorchoicecontext.hxx>
25 #include <drawingml/fillproperties.hxx>
27 namespace oox::drawingml {
30 /** Context handler that imports the a:solidFill element. */
31 class SolidFillContext final : public ColorContext
33 public:
34 explicit SolidFillContext(
35 ::oox::core::ContextHandler2Helper const & rParent,
36 FillProperties& rFillProps );
40 /** Context handler that imports the a:gradFill element. */
41 class GradientFillContext final : public ::oox::core::ContextHandler2
43 public:
44 explicit GradientFillContext(
45 ::oox::core::ContextHandler2Helper const & rParent,
46 const ::oox::AttributeList& rAttribs,
47 GradientFillProperties& rGradientProps );
49 virtual ::oox::core::ContextHandlerRef
50 onCreateContext(
51 sal_Int32 nElement,
52 const ::oox::AttributeList& rAttribs ) override;
54 private:
55 GradientFillProperties& mrGradientProps;
58 /** Context handler that imports the a:pattFill element. */
59 class PatternFillContext final : public ::oox::core::ContextHandler2
61 public:
62 explicit PatternFillContext(
63 ::oox::core::ContextHandler2Helper const & rParent,
64 const ::oox::AttributeList& rAttribs,
65 PatternFillProperties& rPatternProps );
67 virtual ::oox::core::ContextHandlerRef
68 onCreateContext(
69 sal_Int32 nElement,
70 const ::oox::AttributeList& rAttribs ) override;
72 private:
73 PatternFillProperties& mrPatternProps;
77 /** Context handler that imports a14:imgProps, a14:imgLayer, a14:imgEffect containers
78 and the a14:artistic* effect tags defined in the MS-ODRAWXML extension. */
79 class ArtisticEffectContext final : public ::oox::core::ContextHandler2
81 public:
82 explicit ArtisticEffectContext(
83 ::oox::core::ContextHandler2Helper const & rParent,
84 ArtisticEffectProperties& rEffect );
85 virtual ~ArtisticEffectContext() override;
87 virtual ::oox::core::ContextHandlerRef
88 onCreateContext(
89 sal_Int32 nElement,
90 const ::oox::AttributeList& rAttribs ) override;
92 private:
93 ArtisticEffectProperties& maEffect;
97 /** Context handler that imports the a:extLst element inside a:blip and its
98 children a:ext, which can contain transformations to the bitmap. */
99 class BlipExtensionContext final : public ::oox::core::ContextHandler2
101 public:
102 explicit BlipExtensionContext(
103 ::oox::core::ContextHandler2Helper const & rParent,
104 BlipFillProperties& rBlipProps );
105 virtual ~BlipExtensionContext() override;
107 virtual ::oox::core::ContextHandlerRef
108 onCreateContext(
109 sal_Int32 nElement,
110 const ::oox::AttributeList& rAttribs ) override;
112 private:
113 BlipFillProperties& mrBlipProps;
117 /** Context handler that imports the a:duotone element containing the colors
118 of a bitmap duotone transformation. */
119 class DuotoneContext final : public ::oox::core::ContextHandler2
121 public:
122 explicit DuotoneContext(
123 ::oox::core::ContextHandler2Helper const & rParent,
124 BlipFillProperties& rBlipProps );
125 virtual ~DuotoneContext() override;
127 virtual ::oox::core::ContextHandlerRef
128 onCreateContext(
129 sal_Int32 nElement,
130 const ::oox::AttributeList& rAttribs ) override;
132 private:
133 BlipFillProperties& mrBlipProps;
134 int mnColorIndex;
138 /** Context handler that imports the a:clrChange element containing the colors
139 of a bitmap color change transformation. */
140 class ColorChangeContext final : public ::oox::core::ContextHandler2
142 public:
143 explicit ColorChangeContext(
144 ::oox::core::ContextHandler2Helper const & rParent,
145 const ::oox::AttributeList& rAttribs,
146 BlipFillProperties& rBlipProps );
147 virtual ~ColorChangeContext() override;
149 virtual ::oox::core::ContextHandlerRef
150 onCreateContext(
151 sal_Int32 nElement,
152 const ::oox::AttributeList& rAttribs ) override;
154 private:
155 BlipFillProperties& mrBlipProps;
156 bool mbUseAlpha;
159 /** Context handler that imports the a:blip element containing the fill bitmap
160 and bitmap color transformation settings. */
161 class BlipContext final : public ::oox::core::ContextHandler2
163 public:
164 explicit BlipContext(
165 ::oox::core::ContextHandler2Helper const & rParent,
166 const ::oox::AttributeList& rAttribs,
167 BlipFillProperties& rBlipProps );
169 virtual ::oox::core::ContextHandlerRef
170 onCreateContext(
171 sal_Int32 nElement,
172 const ::oox::AttributeList& rAttribs ) override;
174 private:
175 BlipFillProperties& mrBlipProps;
178 /** Context handler that imports the a:blipFill element. */
179 class BlipFillContext final : public ::oox::core::ContextHandler2
181 public:
182 explicit BlipFillContext(
183 ::oox::core::ContextHandler2Helper const & rParent,
184 const ::oox::AttributeList& rAttribs,
185 BlipFillProperties& rBlipProps );
187 virtual ::oox::core::ContextHandlerRef
188 onCreateContext(
189 sal_Int32 nElement,
190 const ::oox::AttributeList& rAttribs ) override;
192 private:
193 BlipFillProperties& mrBlipProps;
196 /** Context handler for elements that contain a fill property element
197 (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill). */
198 class FillPropertiesContext : public ::oox::core::ContextHandler2
200 public:
201 explicit FillPropertiesContext(
202 ::oox::core::ContextHandler2Helper const & rParent,
203 FillProperties& rFillProps );
205 virtual ::oox::core::ContextHandlerRef
206 onCreateContext(
207 sal_Int32 nElement,
208 const ::oox::AttributeList& rAttribs ) override;
210 static ::oox::core::ContextHandlerRef
211 createFillContext(
212 ::oox::core::ContextHandler2Helper const & rParent,
213 sal_Int32 nElement,
214 const ::oox::AttributeList& rAttribs,
215 FillProperties& rFillProps );
217 private:
218 FillProperties& mrFillProps;
221 /** Context handler for elements that contain a fill property element
222 (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill).
224 This context handler takes a simple color instead of a fill properties
225 struct. The imported fill properties are converted automatically to the
226 best fitting solid color.
228 class SimpleFillPropertiesContext final : private FillProperties, public FillPropertiesContext
230 public:
231 explicit SimpleFillPropertiesContext(
232 ::oox::core::ContextHandler2Helper const & rParent,
233 Color& rColor );
234 virtual ~SimpleFillPropertiesContext() override;
236 private:
237 Color& mrColor;
240 } // namespace oox::drawingml
242 #endif
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */