bump product version to 4.1.6.2
[LibreOffice.git] / fpicker / source / office / asyncfilepicker.hxx
blob44b22e62c347b05304ff495588f2c96629ef0a55
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SVTOOLS_SOURCE_FILEPICKER_ASYNCFILEPICKER_HXX
21 #define SVTOOLS_SOURCE_FILEPICKER_ASYNCFILEPICKER_HXX
23 #include <tools/link.hxx>
24 #include <tools/string.hxx>
25 #include <rtl/ref.hxx>
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/uno/Sequence.h>
29 class SvtFileView;
30 class SvtFileDialog;
32 typedef ::com::sun::star::uno::Sequence< OUString > OUStringList;
34 //........................................................................
35 namespace svt
37 //........................................................................
40 //====================================================================
41 //= AsyncPickerAction
42 //====================================================================
43 class AsyncPickerAction : public ::rtl::IReference
45 public:
46 enum Action
48 ePrevLevel,
49 eOpenURL,
50 eExecuteFilter
53 private:
54 mutable oslInterlockedCount m_refCount;
55 Action m_eAction;
56 SvtFileView* m_pView;
57 SvtFileDialog* m_pDialog;
58 String m_sURL;
59 String m_sFileName;
60 bool m_bRunning;
62 public:
63 AsyncPickerAction( SvtFileDialog* _pDialog, SvtFileView* _pView, const Action _eAction );
65 /** executes the action
67 @param _nMinTimeout
68 the minimum timeout to wait, in milliseconds. If negative, the action will we done
69 synchronously. If between 0 and 999, it will be corrected to 1000, means the
70 smallest valid value is 1000 (which equals one second).
71 @param _nMaxTimeout
72 The maximum time to wait for a result, in milliseconds. If there's no result of
73 the action within the given time frame, the action will be cancelled.
74 If smaller than or equal to <arg>_nMinTimeout</arg>, it will be corrected to
75 <arg>_nMinTimeout</arg> + 30000.
77 void execute(
78 const String& _rURL,
79 const String& _rFilter,
80 sal_Int32 _nMinTimeout,
81 sal_Int32 _nMaxTimeout,
82 const OUStringList& rBlackList = OUStringList() );
84 /// cancels the running action
85 void cancel();
87 // IReference overridables
88 virtual oslInterlockedCount SAL_CALL acquire();
89 virtual oslInterlockedCount SAL_CALL release();
91 protected:
92 virtual ~AsyncPickerAction();
94 private:
95 DECL_LINK( OnActionDone, void* );
97 AsyncPickerAction(); // never implemented
98 AsyncPickerAction( const AsyncPickerAction& ); // never implemented
99 AsyncPickerAction& operator=( const AsyncPickerAction& ); // never implemented
102 //........................................................................
103 } // namespace svt
104 //........................................................................
106 #endif // SVTOOLS_SOURCE_FILEPICKER_ASYNCFILEPICKER_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */