merge the formfield patch from ooo-build
[ooovba.git] / formula / source / ui / dlg / funcpage.hxx
blob801fda4389d2abf429fcd5bc193ae932fcc72eb7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: funcpage.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef FORMULA_FUNCPAGE_HXX
32 #define FORMULA_FUNCPAGE_HXX
34 #include <svtools/stdctrl.hxx>
35 #include <vcl/lstbox.hxx>
36 #include <vcl/group.hxx>
37 #include <svtools/svmedit.hxx>
38 #include <vcl/tabpage.hxx>
40 #include <vcl/tabctrl.hxx>
41 #include <vcl/button.hxx>
42 #include <svtools/svtreebx.hxx>
44 #include <boost/shared_ptr.hpp>
45 #include <vector>
46 #include "ModuleHelper.hxx"
47 //============================================================================
48 namespace formula
51 class IFunctionDescription;
52 class IFunctionManager;
53 class IFunctionCategory;
55 //============================================================================
56 class FormulaListBox : public ListBox
58 protected:
60 virtual void KeyInput( const KeyEvent& rKEvt );
61 virtual long PreNotify( NotifyEvent& rNEvt );
63 public:
64 FormulaListBox( Window* pParent, WinBits nWinStyle = WB_BORDER );
66 FormulaListBox( Window* pParent, const ResId& rResId );
72 typedef const IFunctionDescription* TFunctionDesc;
73 //============================================================================
74 class FuncPage : public TabPage
76 private:
77 OModuleClient m_aModuleClient;
78 Link aDoubleClickLink;
79 Link aSelectionLink;
80 FixedText aFtCategory;
81 ListBox aLbCategory;
82 FixedText aFtFunction;
83 FormulaListBox aLbFunction;
84 const IFunctionManager*
85 m_pFunctionManager;
87 ::std::vector< TFunctionDesc > aLRUList;
88 SmartId m_aSmartHelpId;
91 void impl_addFunctions(const IFunctionCategory* _pCategory);
92 DECL_LINK( SelHdl, ListBox* );
93 DECL_LINK( DblClkHdl, ListBox* );
95 protected:
97 void UpdateFunctionList();
98 void InitLRUList();
101 public:
103 FuncPage( Window* pParent,const IFunctionManager* _pFunctionManager);
105 void SetCategory(USHORT nCat);
106 void SetFunction(USHORT nFunc);
107 void SetFocus();
108 USHORT GetCategory();
109 USHORT GetFunction();
110 USHORT GetFunctionEntryCount();
112 USHORT GetFuncPos(const IFunctionDescription* _pDesc);
113 const IFunctionDescription* GetFuncDesc( USHORT nPos ) const;
114 String GetSelFunctionName() const;
116 void SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; }
117 const Link& GetDoubleClickHdl() const { return aDoubleClickLink; }
119 void SetSelectHdl( const Link& rLink ) { aSelectionLink = rLink; }
120 const Link& GetSelectHdl() const { return aSelectionLink; }
124 } // formula
125 #endif