xref: /aoo41x/main/sc/source/ui/inc/funcpage.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_FUNCPAGE_HXX
29 #define SC_FUNCPAGE_HXX
30 
31 #include "funcutl.hxx"
32 #include "global.hxx"		// ScAddress
33 #include <svtools/stdctrl.hxx>
34 #ifndef _LSTBOX_HXX //autogen
35 #include <vcl/lstbox.hxx>
36 #endif
37 #include <vcl/group.hxx>
38 #include <svtools/svmedit.hxx>
39 #include <vcl/tabpage.hxx>
40 
41 #ifndef _SVSTDARR_STRINGS
42 
43 #define _SVSTDARR_STRINGS
44 #include <svl/svstdarr.hxx>
45 
46 #endif
47 #include <vcl/tabctrl.hxx>
48 #include "parawin.hxx"
49 #include <svtools/svtreebx.hxx>
50 #include "compiler.hxx"
51 #include "cell.hxx"
52 
53 
54 class ScViewData;
55 class ScFuncName_Impl;
56 class ScDocument;
57 class ScFuncDesc;
58 
59 //============================================================================
60 
61 #define LRU_MAX 10
62 
63 //============================================================================
64 class ScListBox : public ListBox
65 {
66 protected:
67 
68 	virtual void	KeyInput( const KeyEvent& rKEvt );
69 	virtual long	PreNotify( NotifyEvent& rNEvt );
70 
71 public:
72 					ScListBox( Window* pParent, const ResId& rResId );
73 };
74 
75 
76 
77 
78 //============================================================================
79 class ScFuncPage : public TabPage
80 {
81 private:
82 
83 	Link			aDoubleClickLink;
84 	Link			aSelectionLink;
85 	FixedText		aFtCategory;
86 	ListBox			aLbCategory;
87 	FixedText		aFtFunction;
88 	ScListBox		aLbFunction;
89 	ImageButton		aIBFunction;
90 
91 	const ScFuncDesc*	aLRUList[LRU_MAX];
92 
93 
94 					DECL_LINK( SelHdl, ListBox* );
95 					DECL_LINK( DblClkHdl, ListBox* );
96 
97 protected:
98 
99 	void			UpdateFunctionList();
100 	void			InitLRUList();
101 
102 
103 public:
104 
105 					ScFuncPage( Window* pParent);
106 
107 	void			SetCategory(sal_uInt16 nCat);
108 	void			SetFunction(sal_uInt16 nFunc);
109 	void			SetFocus();
110 	sal_uInt16			GetCategory();
111 	sal_uInt16			GetFunction();
112 	sal_uInt16			GetFunctionEntryCount();
113 
114 	sal_uInt16			GetFuncPos(const ScFuncDesc*);
115 	const ScFuncDesc*	GetFuncDesc( sal_uInt16 nPos ) const;
116 	String			GetSelFunctionName() const;
117 
118 	void            SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; }
119 	const Link&     GetDoubleClickHdl() const { return aDoubleClickLink; }
120 
121 	void            SetSelectHdl( const Link& rLink ) { aSelectionLink = rLink; }
122 	const Link&     GetSelectHdl() const { return aSelectionLink; }
123 
124 };
125 
126 
127 #endif
128 
129