merged tag ooo/DEV300_m102
[LibreOffice.git] / fpicker / source / office / fpinteraction.hxx
blob9b1b4e2c27a480dc6641273e995d80138aa14245
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SVTOOLS_FILEPICKER_INTERACTION_HXX
29 #define SVTOOLS_FILEPICKER_INTERACTION_HXX
31 #include <cppuhelper/implbase1.hxx>
32 #include <com/sun/star/task/XInteractionHandler.hpp>
34 //........................................................................
35 namespace svt
37 //........................................................................
39 //====================================================================
40 //= OFilePickerInteractionHandler
41 //====================================================================
42 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::task::XInteractionHandler
43 > OFilePickerInteractionHandler_Base;
45 /** a InteractionHandler implementation which extends another handler with some customizability
47 class OFilePickerInteractionHandler : public OFilePickerInteractionHandler_Base
49 public:
50 /** flags, which indicates special handled interactions
51 These values will be used combained as flags - so they must
52 in range [2^n]!
54 enum EInterceptedInteractions
56 E_NOINTERCEPTION = 0,
57 E_DOESNOTEXIST = 1
58 // next values [2,4,8,16 ...]!
61 protected:
62 ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > m_xMaster ; // our master handler
63 ::com::sun::star::uno::Any m_aException ; // the last handled request
64 sal_Bool m_bUsed ; // indicates using of this interaction handler instance
65 EInterceptedInteractions m_eInterceptions ; // enable/disable interception of some special interactions
67 public:
68 OFilePickerInteractionHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxMaster );
70 // some generic functions
71 void enableInterceptions( EInterceptedInteractions eInterceptions );
72 sal_Bool wasUsed () const;
73 void resetUseState ();
74 void forgetRequest ();
76 // functions to analyze last cached request
77 sal_Bool wasAccessDenied() const;
79 protected:
80 // XInteractionHandler
81 virtual void SAL_CALL handle( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& _rxRequest ) throw (::com::sun::star::uno::RuntimeException);
83 private:
84 ~OFilePickerInteractionHandler();
87 //........................................................................
88 } // namespace svt
89 //........................................................................
91 #endif // SVTOOLS_FILEPICKER_INTERACTION_HXX