xref: /aoo41x/main/sc/source/ui/inc/funcpage.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_FUNCPAGE_HXX
25cdf0e10cSrcweir #define SC_FUNCPAGE_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "funcutl.hxx"
28cdf0e10cSrcweir #include "global.hxx"		// ScAddress
29cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
30cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
31cdf0e10cSrcweir #include <vcl/lstbox.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <vcl/group.hxx>
34cdf0e10cSrcweir #include <svtools/svmedit.hxx>
35cdf0e10cSrcweir #include <vcl/tabpage.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #ifndef _SVSTDARR_STRINGS
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #define _SVSTDARR_STRINGS
40cdf0e10cSrcweir #include <svl/svstdarr.hxx>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #endif
43cdf0e10cSrcweir #include <vcl/tabctrl.hxx>
44cdf0e10cSrcweir #include "parawin.hxx"
45cdf0e10cSrcweir #include <svtools/svtreebx.hxx>
46cdf0e10cSrcweir #include "compiler.hxx"
47cdf0e10cSrcweir #include "cell.hxx"
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
50cdf0e10cSrcweir class ScViewData;
51cdf0e10cSrcweir class ScFuncName_Impl;
52cdf0e10cSrcweir class ScDocument;
53cdf0e10cSrcweir class ScFuncDesc;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir //============================================================================
56cdf0e10cSrcweir 
57cdf0e10cSrcweir #define LRU_MAX 10
58cdf0e10cSrcweir 
59cdf0e10cSrcweir //============================================================================
60cdf0e10cSrcweir class ScListBox : public ListBox
61cdf0e10cSrcweir {
62cdf0e10cSrcweir protected:
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	virtual void	KeyInput( const KeyEvent& rKEvt );
65cdf0e10cSrcweir 	virtual long	PreNotify( NotifyEvent& rNEvt );
66cdf0e10cSrcweir 
67cdf0e10cSrcweir public:
68cdf0e10cSrcweir 					ScListBox( Window* pParent, const ResId& rResId );
69cdf0e10cSrcweir };
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 
74cdf0e10cSrcweir //============================================================================
75cdf0e10cSrcweir class ScFuncPage : public TabPage
76cdf0e10cSrcweir {
77cdf0e10cSrcweir private:
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	Link			aDoubleClickLink;
80cdf0e10cSrcweir 	Link			aSelectionLink;
81cdf0e10cSrcweir 	FixedText		aFtCategory;
82cdf0e10cSrcweir 	ListBox			aLbCategory;
83cdf0e10cSrcweir 	FixedText		aFtFunction;
84cdf0e10cSrcweir 	ScListBox		aLbFunction;
85cdf0e10cSrcweir 	ImageButton		aIBFunction;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	const ScFuncDesc*	aLRUList[LRU_MAX];
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 					DECL_LINK( SelHdl, ListBox* );
91cdf0e10cSrcweir 					DECL_LINK( DblClkHdl, ListBox* );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir protected:
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	void			UpdateFunctionList();
96cdf0e10cSrcweir 	void			InitLRUList();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 
99cdf0e10cSrcweir public:
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 					ScFuncPage( Window* pParent);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	void			SetCategory(sal_uInt16 nCat);
104cdf0e10cSrcweir 	void			SetFunction(sal_uInt16 nFunc);
105cdf0e10cSrcweir 	void			SetFocus();
106cdf0e10cSrcweir 	sal_uInt16			GetCategory();
107cdf0e10cSrcweir 	sal_uInt16			GetFunction();
108cdf0e10cSrcweir 	sal_uInt16			GetFunctionEntryCount();
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	sal_uInt16			GetFuncPos(const ScFuncDesc*);
111cdf0e10cSrcweir 	const ScFuncDesc*	GetFuncDesc( sal_uInt16 nPos ) const;
112cdf0e10cSrcweir 	String			GetSelFunctionName() const;
113cdf0e10cSrcweir 
SetDoubleClickHdl(const Link & rLink)114cdf0e10cSrcweir 	void            SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; }
GetDoubleClickHdl() const115cdf0e10cSrcweir 	const Link&     GetDoubleClickHdl() const { return aDoubleClickLink; }
116cdf0e10cSrcweir 
SetSelectHdl(const Link & rLink)117cdf0e10cSrcweir 	void            SetSelectHdl( const Link& rLink ) { aSelectionLink = rLink; }
GetSelectHdl() const118cdf0e10cSrcweir 	const Link&     GetSelectHdl() const { return aSelectionLink; }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir };
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 
123cdf0e10cSrcweir #endif
124cdf0e10cSrcweir 
125