update dev300-m58
[ooovba.git] / fpicker / source / office / asyncfilepicker.hxx
blob79f7cf2697a62ab4ea36ad4d19497a0031878b3f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: asyncfilepicker.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVTOOLS_SOURCE_FILEPICKER_ASYNCFILEPICKER_HXX
32 #define SVTOOLS_SOURCE_FILEPICKER_ASYNCFILEPICKER_HXX
34 /** === begin UNO includes === **/
35 /** === end UNO includes === **/
37 #include <tools/link.hxx>
38 #include <tools/string.hxx>
39 #include <rtl/ref.hxx>
40 #include <rtl/ustring.hxx>
41 #include <com/sun/star/uno/Sequence.h>
43 class SvtFileView;
44 class SvtFileDialog;
46 typedef ::com::sun::star::uno::Sequence< ::rtl::OUString > OUStringList;
48 //........................................................................
49 namespace svt
51 //........................................................................
54 //====================================================================
55 //= AsyncPickerAction
56 //====================================================================
57 class AsyncPickerAction : public ::rtl::IReference
59 public:
60 enum Action
62 ePrevLevel,
63 eOpenURL,
64 eExecuteFilter
67 private:
68 mutable oslInterlockedCount m_refCount;
69 Action m_eAction;
70 SvtFileView* m_pView;
71 SvtFileDialog* m_pDialog;
72 String m_sURL;
73 String m_sFileName;
74 bool m_bRunning;
76 public:
77 AsyncPickerAction( SvtFileDialog* _pDialog, SvtFileView* _pView, const Action _eAction );
79 /** executes the action
81 @param _nMinTimeout
82 the minimum timeout to wait, in milliseconds. If negative, the action will we done
83 synchronously. If between 0 and 999, it will be corrected to 1000, means the
84 smallest valid value is 1000 (which equals one second).
85 @param _nMaxTimeout
86 The maximum time to wait for a result, in milliseconds. If there's no result of
87 the action within the given time frame, the action will be cancelled.
88 If smaller than or equal to <arg>_nMinTimeout</arg>, it will be corrected to
89 <arg>_nMinTimeout</arg> + 30000.
91 void execute(
92 const String& _rURL,
93 const String& _rFilter,
94 sal_Int32 _nMinTimeout,
95 sal_Int32 _nMaxTimeout,
96 const OUStringList& rBlackList = OUStringList() );
98 /// cancels the running action
99 void cancel();
101 // IReference overridables
102 virtual oslInterlockedCount SAL_CALL acquire();
103 virtual oslInterlockedCount SAL_CALL release();
105 protected:
106 virtual ~AsyncPickerAction();
108 private:
109 DECL_LINK( OnActionDone, void* );
111 AsyncPickerAction(); // never implemented
112 AsyncPickerAction( const AsyncPickerAction& ); // never implemented
113 AsyncPickerAction& operator=( const AsyncPickerAction& ); // never implemented
116 //........................................................................
117 } // namespace svt
118 //........................................................................
120 #endif // SVTOOLS_SOURCE_FILEPICKER_ASYNCFILEPICKER_HXX