1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imp_share.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <xmlscript/xmlmod_imexp.hxx>
33 #include <cppuhelper/implbase1.hxx>
34 #include <rtl/ustrbuf.hxx>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/container/XNameContainer.hpp>
38 #include <com/sun/star/beans/XPropertySet.hpp>
40 #include <com/sun/star/awt/XControlModel.hpp>
41 #include <com/sun/star/awt/FontDescriptor.hpp>
43 #include <com/sun/star/xml/input/XRoot.hpp>
47 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
50 using namespace ::rtl
;
51 using namespace ::std
;
52 using namespace ::com::sun::star
;
53 using namespace ::com::sun::star::uno
;
58 //==================================================================================================
59 // Script module import
61 //==================================================================================================
63 : public ::cppu::WeakImplHelper1
< xml::input::XRoot
>
65 friend class ModuleElement
;
67 ModuleDescriptor
& mrModuleDesc
;
69 sal_Int32 XMLNS_SCRIPT_UID
;
70 sal_Int32 XMLNS_LIBRARY_UID
;
71 sal_Int32 XMLNS_XLINK_UID
;
74 inline ModuleImport( ModuleDescriptor
& rModuleDesc
)
76 : mrModuleDesc( rModuleDesc
) {}
77 virtual ~ModuleImport()
81 virtual void SAL_CALL
startDocument(
82 Reference
< xml::input::XNamespaceMapping
> const & xNamespaceMapping
)
83 throw (xml::sax::SAXException
, RuntimeException
);
84 virtual void SAL_CALL
endDocument()
85 throw (xml::sax::SAXException
, RuntimeException
);
86 virtual void SAL_CALL
processingInstruction(
87 OUString
const & rTarget
, OUString
const & rData
)
88 throw (xml::sax::SAXException
, RuntimeException
);
89 virtual void SAL_CALL
setDocumentLocator(
90 Reference
< xml::sax::XLocator
> const & xLocator
)
91 throw (xml::sax::SAXException
, RuntimeException
);
92 virtual Reference
< xml::input::XElement
> SAL_CALL
startRootElement(
93 sal_Int32 nUid
, OUString
const & rLocalName
,
94 Reference
< xml::input::XAttributes
> const & xAttributes
)
95 throw (xml::sax::SAXException
, RuntimeException
);
98 //==================================================================================================
100 : public ::cppu::WeakImplHelper1
< xml::input::XElement
>
103 ModuleImport
* _pImport
;
104 ModuleElement
* _pParent
;
106 OUString _aLocalName
;
107 Reference
< xml::input::XAttributes
> _xAttributes
;
108 ::rtl::OUStringBuffer _StrBuffer
;
112 OUString
const & rLocalName
,
113 Reference
< xml::input::XAttributes
> const & xAttributes
,
114 ModuleElement
* pParent
, ModuleImport
* pImport
)
116 virtual ~ModuleElement()
120 virtual Reference
< xml::input::XElement
> SAL_CALL
getParent()
121 throw (RuntimeException
);
122 virtual OUString SAL_CALL
getLocalName()
123 throw (RuntimeException
);
124 virtual sal_Int32 SAL_CALL
getUid()
125 throw (RuntimeException
);
126 virtual Reference
< xml::input::XAttributes
> SAL_CALL
getAttributes()
127 throw (RuntimeException
);
128 virtual void SAL_CALL
ignorableWhitespace(
129 OUString
const & rWhitespaces
)
130 throw (xml::sax::SAXException
, RuntimeException
);
131 virtual void SAL_CALL
characters( OUString
const & rChars
)
132 throw (xml::sax::SAXException
, RuntimeException
);
133 virtual void SAL_CALL
processingInstruction(
134 OUString
const & rTarget
, OUString
const & rData
)
135 throw (xml::sax::SAXException
, RuntimeException
);
136 virtual void SAL_CALL
endElement()
137 throw (xml::sax::SAXException
, RuntimeException
);
138 virtual Reference
< xml::input::XElement
> SAL_CALL
startChildElement(
139 sal_Int32 nUid
, OUString
const & rLocalName
,
140 Reference
< xml::input::XAttributes
> const & xAttributes
)
141 throw (xml::sax::SAXException
, RuntimeException
);
144 //==================================================================================================