tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / dpgroupdlg.hxx
blobd3c390f460875e65ed7dd9a5ed1e9ed01f56d8c9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include <vcl/weld.hxx>
23 #include <dpnumgroupinfo.hxx>
25 class ScDoubleField;
26 class SvtCalendarBox;
28 class ScDPGroupEditHelper
30 public:
31 explicit ScDPGroupEditHelper(weld::RadioButton& rRbAuto,
32 weld::RadioButton& rRbMan,
33 weld::Widget& rEdValue);
35 bool IsAuto() const;
36 double GetValue() const;
37 void SetValue( bool bAuto, double fValue );
39 protected:
40 ~ScDPGroupEditHelper() {}
42 private:
43 virtual bool ImplGetValue( double& rfValue ) const = 0;
44 virtual void ImplSetValue( double fValue ) = 0;
46 DECL_LINK(ToggleHdl, weld::Toggleable&, void);
48 private:
49 weld::RadioButton& mrRbAuto;
50 weld::RadioButton& mrRbMan;
51 weld::Widget& mrEdValue;
54 class ScDPNumGroupEditHelper : public ScDPGroupEditHelper
56 public:
57 explicit ScDPNumGroupEditHelper(weld::RadioButton& rRbAuto,
58 weld::RadioButton& rRbMan,
59 ScDoubleField& rEdValue);
61 virtual ~ScDPNumGroupEditHelper() {}
62 private:
63 virtual bool ImplGetValue( double& rfValue ) const override;
64 virtual void ImplSetValue( double fValue ) override;
66 private:
67 ScDoubleField& mrEdValue;
70 class ScDPDateGroupEditHelper : public ScDPGroupEditHelper
72 public:
73 explicit ScDPDateGroupEditHelper(weld::RadioButton& rRbAuto,
74 weld::RadioButton& rRbMan,
75 SvtCalendarBox& rEdValue,
76 const Date& rNullDate);
78 virtual ~ScDPDateGroupEditHelper() {}
80 private:
81 virtual bool ImplGetValue( double& rfValue ) const override;
82 virtual void ImplSetValue( double fValue ) override;
84 private:
85 SvtCalendarBox& mrEdValue;
86 Date maNullDate;
89 class ScDPNumGroupDlg : public weld::GenericDialogController
91 public:
92 explicit ScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo);
93 virtual ~ScDPNumGroupDlg() override;
94 ScDPNumGroupInfo GetGroupInfo() const;
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;
104 ScDPNumGroupEditHelper maStartHelper;
105 ScDPNumGroupEditHelper maEndHelper;
108 class ScDPDateGroupDlg : public weld::GenericDialogController
110 public:
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;
117 private:
118 DECL_LINK(ToggleHdl, weld::Toggleable&, void);
119 DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
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;
134 ScDPDateGroupEditHelper maStartHelper;
135 ScDPDateGroupEditHelper maEndHelper;
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */