Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / ui / inc / namedefdlg.hxx
blob33f58b36d9c2060369fbf6ca8b69c0f0d44a0407
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 #ifndef INCLUDED_SC_SOURCE_UI_INC_NAMEDEFDLG_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_NAMEDEFDLG_HXX
13 #include "anyrefdg.hxx"
15 #include <map>
17 class ScRangeName;
18 class ScDocument;
19 class ScDocShell;
20 class ScViewData;
22 class ScNameDefDlg : public ScAnyRefDlgController
24 private:
25 bool const mbUndo; //if true we need to add an undo action after creating a range name
26 ScDocument* mpDoc;
27 ScDocShell* mpDocShell;
29 ScAddress const maCursorPos;
30 OUString maStrInfoDefault;
31 const OUString maGlobalNameStr;
32 const OUString maErrInvalidNameStr;
33 const OUString maErrInvalidNameCellRefStr;
34 const OUString maErrNameInUse;
36 //hack to call this dialog from Manage Names
37 OUString maName;
38 OUString maScope;
40 std::map<OUString, ScRangeName*> maRangeMap;
42 std::unique_ptr<weld::Entry> m_xEdName;
44 std::unique_ptr<formula::RefEdit> m_xEdRange;
45 std::unique_ptr<formula::RefButton> m_xRbRange;
47 std::unique_ptr<weld::ComboBox> m_xLbScope;
49 std::unique_ptr<weld::CheckButton> m_xBtnRowHeader;
50 std::unique_ptr<weld::CheckButton> m_xBtnColHeader;
51 std::unique_ptr<weld::CheckButton> m_xBtnPrintArea;
52 std::unique_ptr<weld::CheckButton> m_xBtnCriteria;
54 std::unique_ptr<weld::Button> m_xBtnAdd;
55 std::unique_ptr<weld::Button> m_xBtnCancel;
56 std::unique_ptr<weld::Label> m_xFtInfo;
57 std::unique_ptr<weld::Expander> m_xExpander;
58 std::unique_ptr<weld::Label> m_xFtRange;
60 void CancelPushed();
61 void AddPushed();
63 bool IsNameValid();
64 bool IsFormulaValid();
66 DECL_LINK( CancelBtnHdl, weld::Button&, void );
67 DECL_LINK( AddBtnHdl, weld::Button&, void );
68 DECL_LINK( NameModifyHdl, weld::Entry&, void );
69 DECL_LINK( AssignGetFocusHdl, formula::RefEdit&, void );
71 protected:
72 virtual void RefInputDone( bool bForced = false ) override;
74 public:
75 ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
76 const ScViewData* pViewData, const std::map<OUString, ScRangeName*>& aRangeMap,
77 const ScAddress& aCursorPos, const bool bUndo);
79 virtual ~ScNameDefDlg() override;
81 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
82 virtual bool IsRefInputMode() const override;
84 virtual void SetActive() override;
85 virtual void Close() override;
87 void GetNewData( OUString& rName, OUString& rScope );
90 #endif
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */