1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
36 explicit ScDPGroupEditHelper(
37 RadioButton
& rRbAuto
, RadioButton
& rRbMan
,
41 double GetValue() const;
42 void SetValue( bool bAuto
, double fValue
);
45 ~ScDPGroupEditHelper() {}
48 virtual bool ImplGetValue( double& rfValue
) const = 0;
49 virtual void ImplSetValue( double fValue
) = 0;
51 DECL_LINK( ClickHdl
, RadioButton
* );
54 RadioButton
& mrRbAuto
;
59 // ----------------------------------------------------------------------------
61 class ScDPNumGroupEditHelper
: public ScDPGroupEditHelper
64 explicit ScDPNumGroupEditHelper(
65 RadioButton
& rRbAuto
, RadioButton
& rRbMan
,
66 ScDoubleField
& rEdValue
);
68 virtual ~ScDPNumGroupEditHelper() {}
71 virtual bool ImplGetValue( double& rfValue
) const;
72 virtual void ImplSetValue( double fValue
);
75 ScDoubleField
& mrEdValue
;
78 // ----------------------------------------------------------------------------
80 class ScDPDateGroupEditHelper
: public ScDPGroupEditHelper
83 explicit ScDPDateGroupEditHelper(
84 RadioButton
& rRbAuto
, RadioButton
& rRbMan
,
85 DateField
& rEdValue
, const Date
& rNullDate
);
87 virtual ~ScDPDateGroupEditHelper() {}
90 virtual bool ImplGetValue( double& rfValue
) const;
91 virtual void ImplSetValue( double fValue
);
98 // ============================================================================
99 // ============================================================================
101 class ScDPNumGroupDlg
: public ModalDialog
104 explicit ScDPNumGroupDlg( Window
* pParent
, const ScDPNumGroupInfo
& rInfo
);
106 ScDPNumGroupInfo
GetGroupInfo() const;
110 RadioButton maRbAutoStart
;
111 RadioButton maRbManStart
;
112 ScDoubleField maEdStart
;
114 RadioButton maRbAutoEnd
;
115 RadioButton maRbManEnd
;
116 ScDoubleField maEdEnd
;
118 ScDoubleField maEdBy
;
120 CancelButton maBtnCancel
;
121 HelpButton maBtnHelp
;
122 ScDPNumGroupEditHelper maStartHelper
;
123 ScDPNumGroupEditHelper maEndHelper
;
126 // ============================================================================
128 class ScDPDateGroupDlg
: public ModalDialog
131 explicit ScDPDateGroupDlg( Window
* pParent
, const ScDPNumGroupInfo
& rInfo
,
132 sal_Int32 nDatePart
, const Date
& rNullDate
);
134 ScDPNumGroupInfo
GetGroupInfo() const;
135 sal_Int32
GetDatePart() const;
138 DECL_LINK( ClickHdl
, RadioButton
* );
139 DECL_LINK( CheckHdl
, SvxCheckListBox
* );
143 RadioButton maRbAutoStart
;
144 RadioButton maRbManStart
;
147 RadioButton maRbAutoEnd
;
148 RadioButton maRbManEnd
;
151 RadioButton maRbNumDays
;
152 RadioButton maRbUnits
;
153 NumericField maEdNumDays
;
154 SvxCheckListBox maLbUnits
;
156 CancelButton maBtnCancel
;
157 HelpButton maBtnHelp
;
158 ScDPDateGroupEditHelper maStartHelper
;
159 ScDPDateGroupEditHelper maEndHelper
;
162 // ============================================================================
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */