tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / StatisticsTwoVariableDialog.hxx
blob150a57420913c7fdfeaafd8bce879af753ffedb7
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 ScStatisticsTwoVariableDialog : public ScAnyRefDlgController
19 public:
20 enum GroupedBy {
21 BY_COLUMN,
22 BY_ROW
25 ScStatisticsTwoVariableDialog(
26 SfxBindings* pB, SfxChildWindow* pCW,
27 weld::Window* pParent, ScViewData& rViewData,
28 const OUString& rUIXMLDescription, const OUString& rID);
30 virtual ~ScStatisticsTwoVariableDialog() override;
32 virtual void SetReference( const ScRange& rRef, ScDocument& rDoc ) override;
33 virtual void SetActive() override;
35 protected:
36 void CalculateInputAndWriteToOutput();
38 virtual ScRange ApplyOutput(ScDocShell* pDocShell) = 0;
39 virtual TranslateId GetUndoNameId() = 0;
40 virtual bool InputRangesValid();
41 void ValidateDialogInput();
43 // Widgets
44 std::unique_ptr<weld::Label> mxVariable1RangeLabel;
45 std::unique_ptr<formula::RefEdit> mxVariable1RangeEdit;
46 std::unique_ptr<formula::RefButton> mxVariable1RangeButton;
48 std::unique_ptr<weld::Label> mxVariable2RangeLabel;
49 std::unique_ptr<formula::RefEdit> mxVariable2RangeEdit;
50 std::unique_ptr<formula::RefButton> mxVariable2RangeButton;
52 std::unique_ptr<weld::Label> mxOutputRangeLabel;
53 std::unique_ptr<formula::RefEdit> mxOutputRangeEdit;
54 std::unique_ptr<formula::RefButton> mxOutputRangeButton;
56 // Data
57 ScViewData& mViewData;
58 ScDocument& mDocument;
60 ScRange mVariable1Range;
61 ScRange mVariable2Range;
63 ScAddress::Details const mAddressDetails;
64 ScAddress mOutputAddress;
65 GroupedBy mGroupedBy;
67 private:
68 // Widgets
69 std::unique_ptr<weld::Button> mxButtonOk;
70 std::unique_ptr<weld::Button> mxButtonCancel;
72 std::unique_ptr<weld::RadioButton> mxGroupByColumnsRadio;
73 std::unique_ptr<weld::RadioButton> mxGroupByRowsRadio;
75 formula::RefEdit* mpActiveEdit;
76 ScAddress mCurrentAddress;
77 bool mDialogLostFocus;
79 void Init();
80 void GetRangeFromSelection();
82 DECL_LINK( GroupByChanged, weld::Toggleable&, void );
83 DECL_LINK( ButtonClicked, weld::Button&, void );
84 DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void );
85 DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void );
86 DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void );
87 DECL_LINK( LoseButtonFocusHandler, formula::RefButton&, void );
88 DECL_LINK( RefInputModifyHandler, formula::RefEdit&, void );
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */