xref: /trunk/main/unoxml/source/dom/notationsmap.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef DOM_NOTATIONSMAP_HXX
25 #define DOM_NOTATIONSMAP_HXX
26 
27 #include <sal/types.h>
28 #include <rtl/ref.hxx>
29 
30 #include <com/sun/star/uno/Reference.h>
31 #include <com/sun/star/xml/dom/XNode.hpp>
32 #include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
33 
34 #include <cppuhelper/implbase1.hxx>
35 
36 
37 using ::rtl::OUString;
38 using namespace com::sun::star::uno;
39 using namespace com::sun::star::xml::dom;
40 
41 namespace DOM
42 {
43     class CDocumentType;
44 
45     class CNotationsMap
46         : public cppu::WeakImplHelper1< XNamedNodeMap >
47     {
48     private:
49         ::rtl::Reference<CDocumentType> const m_pDocType;
50         ::osl::Mutex & m_rMutex;
51 
52     public:
53         CNotationsMap(::rtl::Reference<CDocumentType> const& pDocType,
54                 ::osl::Mutex & rMutex);
55 
56         /**
57         The number of nodes in this map.
58         */
59         virtual sal_Int32 SAL_CALL getLength();
60 
61         /**
62         Retrieves a node specified by local name
63         */
64         virtual Reference< XNode > SAL_CALL
65             getNamedItem(OUString const& name);
66 
67         /**
68         Retrieves a node specified by local name and namespace URI.
69         */
70         virtual Reference< XNode > SAL_CALL getNamedItemNS(
71                 OUString const& namespaceURI, OUString const& localName);
72 
73         /**
74         Returns the indexth item in the map.
75         */
76         virtual Reference< XNode > SAL_CALL
77             item(sal_Int32 index);
78 
79         /**
80         Removes a node specified by name.
81         */
82         virtual Reference< XNode > SAL_CALL
83             removeNamedItem(OUString const& name);
84 
85         /**
86         // Removes a node specified by local name and namespace URI.
87         */
88         virtual Reference< XNode > SAL_CALL removeNamedItemNS(
89                 OUString const& namespaceURI, OUString const& localName);
90 
91         /**
92         // Adds a node using its nodeName attribute.
93         */
94         virtual Reference< XNode > SAL_CALL
95             setNamedItem(Reference< XNode > const& arg);
96 
97         /**
98         Adds a node using its namespaceURI and localName.
99         */
100         virtual Reference< XNode > SAL_CALL
101             setNamedItemNS(Reference< XNode > const& arg);
102     };
103 }
104 
105 #endif
106