Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / dpgroupdlg.hxx
blob045997ca88debad82a730a644ce803215f976061
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 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_DPGROUPDLG_HXX
21 #define SC_DPGROUPDLG_HXX
23 #include <vcl/fixed.hxx>
24 #include <vcl/dialog.hxx>
25 #include <vcl/button.hxx>
26 #include <vcl/field.hxx>
27 #include <svx/checklbx.hxx>
28 #include "editfield.hxx"
29 #include "dpgroup.hxx"
31 // ============================================================================
33 class ScDPGroupEditHelper
35 public:
36 explicit ScDPGroupEditHelper(
37 RadioButton& rRbAuto, RadioButton& rRbMan,
38 Edit& rEdValue );
40 bool IsAuto() const;
41 double GetValue() const;
42 void SetValue( bool bAuto, double fValue );
44 protected:
45 ~ScDPGroupEditHelper() {}
47 private:
48 virtual bool ImplGetValue( double& rfValue ) const = 0;
49 virtual void ImplSetValue( double fValue ) = 0;
51 DECL_LINK( ClickHdl, RadioButton* );
53 private:
54 RadioButton& mrRbAuto;
55 RadioButton& mrRbMan;
56 Edit& mrEdValue;
59 // ----------------------------------------------------------------------------
61 class ScDPNumGroupEditHelper : public ScDPGroupEditHelper
63 public:
64 explicit ScDPNumGroupEditHelper(
65 RadioButton& rRbAuto, RadioButton& rRbMan,
66 ScDoubleField& rEdValue );
68 virtual ~ScDPNumGroupEditHelper() {}
70 private:
71 virtual bool ImplGetValue( double& rfValue ) const;
72 virtual void ImplSetValue( double fValue );
74 private:
75 ScDoubleField& mrEdValue;
78 // ----------------------------------------------------------------------------
80 class ScDPDateGroupEditHelper : public ScDPGroupEditHelper
82 public:
83 explicit ScDPDateGroupEditHelper(
84 RadioButton& rRbAuto, RadioButton& rRbMan,
85 DateField& rEdValue, const Date& rNullDate );
87 virtual ~ScDPDateGroupEditHelper() {}
89 private:
90 virtual bool ImplGetValue( double& rfValue ) const;
91 virtual void ImplSetValue( double fValue );
93 private:
94 DateField& mrEdValue;
95 Date maNullDate;
98 // ============================================================================
99 // ============================================================================
101 class ScDPNumGroupDlg : public ModalDialog
103 public:
104 explicit ScDPNumGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo );
106 ScDPNumGroupInfo GetGroupInfo() const;
108 private:
109 FixedLine maFlStart;
110 RadioButton maRbAutoStart;
111 RadioButton maRbManStart;
112 ScDoubleField maEdStart;
113 FixedLine maFlEnd;
114 RadioButton maRbAutoEnd;
115 RadioButton maRbManEnd;
116 ScDoubleField maEdEnd;
117 FixedLine maFlBy;
118 ScDoubleField maEdBy;
119 OKButton maBtnOk;
120 CancelButton maBtnCancel;
121 HelpButton maBtnHelp;
122 ScDPNumGroupEditHelper maStartHelper;
123 ScDPNumGroupEditHelper maEndHelper;
126 // ============================================================================
128 class ScDPDateGroupDlg : public ModalDialog
130 public:
131 explicit ScDPDateGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo,
132 sal_Int32 nDatePart, const Date& rNullDate );
134 ScDPNumGroupInfo GetGroupInfo() const;
135 sal_Int32 GetDatePart() const;
137 private:
138 DECL_LINK( ClickHdl, RadioButton* );
139 DECL_LINK( CheckHdl, SvxCheckListBox* );
141 private:
142 FixedLine maFlStart;
143 RadioButton maRbAutoStart;
144 RadioButton maRbManStart;
145 DateField maEdStart;
146 FixedLine maFlEnd;
147 RadioButton maRbAutoEnd;
148 RadioButton maRbManEnd;
149 DateField maEdEnd;
150 FixedLine maFlBy;
151 RadioButton maRbNumDays;
152 RadioButton maRbUnits;
153 NumericField maEdNumDays;
154 SvxCheckListBox maLbUnits;
155 OKButton maBtnOk;
156 CancelButton maBtnCancel;
157 HelpButton maBtnHelp;
158 ScDPDateGroupEditHelper maStartHelper;
159 ScDPDateGroupEditHelper maEndHelper;
162 // ============================================================================
164 #endif
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */