Line data Source code
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 OOX_DRAWINGML_DIAGRAMFRAGMENTHANDLER
21 : #define OOX_DRAWINGML_DIAGRAMFRAGMENTHANDLER
22 :
23 : #include "oox/core/fragmenthandler.hxx"
24 : #include "oox/core/fragmenthandler2.hxx"
25 : #include "oox/drawingml/diagram/diagram.hxx"
26 :
27 : namespace oox { namespace drawingml {
28 :
29 :
30 : class DiagramDataFragmentHandler : public ::oox::core::FragmentHandler
31 : {
32 : public:
33 : DiagramDataFragmentHandler( oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, const DiagramDataPtr pDataPtr ) throw();
34 : virtual ~DiagramDataFragmentHandler() throw();
35 :
36 : virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
37 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
38 :
39 : private:
40 :
41 : DiagramDataPtr mpDataPtr;
42 : };
43 :
44 :
45 :
46 : class DiagramLayoutFragmentHandler : public ::oox::core::FragmentHandler
47 : {
48 : public:
49 : DiagramLayoutFragmentHandler( oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, const DiagramLayoutPtr pDataPtr ) throw();
50 : virtual ~DiagramLayoutFragmentHandler() throw();
51 :
52 : virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
53 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
54 :
55 : private:
56 :
57 : DiagramLayoutPtr mpDataPtr;
58 : };
59 :
60 0 : class DiagramQStylesFragmentHandler : public ::oox::core::FragmentHandler2
61 : {
62 : public:
63 : DiagramQStylesFragmentHandler(
64 : oox::core::XmlFilterBase& rFilter,
65 : const ::rtl::OUString& rFragmentPath,
66 : DiagramQStyleMap& rStylesMap );
67 :
68 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
69 :
70 : virtual void onStartElement( const AttributeList& rAttribs );
71 : virtual void onEndElement();
72 :
73 : private:
74 : ::oox::core::ContextHandlerRef createStyleMatrixContext(sal_Int32 nElement,
75 : const AttributeList& rAttribs,
76 : ShapeStyleRef& o_rStyle);
77 :
78 : ::rtl::OUString maStyleName;
79 : DiagramStyle maStyleEntry;
80 : DiagramQStyleMap& mrStylesMap;
81 : };
82 :
83 0 : class ColorFragmentHandler : public ::oox::core::FragmentHandler2
84 : {
85 : public:
86 : ColorFragmentHandler(
87 : ::oox::core::XmlFilterBase& rFilter,
88 : const ::rtl::OUString& rFragmentPath,
89 : DiagramColorMap& rColorMap );
90 :
91 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
92 :
93 : virtual void onStartElement( const AttributeList& rAttribs );
94 : virtual void onEndElement();
95 :
96 : private:
97 : ::rtl::OUString maColorName;
98 : DiagramColor maColorEntry;
99 : DiagramColorMap& mrColorsMap;
100 : };
101 :
102 : } }
103 :
104 : #endif
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|