1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: apiaccessobj.inl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 //-----------------------------------------------------------------------------
37 //========================================================================
39 //========================================================================
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 template <class NodeClass>
46 OInnerElement<NodeClass>::OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
47 : m_pUnoThis(pUnoThis)
51 m_rTree.setNodeInstance(aNode,pUnoThis);
52 m_rTree.getUnoInstance()->acquire();
55 template <class NodeClass>
56 OInnerElement<NodeClass>::~OInnerElement()
58 m_rTree.getUnoInstance()->release();
60 //-----------------------------------------------------------------------------
62 template <class NodeClass>
63 configuration::NodeRef OInnerElement<NodeClass>::doGetNode() const
67 //-----------------------------------------------------------------------------
69 template <class NodeClass>
70 ApiTreeImpl& OInnerElement<NodeClass>::getApiTree() const
74 //-----------------------------------------------------------------------------
76 template <class NodeClass>
77 uno::XInterface* OInnerElement<NodeClass>::doGetUnoInstance() const
81 //-----------------------------------------------------------------------------
83 template <class NodeClass>
84 ServiceImplementationInfo const* OInnerElement<NodeClass>::doGetServiceInfo() const
86 return s_pServiceInfo;
88 //-----------------------------------------------------------------------------
90 template <class NodeClass>
91 ServiceImplementationInfo const* OInnerElement<NodeClass>::getStaticServiceInfo()
93 return s_pServiceInfo;
95 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
101 template <class NodeClass>
102 configuration::NodeRef OSetElement<NodeClass>::doGetNode() const
104 return m_aTree.getTree()->getRootNode();
106 //-----------------------------------------------------------------------------
108 template <class NodeClass>
109 ApiTreeImpl& OSetElement<NodeClass>::getApiTree() const
113 //-----------------------------------------------------------------------------
115 template <class NodeClass>
116 uno::XInterface* OSetElement<NodeClass>::doGetUnoInstance() const
118 return m_aTree.getUnoInstance();
120 //-----------------------------------------------------------------------------
122 template <class NodeClass>
123 ServiceImplementationInfo const* OSetElement<NodeClass>::doGetServiceInfo() const
125 return s_pServiceInfo;
127 //-----------------------------------------------------------------------------
129 template <class NodeClass>
130 ServiceImplementationInfo const* OSetElement<NodeClass>::getStaticServiceInfo()
132 return s_pServiceInfo;
134 //-----------------------------------------------------------------------------
136 //-----------------------------------------------------------------------------
137 // Read-only Root Elements
138 //-----------------------------------------------------------------------------
140 template <class NodeClass>
141 configuration::NodeRef OReadRootElement<NodeClass>::doGetNode() const
143 return m_aRootTree.getApiTree().getTree()->getRootNode();
145 //-----------------------------------------------------------------------------
147 template <class NodeClass>
148 ApiTreeImpl& OReadRootElement<NodeClass>::getApiTree() const
150 return m_aRootTree.getApiTree();
152 //-----------------------------------------------------------------------------
154 template <class NodeClass>
155 ApiRootTreeImpl& OReadRootElement<NodeClass>::getRootTree()
159 //-----------------------------------------------------------------------------
161 template <class NodeClass>
162 uno::XInterface* OReadRootElement<NodeClass>::doGetUnoInstance() const
164 return m_aRootTree.getApiTree().getUnoInstance();
166 //-----------------------------------------------------------------------------
168 template <class NodeClass>
169 ServiceImplementationInfo const* OReadRootElement<NodeClass>::doGetServiceInfo() const
171 return s_pServiceInfo;
173 //-----------------------------------------------------------------------------
175 template <class NodeClass>
176 ServiceImplementationInfo const* OReadRootElement<NodeClass>::getStaticServiceInfo()
178 return s_pServiceInfo;
180 //-----------------------------------------------------------------------------
182 //-----------------------------------------------------------------------------
183 // Update Root Elements
184 //-----------------------------------------------------------------------------
186 template <class NodeClass>
187 configuration::NodeRef OUpdateRootElement<NodeClass>::doGetNode() const
189 return m_aRootTree.getApiTree().getTree()->getRootNode();
191 //-----------------------------------------------------------------------------
193 template <class NodeClass>
194 ApiTreeImpl& OUpdateRootElement<NodeClass>::getApiTree() const
196 return m_aRootTree.getApiTree();
198 //-----------------------------------------------------------------------------
200 template <class NodeClass>
201 ApiRootTreeImpl& OUpdateRootElement<NodeClass>::getRootTree()
205 //-----------------------------------------------------------------------------
207 template <class NodeClass>
208 uno::XInterface* OUpdateRootElement<NodeClass>::doGetUnoInstance() const
210 return m_aRootTree.getApiTree().getUnoInstance();
212 //-----------------------------------------------------------------------------
214 template <class NodeClass>
215 ServiceImplementationInfo const* OUpdateRootElement<NodeClass>::doGetServiceInfo() const
217 return s_pServiceInfo;
219 //-----------------------------------------------------------------------------
221 template <class NodeClass>
222 ServiceImplementationInfo const* OUpdateRootElement<NodeClass>::getStaticServiceInfo()
224 return s_pServiceInfo;
226 //-----------------------------------------------------------------------------
228 //========================================================================
230 //========================================================================
232 //-----------------------------------------------------------------------------
234 //-----------------------------------------------------------------------------
236 template class OInnerElement<NodeGroupInfoAccess>; // OInnerGroupInfoAccess
237 template class OInnerElement<NodeGroupAccess>; // OInnerGroupUpdateAccess
238 template class OInnerElement<NodeSetInfoAccess>; // OInnerSetInfoAccess
239 template class OInnerElement<NodeTreeSetAccess>; // OInnerTreeSetUpdateAccess
240 template class OInnerElement<NodeValueSetAccess>; // OInnerValueSetUpdateAccess
242 //-----------------------------------------------------------------------------
244 //-----------------------------------------------------------------------------
245 template class OSetElement<NodeGroupInfoAccess>; // OSetElementGroupInfoAccess
246 template class OSetElement<NodeGroupAccess>; // OSetElementGroupUpdateAccess
247 template class OSetElement<NodeSetInfoAccess>; // OSetElementSetInfoAccess
248 template class OSetElement<NodeTreeSetAccess>; // OSetElementTreeSetUpdateAccess
249 template class OSetElement<NodeValueSetAccess>; // OSetElementValueSetUpdateAccess
251 //-----------------------------------------------------------------------------
253 //-----------------------------------------------------------------------------
255 template class OReadRootElement<NodeGroupInfoAccess>; // ORootElementGroupInfoAccess
256 template class OUpdateRootElement<NodeGroupAccess>; // ORootElementGroupUpdateAccess
257 template class OReadRootElement<NodeSetInfoAccess>; // ORootElementSetInfoAccess
258 template class OUpdateRootElement<NodeTreeSetAccess>; // ORootElementTreeSetUpdateAccess
259 template class OUpdateRootElement<NodeValueSetAccess>; // ORootElementValueSetUpdateAccess
261 //-----------------------------------------------------------------------------