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 .
22 #include <vcl/weld.hxx>
23 #include <dpnumgroupinfo.hxx>
28 class ScDPGroupEditHelper
31 explicit ScDPGroupEditHelper(weld::RadioButton
& rRbAuto
,
32 weld::RadioButton
& rRbMan
,
33 weld::Widget
& rEdValue
);
36 double GetValue() const;
37 void SetValue( bool bAuto
, double fValue
);
40 ~ScDPGroupEditHelper() {}
43 virtual bool ImplGetValue( double& rfValue
) const = 0;
44 virtual void ImplSetValue( double fValue
) = 0;
46 DECL_LINK(ToggleHdl
, weld::Toggleable
&, void);
49 weld::RadioButton
& mrRbAuto
;
50 weld::RadioButton
& mrRbMan
;
51 weld::Widget
& mrEdValue
;
54 class ScDPNumGroupEditHelper
: public ScDPGroupEditHelper
57 explicit ScDPNumGroupEditHelper(weld::RadioButton
& rRbAuto
,
58 weld::RadioButton
& rRbMan
,
59 ScDoubleField
& rEdValue
);
61 virtual ~ScDPNumGroupEditHelper() {}
63 virtual bool ImplGetValue( double& rfValue
) const override
;
64 virtual void ImplSetValue( double fValue
) override
;
67 ScDoubleField
& mrEdValue
;
70 class ScDPDateGroupEditHelper
: public ScDPGroupEditHelper
73 explicit ScDPDateGroupEditHelper(weld::RadioButton
& rRbAuto
,
74 weld::RadioButton
& rRbMan
,
75 SvtCalendarBox
& rEdValue
,
76 const Date
& rNullDate
);
78 virtual ~ScDPDateGroupEditHelper() {}
81 virtual bool ImplGetValue( double& rfValue
) const override
;
82 virtual void ImplSetValue( double fValue
) override
;
85 SvtCalendarBox
& mrEdValue
;
89 class ScDPNumGroupDlg
: public weld::GenericDialogController
92 explicit ScDPNumGroupDlg(weld::Window
* pParent
, const ScDPNumGroupInfo
& rInfo
);
93 virtual ~ScDPNumGroupDlg() override
;
94 ScDPNumGroupInfo
GetGroupInfo() const;
97 std::unique_ptr
<weld::RadioButton
> mxRbAutoStart
;
98 std::unique_ptr
<weld::RadioButton
> mxRbManStart
;
99 std::unique_ptr
<ScDoubleField
> mxEdStart
;
100 std::unique_ptr
<weld::RadioButton
> mxRbAutoEnd
;
101 std::unique_ptr
<weld::RadioButton
> mxRbManEnd
;
102 std::unique_ptr
<ScDoubleField
> mxEdEnd
;
103 std::unique_ptr
<ScDoubleField
> mxEdBy
;
104 ScDPNumGroupEditHelper maStartHelper
;
105 ScDPNumGroupEditHelper maEndHelper
;
108 class ScDPDateGroupDlg
: public weld::GenericDialogController
111 explicit ScDPDateGroupDlg(weld::Window
* pParent
, const ScDPNumGroupInfo
& rInfo
,
112 sal_Int32 nDatePart
, const Date
& rNullDate
);
113 virtual ~ScDPDateGroupDlg() override
;
114 ScDPNumGroupInfo
GetGroupInfo() const;
115 sal_Int32
GetDatePart() const;
118 DECL_LINK(ToggleHdl
, weld::Toggleable
&, void);
119 DECL_LINK(CheckHdl
, const weld::TreeView::iter_col
&, void);
123 std::unique_ptr
<weld::RadioButton
> mxRbAutoStart
;
124 std::unique_ptr
<weld::RadioButton
> mxRbManStart
;
125 std::unique_ptr
<SvtCalendarBox
> mxEdStart
;
126 std::unique_ptr
<weld::RadioButton
> mxRbAutoEnd
;
127 std::unique_ptr
<weld::RadioButton
> mxRbManEnd
;
128 std::unique_ptr
<SvtCalendarBox
> mxEdEnd
;
129 std::unique_ptr
<weld::RadioButton
> mxRbNumDays
;
130 std::unique_ptr
<weld::RadioButton
> mxRbUnits
;
131 std::unique_ptr
<weld::SpinButton
> mxEdNumDays
;
132 std::unique_ptr
<weld::TreeView
> mxLbUnits
;
133 std::unique_ptr
<weld::Button
> mxBtnOk
;
134 ScDPDateGroupEditHelper maStartHelper
;
135 ScDPDateGroupEditHelper maEndHelper
;
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */