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 
16 class ScRangeName;
17 class ScDocument;
18 class ScDocShell;
19 class ScViewData;
20 
22 {
23 private:
24  bool mbUndo; //if true we need to add an undo action after creating a range name
27 
29  OUString maStrInfoDefault;
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::Expander> m_xExpander;
57  std::unique_ptr<weld::Label> m_xFtRange;
58 
59  void CancelPushed();
60  void AddPushed();
61 
62  bool IsNameValid();
63  bool IsFormulaValid();
64 
65  DECL_LINK(CancelBtnHdl, weld::Button&, void);
66  DECL_LINK(AddBtnHdl, weld::Button&, void);
67  DECL_LINK(NameModifyHdl, weld::Entry&, void);
68  DECL_LINK(AssignGetFocusHdl, formula::RefEdit&, void);
69 
70 protected:
71  virtual void RefInputDone(bool bForced = false) override;
72 
73 public:
75  const ScViewData& rViewData, std::map<OUString, ScRangeName*>&& aRangeMap,
76  const ScAddress& aCursorPos, const bool bUndo);
77 
78  virtual ~ScNameDefDlg() override;
79 
80  virtual void SetReference(const ScRange& rRef, ScDocument& rDoc) override;
81  virtual bool IsRefInputMode() const override;
82 
83  virtual void SetActive() override;
84  virtual void Close() override;
85 
86  void GetNewData(OUString& rName, OUString& rScope);
87 };
88 
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: namedefdlg.hxx:54
ScAddress maCursorPos
Definition: namedefdlg.hxx:28
const OUString maErrInvalidNameStr
Definition: namedefdlg.hxx:31
std::unique_ptr< weld::Label > m_xFtRange
Definition: namedefdlg.hxx:57
std::unique_ptr< weld::Label > m_xFtInfo
Definition: namedefdlg.hxx:55
std::unique_ptr< weld::CheckButton > m_xBtnRowHeader
Definition: namedefdlg.hxx:48
std::unique_ptr< weld::Entry > m_xEdName
Definition: namedefdlg.hxx:41
bool IsFormulaValid()
Definition: namedefdlg.cxx:103
void GetNewData(OUString &rName, OUString &rScope)
Definition: namedefdlg.cxx:263
OUString maStrInfoDefault
Definition: namedefdlg.hxx:29
DECL_LINK(CancelBtnHdl, weld::Button &, void)
ScDocument & mrDoc
Definition: namedefdlg.hxx:25
std::unique_ptr< weld::Expander > m_xExpander
Definition: namedefdlg.hxx:56
std::unique_ptr< formula::RefButton > m_xRbRange
Definition: namedefdlg.hxx:44
virtual void RefInputDone(bool bForced=false) override
Definition: namedefdlg.cxx:274
std::unique_ptr< formula::RefEdit > m_xEdRange
Definition: namedefdlg.hxx:43
const OUString maErrInvalidNameCellRefStr
Definition: namedefdlg.hxx:32
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: namedefdlg.hxx:53
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
void CancelPushed()
Definition: namedefdlg.cxx:92
virtual ~ScNameDefDlg() override
Definition: namedefdlg.cxx:88
bool IsNameValid()
Definition: namedefdlg.cxx:118
std::unique_ptr< weld::CheckButton > m_xBtnColHeader
Definition: namedefdlg.hxx:49
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
Definition: namedefdlg.cxx:280
virtual void SetActive() override
Definition: namedefdlg.cxx:297
std::unique_ptr< weld::ComboBox > m_xLbScope
Definition: namedefdlg.hxx:46
virtual bool IsRefInputMode() const override
Definition: namedefdlg.cxx:269
OUString maScope
Definition: namedefdlg.hxx:37
const OUString maErrNameInUse
Definition: namedefdlg.hxx:33
std::unique_ptr< weld::CheckButton > m_xBtnCriteria
Definition: namedefdlg.hxx:51
std::unique_ptr< weld::CheckButton > m_xBtnPrintArea
Definition: namedefdlg.hxx:50
OUString maName
Definition: namedefdlg.hxx:36
virtual void Close() override
Definition: namedefdlg.cxx:292
ScDocShell * mpDocShell
Definition: namedefdlg.hxx:26
std::map< OUString, ScRangeName * > maRangeMap
Definition: namedefdlg.hxx:39
void AddPushed()
Definition: namedefdlg.cxx:172
const OUString maGlobalNameStr
Definition: namedefdlg.hxx:30