xref: /trunk/main/sc/source/ui/inc/tpusrlst.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_TPUSRLST_HXX
25 #define SC_TPUSRLST_HXX
26 
27 #include <sfx2/tabdlg.hxx>
28 #include <vcl/fixed.hxx>
29 #include <vcl/lstbox.hxx>
30 #include <svtools/svmedit.hxx>
31 
32 //========================================================================
33 // Benutzerdefinierte Listen:
34 
35 class ScUserList;
36 class ScDocument;
37 class ScViewData;
38 class ScRangeUtil;
39 
40 class ScTpUserLists : public SfxTabPage
41 {
42 public:
43 	static	SfxTabPage*	Create			( Window*				pParent,
44 										  const SfxItemSet& 	rAttrSet );
45 	static	sal_uInt16*		GetRanges		();
46 	virtual	sal_Bool		FillItemSet		( SfxItemSet& rCoreAttrs );
47 	virtual	void		Reset			( const SfxItemSet& rCoreAttrs );
48     using SfxTabPage::DeactivatePage;
49 	virtual int			DeactivatePage	( SfxItemSet* pSet = NULL );
50 
51 private:
52 			ScTpUserLists( Window*			 	pParent,
53 						   const SfxItemSet&	rArgSet );
54 			~ScTpUserLists();
55 
56 private:
57 	FixedText		aFtLists;
58 	ListBox			aLbLists;
59 	FixedText		aFtEntries;
60 	MultiLineEdit	aEdEntries;
61 	FixedText		aFtCopyFrom;
62 	Edit			aEdCopyFrom;
63 	PushButton		aBtnNew;
64 	PushButton		aBtnAdd;
65 	PushButton		aBtnRemove;
66 	PushButton		aBtnCopy;
67 
68 	const String	aStrQueryRemove;
69 	const String	aStrNew;
70 	const String	aStrCancel;
71 	const String	aStrAdd;
72 	const String	aStrModify;
73 	const String	aStrCopyList;
74 	const String	aStrCopyFrom;
75 	const String	aStrCopyErr;
76 
77 	const sal_uInt16	nWhichUserLists;
78 	ScUserList*		pUserLists;
79 
80 	ScDocument*		pDoc;
81 	ScViewData*		pViewData;
82 	ScRangeUtil*	pRangeUtil;
83 	String			aStrSelectedArea;
84 
85 	sal_Bool			bModifyMode;
86 	sal_Bool			bCancelMode;
87 	sal_Bool			bCopyDone;
88 	sal_uInt16			nCancelPos;
89 
90 #ifdef _TPUSRLST_CXX
91 private:
92 	void	Init				();
93 	sal_uInt16	UpdateUserListBox	();
94 	void	UpdateEntries		( sal_uInt16 nList );
95 	void	MakeListStr			( String& rListStr );
96 	void	AddNewList			( const String& rEntriesStr );
97 	void	RemoveList			( sal_uInt16 nList );
98 	void	ModifyList			( sal_uInt16		nSelList,
99 								  const String& rEntriesStr );
100 	void	CopyListFromArea	( const ScRefAddress& rStartPos,
101 								  const ScRefAddress& rEndPos );
102 
103 	// Handler:
104 	DECL_LINK( LbSelectHdl, 	ListBox* );
105 	DECL_LINK( BtnClickHdl,		PushButton* );
106 	DECL_LINK( EdEntriesModHdl,	MultiLineEdit* );
107 #endif
108 };
109 
110 
111 
112 #endif // SC_TPUSRLST_HXX
113 
114