xref: /aoo42x/main/sc/source/ui/inc/funcpage.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_FUNCPAGE_HXX
25 #define SC_FUNCPAGE_HXX
26 
27 #include "funcutl.hxx"
28 #include "global.hxx"		// ScAddress
29 #include <svtools/stdctrl.hxx>
30 #ifndef _LSTBOX_HXX //autogen
31 #include <vcl/lstbox.hxx>
32 #endif
33 #include <vcl/group.hxx>
34 #include <svtools/svmedit.hxx>
35 #include <vcl/tabpage.hxx>
36 
37 #ifndef _SVSTDARR_STRINGS
38 
39 #define _SVSTDARR_STRINGS
40 #include <svl/svstdarr.hxx>
41 
42 #endif
43 #include <vcl/tabctrl.hxx>
44 #include "parawin.hxx"
45 #include <svtools/svtreebx.hxx>
46 #include "compiler.hxx"
47 #include "cell.hxx"
48 
49 
50 class ScViewData;
51 class ScFuncName_Impl;
52 class ScDocument;
53 class ScFuncDesc;
54 
55 //============================================================================
56 
57 #define LRU_MAX 10
58 
59 //============================================================================
60 class ScListBox : public ListBox
61 {
62 protected:
63 
64 	virtual void	KeyInput( const KeyEvent& rKEvt );
65 	virtual long	PreNotify( NotifyEvent& rNEvt );
66 
67 public:
68 					ScListBox( Window* pParent, const ResId& rResId );
69 };
70 
71 
72 
73 
74 //============================================================================
75 class ScFuncPage : public TabPage
76 {
77 private:
78 
79 	Link			aDoubleClickLink;
80 	Link			aSelectionLink;
81 	FixedText		aFtCategory;
82 	ListBox			aLbCategory;
83 	FixedText		aFtFunction;
84 	ScListBox		aLbFunction;
85 	ImageButton		aIBFunction;
86 
87 	const ScFuncDesc*	aLRUList[LRU_MAX];
88 
89 
90 					DECL_LINK( SelHdl, ListBox* );
91 					DECL_LINK( DblClkHdl, ListBox* );
92 
93 protected:
94 
95 	void			UpdateFunctionList();
96 	void			InitLRUList();
97 
98 
99 public:
100 
101 					ScFuncPage( Window* pParent);
102 
103 	void			SetCategory(sal_uInt16 nCat);
104 	void			SetFunction(sal_uInt16 nFunc);
105 	void			SetFocus();
106 	sal_uInt16			GetCategory();
107 	sal_uInt16			GetFunction();
108 	sal_uInt16			GetFunctionEntryCount();
109 
110 	sal_uInt16			GetFuncPos(const ScFuncDesc*);
111 	const ScFuncDesc*	GetFuncDesc( sal_uInt16 nPos ) const;
112 	String			GetSelFunctionName() const;
113 
SetDoubleClickHdl(const Link & rLink)114 	void            SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; }
GetDoubleClickHdl() const115 	const Link&     GetDoubleClickHdl() const { return aDoubleClickLink; }
116 
SetSelectHdl(const Link & rLink)117 	void            SetSelectHdl( const Link& rLink ) { aSelectionLink = rLink; }
GetSelectHdl() const118 	const Link&     GetSelectHdl() const { return aSelectionLink; }
119 
120 };
121 
122 
123 #endif
124 
125