tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / SparklineDialog.hxx
blobf3f309c5683245320bedcea44081d0fd6ba81ecd
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/.
8 */
10 #pragma once
12 #include <address.hxx>
13 #include "anyrefdg.hxx"
14 #include "viewdata.hxx"
16 #include <SparklineGroup.hxx>
17 #include <SparklineAttributes.hxx>
19 class ColorListBox;
21 namespace sc
23 /** Dialog to create or edit sparkline group attributes */
24 class SparklineDialog : public ScAnyRefDlgController
26 private:
27 ScViewData& mrViewData;
28 ScDocument& mrDocument;
30 ScRange maInputRange;
31 ScRange maOutputRange;
33 formula::RefEdit* mpActiveEdit;
34 bool mbDialogLostFocus;
36 std::unique_ptr<weld::Button> mxButtonOk;
37 std::unique_ptr<weld::Button> mxButtonCancel;
39 std::unique_ptr<weld::Frame> mxFrameData;
41 std::unique_ptr<weld::Label> mxInputRangeLabel;
42 std::unique_ptr<formula::RefEdit> mxInputRangeEdit;
43 std::unique_ptr<formula::RefButton> mxInputRangeButton;
45 std::unique_ptr<weld::Label> mxOutputRangeLabel;
46 std::unique_ptr<formula::RefEdit> mxOutputRangeEdit;
47 std::unique_ptr<formula::RefButton> mxOutputRangeButton;
49 std::unique_ptr<ColorListBox> mxColorSeries;
50 std::unique_ptr<ColorListBox> mxColorNegative;
51 std::unique_ptr<ColorListBox> mxColorMarker;
52 std::unique_ptr<ColorListBox> mxColorHigh;
53 std::unique_ptr<ColorListBox> mxColorLow;
54 std::unique_ptr<ColorListBox> mxColorFirst;
55 std::unique_ptr<ColorListBox> mxColorLast;
57 std::unique_ptr<weld::CheckButton> mxCheckButtonNegative;
58 std::unique_ptr<weld::CheckButton> mxCheckButtonMarker;
59 std::unique_ptr<weld::CheckButton> mxCheckButtonHigh;
60 std::unique_ptr<weld::CheckButton> mxCheckButtonLow;
61 std::unique_ptr<weld::CheckButton> mxCheckButtonFirst;
62 std::unique_ptr<weld::CheckButton> mxCheckButtonLast;
64 std::unique_ptr<weld::SpinButton> mxSpinLineWidth;
65 std::unique_ptr<weld::ComboBox> mxType;
67 std::unique_ptr<weld::CheckButton> mxCheckDisplayXAxis;
68 std::unique_ptr<weld::CheckButton> mxCheckDisplayHidden;
69 std::unique_ptr<weld::CheckButton> mxCheckRightToLeft;
71 std::unique_ptr<weld::ComboBox> mxDisplayEmptyGap;
73 std::unique_ptr<weld::ComboBox> mxComboMinAxisType;
74 std::unique_ptr<weld::ComboBox> mxComboMaxAxisType;
76 std::unique_ptr<weld::FormattedSpinButton> mxSpinCustomMin;
77 std::unique_ptr<weld::FormattedSpinButton> mxSpinCustomMax;
79 DECL_LINK(ButtonClicked, weld::Button&, void);
80 DECL_LINK(EditFocusHandler, formula::RefEdit&, void);
81 DECL_LINK(ButtonFocusHandler, formula::RefButton&, void);
82 DECL_LINK(LoseEditFocusHandler, formula::RefEdit&, void);
83 DECL_LINK(LoseButtonFocusHandler, formula::RefButton&, void);
84 DECL_LINK(RefInputModifyHandler, formula::RefEdit&, void);
85 DECL_LINK(ToggleHandler, weld::Toggleable&, void);
86 DECL_LINK(SelectSparklineType, weld::ComboBox&, void);
87 DECL_LINK(ComboValueChanged, weld::ComboBox&, void);
88 DECL_LINK(SpinLineWidthChanged, weld::SpinButton&, void);
89 DECL_LINK(SpinCustomChanged, weld::FormattedSpinButton&, void);
91 std::shared_ptr<sc::SparklineGroup> mpSparklineGroup;
92 sc::SparklineAttributes maAttributes;
94 bool mbEditMode;
96 void setupValues();
97 void setInputSelection();
99 void perform();
100 bool checkValidInputOutput();
102 public:
103 SparklineDialog(SfxBindings* pBindings, SfxChildWindow* pChildWindow, weld::Window* pWindow,
104 ScViewData& rViewData);
105 virtual ~SparklineDialog() override;
107 virtual void SetReference(const ScRange& rRef, ScDocument& rDocument) override;
108 virtual void SetActive() override;
109 virtual void Close() override;
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */