LibreOffice Module sc (master) 1
namedefdlg.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
10#pragma once
11
12#include "anyrefdg.hxx"
13
14#include <map>
15
16class ScRangeName;
17class ScDocument;
18class ScDocShell;
19class ScViewData;
20
22{
23private:
24 bool mbUndo; //if true we need to add an undo action after creating a range name
27
30 const OUString maGlobalNameStr;
31 const OUString maErrInvalidNameStr;
33 const OUString maErrNameInUse;
34
35 //hack to call this dialog from Manage Names
36 OUString maName;
37 OUString maScope;
38
39 std::map<OUString, ScRangeName*> maRangeMap;
40
41 std::unique_ptr<weld::Entry> m_xEdName;
42
43 std::unique_ptr<formula::RefEdit> m_xEdRange;
44 std::unique_ptr<formula::RefButton> m_xRbRange;
45
46 std::unique_ptr<weld::ComboBox> m_xLbScope;
47
48 std::unique_ptr<weld::CheckButton> m_xBtnRowHeader;
49 std::unique_ptr<weld::CheckButton> m_xBtnColHeader;
50 std::unique_ptr<weld::CheckButton> m_xBtnPrintArea;
51 std::unique_ptr<weld::CheckButton> m_xBtnCriteria;
52
53 std::unique_ptr<weld::Button> m_xBtnAdd;
54 std::unique_ptr<weld::Button> m_xBtnCancel;
55 std::unique_ptr<weld::Label> m_xFtInfo;
56 std::unique_ptr<weld::Label> m_xFtRange;
57
58 void CancelPushed();
59 void AddPushed();
60
61 bool IsNameValid();
62 bool IsFormulaValid();
63
64 DECL_LINK(CancelBtnHdl, weld::Button&, void);
65 DECL_LINK(AddBtnHdl, weld::Button&, void);
66 DECL_LINK(NameModifyHdl, weld::Entry&, void);
67 DECL_LINK(AssignGetFocusHdl, formula::RefEdit&, void);
68
69protected:
70 virtual void RefInputDone(bool bForced = false) override;
71
72public:
74 const ScViewData& rViewData, std::map<OUString, ScRangeName*>&& aRangeMap,
75 const ScAddress& aCursorPos, const bool bUndo);
76
77 virtual ~ScNameDefDlg() override;
78
79 virtual void SetReference(const ScRange& rRef, ScDocument& rDoc) override;
80 virtual bool IsRefInputMode() const override;
81
82 virtual void SetActive() override;
83 virtual void Close() override;
84
85 void GetNewData(OUString& rName, OUString& rScope);
86};
87
88/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString maStrInfoDefault
Definition: namedefdlg.hxx:29
DECL_LINK(NameModifyHdl, weld::Entry &, void)
ScNameDefDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, const ScViewData &rViewData, std::map< OUString, ScRangeName * > &&aRangeMap, const ScAddress &aCursorPos, const bool bUndo)
Definition: namedefdlg.cxx:27
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: namedefdlg.hxx:54
const OUString maErrNameInUse
Definition: namedefdlg.hxx:33
OUString maName
Definition: namedefdlg.hxx:36
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
Definition: namedefdlg.cxx:279
ScDocShell * mpDocShell
Definition: namedefdlg.hxx:26
bool IsFormulaValid()
Definition: namedefdlg.cxx:102
const OUString maErrInvalidNameCellRefStr
Definition: namedefdlg.hxx:32
ScDocument & mrDoc
Definition: namedefdlg.hxx:25
std::unique_ptr< formula::RefEdit > m_xEdRange
Definition: namedefdlg.hxx:43
std::unique_ptr< weld::CheckButton > m_xBtnRowHeader
Definition: namedefdlg.hxx:48
std::unique_ptr< weld::ComboBox > m_xLbScope
Definition: namedefdlg.hxx:46
bool IsNameValid()
Definition: namedefdlg.cxx:117
OUString maScope
Definition: namedefdlg.hxx:37
std::unique_ptr< weld::CheckButton > m_xBtnColHeader
Definition: namedefdlg.hxx:49
virtual void Close() override
Definition: namedefdlg.cxx:291
virtual ~ScNameDefDlg() override
Definition: namedefdlg.cxx:87
const OUString maGlobalNameStr
Definition: namedefdlg.hxx:30
DECL_LINK(CancelBtnHdl, weld::Button &, void)
ScAddress maCursorPos
Definition: namedefdlg.hxx:28
virtual bool IsRefInputMode() const override
Definition: namedefdlg.cxx:268
virtual void SetActive() override
Definition: namedefdlg.cxx:296
std::unique_ptr< weld::Label > m_xFtRange
Definition: namedefdlg.hxx:56
std::unique_ptr< formula::RefButton > m_xRbRange
Definition: namedefdlg.hxx:44
std::unique_ptr< weld::CheckButton > m_xBtnPrintArea
Definition: namedefdlg.hxx:50
virtual void RefInputDone(bool bForced=false) override
Definition: namedefdlg.cxx:273
std::map< OUString, ScRangeName * > maRangeMap
Definition: namedefdlg.hxx:39
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: namedefdlg.hxx:53
void GetNewData(OUString &rName, OUString &rScope)
Definition: namedefdlg.cxx:262
void AddPushed()
Definition: namedefdlg.cxx:171
const OUString maErrInvalidNameStr
Definition: namedefdlg.hxx:31
DECL_LINK(AssignGetFocusHdl, formula::RefEdit &, void)
std::unique_ptr< weld::Entry > m_xEdName
Definition: namedefdlg.hxx:41
std::unique_ptr< weld::CheckButton > m_xBtnCriteria
Definition: namedefdlg.hxx:51
DECL_LINK(AddBtnHdl, weld::Button &, void)
void CancelPushed()
Definition: namedefdlg.cxx:91
std::unique_ptr< weld::Label > m_xFtInfo
Definition: namedefdlg.hxx:55