LibreOffice Module xmloff (master)  1
xmlbasicscript.hxx
Go to the documentation of this file.
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 #pragma once
21 
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>
29 
30 namespace xmloff
31 {
33 {
34 protected:
35  static bool
36  getBoolAttr(bool* pRet, sal_Int32 nToken,
37  const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttributes);
38 
39 public:
40  BasicElementBase(SvXMLImport& rImport);
41 };
42 
44 {
45 private:
46  css::uno::Reference<css::script::XLibraryContainer2> m_xLibContainer;
47 
48 public:
50  const css::uno::Reference<css::frame::XModel>& rxModel);
51 
52  virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext(
53  sal_Int32 Element,
54  const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs) override;
55 };
56 
58 {
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;
64 
65 public:
67  SvXMLImport& rImport,
68  const css::uno::Reference<css::script::XLibraryContainer2>& rxLibContainer,
69  const OUString& rLibName, bool bReadOnly);
70 
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;
75 };
76 
78 {
79 private:
80  css::uno::Reference<css::container::XNameContainer> m_xLib;
81  OUString const m_aName;
82 
83 public:
85  const css::uno::Reference<css::container::XNameContainer>& rxLib,
86  const OUString& rName);
87 
88  virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext(
89  sal_Int32 Element,
90  const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs) override;
91 };
92 
94 {
95 private:
96  css::uno::Reference<css::container::XNameContainer> m_xLib;
97  OUString const m_aName;
98  OUStringBuffer m_aBuffer;
99 
100 public:
102  const css::uno::Reference<css::container::XNameContainer>& rxLib,
103  const OUString& rName);
104 
105  virtual void SAL_CALL characters(const OUString& rChars) override;
106  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
107 };
108 
109 } // namespace xmloff
110 
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
BasicLibrariesElement(SvXMLImport &rImport, const css::uno::Reference< css::frame::XModel > &rxModel)
css::uno::Reference< css::script::XLibraryContainer2 > m_xLibContainer
css::uno::Reference< css::container::XNameContainer > m_xLib
static bool getBoolAttr(bool *pRet, sal_Int32 nToken, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
css::uno::Reference< css::container::XNameContainer > m_xLib
BasicEmbeddedLibraryElement(SvXMLImport &rImport, const css::uno::Reference< css::script::XLibraryContainer2 > &rxLibContainer, const OUString &rLibName, bool bReadOnly)
BasicElementBase(SvXMLImport &rImport)
css::uno::Reference< css::script::XLibraryContainer2 > m_xLibContainer
css::uno::Reference< css::container::XNameContainer > m_xLib
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
DefTokenId nToken
BasicSourceCodeElement(SvXMLImport &rImport, const css::uno::Reference< css::container::XNameContainer > &rxLib, const OUString &rName)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
BasicModuleElement(SvXMLImport &rImport, const css::uno::Reference< css::container::XNameContainer > &rxLib, const OUString &rName)
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override