update dev300-m58
[ooovba.git] / sc / source / ui / inc / dpgroupdlg.hxx
blob3a38e48dfe5ddaffb26432ec6d09a5add24e0619
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dpgroupdlg.hxx,v $
10 * $Revision: 1.4 $
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
34 #ifndef _FIXED_HXX
35 #include <vcl/fixed.hxx>
36 #endif
37 #ifndef _DIALOG_HXX
38 #include <vcl/dialog.hxx>
39 #endif
40 #ifndef _BUTTON_HXX
41 #include <vcl/button.hxx>
42 #endif
43 #include <vcl/field.hxx>
44 #include <svx/checklbx.hxx>
45 #include "editfield.hxx"
46 #include "dpgroup.hxx"
48 // ============================================================================
50 class ScDPGroupEditHelper
52 public:
53 explicit ScDPGroupEditHelper(
54 RadioButton& rRbAuto, RadioButton& rRbMan,
55 Edit& rEdValue );
57 bool IsAuto() const;
58 double GetValue() const;
59 void SetValue( bool bAuto, double fValue );
61 private:
62 virtual bool ImplGetValue( double& rfValue ) const = 0;
63 virtual void ImplSetValue( double fValue ) = 0;
65 DECL_LINK( ClickHdl, RadioButton* );
67 private:
68 RadioButton& mrRbAuto;
69 RadioButton& mrRbMan;
70 Edit& mrEdValue;
73 // ----------------------------------------------------------------------------
75 class ScDPNumGroupEditHelper : public ScDPGroupEditHelper
77 public:
78 explicit ScDPNumGroupEditHelper(
79 RadioButton& rRbAuto, RadioButton& rRbMan,
80 ScDoubleField& rEdValue );
82 private:
83 virtual bool ImplGetValue( double& rfValue ) const;
84 virtual void ImplSetValue( double fValue );
86 private:
87 ScDoubleField& mrEdValue;
90 // ----------------------------------------------------------------------------
92 class ScDPDateGroupEditHelper : public ScDPGroupEditHelper
94 public:
95 explicit ScDPDateGroupEditHelper(
96 RadioButton& rRbAuto, RadioButton& rRbMan,
97 DateField& rEdValue, const Date& rNullDate );
99 private:
100 virtual bool ImplGetValue( double& rfValue ) const;
101 virtual void ImplSetValue( double fValue );
103 private:
104 DateField& mrEdValue;
105 Date maNullDate;
108 // ============================================================================
109 // ============================================================================
111 class ScDPNumGroupDlg : public ModalDialog
113 public:
114 explicit ScDPNumGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo );
116 ScDPNumGroupInfo GetGroupInfo() const;
118 private:
119 FixedLine maFlStart;
120 RadioButton maRbAutoStart;
121 RadioButton maRbManStart;
122 ScDoubleField maEdStart;
123 FixedLine maFlEnd;
124 RadioButton maRbAutoEnd;
125 RadioButton maRbManEnd;
126 ScDoubleField maEdEnd;
127 FixedLine maFlBy;
128 ScDoubleField maEdBy;
129 OKButton maBtnOk;
130 CancelButton maBtnCancel;
131 HelpButton maBtnHelp;
132 ScDPNumGroupEditHelper maStartHelper;
133 ScDPNumGroupEditHelper maEndHelper;
136 // ============================================================================
138 class ScDPDateGroupDlg : public ModalDialog
140 public:
141 explicit ScDPDateGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo,
142 sal_Int32 nDatePart, const Date& rNullDate );
144 ScDPNumGroupInfo GetGroupInfo() const;
145 sal_Int32 GetDatePart() const;
147 private:
148 DECL_LINK( ClickHdl, RadioButton* );
149 DECL_LINK( CheckHdl, SvxCheckListBox* );
151 private:
152 FixedLine maFlStart;
153 RadioButton maRbAutoStart;
154 RadioButton maRbManStart;
155 DateField maEdStart;
156 FixedLine maFlEnd;
157 RadioButton maRbAutoEnd;
158 RadioButton maRbManEnd;
159 DateField maEdEnd;
160 FixedLine maFlBy;
161 RadioButton maRbNumDays;
162 RadioButton maRbUnits;
163 NumericField maEdNumDays;
164 SvxCheckListBox maLbUnits;
165 OKButton maBtnOk;
166 CancelButton maBtnCancel;
167 HelpButton maBtnHelp;
168 ScDPDateGroupEditHelper maStartHelper;
169 ScDPDateGroupEditHelper maEndHelper;
172 // ============================================================================
174 #endif