LibreOffice Module sc (master)  1
dpgroupdlg.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_DPGROUPDLG_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_DPGROUPDLG_HXX
22 
23 #include <vcl/weld.hxx>
24 #include <dpnumgroupinfo.hxx>
25 
26 class ScDoubleField;
27 class SvtCalendarBox;
28 
30 {
31 public:
32  explicit ScDPGroupEditHelper(weld::RadioButton& rRbAuto,
33  weld::RadioButton& rRbMan,
34  weld::Widget& rEdValue);
35 
36  bool IsAuto() const;
37  double GetValue() const;
38  void SetValue( bool bAuto, double fValue );
39 
40 protected:
42 
43 private:
44  virtual bool ImplGetValue( double& rfValue ) const = 0;
45  virtual void ImplSetValue( double fValue ) = 0;
46 
47  DECL_LINK(ClickHdl, weld::Button&, void);
48 
49 private:
53 };
54 
56 {
57 public:
58  explicit ScDPNumGroupEditHelper(weld::RadioButton& rRbAuto,
59  weld::RadioButton& rRbMan,
60  ScDoubleField& rEdValue);
61 
63 private:
64  virtual bool ImplGetValue( double& rfValue ) const override;
65  virtual void ImplSetValue( double fValue ) override;
66 
67 private:
69 };
70 
72 {
73 public:
75  weld::RadioButton& rRbMan,
76  SvtCalendarBox& rEdValue,
77  const Date& rNullDate);
78 
80 
81 private:
82  virtual bool ImplGetValue( double& rfValue ) const override;
83  virtual void ImplSetValue( double fValue ) override;
84 
85 private:
88 };
89 
91 {
92 public:
93  explicit ScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo);
94  virtual ~ScDPNumGroupDlg() override;
96 
97 private:
98  std::unique_ptr<weld::RadioButton> mxRbAutoStart;
99  std::unique_ptr<weld::RadioButton> mxRbManStart;
100  std::unique_ptr<ScDoubleField> mxEdStart;
101  std::unique_ptr<weld::RadioButton> mxRbAutoEnd;
102  std::unique_ptr<weld::RadioButton> mxRbManEnd;
103  std::unique_ptr<ScDoubleField> mxEdEnd;
104  std::unique_ptr<ScDoubleField> mxEdBy;
107 };
108 
110 {
111 public:
112  explicit ScDPDateGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo,
113  sal_Int32 nDatePart, const Date& rNullDate);
114  virtual ~ScDPDateGroupDlg() override;
116  sal_Int32 GetDatePart() const;
117 
118 private:
119  DECL_LINK(ClickHdl, weld::Button&, void);
120  DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
121 
122  void Check();
123 private:
124  std::unique_ptr<weld::RadioButton> mxRbAutoStart;
125  std::unique_ptr<weld::RadioButton> mxRbManStart;
126  std::unique_ptr<SvtCalendarBox> mxEdStart;
127  std::unique_ptr<weld::RadioButton> mxRbAutoEnd;
128  std::unique_ptr<weld::RadioButton> mxRbManEnd;
129  std::unique_ptr<SvtCalendarBox> mxEdEnd;
130  std::unique_ptr<weld::RadioButton> mxRbNumDays;
131  std::unique_ptr<weld::RadioButton> mxRbUnits;
132  std::unique_ptr<weld::SpinButton> mxEdNumDays;
133  std::unique_ptr<weld::TreeView> mxLbUnits;
134  std::unique_ptr<weld::Button> mxBtnOk;
137 };
138 
139 #endif
140 
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScDPDateGroupEditHelper maEndHelper
Definition: dpgroupdlg.hxx:136
virtual bool ImplGetValue(double &rfValue) const override
Definition: dpgroupdlg.cxx:118
virtual ~ScDPNumGroupDlg() override
Definition: dpgroupdlg.cxx:175
ScDPNumGroupInfo GetGroupInfo() const
Definition: dpgroupdlg.cxx:179
virtual ~ScDPDateGroupDlg() override
Definition: dpgroupdlg.cxx:264
ScDPNumGroupEditHelper maEndHelper
Definition: dpgroupdlg.hxx:106
std::unique_ptr< weld::RadioButton > mxRbManStart
Definition: dpgroupdlg.hxx:125
ScDPNumGroupEditHelper maStartHelper
Definition: dpgroupdlg.hxx:105
bool IsAuto() const
Definition: dpgroupdlg.cxx:68
ScDoubleField & mrEdValue
Definition: dpgroupdlg.hxx:68
virtual ~ScDPDateGroupEditHelper()
Definition: dpgroupdlg.hxx:79
std::unique_ptr< ScDoubleField > mxEdStart
Definition: dpgroupdlg.hxx:100
ScDPDateGroupEditHelper maStartHelper
Definition: dpgroupdlg.hxx:135
ScDPNumGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo)
Definition: dpgroupdlg.cxx:149
virtual bool ImplGetValue(double &rfValue) const =0
std::unique_ptr< weld::RadioButton > mxRbUnits
Definition: dpgroupdlg.hxx:131
ScDPDateGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, SvtCalendarBox &rEdValue, const Date &rNullDate)
Definition: dpgroupdlg.cxx:128
std::unique_ptr< weld::SpinButton > mxEdNumDays
Definition: dpgroupdlg.hxx:132
void SetValue(bool bAuto, double fValue)
Definition: dpgroupdlg.cxx:81
std::unique_ptr< ScDoubleField > mxEdEnd
Definition: dpgroupdlg.hxx:103
ScDPDateGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo, sal_Int32 nDatePart, const Date &rNullDate)
Definition: dpgroupdlg.cxx:199
sal_Int32 GetDatePart() const
Definition: dpgroupdlg.cxx:288
std::pair< const TreeIter &, int > iter_col
virtual void ImplSetValue(double fValue)=0
std::unique_ptr< SvtCalendarBox > mxEdStart
Definition: dpgroupdlg.hxx:126
weld::RadioButton & mrRbAuto
Definition: dpgroupdlg.hxx:50
std::unique_ptr< weld::RadioButton > mxRbAutoStart
Definition: dpgroupdlg.hxx:124
std::unique_ptr< weld::RadioButton > mxRbManEnd
Definition: dpgroupdlg.hxx:128
ScDPGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, weld::Widget &rEdValue)
Definition: dpgroupdlg.cxx:59
weld::Widget & mrEdValue
Definition: dpgroupdlg.hxx:52
DECL_LINK(ClickHdl, weld::Button &, void)
ScDPNumGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, ScDoubleField &rEdValue)
Definition: dpgroupdlg.cxx:111
weld::RadioButton & mrRbMan
Definition: dpgroupdlg.hxx:51
An edit control that contains a double precision floating-point value.
Definition: editfield.hxx:26
std::unique_ptr< SvtCalendarBox > mxEdEnd
Definition: dpgroupdlg.hxx:129
std::unique_ptr< weld::TreeView > mxLbUnits
Definition: dpgroupdlg.hxx:133
ScDPNumGroupInfo GetGroupInfo() const
Definition: dpgroupdlg.cxx:268
virtual void ImplSetValue(double fValue) override
Definition: dpgroupdlg.cxx:142
std::unique_ptr< weld::Button > mxBtnOk
Definition: dpgroupdlg.hxx:134
std::unique_ptr< weld::RadioButton > mxRbNumDays
Definition: dpgroupdlg.hxx:130
virtual bool ImplGetValue(double &rfValue) const override
Definition: dpgroupdlg.cxx:136
std::unique_ptr< weld::RadioButton > mxRbAutoStart
Definition: dpgroupdlg.hxx:98
std::unique_ptr< weld::RadioButton > mxRbAutoEnd
Definition: dpgroupdlg.hxx:127
double GetValue() const
Definition: dpgroupdlg.cxx:73
std::unique_ptr< ScDoubleField > mxEdBy
Definition: dpgroupdlg.hxx:104
virtual void ImplSetValue(double fValue) override
Definition: dpgroupdlg.cxx:123
DECL_LINK(ClickHdl, weld::Button &, void)
SvtCalendarBox & mrEdValue
Definition: dpgroupdlg.hxx:86
std::unique_ptr< weld::RadioButton > mxRbManStart
Definition: dpgroupdlg.hxx:99
std::unique_ptr< weld::RadioButton > mxRbAutoEnd
Definition: dpgroupdlg.hxx:101
std::unique_ptr< weld::RadioButton > mxRbManEnd
Definition: dpgroupdlg.hxx:102
virtual ~ScDPNumGroupEditHelper()
Definition: dpgroupdlg.hxx:62