LibreOffice Module unoxml (master) 1
entity.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 <libxml/tree.h>
23
24#include <sal/types.h>
25
26#include <com/sun/star/uno/Reference.h>
27#include <com/sun/star/xml/dom/XEntity.hpp>
28
30#include <node.hxx>
31
32namespace DOM
33{
34 typedef ::cppu::ImplInheritanceHelper< CNode, css::xml::dom::XEntity > CEntity_Base;
35
36 class CEntity
37 : public CEntity_Base
38 {
39 private:
40 friend class CDocument;
41
42 xmlEntityPtr m_aEntityPtr;
43
44 CEntity(CDocument const& rDocument, ::osl::Mutex const& rMutex,
45 xmlEntityPtr const pEntity);
46
47 public:
48 virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const nodeType,
49 css::xml::dom::NodeType const*) override;
50
54 virtual OUString SAL_CALL getNotationName() override;
55
59 virtual OUString SAL_CALL getPublicId() override;
60
64 virtual OUString SAL_CALL getSystemId() override;
65
66 // ---- resolve uno inheritance problems...
67 // overrides for XNode base
68 virtual OUString SAL_CALL getNodeName() override;
69 virtual OUString SAL_CALL getNodeValue() override;
70 // --- delegation for XNode base.
71 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode >& newChild) override
72 {
73 return CNode::appendChild(newChild);
74 }
75 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep) override
76 {
77 return CNode::cloneNode(deep);
78 }
79 virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes() override
80 {
81 return CNode::getAttributes();
82 }
83 virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes() override
84 {
85 return CNode::getChildNodes();
86 }
87 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild() override
88 {
89 return CNode::getFirstChild();
90 }
91 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild() override
92 {
93 return CNode::getLastChild();
94 }
95 virtual OUString SAL_CALL getLocalName() override
96 {
97 return CNode::getLocalName();
98 }
99 virtual OUString SAL_CALL getNamespaceURI() override
100 {
101 return CNode::getNamespaceURI();
102 }
103 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling() override
104 {
105 return CNode::getNextSibling();
106 }
107 virtual css::xml::dom::NodeType SAL_CALL getNodeType() override
108 {
109 return CNode::getNodeType();
110 }
111 virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument() override
112 {
113 return CNode::getOwnerDocument();
114 }
115 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode() override
116 {
117 return CNode::getParentNode();
118 }
119 virtual OUString SAL_CALL getPrefix() override
120 {
121 return CNode::getPrefix();
122 }
123 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling() override
124 {
125 return CNode::getPreviousSibling();
126 }
127 virtual sal_Bool SAL_CALL hasAttributes() override
128 {
129 return CNode::hasAttributes();
130 }
131 virtual sal_Bool SAL_CALL hasChildNodes() override
132 {
133 return CNode::hasChildNodes();
134 }
135 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore(
136 const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& refChild) override
137 {
138 return CNode::insertBefore(newChild, refChild);
139 }
140 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) override
141 {
142 return CNode::isSupported(feature, ver);
143 }
144 virtual void SAL_CALL normalize() override
145 {
146 CNode::normalize();
147 }
148 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild) override
149 {
150 return CNode::removeChild(oldChild);
151 }
152 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild(
153 const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& oldChild) override
154 {
155 return CNode::replaceChild(newChild, oldChild);
156 }
157 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) override
158 {
159 return CNode::setNodeValue(nodeValue);
160 }
161 virtual void SAL_CALL setPrefix(const OUString& prefix) override
162 {
163 return CNode::setPrefix(prefix);
164 }
165
166
167 };
168}
169
170/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getPublicId() override
The public identifier associated with the entity, if specified.
Definition: entity.cxx:68
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild(const css::uno::Reference< css::xml::dom::XNode > &newChild, const css::uno::Reference< css::xml::dom::XNode > &oldChild) override
Definition: entity.hxx:152
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep) override
Definition: entity.hxx:75
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild() override
Definition: entity.hxx:87
virtual sal_Bool SAL_CALL hasAttributes() override
Definition: entity.hxx:127
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling() override
Definition: entity.hxx:123
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes() override
Definition: entity.hxx:83
virtual OUString SAL_CALL getPrefix() override
Definition: entity.hxx:119
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode() override
Definition: entity.hxx:115
virtual void SAL_CALL normalize() override
Definition: entity.hxx:144
virtual sal_Bool SAL_CALL hasChildNodes() override
Definition: entity.hxx:131
xmlEntityPtr m_aEntityPtr
Definition: entity.hxx:42
virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes() override
Definition: entity.hxx:79
virtual OUString SAL_CALL getNodeValue() override
Definition: entity.cxx:106
virtual OUString SAL_CALL getNamespaceURI() override
Definition: entity.hxx:99
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode > &oldChild) override
Definition: entity.hxx:148
virtual css::xml::dom::NodeType SAL_CALL getNodeType() override
Definition: entity.hxx:107
virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const nodeType, css::xml::dom::NodeType const *) override
Definition: entity.cxx:40
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore(const css::uno::Reference< css::xml::dom::XNode > &newChild, const css::uno::Reference< css::xml::dom::XNode > &refChild) override
Definition: entity.hxx:135
virtual OUString SAL_CALL getNodeName() override
Definition: entity.cxx:94
virtual OUString SAL_CALL getNotationName() override
For unparsed entities, the name of the notation for the entity.
Definition: entity.cxx:58
virtual void SAL_CALL setNodeValue(const OUString &nodeValue) override
Definition: entity.hxx:157
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild() override
Definition: entity.hxx:91
virtual void SAL_CALL setPrefix(const OUString &prefix) override
Definition: entity.hxx:161
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling() override
Definition: entity.hxx:103
virtual sal_Bool SAL_CALL isSupported(const OUString &feature, const OUString &ver) override
Definition: entity.hxx:140
virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument() override
Definition: entity.hxx:111
virtual OUString SAL_CALL getLocalName() override
Definition: entity.hxx:95
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode > &newChild) override
Definition: entity.hxx:71
virtual OUString SAL_CALL getSystemId() override
The system identifier associated with the entity, if specified.
Definition: entity.cxx:83
CEntity(CDocument const &rDocument, ::osl::Mutex const &rMutex, xmlEntityPtr const pEntity)
Definition: entity.cxx:32
Definition: attr.cxx:38
::cppu::ImplInheritanceHelper< CNode, css::xml::dom::XEntity > CEntity_Base
Definition: entity.hxx:34
unsigned char sal_Bool