LibreOffice Module sc (master)  1
dataproviderdlg.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  */
9 
10 #pragma once
11 
12 #include <datamapper.hxx>
13 
14 #include <sal/config.h>
15 
16 #include <com/sun/star/awt/XWindow.hpp>
17 #include <vcl/idle.hxx>
18 #include <vcl/weld.hxx>
19 #include "datatableview.hxx"
20 #include <memory>
21 
22 class ScDocument;
24 class ScDBData;
25 
27 {
28 private:
29  std::shared_ptr<ScDocument> mxDoc;
30  std::unique_ptr<weld::Container> mxBox;
31  css::uno::Reference<css::awt::XWindow> m_xTableParent;
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;
46 
47  OUString msApplyTooltip;
49 
50  std::vector<std::unique_ptr<ScDataTransformationBaseControl>> maControls;
51 
53 
54  sal_uInt32 mnIndex;
56 
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);
69 
70 public:
71  ScDataProviderDlg(weld::Window* pWindow, std::shared_ptr<ScDocument> pDoc,
72  const ScDocument* pDocument);
73  virtual ~ScDataProviderDlg() override;
74 
75  void applyAndQuit();
76  void cancelAndQuit();
77 
78  void deleteColumn();
79  void splitColumn();
80  void mergeColumns();
81  void textTransformation();
82  void sortTransformation();
83  void aggregateFunction();
84  void numberTransformation();
85  void deletefromList(sal_uInt32 nIndex);
91 
92  void updateApplyBtn(bool bValidConfig);
93  void isValid();
94 
96 
97  void import(ScDocument& rDoc, bool bInternal = false);
98 };
99 
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< ScDocument > mxDoc
std::unique_ptr< weld::Button > mxCancelBtn
std::unique_ptr< weld::ScrolledWindow > mxScroll
std::unique_ptr< weld::Button > mxOKBtn
std::unique_ptr< weld::Button > mxBrowseBtn
std::unique_ptr< weld::Button > mxApplyBtn
std::unique_ptr< weld::Container > mxBox
std::unique_ptr< weld::Container > mxTransformationList
void updateApplyBtn(bool bValidConfig)
std::unique_ptr< weld::ComboBox > mxTransformationBox
css::uno::Reference< css::awt::XWindow > m_xTableParent
std::unique_ptr< weld::Entry > mxEditID
void deletefromList(sal_uInt32 nIndex)
std::unique_ptr< weld::ComboBox > mxProviderList
sc::ExternalDataSource getDataSource(ScDocument *pDoc)
virtual ~ScDataProviderDlg() override
ScDataProviderDlg(weld::Window *pWindow, std::shared_ptr< ScDocument > pDoc, const ScDocument *pDocument)
OUString msAddTransformationToolTip
std::unique_ptr< weld::ComboBox > mxDBRanges
std::unique_ptr< weld::Entry > mxEditURL
VclPtr< ScDataTableView > mxTable
std::vector< std::unique_ptr< ScDataTransformationBaseControl > > maControls
std::unique_ptr< weld::Container > mxList
DECL_LINK(StartMenuHdl, const OString &, void)
std::unique_ptr< weld::Button > mxAddTransformationBtn