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/.
12 #include <datamapper.hxx>
14 #include <sal/config.h>
16 #include <com/sun/star/awt/XWindow.hpp>
17 #include <vcl/idle.hxx>
18 #include <vcl/weld.hxx>
19 #include "datatableview.hxx"
23 class ScDataTransformationBaseControl
;
26 class ScDataProviderDlg
: public weld::GenericDialogController
29 std::shared_ptr
<ScDocument
> mxDoc
;
30 std::unique_ptr
<weld::Container
> mxBox
;
31 css::uno::Reference
<css::awt::XWindow
> m_xTableParent
;
32 VclPtr
<ScDataTableView
> mxTable
;
33 std::unique_ptr
<weld::Container
> mxList
;
34 std::unique_ptr
<weld::ComboBox
> mxDBRanges
;
35 std::unique_ptr
<weld::Button
> mxOKBtn
;
36 std::unique_ptr
<weld::Button
> mxCancelBtn
;
37 std::unique_ptr
<weld::Button
> mxAddTransformationBtn
;
38 std::unique_ptr
<weld::ScrolledWindow
> mxScroll
;
39 std::unique_ptr
<weld::Container
> mxTransformationList
;
40 std::unique_ptr
<weld::ComboBox
> mxTransformationBox
;
41 std::unique_ptr
<weld::ComboBox
> mxProviderList
;
42 std::unique_ptr
<weld::Entry
> mxEditURL
;
43 std::unique_ptr
<weld::Entry
> mxEditID
;
44 std::unique_ptr
<weld::Button
> mxApplyBtn
;
45 std::unique_ptr
<weld::Button
> mxBrowseBtn
;
47 OUString msApplyTooltip
;
48 OUString msAddTransformationToolTip
;
50 std::vector
<std::unique_ptr
<ScDataTransformationBaseControl
>> maControls
;
57 DECL_LINK(StartMenuHdl
, const OString
&, void);
58 DECL_LINK(ColumnMenuHdl
, const weld::ComboBox
&, void);
59 DECL_LINK(ScrollToEnd
, Timer
*, void);
60 DECL_LINK(ApplyQuitHdl
, weld::Button
&, void);
61 DECL_LINK(CancelQuitHdl
, weld::Button
&, void);
62 DECL_LINK(TransformationListHdl
, weld::Button
&, void);
63 DECL_LINK(ProviderSelectHdl
, weld::ComboBox
&, void);
64 DECL_LINK(TransformationSelectHdl
, weld::ComboBox
&, void);
65 DECL_LINK(IDEditHdl
, weld::Entry
&, void);
66 DECL_LINK(URLEditHdl
, weld::Entry
&, void);
67 DECL_LINK(ApplyBtnHdl
, weld::Button
&, void);
68 DECL_LINK(BrowseBtnHdl
, weld::Button
&, void);
71 ScDataProviderDlg(weld::Window
* pWindow
, std::shared_ptr
<ScDocument
> pDoc
,
72 const ScDocument
* pDocument
);
73 virtual ~ScDataProviderDlg() override
;
81 void textTransformation();
82 void sortTransformation();
83 void aggregateFunction();
84 void numberTransformation();
85 void deletefromList(sal_uInt32 nIndex
);
86 void replaceNullTransformation();
87 void dateTimeTransformation();
88 void findReplaceTransformation();
89 void deleteRowTransformation();
90 void swapRowsTransformation();
92 void updateApplyBtn(bool bValidConfig
);
95 sc::ExternalDataSource
getDataSource(ScDocument
* pDoc
);
97 void import(ScDocument
& rDoc
, bool bInternal
= false);
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */