cool#10610 Ensure the parent-child relations of comments.
[LibreOffice.git] / fpicker / source / office / asyncfilepicker.hxx
blobe2bac1208fb1462c9cf255065438dd5829186778
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 #pragma once
22 #include <tools/link.hxx>
23 #include <rtl/ustring.hxx>
24 #include <com/sun/star/uno/Sequence.h>
25 #include <salhelper/simplereferenceobject.hxx>
27 class SvtFileView;
28 class SvtFileDialog_Base;
30 namespace svt
34 //= AsyncPickerAction
36 class AsyncPickerAction : public salhelper::SimpleReferenceObject
38 public:
39 enum Action
41 ePrevLevel,
42 eOpenURL,
43 eExecuteFilter
46 private:
47 Action m_eAction;
48 SvtFileView* m_pView;
49 SvtFileDialog_Base* m_pDialog;
50 OUString m_sURL;
51 OUString m_sFileName;
52 bool m_bRunning;
54 public:
55 AsyncPickerAction( SvtFileDialog_Base* _pDialog, SvtFileView* _pView, const Action _eAction );
57 /** executes the action
59 @param _nMinTimeout
60 the minimum timeout to wait, in milliseconds. If negative, the action will we done
61 synchronously. If between 0 and 999, it will be corrected to 1000, means the
62 smallest valid value is 1000 (which equals one second).
63 @param _nMaxTimeout
64 The maximum time to wait for a result, in milliseconds. If there's no result of
65 the action within the given time frame, the action will be cancelled.
66 If smaller than or equal to <arg>_nMinTimeout</arg>, it will be corrected to
67 <arg>_nMinTimeout</arg> + 30000.
69 void execute(
70 const OUString& _rURL,
71 const OUString& _rFilter,
72 sal_Int32 _nMinTimeout,
73 sal_Int32 _nMaxTimeout,
74 const css::uno::Sequence< OUString >& rDenyList );
76 /// cancels the running action
77 void cancel();
79 protected:
80 virtual ~AsyncPickerAction() override;
82 private:
83 DECL_LINK( OnActionDone, void*, void );
85 AsyncPickerAction( const AsyncPickerAction& ) = delete;
86 AsyncPickerAction& operator=( const AsyncPickerAction& ) = delete;
90 } // namespace svt
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */