1f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e07b45SAndrew Rist  * distributed with this work for additional information
6f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10f8e07b45SAndrew Rist  *
11f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12f8e07b45SAndrew Rist  *
13f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18f8e07b45SAndrew Rist  * under the License.
19f8e07b45SAndrew Rist  *
20f8e07b45SAndrew Rist  *************************************************************/
21f8e07b45SAndrew Rist 
22f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_SERVICES_DETECTORFACTORY_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_SERVICES_DETECTORFACTORY_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //_______________________________________________
28cdf0e10cSrcweir // includes of own project
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <classes/filtercache.hxx>
31cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx>
32cdf0e10cSrcweir #include <macros/xinterface.hxx>
33cdf0e10cSrcweir #include <macros/xtypeprovider.hxx>
34cdf0e10cSrcweir #include <macros/xserviceinfo.hxx>
35cdf0e10cSrcweir #include <macros/generic.hxx>
36cdf0e10cSrcweir #include <macros/debug.hxx>
37cdf0e10cSrcweir #include <general.h>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir //_______________________________________________
40cdf0e10cSrcweir // includes of interfaces
41cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
42cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
43cdf0e10cSrcweir #include <com/sun/star/lang/WrappedTargetException.hpp>
44cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp>
45cdf0e10cSrcweir #include <com/sun/star/container/ElementExistException.hpp>
46cdf0e10cSrcweir #include <com/sun/star/container/NoSuchElementException.hpp>
47cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
48cdf0e10cSrcweir #include <com/sun/star/container/NoSuchElementException.hpp>
49cdf0e10cSrcweir #include <com/sun/star/io/XInputStream.hpp>
50cdf0e10cSrcweir #include <com/sun/star/util/XFlushable.hpp>
51cdf0e10cSrcweir 
52cdf0e10cSrcweir //_______________________________________________
53cdf0e10cSrcweir // includes of other projects
54cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx>
55cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
56cdf0e10cSrcweir 
57cdf0e10cSrcweir //_______________________________________________
58cdf0e10cSrcweir // namespace
59cdf0e10cSrcweir 
60cdf0e10cSrcweir namespace framework{
61cdf0e10cSrcweir 
62cdf0e10cSrcweir //_______________________________________________
63cdf0e10cSrcweir // exported const
64cdf0e10cSrcweir 
65cdf0e10cSrcweir //_______________________________________________
66cdf0e10cSrcweir // exported definitions
67cdf0e10cSrcweir 
68cdf0e10cSrcweir /// @HTML
69cdf0e10cSrcweir /** @short      factory to create detect service objects and initialize it in the right way.
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     @descr      This class can be used to create new detect services for specified contents.
72cdf0e10cSrcweir                 It uses cached values of the configuration to lay down, which detector match
73cdf0e10cSrcweir                 a given name. Further this class provides full access to the configuration data
74cdf0e10cSrcweir                 of such detect services and following implementations will support some special
75cdf0e10cSrcweir                 query modes.
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     @author     as96863
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     @docdate    07.03.2003 by as96863
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     @todo       <ul>
82cdf0e10cSrcweir                     <li>implementation of query mode</li>
83cdf0e10cSrcweir                     <li>simple restore mechanism of last consistent cache state,
84cdf0e10cSrcweir                         if flush failed</li>
85cdf0e10cSrcweir                 </ul>
86cdf0e10cSrcweir  */
87cdf0e10cSrcweir /// @NOHTML
88cdf0e10cSrcweir 
89cdf0e10cSrcweir class DetectorFactory : // interfaces
90cdf0e10cSrcweir 						public	css::lang::XTypeProvider			,
91cdf0e10cSrcweir 						public	css::lang::XServiceInfo				,
92cdf0e10cSrcweir 						public	css::lang::XMultiServiceFactory		,
93cdf0e10cSrcweir 						public	css::container::XNameContainer		,		// => XNameReplace => XNameAccess => XElementAccess
94cdf0e10cSrcweir 						public	css::util::XFlushable				,
95cdf0e10cSrcweir 						// base classes
9607a3d7f1SPedro Giffuni 						// Order is necessary for right initialization of it!
97cdf0e10cSrcweir                         private ThreadHelpBase                      ,
98cdf0e10cSrcweir 						public	::cppu::OWeakObject
99cdf0e10cSrcweir {
100cdf0e10cSrcweir     //-------------------------------------------
101cdf0e10cSrcweir     // member
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     private:
104cdf0e10cSrcweir 
105cdf0e10cSrcweir         /** reference to the global uno service manager.
106cdf0e10cSrcweir             It will be used to create own needed services on demand. */
107cdf0e10cSrcweir         css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir         /** singleton, which contains all needed configuration data and provides
110cdf0e10cSrcweir             read/write access on it. */
111cdf0e10cSrcweir         FilterCache m_aCache;
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         /** contains all registered listener. */
114cdf0e10cSrcweir         ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     //-------------------------------------------
117cdf0e10cSrcweir     // interface
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 	public:
120cdf0e10cSrcweir 
121cdf0e10cSrcweir         //---------------------------------------
122cdf0e10cSrcweir         // XInterface, XTypeProvider, XServiceInfo
123cdf0e10cSrcweir 
124cdf0e10cSrcweir         DECLARE_XINTERFACE
125cdf0e10cSrcweir         DECLARE_XTYPEPROVIDER
126cdf0e10cSrcweir         DECLARE_XSERVICEINFO
127cdf0e10cSrcweir 
128cdf0e10cSrcweir         #ifdef ENABLE_AUTODOC_FIX
129cdf0e10cSrcweir         ;
130cdf0e10cSrcweir         #endif
131cdf0e10cSrcweir 
132cdf0e10cSrcweir         //---------------------------------------
133cdf0e10cSrcweir 
134cdf0e10cSrcweir         /** @short  initialize new instance of this class.
135cdf0e10cSrcweir 
136cdf0e10cSrcweir             @param  xSMGR
137cdf0e10cSrcweir                     reference to the global uno service manager, which created this new factory instance.
138cdf0e10cSrcweir                     It must be used during runtime to create own needed services.
139cdf0e10cSrcweir          */
140cdf0e10cSrcweir 
141cdf0e10cSrcweir         DetectorFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR );
142cdf0e10cSrcweir 
143cdf0e10cSrcweir         //---------------------------------------
144cdf0e10cSrcweir 
145cdf0e10cSrcweir         /** @short  release internal structures.
146cdf0e10cSrcweir          */
147cdf0e10cSrcweir 
148cdf0e10cSrcweir         virtual ~DetectorFactory();
149cdf0e10cSrcweir 
150cdf0e10cSrcweir         //---------------------------------------
151cdf0e10cSrcweir         // XMultiServiceFactory
152cdf0e10cSrcweir 
153cdf0e10cSrcweir         /** @short  create a new detect service and initialize it with it's own configuration data.
154cdf0e10cSrcweir 
155cdf0e10cSrcweir             @param  sName
156cdf0e10cSrcweir                     means the uno implementation name of a detect service.
157cdf0e10cSrcweir 
158cdf0e10cSrcweir             @exception  com::sun::star::uno::Exception
159cdf0e10cSrcweir                         if the requested service could not be created or initialized.
160cdf0e10cSrcweir          */
161cdf0e10cSrcweir 
162cdf0e10cSrcweir         virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& sName )
163cdf0e10cSrcweir             throw(css::uno::Exception       ,
164cdf0e10cSrcweir                   css::uno::RuntimeException);
165cdf0e10cSrcweir 
166cdf0e10cSrcweir         //---------------------------------------
167cdf0e10cSrcweir         // XMultiServiceFactory
168cdf0e10cSrcweir 
169cdf0e10cSrcweir         /** @short  does the same as createInstance() method, but initialize created detect service with some
170cdf0e10cSrcweir                     additional data.
171cdf0e10cSrcweir 
172cdf0e10cSrcweir             @param  sName
173cdf0e10cSrcweir                     means the uno implementation name of a detect service.
174cdf0e10cSrcweir 
175cdf0e10cSrcweir             @param  lArguments
176cdf0e10cSrcweir                     the optional arguments, which are passed to the created detect service against
177cdf0e10cSrcweir                     it's own configuration data.
178cdf0e10cSrcweir 
179cdf0e10cSrcweir             @exception  com::sun::star::uno::Exception
180cdf0e10cSrcweir                         if the requested service could not be created or initialized.
181cdf0e10cSrcweir          */
182cdf0e10cSrcweir 
183cdf0e10cSrcweir         virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString&                     sName      ,
184cdf0e10cSrcweir                                                                                                   const css::uno::Sequence< css::uno::Any >& lArguments )
185cdf0e10cSrcweir             throw(css::uno::Exception       ,
186cdf0e10cSrcweir                   css::uno::RuntimeException);
187cdf0e10cSrcweir 
188cdf0e10cSrcweir         //---------------------------------------
189cdf0e10cSrcweir         // XMultiServiceFactory
190cdf0e10cSrcweir 
191cdf0e10cSrcweir         /** @short  return list of all well know detect services, which can be created by this factory.
192cdf0e10cSrcweir 
193cdf0e10cSrcweir             @attention  Because this service implements read/write access to the configuration too,
194cdf0e10cSrcweir                         this list is dynamic. Means: in multithreaded environments some items of this
195cdf0e10cSrcweir                         return list could be invalid next time!
196cdf0e10cSrcweir 
197cdf0e10cSrcweir             @return A list of all registered detect services.
198cdf0e10cSrcweir          */
199cdf0e10cSrcweir 
200cdf0e10cSrcweir         virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames()
201cdf0e10cSrcweir             throw(css::uno::RuntimeException);
202cdf0e10cSrcweir 
203cdf0e10cSrcweir         //---------------------------------------
204cdf0e10cSrcweir         // XNameContainer
205cdf0e10cSrcweir 
206cdf0e10cSrcweir         /** @short  add new detect service entry to this container.
207cdf0e10cSrcweir 
208cdf0e10cSrcweir             @descr  This will change all internal structures only!
209cdf0e10cSrcweir                     Updating of the configuration layer and notify of all registered
210cdf0e10cSrcweir                     listener will be done inside API call XFlushable::flush() on this
211cdf0e10cSrcweir                     container.
212cdf0e10cSrcweir 
213cdf0e10cSrcweir             @param  sName
214cdf0e10cSrcweir                     means the uno implementation name of this new detect service entry.
215cdf0e10cSrcweir 
216cdf0e10cSrcweir             @param  aPropertySet [sequence< com::sun::star::beans::PropertyValue >!]
217cdf0e10cSrcweir                     describe this new entry. For a list of all supported properties
218cdf0e10cSrcweir                     have a look on method >>getByName()<<.
219cdf0e10cSrcweir                     Note: Missing values will be created with defaults!
220cdf0e10cSrcweir 
221cdf0e10cSrcweir             @exception  com::sun::star::lang::IllegalArgumentException
222*796b7e2aSmseidel                         if one of the incoming parameters seems to be invalid.
223cdf0e10cSrcweir                         That doesn't include the check, if this item already exist!
224cdf0e10cSrcweir 
225cdf0e10cSrcweir             @exception  com::sun::star::container::ElementExistException
226cdf0e10cSrcweir                         if this item already exist inside this container.
227cdf0e10cSrcweir 
228cdf0e10cSrcweir             @exception  com::sun::star::lang::WrappedTargetException
229cdf0e10cSrcweir                         f creation of the internal structures failed.
230cdf0e10cSrcweir          */
231cdf0e10cSrcweir 
232cdf0e10cSrcweir         virtual void SAL_CALL insertByName( const ::rtl::OUString& sName        ,
233cdf0e10cSrcweir                                             const css::uno::Any&   aPropertySet )
234cdf0e10cSrcweir             throw(css::lang::IllegalArgumentException  ,
235cdf0e10cSrcweir                   css::container::ElementExistException,
236cdf0e10cSrcweir                   css::lang::WrappedTargetException    ,
237cdf0e10cSrcweir                   css::uno::RuntimeException           );
238cdf0e10cSrcweir 
239cdf0e10cSrcweir         //---------------------------------------
240cdf0e10cSrcweir         // XNameContainer
241cdf0e10cSrcweir 
242cdf0e10cSrcweir         /** @short  remove a detect service entry from this container.
243cdf0e10cSrcweir 
244cdf0e10cSrcweir             @descr  This will change all internal structures only!
245cdf0e10cSrcweir                     Updating of the configuration layer and notify of all registered
246cdf0e10cSrcweir                     listener will be done inside API call XFlushable::flush() on this
247cdf0e10cSrcweir                     container.
248cdf0e10cSrcweir 
249cdf0e10cSrcweir             @param  sName
250cdf0e10cSrcweir                     means the uno implementation name of a detect service entry.
251cdf0e10cSrcweir 
252cdf0e10cSrcweir             @exception  com::sun::star::container::NoSuchElementException
253cdf0e10cSrcweir                         if the requested item does not exist inside this container.
254cdf0e10cSrcweir 
255cdf0e10cSrcweir             @exception  com::sun::star::lang::WrappedTargetException
256cdf0e10cSrcweir                         if creation of the internal structures failed.
257cdf0e10cSrcweir          */
258cdf0e10cSrcweir 
259cdf0e10cSrcweir         virtual void SAL_CALL removeByName( const ::rtl::OUString& sName )
260cdf0e10cSrcweir             throw(css::container::NoSuchElementException,
261cdf0e10cSrcweir                   css::lang::WrappedTargetException     ,
262cdf0e10cSrcweir                   css::uno::RuntimeException            );
263cdf0e10cSrcweir 
264cdf0e10cSrcweir         //---------------------------------------
265cdf0e10cSrcweir         // XNameReplace
266cdf0e10cSrcweir 
267cdf0e10cSrcweir         /** @short  change a detect service entry inside this container.
268cdf0e10cSrcweir 
269cdf0e10cSrcweir             @descr  This will change all internal structures only!
270cdf0e10cSrcweir                     Updating of the configuration layer and notify of all registered
271cdf0e10cSrcweir                     listener will be done inside API call XFlushable::flush() on this
272cdf0e10cSrcweir                     container.
273cdf0e10cSrcweir 
274cdf0e10cSrcweir             @param  sName
275cdf0e10cSrcweir                     means the uno implementation name of a detect service entry.
276cdf0e10cSrcweir 
277cdf0e10cSrcweir             @param  aPropertySet [sequence< com::sun::star::beans::PropertyValue >!]
278cdf0e10cSrcweir                     describe the changes on this entry. For a list of all supported properties
279cdf0e10cSrcweir                     have a look on method getByName().
280cdf0e10cSrcweir                     Note: Missing properties will be untouched.
281cdf0e10cSrcweir 
282cdf0e10cSrcweir             @exception  com::sun::star::lang::IllegalArgumentException
283*796b7e2aSmseidel                         if one of the incoming parameters seems to be invalid.
284cdf0e10cSrcweir                         That doesn't include the check, if this item exist!
285cdf0e10cSrcweir 
286cdf0e10cSrcweir             @exception  com::sun::star::container::NoSuchElementException
287cdf0e10cSrcweir                         if the requested item does not exist inside this container.
288cdf0e10cSrcweir 
289cdf0e10cSrcweir             @exception  com::sun::star::lang::WrappedTargetException
290cdf0e10cSrcweir                         if updating of the internal structures failed.
291cdf0e10cSrcweir          */
292cdf0e10cSrcweir 
293cdf0e10cSrcweir         virtual void SAL_CALL replaceByName( const ::rtl::OUString& sName        ,
294cdf0e10cSrcweir                                              const css::uno::Any&   aPropertySet )
295cdf0e10cSrcweir             throw(css::lang::IllegalArgumentException   ,
296cdf0e10cSrcweir                   css::container::NoSuchElementException,
297cdf0e10cSrcweir                   css::lang::WrappedTargetException     ,
298cdf0e10cSrcweir                   css::uno::RuntimeException            );
299cdf0e10cSrcweir 
300cdf0e10cSrcweir         //---------------------------------------
301cdf0e10cSrcweir         // XNameAccess
302cdf0e10cSrcweir 
303cdf0e10cSrcweir         /// @HTML
304cdf0e10cSrcweir         /** @short  return properties of queried detector item.
305cdf0e10cSrcweir 
306cdf0e10cSrcweir             @descr  Use this method to get all informations about a detector item of this cache.
307cdf0e10cSrcweir                     A sequence< com::sun::star::beans::PropertyValue > packed inside an Any will be returned.
308cdf0e10cSrcweir                     Following properties are defined:
309cdf0e10cSrcweir                     <table border=1>
310cdf0e10cSrcweir                     <tr>
311cdf0e10cSrcweir                         <td><b>Property</b></td>
312cdf0e10cSrcweir                         <td><b>Value<b></td>
313cdf0e10cSrcweir                         <td><b>Description<b></td>
314cdf0e10cSrcweir                     </tr>
315cdf0e10cSrcweir                     <tr>
316cdf0e10cSrcweir                         <td>Name</td>
317cdf0e10cSrcweir                         <td>[string]</td>
318cdf0e10cSrcweir                             <td>the uno implementation name for this detect service</td>
319cdf0e10cSrcweir                     </tr>
320cdf0e10cSrcweir                     <tr>
321cdf0e10cSrcweir                         <td>Types</td>
322cdf0e10cSrcweir                         <td>[sequence< string >]</td>
323cdf0e10cSrcweir                         <td>a list of all internbal type names, which this detect service is registered for</td>
324cdf0e10cSrcweir                     </tr>
325cdf0e10cSrcweir                     </table>
326cdf0e10cSrcweir 
327cdf0e10cSrcweir             @param  sName
328cdf0e10cSrcweir                     the uno implementation name the requested detector.
329cdf0e10cSrcweir 
330a49f1911Smseidel             @return A property set, which describes this detect service.
331a49f1911Smseidel                     It uses a sequence< com::sun::star::beans::PropertyValue > internally.
332cdf0e10cSrcweir 
333cdf0e10cSrcweir             @exception  com::sun::star::container::NoSuchElementException
334cdf0e10cSrcweir                         if the requested entry does not exist inside this container.
335cdf0e10cSrcweir          */
336cdf0e10cSrcweir         /// @NOHTML
337cdf0e10cSrcweir 
338cdf0e10cSrcweir         virtual css::uno::Any SAL_CALL getByName( const ::rtl::OUString& sName )
339cdf0e10cSrcweir             throw(css::container::NoSuchElementException,
340cdf0e10cSrcweir                   css::lang::WrappedTargetException     ,
341cdf0e10cSrcweir                   css::uno::RuntimeException            );
342cdf0e10cSrcweir 
343cdf0e10cSrcweir         //---------------------------------------
344cdf0e10cSrcweir         // XNameAccess
345cdf0e10cSrcweir 
346cdf0e10cSrcweir         /** @short  return list of all well know container entries available on this container.
347cdf0e10cSrcweir 
348cdf0e10cSrcweir             @attention  Because this service implements read/write access to the configuration too,
349cdf0e10cSrcweir                         this list is dynamic. Means: in multithreaded environments some items of this
350cdf0e10cSrcweir                         return list could be invalid next time!
351cdf0e10cSrcweir 
352cdf0e10cSrcweir             @return A list of all well known container items.
353cdf0e10cSrcweir          */
354cdf0e10cSrcweir 
355cdf0e10cSrcweir         virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
356cdf0e10cSrcweir             throw(css::uno::RuntimeException);
357cdf0e10cSrcweir 
358cdf0e10cSrcweir         //---------------------------------------
359cdf0e10cSrcweir         // XNameAccess
360cdf0e10cSrcweir 
361cdf0e10cSrcweir         /** @short  check if searched entry exist inside this container.
362cdf0e10cSrcweir 
363cdf0e10cSrcweir             @attention  In multithreaded environments it's not guaranteed, that a
36407a3d7f1SPedro Giffuni                         queried item exist next time really! It can be deleted by
365cdf0e10cSrcweir                         another thread ...
366cdf0e10cSrcweir 
367cdf0e10cSrcweir             @param  sName
368cdf0e10cSrcweir                     the name of the queried container entry.
369cdf0e10cSrcweir 
370cdf0e10cSrcweir             @return sal_True if the requested item exist; sal_False otherwise.
371cdf0e10cSrcweir          */
372cdf0e10cSrcweir 
373cdf0e10cSrcweir         virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& sName )
374cdf0e10cSrcweir             throw(css::uno::RuntimeException);
375cdf0e10cSrcweir 
376cdf0e10cSrcweir         //---------------------------------------
377cdf0e10cSrcweir         // XElementAccess
378cdf0e10cSrcweir 
379cdf0e10cSrcweir         /** @short  return the uno type, which is used for all container items.
380cdf0e10cSrcweir 
38107a3d7f1SPedro Giffuni             @return Type of sequence< com::sun::star::beans::PropertyValue > every time - because it's fix.
382cdf0e10cSrcweir          */
383cdf0e10cSrcweir 
384cdf0e10cSrcweir         virtual css::uno::Type SAL_CALL getElementType()
385cdf0e10cSrcweir             throw(css::uno::RuntimeException);
386cdf0e10cSrcweir 
387cdf0e10cSrcweir         //---------------------------------------
388cdf0e10cSrcweir         // XElementAccess
389cdf0e10cSrcweir 
390cdf0e10cSrcweir         /** @short  return fill state of this cache.
391cdf0e10cSrcweir 
3924e7d57d8Smseidel             @return sal_True if any item exist inside this conatiner; sal_False otherwise.
393cdf0e10cSrcweir          */
394cdf0e10cSrcweir 
395cdf0e10cSrcweir         virtual sal_Bool SAL_CALL hasElements()
396cdf0e10cSrcweir             throw(css::uno::RuntimeException);
397cdf0e10cSrcweir 
398cdf0e10cSrcweir         //---------------------------------------
399cdf0e10cSrcweir         // XFlushable
400cdf0e10cSrcweir 
401cdf0e10cSrcweir         /** @short  update the configuration layer and notify all registered listener.
402cdf0e10cSrcweir 
403cdf0e10cSrcweir             @descr  All container interface methods update the internal structures of
404cdf0e10cSrcweir                     this container only. But the underlying configuration layer and
405cdf0e10cSrcweir                     may some possible other caches was not updated.
406cdf0e10cSrcweir                     Calling of flush() will do that.
407cdf0e10cSrcweir                     At the same time all currently registered flush listener will be informed,
408cdf0e10cSrcweir                     so they can update her structures too.
40907a3d7f1SPedro Giffuni                     Note: Before all these operations are started really, all changes will be
41007a3d7f1SPedro Giffuni                     verified and if necessary some corrections will be done.
411cdf0e10cSrcweir                     In case the cache will be invalid and could not be repaired an exception is thrown!
412e9faf1d9Smseidel                     Normally this container will not work correctly afterwards ...
413cdf0e10cSrcweir 
414cdf0e10cSrcweir             @exception  com::sun::star::uno::RuntimeException
415cdf0e10cSrcweir                         if the changes on this container was invald and could not be repaired.
416cdf0e10cSrcweir          */
417cdf0e10cSrcweir 
418cdf0e10cSrcweir         virtual void SAL_CALL flush()
419cdf0e10cSrcweir             throw(css::uno::RuntimeException);
420cdf0e10cSrcweir 
421cdf0e10cSrcweir         //---------------------------------------
422cdf0e10cSrcweir         // XFlushable
423cdf0e10cSrcweir 
424cdf0e10cSrcweir         /** @short  register listener for container updates.
425cdf0e10cSrcweir 
426cdf0e10cSrcweir             @param  xListener
427cdf0e10cSrcweir                     reference to listener, which wish to be registered.
428cdf0e10cSrcweir 
429cdf0e10cSrcweir             @exception  com::sun::star::uno::RuntimeException
430cdf0e10cSrcweir                         if the given listener is an invalid reference.
431cdf0e10cSrcweir                         Note: multiple calls of this method for the same listener won't be checked!
432cdf0e10cSrcweir          */
433cdf0e10cSrcweir 
434cdf0e10cSrcweir         virtual void SAL_CALL addFlushListener( const css::uno::Reference< css::util::XFlushListener >& xListener )
435cdf0e10cSrcweir             throw(css::uno::RuntimeException);
436cdf0e10cSrcweir 
437cdf0e10cSrcweir         //---------------------------------------
438cdf0e10cSrcweir         // XFlushable
439cdf0e10cSrcweir 
440cdf0e10cSrcweir         /** @short  deregister listener for container updates.
441cdf0e10cSrcweir 
442cdf0e10cSrcweir             @param  xListener
443cdf0e10cSrcweir                     reference to listener, which wish to be deregistered.
444cdf0e10cSrcweir 
445cdf0e10cSrcweir             @exception  com::sun::star::uno::RuntimeException
446cdf0e10cSrcweir                         if the given listener is an invalid reference.
447cdf0e10cSrcweir                         Note: multiple calls of this method for the same listener won't be checked!
448cdf0e10cSrcweir          */
449cdf0e10cSrcweir 
450cdf0e10cSrcweir         virtual void SAL_CALL removeFlushListener( const css::uno::Reference< css::util::XFlushListener >& xListener )
451cdf0e10cSrcweir             throw(css::uno::RuntimeException);
452cdf0e10cSrcweir 
453cdf0e10cSrcweir }; // class DetectorFactory
454cdf0e10cSrcweir 
455cdf0e10cSrcweir } // namespace framework
456cdf0e10cSrcweir 
457cdf0e10cSrcweir #endif // #ifndef __FRAMEWORK_SERVICES_DETECTORFACTORY_HXX_
458