1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sfx2/objsh.hxx>
23 #include <vcl/weld.hxx>
25 namespace sfx2
{ class DocumentInserter
; }
26 namespace sfx2
{ class FileDialogHelper
; }
31 class ScLinkedAreaDlg
: public weld::GenericDialogController
34 rtl::Reference
<ScDocShell
> m_pSourceShell
;
35 std::unique_ptr
<sfx2::DocumentInserter
> m_xDocInserter
;
37 std::unique_ptr
<SvtURLBox
> m_xCbUrl
;
38 std::unique_ptr
<weld::Button
> m_xBtnBrowse
;
39 std::unique_ptr
<weld::TreeView
> m_xLbRanges
;
40 std::unique_ptr
<weld::CheckButton
> m_xBtnReload
;
41 std::unique_ptr
<weld::SpinButton
> m_xNfDelay
;
42 std::unique_ptr
<weld::Label
> m_xFtSeconds
;
43 std::unique_ptr
<weld::Button
> m_xBtnOk
;
45 DECL_LINK(FileHdl
, weld::ComboBox
&, bool);
46 DECL_LINK(BrowseHdl
, weld::Button
&, void);
47 DECL_LINK(RangeHdl
, weld::TreeView
&, void);
48 DECL_LINK(ReloadHdl
, weld::Toggleable
&, void);
49 DECL_LINK(DialogClosedHdl
, sfx2::FileDialogHelper
*, void);
51 void UpdateSourceRanges();
53 void LoadDocument( const OUString
& rFile
, const OUString
& rFilter
,
54 const OUString
& rOptions
);
57 ScLinkedAreaDlg(weld::Widget
* pParent
);
58 virtual ~ScLinkedAreaDlg() override
;
60 void InitFromOldLink( const OUString
& rFile
, const OUString
& rFilter
,
61 const OUString
& rOptions
, std::u16string_view rSource
,
62 sal_Int32 nRefreshDelaySeconds
);
64 OUString
GetURL() const;
65 OUString
GetFilter() const; // may be empty
66 OUString
GetOptions() const; // filter options
67 OUString
GetSource() const; // separated by ";"
68 sal_Int32
GetRefreshDelaySeconds() const; // 0 if disabled
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */