Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / SamplingDialog.hxx
blob02f07cd1ea51b9ac5e925aad72dd3daedf009a00
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 SAMPLING_DIALOG_HXX
12 #define SAMPLING_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 ScSamplingDialog : public ScAnyRefDlg
24 public:
25 ScSamplingDialog(
26 SfxBindings* pB, SfxChildWindow* pCW,
27 Window* pParent, ScViewData* pViewData );
29 virtual ~ScSamplingDialog();
31 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
32 virtual void SetActive();
33 virtual sal_Bool Close();
35 private:
36 // Widgets
37 FixedText* mpInputRangeLabel;
38 formula::RefEdit* mpInputRangeEdit;
39 formula::RefButton* mpInputRangeButton;
41 FixedText* mpOutputRangeLabel;
42 formula::RefEdit* mpOutputRangeEdit;
43 formula::RefButton* mpOutputRangeButton;
45 NumericField* mpSampleSize;
46 NumericField* mpPeriod;
48 RadioButton* mpRandomMethodRadio;
49 RadioButton* mpPeriodicMethodRadio;
51 PushButton* mpButtonApply;
52 OKButton* mpButtonOk;
53 CloseButton* mpButtonClose;
56 formula::RefEdit* mpActiveEdit;
58 // Data
59 ScViewData* mViewData;
60 ScDocument* mDocument;
62 ScRange mInputRange;
63 ScAddress::Details mAddressDetails;
64 ScAddress mOutputAddress;
66 ScAddress mCurrentAddress;
68 bool mDialogLostFocus;
70 void Init();
71 void GetRangeFromSelection();
72 void PerformSampling();
74 ScRange PerformRandomSampling(ScDocShell* pDocShell);
75 ScRange PerformPeriodicSampling(ScDocShell* pDocShell);
77 DECL_LINK( OkClicked, PushButton* );
78 DECL_LINK( CloseClicked, PushButton* );
79 DECL_LINK( ApplyClicked, PushButton* );
80 DECL_LINK( GetFocusHandler, Control* );
81 DECL_LINK( LoseFocusHandler, void* );
82 DECL_LINK( SamplingSizeValueModified, void* );
83 DECL_LINK( ToggleSamplingMethod, void* );
86 #endif
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */