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 #include "anyrefdg.hxx"
11 #include <vcl/button.hxx>
12 #include <vcl/fixed.hxx>
13 #include <vcl/edit.hxx>
14 #include <vcl/lstbox.hxx>
23 class ScNameDefDlg
: public ScAnyRefDlg
28 formula::RefEdit
* m_pEdRange
;
29 formula::RefButton
* m_pRbRange
;
33 CheckBox
* m_pBtnRowHeader
;
34 CheckBox
* m_pBtnColHeader
;
35 CheckBox
* m_pBtnPrintArea
;
36 CheckBox
* m_pBtnCriteria
;
38 PushButton
* m_pBtnAdd
;
39 PushButton
* m_pBtnCancel
;
42 bool mbUndo
; //if true we need to add an undo action after creating a range name
44 ScDocShell
* mpDocShell
;
46 ScAddress maCursorPos
;
47 OUString maStrInfoDefault
;
48 const OUString maGlobalNameStr
;
49 const OUString maErrInvalidNameStr
;
50 const OUString maErrNameInUse
;
52 //hack to call this dialog from Manage Names
56 std::map
<OUString
, ScRangeName
*> maRangeMap
;
62 bool IsFormulaValid();
64 DECL_LINK( CancelBtnHdl
, void * );
65 DECL_LINK( AddBtnHdl
, void* );
66 DECL_LINK( NameModifyHdl
, void* );
67 DECL_LINK( AssignGetFocusHdl
, void * );
70 virtual void RefInputDone( sal_Bool bForced
= sal_False
);
73 ScNameDefDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
, Window
* pParent
,
74 ScViewData
* pViewData
, std::map
<OUString
, ScRangeName
*> aRangeMap
,
75 const ScAddress
& aCursorPos
, const bool bUndo
);
77 virtual ~ScNameDefDlg() {};
79 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
);
80 virtual sal_Bool
IsRefInputMode() const;
82 virtual void SetActive();
83 virtual sal_Bool
Close();
85 void GetNewData( OUString
& rName
, OUString
& rScope
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */