Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_DPGROUPDLG_HXX
30 : : #define SC_DPGROUPDLG_HXX
31 : :
32 : : #include <vcl/fixed.hxx>
33 : : #include <vcl/dialog.hxx>
34 : : #include <vcl/button.hxx>
35 : : #include <vcl/field.hxx>
36 : : #include <svx/checklbx.hxx>
37 : : #include "editfield.hxx"
38 : : #include "dpgroup.hxx"
39 : :
40 : : // ============================================================================
41 : :
42 : : class ScDPGroupEditHelper
43 : : {
44 : : public:
45 : : explicit ScDPGroupEditHelper(
46 : : RadioButton& rRbAuto, RadioButton& rRbMan,
47 : : Edit& rEdValue );
48 : :
49 : : bool IsAuto() const;
50 : : double GetValue() const;
51 : : void SetValue( bool bAuto, double fValue );
52 : :
53 : : protected:
54 : 0 : ~ScDPGroupEditHelper() {}
55 : :
56 : : private:
57 : : virtual bool ImplGetValue( double& rfValue ) const = 0;
58 : : virtual void ImplSetValue( double fValue ) = 0;
59 : :
60 : : DECL_LINK( ClickHdl, RadioButton* );
61 : :
62 : : private:
63 : : RadioButton& mrRbAuto;
64 : : RadioButton& mrRbMan;
65 : : Edit& mrEdValue;
66 : : };
67 : :
68 : : // ----------------------------------------------------------------------------
69 : :
70 : : class ScDPNumGroupEditHelper : public ScDPGroupEditHelper
71 : : {
72 : : public:
73 : : explicit ScDPNumGroupEditHelper(
74 : : RadioButton& rRbAuto, RadioButton& rRbMan,
75 : : ScDoubleField& rEdValue );
76 : :
77 : 0 : virtual ~ScDPNumGroupEditHelper() {}
78 : :
79 : : private:
80 : : virtual bool ImplGetValue( double& rfValue ) const;
81 : : virtual void ImplSetValue( double fValue );
82 : :
83 : : private:
84 : : ScDoubleField& mrEdValue;
85 : : };
86 : :
87 : : // ----------------------------------------------------------------------------
88 : :
89 : : class ScDPDateGroupEditHelper : public ScDPGroupEditHelper
90 : : {
91 : : public:
92 : : explicit ScDPDateGroupEditHelper(
93 : : RadioButton& rRbAuto, RadioButton& rRbMan,
94 : : DateField& rEdValue, const Date& rNullDate );
95 : :
96 : 0 : virtual ~ScDPDateGroupEditHelper() {}
97 : :
98 : : private:
99 : : virtual bool ImplGetValue( double& rfValue ) const;
100 : : virtual void ImplSetValue( double fValue );
101 : :
102 : : private:
103 : : DateField& mrEdValue;
104 : : Date maNullDate;
105 : : };
106 : :
107 : : // ============================================================================
108 : : // ============================================================================
109 : :
110 : 0 : class ScDPNumGroupDlg : public ModalDialog
111 : : {
112 : : public:
113 : : explicit ScDPNumGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo );
114 : :
115 : : ScDPNumGroupInfo GetGroupInfo() const;
116 : :
117 : : private:
118 : : FixedLine maFlStart;
119 : : RadioButton maRbAutoStart;
120 : : RadioButton maRbManStart;
121 : : ScDoubleField maEdStart;
122 : : FixedLine maFlEnd;
123 : : RadioButton maRbAutoEnd;
124 : : RadioButton maRbManEnd;
125 : : ScDoubleField maEdEnd;
126 : : FixedLine maFlBy;
127 : : ScDoubleField maEdBy;
128 : : OKButton maBtnOk;
129 : : CancelButton maBtnCancel;
130 : : HelpButton maBtnHelp;
131 : : ScDPNumGroupEditHelper maStartHelper;
132 : : ScDPNumGroupEditHelper maEndHelper;
133 : : };
134 : :
135 : : // ============================================================================
136 : :
137 : 0 : class ScDPDateGroupDlg : public ModalDialog
138 : : {
139 : : public:
140 : : explicit ScDPDateGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo,
141 : : sal_Int32 nDatePart, const Date& rNullDate );
142 : :
143 : : ScDPNumGroupInfo GetGroupInfo() const;
144 : : sal_Int32 GetDatePart() const;
145 : :
146 : : private:
147 : : DECL_LINK( ClickHdl, RadioButton* );
148 : : DECL_LINK( CheckHdl, SvxCheckListBox* );
149 : :
150 : : private:
151 : : FixedLine maFlStart;
152 : : RadioButton maRbAutoStart;
153 : : RadioButton maRbManStart;
154 : : DateField maEdStart;
155 : : FixedLine maFlEnd;
156 : : RadioButton maRbAutoEnd;
157 : : RadioButton maRbManEnd;
158 : : DateField maEdEnd;
159 : : FixedLine maFlBy;
160 : : RadioButton maRbNumDays;
161 : : RadioButton maRbUnits;
162 : : NumericField maEdNumDays;
163 : : SvxCheckListBox maLbUnits;
164 : : OKButton maBtnOk;
165 : : CancelButton maBtnCancel;
166 : : HelpButton maBtnHelp;
167 : : ScDPDateGroupEditHelper maStartHelper;
168 : : ScDPDateGroupEditHelper maEndHelper;
169 : : };
170 : :
171 : : // ============================================================================
172 : :
173 : : #endif
174 : :
175 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|