1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef FORMULA_FUNCPAGE_HXX
21 #define FORMULA_FUNCPAGE_HXX
23 #include <svtools/stdctrl.hxx>
24 #include <vcl/lstbox.hxx>
25 #include <vcl/group.hxx>
26 #include <svtools/svmedit.hxx>
27 #include <vcl/tabpage.hxx>
29 #include <vcl/tabctrl.hxx>
30 #include <vcl/button.hxx>
31 #include <svtools/treelistbox.hxx>
33 #include <boost/shared_ptr.hpp>
35 #include "formula/omoduleclient.hxx"
36 //============================================================================
40 class IFunctionDescription
;
41 class IFunctionManager
;
42 class IFunctionCategory
;
44 //============================================================================
45 class FormulaListBox
: public ListBox
49 virtual void KeyInput( const KeyEvent
& rKEvt
);
50 virtual long PreNotify( NotifyEvent
& rNEvt
);
53 FormulaListBox( Window
* pParent
, const ResId
& rResId
);
59 typedef const IFunctionDescription
* TFunctionDesc
;
60 //============================================================================
61 class FuncPage
: public TabPage
64 OModuleClient m_aModuleClient
;
65 Link aDoubleClickLink
;
67 FixedText aFtCategory
;
69 FixedText aFtFunction
;
70 FormulaListBox aLbFunction
;
71 const IFunctionManager
*
74 ::std::vector
< TFunctionDesc
> aLRUList
;
75 rtl::OString m_aHelpId
;
78 void impl_addFunctions(const IFunctionCategory
* _pCategory
);
79 DECL_LINK( SelHdl
, ListBox
* );
80 DECL_LINK(DblClkHdl
, void *);
84 void UpdateFunctionList();
90 FuncPage( Window
* pParent
,const IFunctionManager
* _pFunctionManager
);
92 void SetCategory(sal_uInt16 nCat
);
93 void SetFunction(sal_uInt16 nFunc
);
95 sal_uInt16
GetCategory();
96 sal_uInt16
GetFunction();
97 sal_uInt16
GetFunctionEntryCount();
99 sal_uInt16
GetFuncPos(const IFunctionDescription
* _pDesc
);
100 const IFunctionDescription
* GetFuncDesc( sal_uInt16 nPos
) const;
101 String
GetSelFunctionName() const;
103 void SetDoubleClickHdl( const Link
& rLink
) { aDoubleClickLink
= rLink
; }
104 const Link
& GetDoubleClickHdl() const { return aDoubleClickLink
; }
106 void SetSelectHdl( const Link
& rLink
) { aSelectionLink
= rLink
; }
107 const Link
& GetSelectHdl() const { return aSelectionLink
; }
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */