Bump for 3.6-28
[LibreOffice.git] / xmlscript / source / xmlmod_imexp / imp_share.hxx
blob1ae18d80b57202ff849c4eff65891af0b8153211
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include <xmlscript/xmlmod_imexp.hxx>
31 #include <cppuhelper/implbase1.hxx>
32 #include <rtl/ustrbuf.hxx>
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/container/XNameContainer.hpp>
36 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/awt/XControlModel.hpp>
39 #include <com/sun/star/awt/FontDescriptor.hpp>
41 #include <com/sun/star/xml/input/XRoot.hpp>
43 #include <vector>
45 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
48 using namespace ::rtl;
49 using namespace ::std;
50 using namespace ::com::sun::star;
51 using namespace ::com::sun::star::uno;
53 namespace xmlscript
56 //==================================================================================================
57 // Script module import
59 //==================================================================================================
60 struct ModuleImport
61 : public ::cppu::WeakImplHelper1< xml::input::XRoot >
63 friend class ModuleElement;
65 ModuleDescriptor& mrModuleDesc;
67 sal_Int32 XMLNS_SCRIPT_UID;
68 sal_Int32 XMLNS_LIBRARY_UID;
69 sal_Int32 XMLNS_XLINK_UID;
71 public:
72 inline ModuleImport( ModuleDescriptor& rModuleDesc )
73 SAL_THROW(())
74 : mrModuleDesc( rModuleDesc ) {}
75 virtual ~ModuleImport()
76 SAL_THROW(());
78 // XRoot
79 virtual void SAL_CALL startDocument(
80 Reference< xml::input::XNamespaceMapping > const & xNamespaceMapping )
81 throw (xml::sax::SAXException, RuntimeException);
82 virtual void SAL_CALL endDocument()
83 throw (xml::sax::SAXException, RuntimeException);
84 virtual void SAL_CALL processingInstruction(
85 OUString const & rTarget, OUString const & rData )
86 throw (xml::sax::SAXException, RuntimeException);
87 virtual void SAL_CALL setDocumentLocator(
88 Reference< xml::sax::XLocator > const & xLocator )
89 throw (xml::sax::SAXException, RuntimeException);
90 virtual Reference< xml::input::XElement > SAL_CALL startRootElement(
91 sal_Int32 nUid, OUString const & rLocalName,
92 Reference< xml::input::XAttributes > const & xAttributes )
93 throw (xml::sax::SAXException, RuntimeException);
96 //==================================================================================================
97 class ModuleElement
98 : public ::cppu::WeakImplHelper1< xml::input::XElement >
100 protected:
101 ModuleImport * _pImport;
102 ModuleElement * _pParent;
104 OUString _aLocalName;
105 Reference< xml::input::XAttributes > _xAttributes;
106 ::rtl::OUStringBuffer _StrBuffer;
108 public:
109 ModuleElement(
110 OUString const & rLocalName,
111 Reference< xml::input::XAttributes > const & xAttributes,
112 ModuleElement * pParent, ModuleImport * pImport )
113 SAL_THROW(());
114 virtual ~ModuleElement()
115 SAL_THROW(());
117 // XElement
118 virtual Reference< xml::input::XElement > SAL_CALL getParent()
119 throw (RuntimeException);
120 virtual OUString SAL_CALL getLocalName()
121 throw (RuntimeException);
122 virtual sal_Int32 SAL_CALL getUid()
123 throw (RuntimeException);
124 virtual Reference< xml::input::XAttributes > SAL_CALL getAttributes()
125 throw (RuntimeException);
126 virtual void SAL_CALL ignorableWhitespace(
127 OUString const & rWhitespaces )
128 throw (xml::sax::SAXException, RuntimeException);
129 virtual void SAL_CALL characters( OUString const & rChars )
130 throw (xml::sax::SAXException, RuntimeException);
131 virtual void SAL_CALL processingInstruction(
132 OUString const & rTarget, OUString const & rData )
133 throw (xml::sax::SAXException, RuntimeException);
134 virtual void SAL_CALL endElement()
135 throw (xml::sax::SAXException, RuntimeException);
136 virtual Reference< xml::input::XElement > SAL_CALL startChildElement(
137 sal_Int32 nUid, OUString const & rLocalName,
138 Reference< xml::input::XAttributes > const & xAttributes )
139 throw (xml::sax::SAXException, RuntimeException);
142 //==================================================================================================
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */