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.hxx,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 ************************************************************************/
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"
45 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 template <class NodeClass
>
53 class OInnerElement
: public InnerElement
, public NodeClass
55 static ServiceImplementationInfo
const*const s_pServiceInfo
;
57 uno::XInterface
* m_pUnoThis
;
59 configuration::NodeRef m_aNode
;
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 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
77 template <class NodeClass
>
78 class OSetElement
: public SetElement
, public NodeClass
80 static ServiceImplementationInfo
const*const s_pServiceInfo
;
82 mutable ApiTreeImpl m_aTree
;
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 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
101 template <class NodeClass
>
102 class OReadRootElement
: public RootElement
, public NodeClass
104 static ServiceImplementationInfo
const*const s_pServiceInfo
;
105 mutable ApiRootTreeImpl m_aRootTree
;
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
;
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_