xref: /aoo41x/main/sc/source/ui/inc/dpgroupdlg.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_DPGROUPDLG_HXX
25cdf0e10cSrcweir #define SC_DPGROUPDLG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _FIXED_HXX
28cdf0e10cSrcweir #include <vcl/fixed.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _DIALOG_HXX
31cdf0e10cSrcweir #include <vcl/dialog.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _BUTTON_HXX
34cdf0e10cSrcweir #include <vcl/button.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #include <vcl/field.hxx>
37cdf0e10cSrcweir #include <svx/checklbx.hxx>
38cdf0e10cSrcweir #include "editfield.hxx"
39cdf0e10cSrcweir #include "dpgroup.hxx"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // ============================================================================
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class ScDPGroupEditHelper
44cdf0e10cSrcweir {
45cdf0e10cSrcweir public:
46cdf0e10cSrcweir     explicit            ScDPGroupEditHelper(
47cdf0e10cSrcweir                             RadioButton& rRbAuto, RadioButton& rRbMan,
48cdf0e10cSrcweir                             Edit& rEdValue );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     bool                IsAuto() const;
51cdf0e10cSrcweir     double              GetValue() const;
52cdf0e10cSrcweir     void                SetValue( bool bAuto, double fValue );
53cdf0e10cSrcweir 
54cdf0e10cSrcweir private:
55cdf0e10cSrcweir     virtual bool        ImplGetValue( double& rfValue ) const = 0;
56cdf0e10cSrcweir     virtual void        ImplSetValue( double fValue ) = 0;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     DECL_LINK( ClickHdl, RadioButton* );
59cdf0e10cSrcweir 
60cdf0e10cSrcweir private:
61cdf0e10cSrcweir     RadioButton&        mrRbAuto;
62cdf0e10cSrcweir     RadioButton&        mrRbMan;
63cdf0e10cSrcweir     Edit&               mrEdValue;
64cdf0e10cSrcweir };
65cdf0e10cSrcweir 
66cdf0e10cSrcweir // ----------------------------------------------------------------------------
67cdf0e10cSrcweir 
68cdf0e10cSrcweir class ScDPNumGroupEditHelper : public ScDPGroupEditHelper
69cdf0e10cSrcweir {
70cdf0e10cSrcweir public:
71cdf0e10cSrcweir     explicit            ScDPNumGroupEditHelper(
72cdf0e10cSrcweir                             RadioButton& rRbAuto, RadioButton& rRbMan,
73cdf0e10cSrcweir                             ScDoubleField& rEdValue );
74cdf0e10cSrcweir 
75cdf0e10cSrcweir private:
76cdf0e10cSrcweir     virtual bool        ImplGetValue( double& rfValue ) const;
77cdf0e10cSrcweir     virtual void        ImplSetValue( double fValue );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir private:
80cdf0e10cSrcweir     ScDoubleField&      mrEdValue;
81cdf0e10cSrcweir };
82cdf0e10cSrcweir 
83cdf0e10cSrcweir // ----------------------------------------------------------------------------
84cdf0e10cSrcweir 
85cdf0e10cSrcweir class ScDPDateGroupEditHelper : public ScDPGroupEditHelper
86cdf0e10cSrcweir {
87cdf0e10cSrcweir public:
88cdf0e10cSrcweir     explicit            ScDPDateGroupEditHelper(
89cdf0e10cSrcweir                             RadioButton& rRbAuto, RadioButton& rRbMan,
90cdf0e10cSrcweir                             DateField& rEdValue, const Date& rNullDate );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir private:
93cdf0e10cSrcweir     virtual bool        ImplGetValue( double& rfValue ) const;
94cdf0e10cSrcweir     virtual void        ImplSetValue( double fValue );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir private:
97cdf0e10cSrcweir     DateField&          mrEdValue;
98cdf0e10cSrcweir     Date                maNullDate;
99cdf0e10cSrcweir };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir // ============================================================================
102cdf0e10cSrcweir // ============================================================================
103cdf0e10cSrcweir 
104cdf0e10cSrcweir class ScDPNumGroupDlg : public ModalDialog
105cdf0e10cSrcweir {
106cdf0e10cSrcweir public:
107cdf0e10cSrcweir     explicit            ScDPNumGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo );
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     ScDPNumGroupInfo    GetGroupInfo() const;
110cdf0e10cSrcweir 
111cdf0e10cSrcweir private:
112cdf0e10cSrcweir     FixedLine           maFlStart;
113cdf0e10cSrcweir     RadioButton         maRbAutoStart;
114cdf0e10cSrcweir     RadioButton         maRbManStart;
115cdf0e10cSrcweir     ScDoubleField       maEdStart;
116cdf0e10cSrcweir     FixedLine           maFlEnd;
117cdf0e10cSrcweir     RadioButton         maRbAutoEnd;
118cdf0e10cSrcweir     RadioButton         maRbManEnd;
119cdf0e10cSrcweir     ScDoubleField       maEdEnd;
120cdf0e10cSrcweir     FixedLine           maFlBy;
121cdf0e10cSrcweir     ScDoubleField       maEdBy;
122cdf0e10cSrcweir     OKButton            maBtnOk;
123cdf0e10cSrcweir     CancelButton        maBtnCancel;
124cdf0e10cSrcweir     HelpButton          maBtnHelp;
125cdf0e10cSrcweir     ScDPNumGroupEditHelper maStartHelper;
126cdf0e10cSrcweir     ScDPNumGroupEditHelper maEndHelper;
127cdf0e10cSrcweir };
128cdf0e10cSrcweir 
129cdf0e10cSrcweir // ============================================================================
130cdf0e10cSrcweir 
131cdf0e10cSrcweir class ScDPDateGroupDlg : public ModalDialog
132cdf0e10cSrcweir {
133cdf0e10cSrcweir public:
134cdf0e10cSrcweir     explicit            ScDPDateGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo,
135cdf0e10cSrcweir                             sal_Int32 nDatePart, const Date& rNullDate );
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     ScDPNumGroupInfo    GetGroupInfo() const;
138cdf0e10cSrcweir     sal_Int32           GetDatePart() const;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir private:
141cdf0e10cSrcweir     DECL_LINK( ClickHdl, RadioButton* );
142cdf0e10cSrcweir     DECL_LINK( CheckHdl, SvxCheckListBox* );
143cdf0e10cSrcweir 
144cdf0e10cSrcweir private:
145cdf0e10cSrcweir     FixedLine           maFlStart;
146cdf0e10cSrcweir     RadioButton         maRbAutoStart;
147cdf0e10cSrcweir     RadioButton         maRbManStart;
148cdf0e10cSrcweir     DateField           maEdStart;
149cdf0e10cSrcweir     FixedLine           maFlEnd;
150cdf0e10cSrcweir     RadioButton         maRbAutoEnd;
151cdf0e10cSrcweir     RadioButton         maRbManEnd;
152cdf0e10cSrcweir     DateField           maEdEnd;
153cdf0e10cSrcweir     FixedLine           maFlBy;
154cdf0e10cSrcweir     RadioButton         maRbNumDays;
155cdf0e10cSrcweir     RadioButton         maRbUnits;
156cdf0e10cSrcweir     NumericField        maEdNumDays;
157cdf0e10cSrcweir     SvxCheckListBox     maLbUnits;
158cdf0e10cSrcweir     OKButton            maBtnOk;
159cdf0e10cSrcweir     CancelButton        maBtnCancel;
160cdf0e10cSrcweir     HelpButton          maBtnHelp;
161cdf0e10cSrcweir     ScDPDateGroupEditHelper maStartHelper;
162cdf0e10cSrcweir     ScDPDateGroupEditHelper maEndHelper;
163cdf0e10cSrcweir };
164cdf0e10cSrcweir 
165cdf0e10cSrcweir // ============================================================================
166cdf0e10cSrcweir 
167cdf0e10cSrcweir #endif
168cdf0e10cSrcweir 
169