update dev300-m58
[ooovba.git] / configmgr / source / api2 / apiaccessobj.hxx
blob85832c27aa2511b4400c19fc62cf70520f6f9e5d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: apiaccessobj.hxx,v $
10 * $Revision: 1.13 $
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 ************************************************************************/
31 #ifndef CONFIGMGR_API_ACCESSOBJECTS_HXX_
32 #define CONFIGMGR_API_ACCESSOBJECTS_HXX_
34 #include "apitreeaccess.hxx"
35 #include "apinodeaccess.hxx"
36 #include "apinodeupdate.hxx"
38 #include "apitreeimplobj.hxx"
39 #include "noderef.hxx"
41 #include "apiserviceinfo.hxx"
43 namespace configmgr
45 //-----------------------------------------------------------------------------
46 namespace configapi
48 //-----------------------------------------------------------------------------
49 // Inner Elements
50 //-----------------------------------------------------------------------------
52 template <class NodeClass>
53 class OInnerElement : public InnerElement, public NodeClass
55 static ServiceImplementationInfo const*const s_pServiceInfo;
57 uno::XInterface* m_pUnoThis;
58 ApiTreeImpl& m_rTree;
59 configuration::NodeRef m_aNode;
60 public:
61 inline OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode);
62 inline ~OInnerElement();
64 virtual inline configuration::NodeRef doGetNode() const;
65 virtual inline ApiTreeImpl& getApiTree() const;
67 virtual inline uno::XInterface* doGetUnoInstance() const;
68 virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
70 static inline ServiceImplementationInfo const* getStaticServiceInfo();
73 //-----------------------------------------------------------------------------
74 // Set Elements
75 //-----------------------------------------------------------------------------
77 template <class NodeClass>
78 class OSetElement : public SetElement, public NodeClass
80 static ServiceImplementationInfo const*const s_pServiceInfo;
82 mutable ApiTreeImpl m_aTree;
83 public:
84 OSetElement(uno::XInterface* pUnoThis, rtl::Reference< configuration::Tree > const& aTree, ApiProvider& rProvider, ApiTreeImpl* pParentTree = 0)
85 : m_aTree(pUnoThis, rProvider,aTree,pParentTree)
88 virtual inline configuration::NodeRef doGetNode() const;
89 virtual inline ApiTreeImpl& getApiTree() const;
91 virtual inline uno::XInterface* doGetUnoInstance() const;
92 virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
94 static inline ServiceImplementationInfo const* getStaticServiceInfo();
97 //-----------------------------------------------------------------------------
98 // Root Elements
99 //-----------------------------------------------------------------------------
101 template <class NodeClass>
102 class OReadRootElement : public RootElement, public NodeClass
104 static ServiceImplementationInfo const*const s_pServiceInfo;
105 mutable ApiRootTreeImpl m_aRootTree;
106 public:
107 OReadRootElement(uno::XInterface* pUnoThis, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
108 : m_aRootTree(pUnoThis, rProvider,aTree, _xOptions)
111 virtual inline configuration::NodeRef doGetNode() const;
112 virtual inline ApiTreeImpl& getApiTree() const;
113 virtual inline ApiRootTreeImpl& getRootTree();
115 virtual inline uno::XInterface* doGetUnoInstance() const;
116 virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
118 static inline ServiceImplementationInfo const* getStaticServiceInfo();
120 //-------------------------------------------------------------------------
122 template <class NodeClass>
123 class OUpdateRootElement : public UpdateRootElement, public NodeClass
125 static ServiceImplementationInfo const*const s_pServiceInfo;
127 mutable ApiRootTreeImpl m_aRootTree;
128 public:
129 OUpdateRootElement(uno::XInterface* pUnoThis, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
130 : m_aRootTree(pUnoThis, rProvider,aTree,_xOptions)
133 virtual inline configuration::NodeRef doGetNode() const;
134 virtual inline ApiTreeImpl& getApiTree() const;
135 virtual inline ApiRootTreeImpl& getRootTree();
137 virtual inline uno::XInterface* doGetUnoInstance() const;
138 virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
140 static inline ServiceImplementationInfo const* getStaticServiceInfo();
144 //-----------------------------------------------------------------------------
145 #include "apiaccessobj.inl"
146 //-----------------------------------------------------------------------------
148 #endif // CONFIGMGR_API_ACCESSOBJECTS_HXX_