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/.
10 #ifndef INCLUDED_SC_SOURCE_UI_INC_NAMEDEFDLG_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_NAMEDEFDLG_HXX
13 #include "anyrefdg.hxx"
22 class ScNameDefDlg
: public ScAnyRefDlgController
25 bool const mbUndo
; //if true we need to add an undo action after creating a range name
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
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 );
72 virtual void RefInputDone( bool bForced
= false ) override
;
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
);
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */