xref: /trunk/main/sc/source/ui/inc/namedlg.hxx (revision 38d50f7b)
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 "rangenam.hxx"
38 #include "anyrefdg.hxx"
39 
40 class ScViewData;
41 class ScDocument;
42 
43 
44 //==================================================================
45 
46 class ScNameDlg : public ScAnyRefDlg
47 {
48 private:
49     FixedLine       aFlName;
50 	ComboBox		aEdName;
51 
52     FixedLine       aFlAssign;
53 	formula::RefEdit		aEdAssign;
54 	formula::RefButton		aRbAssign;
55 
56 	FixedLine		aFlType;
57 	CheckBox		aBtnPrintArea;
58 	CheckBox		aBtnColHeader;
59 	CheckBox		aBtnCriteria;
60 	CheckBox		aBtnRowHeader;
61 
62 	OKButton		aBtnOk;
63 	CancelButton	aBtnCancel;
64 	HelpButton		aBtnHelp;
65 	PushButton		aBtnAdd;
66 	PushButton		aBtnRemove;
67 	MoreButton		aBtnMore;
68 	sal_Bool			bSaved;
69 
70 	const String	aStrAdd;	// "Hinzufuegen"
71 	const String	aStrModify;	// "Aendern"
72 	const String	errMsgInvalidSym;
73 
74 	ScViewData*		pViewData;
75 	ScDocument*		pDoc;
76 	ScRangeName		aLocalRangeName;
77 	const ScAddress	theCursorPos;
78 	Selection		theCurSel;
79 
80 #ifdef _NAMEDLG_CXX
81 private:
82 	void Init();
83 	void UpdateChecks();
84 	void UpdateNames();
85 	void CalcCurTableAssign( String& aAssign, sal_uInt16 nPos );
86 
87 	// Handler:
88 	DECL_LINK( OkBtnHdl, void * );
89 	DECL_LINK( CancelBtnHdl, void * );
90 	DECL_LINK( AddBtnHdl, void * );
91 	DECL_LINK( RemoveBtnHdl, void * );
92 	DECL_LINK( EdModifyHdl, Edit * );
93 	DECL_LINK( NameSelectHdl, void * );
94 	DECL_LINK( AssignGetFocusHdl, void * );
95 #endif
96 
97 protected:
98 
99 	virtual void	RefInputDone( sal_Bool bForced = sal_False );
100 
101 
102 public:
103 					ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
104 							   ScViewData*		ptrViewData,
105 							   const ScAddress&	aCursorPos );
106 					~ScNameDlg();
107 
108 	virtual void	SetReference( const ScRange& rRef, ScDocument* pDoc );
109 	virtual sal_Bool	IsRefInputMode() const;
110 
111 	virtual void	SetActive();
112 	virtual sal_Bool	Close();
113 
114 };
115 
116 
117 
118 #endif // SC_NAMEDLG_HXX
119 
120