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