xref: /aoo4110/main/sc/source/ui/inc/namedlg.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_NAMEDLG_HXX
25 #define SC_NAMEDLG_HXX
26 
27 #ifndef _MOREBTN_HXX //autogen
28 #include <vcl/morebtn.hxx>
29 #endif
30 #ifndef _COMBOBOX_HXX //autogen
31 #include <vcl/combobox.hxx>
32 #endif
33 #ifndef _GROUP_HXX //autogen
34 #include <vcl/group.hxx>
35 #endif
36 #include <vcl/fixed.hxx>
37 #include <vcl/lstbox.hxx>
38 #include <vcl/edit.hxx>
39 #include "rangenam.hxx"
40 #include "anyrefdg.hxx"
41 
42 class ScViewData;
43 class ScDocument;
44 
45 
46 //==================================================================
47 
48 class ScNameDlg : public ScAnyRefDlg
49 {
50 private:
51     FixedLine       aFlName;
52 	//ComboBox		aEdName;
53 	Edit                       aEdName;
54 	ListBox     aLBNames;
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 	SCTAB           aSelectedRangeScope;
84 
85 #ifdef _NAMEDLG_CXX
86 private:
87 	void Init();
88 	void UpdateChecks();
89 	void UpdateNames();
90 	void CalcCurTableAssign( String& aAssign, sal_uInt16 nPos );
91 
92 	// Handler:
93 	DECL_LINK( OkBtnHdl, void * );
94 	DECL_LINK( CancelBtnHdl, void * );
95 	DECL_LINK( AddBtnHdl, void * );
96 	DECL_LINK( RemoveBtnHdl, void * );
97 	DECL_LINK( EdModifyHdl, Edit * );
98 	DECL_LINK( NameSelectHdl, void * );
99 	DECL_LINK( AssignGetFocusHdl, void * );
100 #endif
101 
102 protected:
103 
104 	virtual void	RefInputDone( sal_Bool bForced = sal_False );
105 
106 
107 public:
108 					ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
109 							   ScViewData*		ptrViewData,
110 							   const ScAddress&	aCursorPos );
111 					~ScNameDlg();
112 
113 	virtual void	SetReference( const ScRange& rRef, ScDocument* pDoc );
114 	virtual sal_Bool	IsRefInputMode() const;
115 
116 	virtual void	SetActive();
117 	virtual sal_Bool	Close();
118 
119 };
120 
121 
122 
123 #endif // SC_NAMEDLG_HXX
124 
125