tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / StatisticsInputOutputDialog.hxx
blobe831772c84515c7bc49f1fc3f5ac8f948d3d60ca
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 */
11 #pragma once
13 #include <address.hxx>
14 #include "anyrefdg.hxx"
15 #include "viewdata.hxx"
17 class ScStatisticsInputOutputDialog : public ScAnyRefDlgController
19 public:
20 enum GroupedBy {
21 BY_COLUMN,
22 BY_ROW
25 ScStatisticsInputOutputDialog(
26 SfxBindings* pB, SfxChildWindow* pCW,
27 weld::Window* pParent, ScViewData& rViewData,
28 const OUString& rUIXMLDescription,
29 const OUString& rID);
31 virtual ~ScStatisticsInputOutputDialog() override;
33 virtual void SetReference( const ScRange& rRef, ScDocument& rDoc ) override;
34 virtual void SetActive() override;
36 protected:
37 void CalculateInputAndWriteToOutput();
39 virtual ScRange ApplyOutput(ScDocShell* pDocShell) = 0;
40 virtual TranslateId GetUndoNameId() = 0;
41 virtual bool InputRangesValid();
42 void ValidateDialogInput();
44 // Widgets
45 std::unique_ptr<weld::Label> mxInputRangeLabel;
46 std::unique_ptr<formula::RefEdit> mxInputRangeEdit;
47 std::unique_ptr<formula::RefButton> mxInputRangeButton;
49 std::unique_ptr<weld::Label> mxOutputRangeLabel;
50 std::unique_ptr<formula::RefEdit> mxOutputRangeEdit;
51 std::unique_ptr<formula::RefButton> mxOutputRangeButton;
53 std::unique_ptr<weld::RadioButton> mxGroupByColumnsRadio;
54 std::unique_ptr<weld::RadioButton> mxGroupByRowsRadio;
56 // Data
57 ScViewData& mViewData;
58 ScDocument& mDocument;
60 ScRange mInputRange;
61 ScAddress::Details mAddressDetails;
62 ScAddress mOutputAddress;
63 GroupedBy mGroupedBy;
65 static ScRangeList MakeColumnRangeList(SCTAB aTab, ScAddress const & aStart, ScAddress const & aEnd);
66 static ScRangeList MakeRowRangeList(SCTAB aTab, ScAddress const & aStart, ScAddress const & aEnd);
68 private:
69 // Widgets
70 std::unique_ptr<weld::Button> mxButtonOk;
71 std::unique_ptr<weld::Button> mxButtonCancel;
73 formula::RefEdit* mpActiveEdit;
74 ScAddress mCurrentAddress;
75 bool mDialogLostFocus;
77 void Init();
78 void GetRangeFromSelection();
80 DECL_LINK( GroupByChanged, weld::Toggleable&, void );
81 DECL_LINK( ButtonClicked, weld::Button&, void );
82 DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void );
83 DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void );
84 DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void );
85 DECL_LINK( LoseButtonFocusHandler, formula::RefButton&, void );
86 DECL_LINK( RefInputModifyHandler, formula::RefEdit&, void );
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */