Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / namedefdlg.hxx
blob185a3c237f3cbfac8556df3a629b4d02ad2b59dc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
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>
19 #include <map>
21 class ScRangeName;
22 class ScDocument;
23 class ScDocShell;
24 class ScViewData;
26 class ScNameDefDlg : public ScAnyRefDlg
28 private:
29 Edit* m_pEdName;
31 formula::RefEdit* m_pEdRange;
32 formula::RefButton* m_pRbRange;
34 ListBox* m_pLbScope;
36 CheckBox* m_pBtnRowHeader;
37 CheckBox* m_pBtnColHeader;
38 CheckBox* m_pBtnPrintArea;
39 CheckBox* m_pBtnCriteria;
41 PushButton* m_pBtnAdd;
42 PushButton* m_pBtnCancel;
43 FixedText* m_pFtInfo;
45 bool mbUndo; //if true we need to add an undo action after creating a range name
46 ScDocument* mpDoc;
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
56 OUString maName;
57 OUString maScope;
59 std::map<OUString, ScRangeName*> maRangeMap;
61 void CancelPushed();
62 void AddPushed();
64 bool IsNameValid();
65 bool IsFormulaValid();
67 DECL_LINK( CancelBtnHdl, void * );
68 DECL_LINK( AddBtnHdl, void* );
69 DECL_LINK( NameModifyHdl, void* );
70 DECL_LINK( AssignGetFocusHdl, void * );
72 protected:
73 virtual void RefInputDone( sal_Bool bForced = sal_False );
75 public:
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 );
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */