Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : #ifndef _DESKTOP_CONFIGINIT_HXX_
3 : : #define _DESKTOP_CONFIGINIT_HXX_
4 : :
5 : : #include "sal/config.h"
6 : :
7 : : #include <com/sun/star/task/XInteractionHandler.hpp>
8 : :
9 : : /**
10 : : sets an InteractionHandler for configuration errors in the current context.
11 : :
12 : : */
13 : : class ConfigurationErrorHandler
14 : : {
15 : : public:
16 : : typedef com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > InteractionHandler;
17 : :
18 : : /// Constructor: Uses the default interaction handler
19 : 158 : ConfigurationErrorHandler()
20 : 158 : : m_pContext(0), m_xHandler()
21 : 158 : {}
22 : :
23 : : /// Constructor: Uses an externally provided interaction handler
24 : : ConfigurationErrorHandler(const InteractionHandler & xHandler)
25 : : : m_pContext(0), m_xHandler( xHandler )
26 : : {}
27 : :
28 : : ~ConfigurationErrorHandler();
29 : :
30 : : static InteractionHandler getDefaultInteractionHandler();
31 : :
32 : : /// installs the handler into the current context
33 : : void activate();
34 : : /// deinstalls the handler from the current context, restoring the previous context
35 : : void deactivate();
36 : : private:
37 : : class Context;
38 : : Context * m_pContext;
39 : : InteractionHandler m_xHandler;
40 : : private:
41 : : // not implemented - suppress copy
42 : : ConfigurationErrorHandler(const ConfigurationErrorHandler&);
43 : : void operator=(const ConfigurationErrorHandler&);
44 : : };
45 : :
46 : : //-----------------------------------------------------------------------------
47 : : #endif
48 : :
49 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|