Update ooo320-m1
[ooovba.git] / desktop / source / app / configinit.hxx
blobcdcf5145eca93c9b43714167d4660ee764fc64a1
1 #ifndef _DESKTOP_CONFIGINIT_HXX_
2 #define _DESKTOP_CONFIGINIT_HXX_
4 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
5 #include <rtl/ustring.hxx>
7 /** creates a ConfigurationProvider instance
8 Important: exceptions thrown from that method will contain a readily
9 displayable message.
11 @return
12 The default configuration provider for the application or<br/>
13 <NULL/>, if startup was canceled
15 @throw com::sun::star::configuration::CannotLoadConfigurationException
16 if the configuration provider can't be created
18 @throw com::sun::star::lang::ServiceNotRegisteredException
19 if the ConfigurationProvider service is unknwon
21 @throw com::sun::star::lang::WrappedTargetException
22 if the configuration backend could be created,
23 but incurred a failure later
26 extern
27 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
28 CreateApplicationConfigurationProvider( );
30 //-----------------------------------------------------------------------------
31 #include <com/sun/star/task/XInteractionHandler.hpp>
33 /**
34 sets an InteractionHandler for configuration errors in the current context.
37 class ConfigurationErrorHandler
39 public:
40 typedef com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > InteractionHandler;
42 /// Constructor: Uses the default interaction handler
43 ConfigurationErrorHandler()
44 : m_pContext(0), m_xHandler()
47 /// Constructor: Uses an externally provided interaction handler
48 ConfigurationErrorHandler(const InteractionHandler & xHandler)
49 : m_pContext(0), m_xHandler( xHandler )
52 ~ConfigurationErrorHandler();
54 static InteractionHandler getDefaultInteractionHandler();
56 /// installs the handler into the current context
57 void activate();
58 /// deinstalls the handler from the current context, restoring the previous context
59 void deactivate();
60 private:
61 class Context;
62 Context * m_pContext;
63 InteractionHandler m_xHandler;
64 private:
65 // not implemented - suppress copy
66 ConfigurationErrorHandler(const ConfigurationErrorHandler&);
67 void operator=(const ConfigurationErrorHandler&);
70 //-----------------------------------------------------------------------------
71 #endif