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