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 #pragma once
21 
22 #include <vcl/weld.hxx>
23 #include <dpnumgroupinfo.hxx>
24 
25 class ScDoubleField;
26 class SvtCalendarBox;
27 
29 {
30 public:
31  explicit ScDPGroupEditHelper(weld::RadioButton& rRbAuto,
32  weld::RadioButton& rRbMan,
33  weld::Widget& rEdValue);
34 
35  bool IsAuto() const;
36  double GetValue() const;
37  void SetValue( bool bAuto, double fValue );
38 
39 protected:
41 
42 private:
43  virtual bool ImplGetValue( double& rfValue ) const = 0;
44  virtual void ImplSetValue( double fValue ) = 0;
45 
46  DECL_LINK(ToggleHdl, weld::Toggleable&, void);
47 
48 private:
52 };
53 
55 {
56 public:
57  explicit ScDPNumGroupEditHelper(weld::RadioButton& rRbAuto,
58  weld::RadioButton& rRbMan,
59  ScDoubleField& rEdValue);
60 
62 private:
63  virtual bool ImplGetValue( double& rfValue ) const override;
64  virtual void ImplSetValue( double fValue ) override;
65 
66 private:
68 };
69 
71 {
72 public:
74  weld::RadioButton& rRbMan,
75  SvtCalendarBox& rEdValue,
76  const Date& rNullDate);
77 
79 
80 private:
81  virtual bool ImplGetValue( double& rfValue ) const override;
82  virtual void ImplSetValue( double fValue ) override;
83 
84 private:
87 };
88 
90 {
91 public:
92  explicit ScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo);
93  virtual ~ScDPNumGroupDlg() override;
95 
96 private:
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;
106 };
107 
109 {
110 public:
111  explicit ScDPDateGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo,
112  sal_Int32 nDatePart, const Date& rNullDate);
113  virtual ~ScDPDateGroupDlg() override;
115  sal_Int32 GetDatePart() const;
116 
117 private:
118  DECL_LINK(ToggleHdl, weld::Toggleable&, void);
119  DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
120 
121  void Check();
122 private:
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;
136 };
137 
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScDPDateGroupEditHelper maEndHelper
Definition: dpgroupdlg.hxx:135
DECL_LINK(ToggleHdl, weld::Toggleable &, void)
virtual bool ImplGetValue(double &rfValue) const override
Definition: dpgroupdlg.cxx:121
virtual ~ScDPNumGroupDlg() override
Definition: dpgroupdlg.cxx:178
ScDPNumGroupInfo GetGroupInfo() const
Definition: dpgroupdlg.cxx:182
virtual ~ScDPDateGroupDlg() override
Definition: dpgroupdlg.cxx:267
ScDPNumGroupEditHelper maEndHelper
Definition: dpgroupdlg.hxx:105
std::unique_ptr< weld::RadioButton > mxRbManStart
Definition: dpgroupdlg.hxx:124
ScDPNumGroupEditHelper maStartHelper
Definition: dpgroupdlg.hxx:104
bool IsAuto() const
Definition: dpgroupdlg.cxx:68
ScDoubleField & mrEdValue
Definition: dpgroupdlg.hxx:67
virtual ~ScDPDateGroupEditHelper()
Definition: dpgroupdlg.hxx:78
std::unique_ptr< ScDoubleField > mxEdStart
Definition: dpgroupdlg.hxx:99
ScDPDateGroupEditHelper maStartHelper
Definition: dpgroupdlg.hxx:134
ScDPNumGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo)
Definition: dpgroupdlg.cxx:152
virtual bool ImplGetValue(double &rfValue) const =0
std::unique_ptr< weld::RadioButton > mxRbUnits
Definition: dpgroupdlg.hxx:130
ScDPDateGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, SvtCalendarBox &rEdValue, const Date &rNullDate)
Definition: dpgroupdlg.cxx:131
std::unique_ptr< weld::SpinButton > mxEdNumDays
Definition: dpgroupdlg.hxx:131
void SetValue(bool bAuto, double fValue)
Definition: dpgroupdlg.cxx:81
std::unique_ptr< ScDoubleField > mxEdEnd
Definition: dpgroupdlg.hxx:102
ScDPDateGroupDlg(weld::Window *pParent, const ScDPNumGroupInfo &rInfo, sal_Int32 nDatePart, const Date &rNullDate)
Definition: dpgroupdlg.cxx:202
sal_Int32 GetDatePart() const
Definition: dpgroupdlg.cxx:291
std::pair< const TreeIter &, int > iter_col
virtual void ImplSetValue(double fValue)=0
std::unique_ptr< SvtCalendarBox > mxEdStart
Definition: dpgroupdlg.hxx:125
DECL_LINK(ToggleHdl, weld::Toggleable &, void)
weld::RadioButton & mrRbAuto
Definition: dpgroupdlg.hxx:49
std::unique_ptr< weld::RadioButton > mxRbAutoStart
Definition: dpgroupdlg.hxx:123
std::unique_ptr< weld::RadioButton > mxRbManEnd
Definition: dpgroupdlg.hxx:127
ScDPGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, weld::Widget &rEdValue)
Definition: dpgroupdlg.cxx:59
weld::Widget & mrEdValue
Definition: dpgroupdlg.hxx:51
ScDPNumGroupEditHelper(weld::RadioButton &rRbAuto, weld::RadioButton &rRbMan, ScDoubleField &rEdValue)
Definition: dpgroupdlg.cxx:114
weld::RadioButton & mrRbMan
Definition: dpgroupdlg.hxx:50
An edit control that contains a double precision floating-point value.
Definition: editfield.hxx:25
std::unique_ptr< SvtCalendarBox > mxEdEnd
Definition: dpgroupdlg.hxx:128
std::unique_ptr< weld::TreeView > mxLbUnits
Definition: dpgroupdlg.hxx:132
ScDPNumGroupInfo GetGroupInfo() const
Definition: dpgroupdlg.cxx:271
virtual void ImplSetValue(double fValue) override
Definition: dpgroupdlg.cxx:145
std::unique_ptr< weld::Button > mxBtnOk
Definition: dpgroupdlg.hxx:133
std::unique_ptr< weld::RadioButton > mxRbNumDays
Definition: dpgroupdlg.hxx:129
virtual bool ImplGetValue(double &rfValue) const override
Definition: dpgroupdlg.cxx:139
std::unique_ptr< weld::RadioButton > mxRbAutoStart
Definition: dpgroupdlg.hxx:97
std::unique_ptr< weld::RadioButton > mxRbAutoEnd
Definition: dpgroupdlg.hxx:126
double GetValue() const
Definition: dpgroupdlg.cxx:73
std::unique_ptr< ScDoubleField > mxEdBy
Definition: dpgroupdlg.hxx:103
virtual void ImplSetValue(double fValue) override
Definition: dpgroupdlg.cxx:126
SvtCalendarBox & mrEdValue
Definition: dpgroupdlg.hxx:85
std::unique_ptr< weld::RadioButton > mxRbManStart
Definition: dpgroupdlg.hxx:98
std::unique_ptr< weld::RadioButton > mxRbAutoEnd
Definition: dpgroupdlg.hxx:100
std::unique_ptr< weld::RadioButton > mxRbManEnd
Definition: dpgroupdlg.hxx:101
virtual ~ScDPNumGroupEditHelper()
Definition: dpgroupdlg.hxx:61