Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / formula / source / ui / dlg / funcpage.hxx
blobbcd59f3c11ecbb824632e23b1cc991ddc3e663f7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
34 #include <vector>
35 #include "formula/omoduleclient.hxx"
36 //============================================================================
37 namespace formula
40 class IFunctionDescription;
41 class IFunctionManager;
42 class IFunctionCategory;
44 //============================================================================
45 class FormulaListBox : public ListBox
47 protected:
49 virtual void KeyInput( const KeyEvent& rKEvt );
50 virtual long PreNotify( NotifyEvent& rNEvt );
52 public:
53 FormulaListBox( Window* pParent, const ResId& rResId );
59 typedef const IFunctionDescription* TFunctionDesc;
60 //============================================================================
61 class FuncPage : public TabPage
63 private:
64 OModuleClient m_aModuleClient;
65 Link aDoubleClickLink;
66 Link aSelectionLink;
67 FixedText aFtCategory;
68 ListBox aLbCategory;
69 FixedText aFtFunction;
70 FormulaListBox aLbFunction;
71 const IFunctionManager*
72 m_pFunctionManager;
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 *);
82 protected:
84 void UpdateFunctionList();
85 void InitLRUList();
88 public:
90 FuncPage( Window* pParent,const IFunctionManager* _pFunctionManager);
92 void SetCategory(sal_uInt16 nCat);
93 void SetFunction(sal_uInt16 nFunc);
94 void SetFocus();
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; }
111 } // formula
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */