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