cid#1607171 Data race condition
[LibreOffice.git] / include / oox / shape / ShapeFilterBase.hxx
blob477060fa6e48898c00d1f957116d5ac6feb35c7e
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_SHAPE_SHAPEFILTERBASE_HXX
21 #define INCLUDED_OOX_SHAPE_SHAPEFILTERBASE_HXX
23 #include <memory>
24 #include <oox/dllapi.h>
25 #include <oox/vml/vmldrawing.hxx>
26 #include <oox/core/xmlfilterbase.hxx>
27 #include <oox/drawingml/drawingmltypes.hxx>
28 #include <com/sun/star/graphic/XGraphicMapper.hpp>
29 #include <rtl/ref.hxx>
30 #include <tools/color.hxx>
32 namespace oox::drawingml::table {
34 class TableStyleList;
35 typedef std::shared_ptr< TableStyleList > TableStyleListPtr;
39 namespace oox::shape {
41 class OOX_DLLPUBLIC ShapeFilterBase final : public core::XmlFilterBase
43 public:
44 typedef rtl::Reference<ShapeFilterBase> Pointer_t;
46 /// @throws css::uno::RuntimeException
47 explicit ShapeFilterBase(
48 const css::uno::Reference< css::uno::XComponentContext >& rxContext );
50 virtual ~ShapeFilterBase() override;
52 /** Has to be implemented by each filter, returns the current theme. */
53 virtual const ::oox::drawingml::Theme* getCurrentTheme() const override;
55 /** May be implemented by filters which handle Diagrams, default returns empty ptr */
56 virtual std::shared_ptr<::oox::drawingml::Theme> getCurrentThemePtr() const override;
58 void setCurrentTheme(const ::oox::drawingml::ThemePtr& pTheme);
60 /** Has to be implemented by each filter to return the collection of VML shapes. */
61 virtual ::oox::vml::Drawing* getVmlDrawing() override;
63 /** Has to be implemented by each filter to return TableStyles. */
64 virtual ::oox::drawingml::table::TableStyleListPtr getTableStyles() override;
66 virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() override;
68 virtual bool importDocument() override { return true; }
69 virtual bool exportDocument() override { return true; }
71 ::Color getSchemeColor( sal_Int32 nToken ) const;
73 void setGraphicMapper(css::uno::Reference<css::graphic::XGraphicMapper> const & rxGraphicMapper)
75 mxGraphicMapper = rxGraphicMapper;
78 private:
79 virtual ::oox::ole::VbaProject* implCreateVbaProject() const override;
80 virtual OUString SAL_CALL getImplementationName() override;
81 virtual GraphicHelper* implCreateGraphicHelper() const override;
83 std::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv;
84 ::oox::drawingml::ThemePtr mpTheme;
85 css::uno::Reference<css::graphic::XGraphicMapper> mxGraphicMapper;
88 } // namespace oox::shape
90 #endif
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */