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 SC_NAMEDEFDLG_HXX
11 #define SC_NAMEDEFDLG_HXX
13 #include "anyrefdg.hxx"
14 #include <vcl/button.hxx>
15 #include <vcl/fixed.hxx>
16 #include <vcl/edit.hxx>
17 #include <vcl/lstbox.hxx>
26 class ScNameDefDlg
: public ScAnyRefDlg
31 formula::RefEdit
* m_pEdRange
;
32 formula::RefButton
* m_pRbRange
;
36 CheckBox
* m_pBtnRowHeader
;
37 CheckBox
* m_pBtnColHeader
;
38 CheckBox
* m_pBtnPrintArea
;
39 CheckBox
* m_pBtnCriteria
;
41 PushButton
* m_pBtnAdd
;
42 PushButton
* m_pBtnCancel
;
45 bool mbUndo
; //if true we need to add an undo action after creating a range name
47 ScDocShell
* mpDocShell
;
49 ScAddress maCursorPos
;
50 OUString maStrInfoDefault
;
51 const OUString maGlobalNameStr
;
52 const OUString maErrInvalidNameStr
;
53 const OUString maErrNameInUse
;
55 //hack to call this dialog from Manage Names
59 std::map
<OUString
, ScRangeName
*> maRangeMap
;
65 bool IsFormulaValid();
67 DECL_LINK( CancelBtnHdl
, void * );
68 DECL_LINK( AddBtnHdl
, void* );
69 DECL_LINK( NameModifyHdl
, void* );
70 DECL_LINK( AssignGetFocusHdl
, void * );
73 virtual void RefInputDone( sal_Bool bForced
= sal_False
);
76 ScNameDefDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
, Window
* pParent
,
77 ScViewData
* pViewData
, std::map
<OUString
, ScRangeName
*> aRangeMap
,
78 const ScAddress
& aCursorPos
, const bool bUndo
);
80 virtual ~ScNameDefDlg() {};
82 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
);
83 virtual sal_Bool
IsRefInputMode() const;
85 virtual void SetActive();
86 virtual sal_Bool
Close();
88 void GetNewData( OUString
& rName
, OUString
& rScope
);
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */