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 INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX
21 : #define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX
22 :
23 : #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
24 : #include <svgio/svgreader/svgdocument.hxx>
25 :
26 : namespace svgio { namespace svgreader { class SvgCharacterNode; }}
27 :
28 : namespace svgio
29 : {
30 : namespace svgreader
31 : {
32 : class SvgDocHdl : public cppu::WeakImplHelper1< com::sun::star::xml::sax::XDocumentHandler >
33 : {
34 : private:
35 : // the complete SVG Document
36 : SvgDocument maDocument;
37 :
38 : // current node for parsing
39 : SvgNode* mpTarget;
40 :
41 : // text collector string stack for css styles
42 : std::vector< OUString > maCssContents;
43 :
44 : bool bSkip;
45 :
46 : public:
47 : SvgDocHdl(const OUString& rAbsolutePath);
48 : virtual ~SvgDocHdl();
49 :
50 : // Methods XDocumentHandler
51 : virtual void SAL_CALL startDocument( ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
52 : virtual void SAL_CALL endDocument( ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
53 : virtual void SAL_CALL startElement( const OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
54 : virtual void SAL_CALL endElement( const OUString& aName ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
55 : virtual void SAL_CALL characters( const OUString& aChars ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
56 : virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
57 : virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
58 : virtual void SAL_CALL setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator ) throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
59 :
60 299 : const SvgDocument& getSvgDocument() const { return maDocument; }
61 : };
62 : } // end of namespace svgreader
63 : } // end of namespace svgio
64 :
65 : #endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX
66 :
67 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|