Bump version to 6.0-36
[LibreOffice.git] / xmlsecurity / source / framework / buffernode.hxx
blob150b47e3dabd60fc8ed83173cafecf54467e4265
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 #ifndef INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_BUFFERNODE_HXX
21 #define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_BUFFERNODE_HXX
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
26 #include <vector>
28 class ElementMark;
29 class ElementCollector;
31 class BufferNode final
32 /****** buffernode.hxx/CLASS BufferNode ***************************************
34 * NAME
35 * BufferNode -- Class to maintain the tree of bufferred elements
37 * FUNCTION
38 * One BufferNode object represents a bufferred element in the document
39 * wrapper component.
40 * All BufferNode objects construct a tree which has the same structure
41 * of all bufferred elements. That is to say, if one bufferred element is
42 * an ancestor of another bufferred element, then the corresponding
43 * BufferNode objects are also in ancestor/descendant relationship.
44 * This class is used to manipulate the tree of bufferred elements.
45 ******************************************************************************/
47 private:
48 /* the parent BufferNode */
49 BufferNode* m_pParent;
51 /* all child BufferNodes */
52 std::vector< const BufferNode* > m_vChildren;
54 /* all ElementCollector holding this BufferNode */
55 std::vector< const ElementCollector* > m_vElementCollectors;
58 * the blocker holding this BufferNode, one BufferNode can have one
59 * blocker at most
61 ElementMark* m_pBlocker;
64 * whether the element has completely bufferred by the document wrapper
65 * component
67 bool m_bAllReceived;
69 /* the XMLElementWrapper of the bufferred element */
70 css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > m_xXMLElement;
72 private:
73 bool isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const;
74 bool isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurityId) const;
75 bool isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const;
76 const BufferNode* getNextChild(const BufferNode* pChild) const;
78 public:
79 explicit BufferNode(
80 const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& xXMLElement);
82 bool isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const;
83 void setReceivedAll();
84 bool isAllReceived() const { return m_bAllReceived;}
85 void addElementCollector(const ElementCollector* pElementCollector);
86 void removeElementCollector(const ElementCollector* pElementCollector);
87 ElementMark* getBlocker() const { return m_pBlocker;}
88 void setBlocker(const ElementMark* pBlocker);
89 OUString printChildren() const;
90 bool hasAnything() const;
91 bool hasChildren() const;
92 std::vector< const BufferNode* >* getChildren() const;
93 const BufferNode* getFirstChild() const;
94 void addChild(const BufferNode* pChild, sal_Int32 nPosition);
95 void addChild(const BufferNode* pChild);
96 void removeChild(const BufferNode* pChild);
97 sal_Int32 indexOfChild(const BufferNode* pChild) const;
98 const BufferNode* getParent() const { return m_pParent;}
99 void setParent(const BufferNode* pParent);
100 const BufferNode* getNextSibling() const;
101 const BufferNode* isAncestor(const BufferNode* pDescendant) const;
102 bool isPrevious(const BufferNode* pFollowing) const;
103 const BufferNode* getNextNodeByTreeOrder() const;
104 const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& getXMLElement() const { return m_xXMLElement;}
105 void setXMLElement(const css::uno::Reference<
106 css::xml::wrapper::XXMLElementWrapper >& xXMLElement);
107 void notifyBranch();
108 void elementCollectorNotify();
109 void freeAllChildren();
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */