1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <com/sun/star/frame/XModel.hpp>
23 #include <com/sun/star/script/XLibraryContainer2.hpp>
24 #include <cppuhelper/implbase.hxx>
25 #include <osl/mutex.hxx>
26 #include <rtl/ustrbuf.hxx>
27 #include <rtl/ref.hxx>
28 #include <xmloff/xmlimp.hxx>
32 class BasicElementBase
: public SvXMLImportContext
36 getBoolAttr(bool* pRet
, sal_Int32 nToken
,
37 const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& xAttributes
);
40 BasicElementBase(SvXMLImport
& rImport
);
43 class BasicLibrariesElement
: public BasicElementBase
46 css::uno::Reference
<css::script::XLibraryContainer2
> m_xLibContainer
;
49 BasicLibrariesElement(SvXMLImport
& rImport
,
50 const css::uno::Reference
<css::frame::XModel
>& rxModel
);
52 virtual css::uno::Reference
<XFastContextHandler
> SAL_CALL
createFastChildContext(
54 const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& Attribs
) override
;
57 class BasicEmbeddedLibraryElement
: public BasicElementBase
60 css::uno::Reference
<css::script::XLibraryContainer2
> m_xLibContainer
;
61 css::uno::Reference
<css::container::XNameContainer
> m_xLib
;
62 OUString
const m_aLibName
;
63 bool const m_bReadOnly
;
66 BasicEmbeddedLibraryElement(
68 const css::uno::Reference
<css::script::XLibraryContainer2
>& rxLibContainer
,
69 OUString aLibName
, bool bReadOnly
);
71 virtual css::uno::Reference
<XFastContextHandler
> SAL_CALL
createFastChildContext(
73 const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& Attribs
) override
;
74 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
77 class BasicModuleElement
: public BasicElementBase
80 css::uno::Reference
<css::container::XNameContainer
> m_xLib
;
81 OUString
const m_aName
;
84 BasicModuleElement(SvXMLImport
& rImport
,
85 const css::uno::Reference
<css::container::XNameContainer
>& rxLib
,
88 virtual css::uno::Reference
<XFastContextHandler
> SAL_CALL
createFastChildContext(
90 const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& Attribs
) override
;
93 class BasicSourceCodeElement
: public BasicElementBase
96 css::uno::Reference
<css::container::XNameContainer
> m_xLib
;
97 OUString
const m_aName
;
98 OUStringBuffer m_aBuffer
;
101 BasicSourceCodeElement(SvXMLImport
& rImport
,
102 const css::uno::Reference
<css::container::XNameContainer
>& rxLib
,
105 virtual void SAL_CALL
characters(const OUString
& rChars
) override
;
106 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
109 } // namespace xmloff
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */