1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
12 #include "anyrefdg.hxx"
21 class ScNameDefDlg
: public ScAnyRefDlgController
24 bool mbUndo
; //if true we need to add an undo action after creating a range name
26 ScDocShell
* mpDocShell
;
28 ScAddress maCursorPos
;
29 OUString maStrInfoDefault
;
30 const OUString maGlobalNameStr
;
31 const OUString maErrInvalidNameStr
;
32 const OUString maErrInvalidNameCellRefStr
;
33 const OUString maErrInvalidSheetReference
;
34 const OUString maErrNameInUse
;
36 //hack to call this dialog from Manage Names
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
;
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);
70 DECL_LINK(EdModifyCheckBoxHdl
, weld::Toggleable
&, void);
71 DECL_LINK(RefEdModifyHdl
, formula::RefEdit
&, void);
74 virtual void RefInputDone(bool bForced
= false) override
;
77 ScNameDefDlg(SfxBindings
* pB
, SfxChildWindow
* pCW
, weld::Window
* pParent
,
78 const ScViewData
& rViewData
, std::map
<OUString
, ScRangeName
*>&& aRangeMap
,
79 const ScAddress
& aCursorPos
, const bool bUndo
);
81 virtual ~ScNameDefDlg() override
;
83 virtual void SetReference(const ScRange
& rRef
, ScDocument
& rDoc
) override
;
84 virtual bool IsRefInputMode() const override
;
86 virtual void SetActive() override
;
87 virtual void Close() override
;
89 void GetNewData(OUString
& rName
, OUString
& rScope
);
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */