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: setupdate.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_SETUPDATE_HXX_
32 #define CONFIGMGR_API_SETUPDATE_HXX_
34 #include "setaccess.hxx"
35 #include <com/sun/star/container/XNameContainer.hpp>
36 #include <com/sun/star/beans/XPropertyWithState.hpp>
37 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
39 //........................................................................
42 //........................................................................
43 namespace configapi
{ class NodeTreeSetAccess
; class NodeValueSetAccess
; }
45 //==========================================================================
47 //==========================================================================
49 /** base class for configuration nodes which are dynamic sets of complex types (trees)
52 : public BasicSetAccess
53 , public css::container::XNameContainer
54 , public css::beans::XPropertyWithState
55 , public css::lang::XSingleServiceFactory
59 virtual ~BasicSet() {}
62 // Base class Interface methods
64 uno::Any SAL_CALL
queryInterface( uno::Type
const& rType
) throw (uno::RuntimeException
);
66 // XTypeProvider joining
67 uno::Sequence
< uno::Type
> SAL_CALL
getTypes( ) throw (uno::RuntimeException
);
68 uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw (uno::RuntimeException
) = 0;
70 // XElementAccess forwarding
71 virtual uno::Type SAL_CALL
getElementType( ) throw(uno::RuntimeException
)
72 { return BasicSetAccess::getElementType(); }
74 virtual sal_Bool SAL_CALL
hasElements( ) throw(uno::RuntimeException
)
75 { return BasicSetAccess::hasElements(); }
77 // XNameAccess forwarding
78 virtual uno::Any SAL_CALL
getByName( const rtl::OUString
& aName
)
79 throw(css::container::NoSuchElementException
, css::lang::WrappedTargetException
, uno::RuntimeException
)
80 { return BasicSetAccess::getByName(aName
); }
82 virtual uno::Sequence
< rtl::OUString
> SAL_CALL
getElementNames( ) throw( uno::RuntimeException
)
83 { return BasicSetAccess::getElementNames(); }
85 virtual sal_Bool SAL_CALL
hasByName( const rtl::OUString
& aName
) throw(uno::RuntimeException
)
86 { return BasicSetAccess::hasByName(aName
); }
88 // New Interface methods
91 replaceByName( const rtl::OUString
& rName
, const uno::Any
& rElement
)
92 throw(css::lang::IllegalArgumentException
, css::container::NoSuchElementException
, css::lang::WrappedTargetException
, uno::RuntimeException
);
96 insertByName( const rtl::OUString
& rName
, const uno::Any
& rElement
)
97 throw(css::lang::IllegalArgumentException
, css::container::ElementExistException
, css::lang::WrappedTargetException
, uno::RuntimeException
);
100 removeByName( const rtl::OUString
& rName
)
101 throw(css::container::NoSuchElementException
, css::lang::WrappedTargetException
, uno::RuntimeException
);
103 // XPropertyWithState
104 virtual css::beans::PropertyState SAL_CALL
105 getStateAsProperty( )
106 throw (uno::RuntimeException
);
108 virtual void SAL_CALL
109 setToDefaultAsProperty( )
110 throw (css::lang::WrappedTargetException
, uno::RuntimeException
);
112 virtual uno::Reference
< uno::XInterface
> SAL_CALL
113 getDefaultAsProperty( )
114 throw (css::lang::WrappedTargetException
, uno::RuntimeException
);
116 // XSingleServiceFactory
117 virtual uno::Reference
< uno::XInterface
> SAL_CALL
119 throw(uno::Exception
, uno::RuntimeException
);
121 virtual uno::Reference
< uno::XInterface
> SAL_CALL
122 createInstanceWithArguments( const uno::Sequence
< uno::Any
>& aArguments
)
123 throw(uno::Exception
, uno::RuntimeException
);
126 configapi::NodeTreeSetAccess
& getSetNode();
127 virtual configapi::NodeTreeSetAccess
* maybeGetUpdateAccess() = 0;
130 //==========================================================================
132 //==========================================================================
134 /** class for configuration nodes which are dynamic sets of simple types (values)
137 : public BasicSetAccess
138 , public css::beans::XPropertyWithState
139 , public css::container::XNameContainer
143 virtual ~BasicValueSet() {}
146 // Base class Interface methods
147 // XInterface joining
148 uno::Any SAL_CALL
queryInterface( uno::Type
const& rType
) throw (uno::RuntimeException
);
150 // XTypeProvider joining
151 uno::Sequence
< uno::Type
> SAL_CALL
getTypes( ) throw (uno::RuntimeException
);
152 uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw (uno::RuntimeException
) = 0;
154 // XElementAccess forwarding
155 virtual uno::Type SAL_CALL
getElementType( ) throw(uno::RuntimeException
)
156 { return BasicSetAccess::getElementType(); }
158 virtual sal_Bool SAL_CALL
hasElements( ) throw(uno::RuntimeException
)
159 { return BasicSetAccess::hasElements(); }
161 // XNameAccess forwarding
162 virtual uno::Any SAL_CALL
getByName( const rtl::OUString
& aName
)
163 throw(css::container::NoSuchElementException
, css::lang::WrappedTargetException
, uno::RuntimeException
)
164 { return BasicSetAccess::getByName(aName
); }
166 virtual uno::Sequence
< rtl::OUString
> SAL_CALL
getElementNames( ) throw( uno::RuntimeException
)
167 { return BasicSetAccess::getElementNames(); }
169 virtual sal_Bool SAL_CALL
hasByName( const rtl::OUString
& aName
) throw(uno::RuntimeException
)
170 { return BasicSetAccess::hasByName(aName
); }
172 // New Interface methods
174 virtual void SAL_CALL
175 replaceByName( const rtl::OUString
& rName
, const uno::Any
& rElement
)
176 throw(css::lang::IllegalArgumentException
, css::container::NoSuchElementException
, css::lang::WrappedTargetException
, uno::RuntimeException
);
179 virtual void SAL_CALL
180 insertByName( const rtl::OUString
& rName
, const uno::Any
& rElement
)
181 throw(css::lang::IllegalArgumentException
, css::container::ElementExistException
, css::lang::WrappedTargetException
, uno::RuntimeException
);
183 virtual void SAL_CALL
184 removeByName( const rtl::OUString
& rName
)
185 throw(css::container::NoSuchElementException
, css::lang::WrappedTargetException
, uno::RuntimeException
);
187 // XPropertyWithState
188 virtual css::beans::PropertyState SAL_CALL
189 getStateAsProperty( )
190 throw (uno::RuntimeException
);
192 virtual void SAL_CALL
193 setToDefaultAsProperty( )
194 throw (css::lang::WrappedTargetException
, uno::RuntimeException
);
196 virtual uno::Reference
< uno::XInterface
> SAL_CALL
197 getDefaultAsProperty( )
198 throw (css::lang::WrappedTargetException
, uno::RuntimeException
);
201 configapi::NodeValueSetAccess
& getSetNode();
202 virtual configapi::NodeValueSetAccess
* maybeGetUpdateAccess() = 0;
205 //........................................................................
206 } // namespace configmgr
207 //........................................................................
209 #endif // CONFIGMGR_API_VALUESETACCESS_HXX_