1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dpgroupdlg.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_DPGROUPDLG_HXX
32 #define SC_DPGROUPDLG_HXX
35 #include <vcl/fixed.hxx>
38 #include <vcl/dialog.hxx>
41 #include <vcl/button.hxx>
43 #include <vcl/field.hxx>
44 #include <svx/checklbx.hxx>
45 #include "editfield.hxx"
46 #include "dpgroup.hxx"
48 // ============================================================================
50 class ScDPGroupEditHelper
53 explicit ScDPGroupEditHelper(
54 RadioButton
& rRbAuto
, RadioButton
& rRbMan
,
58 double GetValue() const;
59 void SetValue( bool bAuto
, double fValue
);
62 virtual bool ImplGetValue( double& rfValue
) const = 0;
63 virtual void ImplSetValue( double fValue
) = 0;
65 DECL_LINK( ClickHdl
, RadioButton
* );
68 RadioButton
& mrRbAuto
;
73 // ----------------------------------------------------------------------------
75 class ScDPNumGroupEditHelper
: public ScDPGroupEditHelper
78 explicit ScDPNumGroupEditHelper(
79 RadioButton
& rRbAuto
, RadioButton
& rRbMan
,
80 ScDoubleField
& rEdValue
);
83 virtual bool ImplGetValue( double& rfValue
) const;
84 virtual void ImplSetValue( double fValue
);
87 ScDoubleField
& mrEdValue
;
90 // ----------------------------------------------------------------------------
92 class ScDPDateGroupEditHelper
: public ScDPGroupEditHelper
95 explicit ScDPDateGroupEditHelper(
96 RadioButton
& rRbAuto
, RadioButton
& rRbMan
,
97 DateField
& rEdValue
, const Date
& rNullDate
);
100 virtual bool ImplGetValue( double& rfValue
) const;
101 virtual void ImplSetValue( double fValue
);
104 DateField
& mrEdValue
;
108 // ============================================================================
109 // ============================================================================
111 class ScDPNumGroupDlg
: public ModalDialog
114 explicit ScDPNumGroupDlg( Window
* pParent
, const ScDPNumGroupInfo
& rInfo
);
116 ScDPNumGroupInfo
GetGroupInfo() const;
120 RadioButton maRbAutoStart
;
121 RadioButton maRbManStart
;
122 ScDoubleField maEdStart
;
124 RadioButton maRbAutoEnd
;
125 RadioButton maRbManEnd
;
126 ScDoubleField maEdEnd
;
128 ScDoubleField maEdBy
;
130 CancelButton maBtnCancel
;
131 HelpButton maBtnHelp
;
132 ScDPNumGroupEditHelper maStartHelper
;
133 ScDPNumGroupEditHelper maEndHelper
;
136 // ============================================================================
138 class ScDPDateGroupDlg
: public ModalDialog
141 explicit ScDPDateGroupDlg( Window
* pParent
, const ScDPNumGroupInfo
& rInfo
,
142 sal_Int32 nDatePart
, const Date
& rNullDate
);
144 ScDPNumGroupInfo
GetGroupInfo() const;
145 sal_Int32
GetDatePart() const;
148 DECL_LINK( ClickHdl
, RadioButton
* );
149 DECL_LINK( CheckHdl
, SvxCheckListBox
* );
153 RadioButton maRbAutoStart
;
154 RadioButton maRbManStart
;
157 RadioButton maRbAutoEnd
;
158 RadioButton maRbManEnd
;
161 RadioButton maRbNumDays
;
162 RadioButton maRbUnits
;
163 NumericField maEdNumDays
;
164 SvxCheckListBox maLbUnits
;
166 CancelButton maBtnCancel
;
167 HelpButton maBtnHelp
;
168 ScDPDateGroupEditHelper maStartHelper
;
169 ScDPDateGroupEditHelper maEndHelper
;
172 // ============================================================================