merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / api2 / setaccess.hxx
bloba8975ff90d219382e0bf5af043a7c1de8c89927f
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: setaccess.hxx,v $
10 * $Revision: 1.4 $
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_SETACCESS_HXX_
32 #define CONFIGMGR_API_SETACCESS_HXX_
34 #include <com/sun/star/container/XHierarchicalName.hpp>
35 #include <com/sun/star/container/XNameAccess.hpp>
36 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
37 #include <com/sun/star/container/XContainer.hpp>
38 #include <com/sun/star/configuration/XTemplateContainer.hpp>
39 #include <com/sun/star/beans/XExactName.hpp>
40 #include <com/sun/star/beans/XProperty.hpp>
41 #include <com/sun/star/beans/XPropertySetInfo.hpp>
42 #include <com/sun/star/util/XStringEscape.hpp>
43 #include <cppuhelper/implbase9.hxx>
45 namespace configmgr
47 namespace css = ::com::sun::star;
48 namespace uno = ::com::sun::star::uno;
50 namespace configapi { class NodeSetInfoAccess; }
52 /** implements the (read-only) interfaces supported by a set node
53 within the configuration tree.
54 <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeAccess</type>.</p>
56 class BasicSetAccess
57 : public ::cppu::ImplHelper9
58 < css::container::XNameAccess
59 , css::container::XHierarchicalName
60 , css::container::XHierarchicalNameAccess
61 , css::container::XContainer
62 , css::beans::XExactName
63 , css::beans::XProperty
64 , css::beans::XPropertySetInfo
65 , css::configuration::XTemplateContainer
66 , css::util::XStringEscape
69 protected:
70 // Destructors
71 virtual ~BasicSetAccess() {}
73 public:
74 // Interface methods
75 // XHierarchicalName
76 virtual rtl::OUString SAL_CALL
77 getHierarchicalName( )
78 throw(uno::RuntimeException);
80 virtual rtl::OUString SAL_CALL
81 composeHierarchicalName( const rtl::OUString& aRelativeName )
82 throw(css::lang::IllegalArgumentException, css::lang::NoSupportException,
83 uno::RuntimeException);
85 // XElementAccess, base class of XNameAccess
86 virtual uno::Type SAL_CALL
87 getElementType( )
88 throw(uno::RuntimeException);
90 virtual sal_Bool SAL_CALL
91 hasElements( )
92 throw(uno::RuntimeException);
94 // XNameAccess
95 virtual uno::Any SAL_CALL
96 getByName( const rtl::OUString& aName )
97 throw(css::container::NoSuchElementException, css::lang::WrappedTargetException,
98 uno::RuntimeException);
100 virtual uno::Sequence< rtl::OUString > SAL_CALL
101 getElementNames( )
102 throw( uno::RuntimeException);
104 virtual sal_Bool SAL_CALL
105 hasByName( const rtl::OUString& aName )
106 throw(uno::RuntimeException);
108 // XHierarchicalNameAccess
109 virtual uno::Any SAL_CALL
110 getByHierarchicalName( const rtl::OUString& aName )
111 throw(css::container::NoSuchElementException, uno::RuntimeException);
113 virtual sal_Bool SAL_CALL
114 hasByHierarchicalName( const rtl::OUString& aName )
115 throw(uno::RuntimeException);
117 // XContainer
118 virtual void SAL_CALL
119 addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
120 throw(uno::RuntimeException);
122 virtual void SAL_CALL
123 removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
124 throw(uno::RuntimeException);
126 // XExactName
127 virtual rtl::OUString SAL_CALL
128 getExactName( const rtl::OUString& aApproximateName )
129 throw(uno::RuntimeException);
131 // XProperty
132 virtual css::beans::Property SAL_CALL
133 getAsProperty( )
134 throw(uno::RuntimeException);
136 // XPropertySetInfo
137 virtual uno::Sequence< css::beans::Property > SAL_CALL
138 getProperties( )
139 throw (uno::RuntimeException);
141 virtual css::beans::Property SAL_CALL
142 getPropertyByName( const rtl::OUString& aName )
143 throw (css::beans::UnknownPropertyException, uno::RuntimeException);
145 virtual sal_Bool SAL_CALL
146 hasPropertyByName( const rtl::OUString& name )
147 throw (uno::RuntimeException);
149 // XTemplateContainer
150 rtl::OUString SAL_CALL
151 getElementTemplateName( )
152 throw(uno::RuntimeException);
154 // XStringEscape
155 rtl::OUString SAL_CALL
156 escapeString( const rtl::OUString& aString )
157 throw(css::lang::IllegalArgumentException, uno::RuntimeException);
159 rtl::OUString SAL_CALL
160 unescapeString( const rtl::OUString& aEscapedString )
161 throw(css::lang::IllegalArgumentException, uno::RuntimeException);
163 protected:
164 virtual configapi::NodeSetInfoAccess& getNode() = 0;
168 #endif // CONFIGMGR_API_SETACCESS_HXX_