tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / chart2 / source / controller / dialogs / tp_Scale.hxx
blob928637101a67d1ec17f7fe271dd43cb7cd35757e
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 .
19 #pragma once
21 #include <sfx2/tabdlg.hxx>
22 #include <unotools/resmgr.hxx>
24 class SvNumberFormatter;
26 namespace chart
29 class ScaleTabPage : public SfxTabPage
31 public:
32 ScaleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
33 virtual ~ScaleTabPage() override;
35 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs );
36 virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override;
37 virtual void Reset( const SfxItemSet* rInAttrs ) override;
38 virtual DeactivateRC DeactivatePage( SfxItemSet* pItemSet ) override;
40 void SetNumFormatter( SvNumberFormatter* pFormatter );
41 void SetNumFormat();
43 void ShowAxisOrigin( bool bShowOrigin );
45 private:
46 double fMin;
47 double fMax;
48 double fStepMain;
49 sal_Int32 nStepHelp;
50 double fOrigin;
51 sal_Int32 m_nTimeResolution;
52 sal_Int32 m_nMainTimeUnit;
53 sal_Int32 m_nHelpTimeUnit;
54 int m_nAxisType;
55 bool m_bAllowDateAxis;
56 SvNumberFormatter* pNumFormatter;
58 bool m_bShowAxisOrigin;
60 std::unique_ptr<weld::CheckButton> m_xCbxReverse;
61 std::unique_ptr<weld::CheckButton> m_xCbxLogarithm;
62 std::unique_ptr<weld::Widget> m_xBxType;
63 std::unique_ptr<weld::ComboBox> m_xLB_AxisType;
64 std::unique_ptr<weld::Widget> m_xBxMinMax;
65 std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldMin;
66 std::unique_ptr<weld::CheckButton> m_xCbxAutoMin;
67 std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldMax;
68 std::unique_ptr<weld::CheckButton> m_xCbxAutoMax;
69 std::unique_ptr<weld::Widget> m_xBxResolution;
70 std::unique_ptr<weld::ComboBox> m_xLB_TimeResolution;
71 std::unique_ptr<weld::CheckButton> m_xCbx_AutoTimeResolution;
72 std::unique_ptr<weld::Label> m_xTxtMain;
73 std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldStepMain;
74 std::unique_ptr<weld::SpinButton> m_xMt_MainDateStep;
75 std::unique_ptr<weld::ComboBox> m_xLB_MainTimeUnit;
76 std::unique_ptr<weld::CheckButton> m_xCbxAutoStepMain;
77 std::unique_ptr<weld::Label> m_xTxtHelpCount;
78 std::unique_ptr<weld::Label> m_xTxtHelp;
79 std::unique_ptr<weld::SpinButton> m_xMtStepHelp;
80 std::unique_ptr<weld::ComboBox> m_xLB_HelpTimeUnit;
81 std::unique_ptr<weld::CheckButton> m_xCbxAutoStepHelp;
82 std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldOrigin;
83 std::unique_ptr<weld::CheckButton> m_xCbxAutoOrigin;
84 std::unique_ptr<weld::Widget> m_xBxOrigin;
86 void EnableControls();
88 DECL_LINK(SelectAxisTypeHdl, weld::ComboBox&, void);
89 DECL_LINK(EnableValueHdl, weld::Toggleable&, void);
91 /** shows a warning window due to an invalid input.
93 @param pResIdMessage
94 The resource identifier that represents the localized warning text.
95 If this is nullptr, no warning is shown and false is returned.
97 @param pControl
98 If non-NULL, contains a pointer to the control in which the
99 erroneous value was in. This method gives this control the focus
100 and selects its content.
102 @return false, if nResIdMessage was 0, true otherwise
104 bool ShowWarning(TranslateId pResIdMessage, weld::Widget* pControl);
106 void HideAllControls();
109 } //namespace chart
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */