xref: /aoo41x/main/sc/source/ui/inc/namedlg.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_NAMEDLG_HXX
29 #define SC_NAMEDLG_HXX
30 
31 #ifndef _MOREBTN_HXX //autogen
32 #include <vcl/morebtn.hxx>
33 #endif
34 #ifndef _COMBOBOX_HXX //autogen
35 #include <vcl/combobox.hxx>
36 #endif
37 #ifndef _GROUP_HXX //autogen
38 #include <vcl/group.hxx>
39 #endif
40 #include <vcl/fixed.hxx>
41 #include "rangenam.hxx"
42 #include "anyrefdg.hxx"
43 
44 class ScViewData;
45 class ScDocument;
46 
47 
48 //==================================================================
49 
50 class ScNameDlg : public ScAnyRefDlg
51 {
52 private:
53     FixedLine       aFlName;
54 	ComboBox		aEdName;
55 
56     FixedLine       aFlAssign;
57 	formula::RefEdit		aEdAssign;
58 	formula::RefButton		aRbAssign;
59 
60 	FixedLine		aFlType;
61 	CheckBox		aBtnPrintArea;
62 	CheckBox		aBtnColHeader;
63 	CheckBox		aBtnCriteria;
64 	CheckBox		aBtnRowHeader;
65 
66 	OKButton		aBtnOk;
67 	CancelButton	aBtnCancel;
68 	HelpButton		aBtnHelp;
69 	PushButton		aBtnAdd;
70 	PushButton		aBtnRemove;
71 	MoreButton		aBtnMore;
72 	sal_Bool			bSaved;
73 
74 	const String	aStrAdd;	// "Hinzufuegen"
75 	const String	aStrModify;	// "Aendern"
76 	const String	errMsgInvalidSym;
77 
78 	ScViewData*		pViewData;
79 	ScDocument*		pDoc;
80 	ScRangeName		aLocalRangeName;
81 	const ScAddress	theCursorPos;
82 	Selection		theCurSel;
83 
84 #ifdef _NAMEDLG_CXX
85 private:
86 	void Init();
87 	void UpdateChecks();
88 	void UpdateNames();
89 	void CalcCurTableAssign( String& aAssign, sal_uInt16 nPos );
90 
91 	// Handler:
92 	DECL_LINK( OkBtnHdl, void * );
93 	DECL_LINK( CancelBtnHdl, void * );
94 	DECL_LINK( AddBtnHdl, void * );
95 	DECL_LINK( RemoveBtnHdl, void * );
96 	DECL_LINK( EdModifyHdl, Edit * );
97 	DECL_LINK( NameSelectHdl, void * );
98 	DECL_LINK( AssignGetFocusHdl, void * );
99 #endif
100 
101 protected:
102 
103 	virtual void	RefInputDone( sal_Bool bForced = sal_False );
104 
105 
106 public:
107 					ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
108 							   ScViewData*		ptrViewData,
109 							   const ScAddress&	aCursorPos );
110 					~ScNameDlg();
111 
112 	virtual void	SetReference( const ScRange& rRef, ScDocument* pDoc );
113 	virtual sal_Bool	IsRefInputMode() const;
114 
115 	virtual void	SetActive();
116 	virtual sal_Bool	Close();
117 
118 };
119 
120 
121 
122 #endif // SC_NAMEDLG_HXX
123 
124