bump product version to 7.6.3.2-android
[LibreOffice.git] / xmloff / source / script / xmlbasicscript.hxx
blob04dd31211ce5276cbe179d3a7ea73f23767ffb2e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
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>
30 namespace xmloff
32 class BasicElementBase : public SvXMLImportContext
34 protected:
35 static bool
36 getBoolAttr(bool* pRet, sal_Int32 nToken,
37 const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttributes);
39 public:
40 BasicElementBase(SvXMLImport& rImport);
43 class BasicLibrariesElement : public BasicElementBase
45 private:
46 css::uno::Reference<css::script::XLibraryContainer2> m_xLibContainer;
48 public:
49 BasicLibrariesElement(SvXMLImport& rImport,
50 const css::uno::Reference<css::frame::XModel>& rxModel);
52 virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext(
53 sal_Int32 Element,
54 const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs) override;
57 class BasicEmbeddedLibraryElement : public BasicElementBase
59 private:
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;
65 public:
66 BasicEmbeddedLibraryElement(
67 SvXMLImport& rImport,
68 const css::uno::Reference<css::script::XLibraryContainer2>& rxLibContainer,
69 OUString aLibName, bool bReadOnly);
71 virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext(
72 sal_Int32 Element,
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
79 private:
80 css::uno::Reference<css::container::XNameContainer> m_xLib;
81 OUString const m_aName;
83 public:
84 BasicModuleElement(SvXMLImport& rImport,
85 const css::uno::Reference<css::container::XNameContainer>& rxLib,
86 OUString aName);
88 virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext(
89 sal_Int32 Element,
90 const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs) override;
93 class BasicSourceCodeElement : public BasicElementBase
95 private:
96 css::uno::Reference<css::container::XNameContainer> m_xLib;
97 OUString const m_aName;
98 OUStringBuffer m_aBuffer;
100 public:
101 BasicSourceCodeElement(SvXMLImport& rImport,
102 const css::uno::Reference<css::container::XNameContainer>& rxLib,
103 OUString rName);
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: */