Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / StatisticsInputOutputDialog.hxx
blob8a316b47e45fccd7ad5b9e93747f6a30c7e8b807
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 STATISTICS_INPUT_OUTPUT_DIALOG_HXX
12 #define STATISTICS_INPUT_OUTPUT_DIALOG_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 ScStatisticsInputOutputDialog : public ScAnyRefDlg
24 public:
25 enum GroupedBy {
26 BY_COLUMN,
27 BY_ROW
30 ScStatisticsInputOutputDialog(
31 SfxBindings* pB, SfxChildWindow* pCW,
32 Window* pParent, ScViewData* pViewData,
33 const OString& rID, const OUString& rUIXMLDescription );
35 virtual ~ScStatisticsInputOutputDialog();
37 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
38 virtual void SetActive();
40 protected:
41 virtual void CalculateInputAndWriteToOutput();
43 virtual ScRange ApplyOutput(ScDocShell* pDocShell) = 0;
44 virtual sal_Int16 GetUndoNameId() = 0;
46 // Widgets
47 FixedText* mpInputRangeLabel;
48 formula::RefEdit* mpInputRangeEdit;
49 formula::RefButton* mpInputRangeButton;
51 FixedText* mpOutputRangeLabel;
52 formula::RefEdit* mpOutputRangeEdit;
53 formula::RefButton* mpOutputRangeButton;
55 // Data
56 ScViewData* mViewData;
57 ScDocument* mDocument;
59 ScRange mInputRange;
60 ScAddress::Details mAddressDetails;
61 ScAddress mOutputAddress;
62 GroupedBy mGroupedBy;
64 static ScRangeList MakeColumnRangeList(SCTAB aTab, ScAddress aStart, ScAddress aEnd);
65 static ScRangeList MakeRowRangeList(SCTAB aTab, ScAddress aStart, ScAddress aEnd);
67 private:
68 // Widgets
69 PushButton* mpButtonApply;
70 OKButton* mpButtonOk;
71 CloseButton* mpButtonClose;
72 RadioButton* mpGroupByColumnsRadio;
73 RadioButton* mpGroupByRowsRadio;
75 formula::RefEdit* mpActiveEdit;
76 ScAddress mCurrentAddress;
77 bool mDialogLostFocus;
79 void Init();
80 void GetRangeFromSelection();
82 DECL_LINK( GroupByChanged, void* );
83 DECL_LINK( OkClicked, PushButton* );
84 DECL_LINK( CloseClicked, PushButton* );
85 DECL_LINK( ApplyClicked, PushButton* );
86 DECL_LINK( GetFocusHandler, Control* );
87 DECL_LINK( LoseFocusHandler, void* );
90 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */