Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / StatisticsTwoVariableDialog.hxx
blob41c0df053447aedf58544a9ab193670ae31906ba
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 #ifndef INCLUDED_SC_SOURCE_UI_INC_STATISTICSTWOVARIABLEDIALOG_HXX
12 #define INCLUDED_SC_SOURCE_UI_INC_STATISTICSTWOVARIABLEDIALOG_HXX
14 #include "global.hxx"
15 #include "address.hxx"
16 #include "anyrefdg.hxx"
18 #include <vcl/fixed.hxx>
19 #include <vcl/group.hxx>
20 #include <vcl/lstbox.hxx>
22 class ScStatisticsTwoVariableDialog : public ScAnyRefDlg
24 public:
25 enum GroupedBy {
26 BY_COLUMN,
27 BY_ROW
30 ScStatisticsTwoVariableDialog(
31 SfxBindings* pB, SfxChildWindow* pCW,
32 vcl::Window* pParent, ScViewData* pViewData,
33 const OUString& rID, const OUString& rUIXMLDescription );
35 virtual ~ScStatisticsTwoVariableDialog();
36 virtual void dispose() override;
38 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
39 virtual void SetActive() override;
41 protected:
42 void CalculateInputAndWriteToOutput();
44 virtual ScRange ApplyOutput(ScDocShell* pDocShell) = 0;
45 virtual sal_Int16 GetUndoNameId() = 0;
47 // Widgets
48 VclPtr<FixedText> mpVariable1RangeLabel;
49 VclPtr<formula::RefEdit> mpVariable1RangeEdit;
50 VclPtr<formula::RefButton> mpVariable1RangeButton;
52 VclPtr<FixedText> mpVariable2RangeLabel;
53 VclPtr<formula::RefEdit> mpVariable2RangeEdit;
54 VclPtr<formula::RefButton> mpVariable2RangeButton;
56 VclPtr<FixedText> mpOutputRangeLabel;
57 VclPtr<formula::RefEdit> mpOutputRangeEdit;
58 VclPtr<formula::RefButton> mpOutputRangeButton;
60 // Data
61 ScViewData* mViewData;
62 ScDocument* mDocument;
64 ScRange mVariable1Range;
65 ScRange mVariable2Range;
67 ScAddress::Details mAddressDetails;
68 ScAddress mOutputAddress;
69 GroupedBy mGroupedBy;
71 private:
72 // Widgets
73 VclPtr<OKButton> mpButtonOk;
75 VclPtr<RadioButton> mpGroupByColumnsRadio;
76 VclPtr<RadioButton> mpGroupByRowsRadio;
78 VclPtr<formula::RefEdit> mpActiveEdit;
79 ScAddress mCurrentAddress;
80 bool mDialogLostFocus;
82 void Init();
83 void GetRangeFromSelection();
85 DECL_LINK_TYPED( GroupByChanged, RadioButton&, void );
86 DECL_LINK_TYPED( OkClicked, Button*, void );
87 DECL_LINK_TYPED( GetFocusHandler, Control&, void );
88 DECL_LINK_TYPED( LoseFocusHandler, Control&, void );
89 DECL_LINK_TYPED( RefInputModifyHandler, Edit&, void );
92 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */