Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_FORMULA_SOURCE_UI_DLG_FUNCPAGE_HXX
21 : #define INCLUDED_FORMULA_SOURCE_UI_DLG_FUNCPAGE_HXX
22 :
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>
28 :
29 : #include <vcl/tabctrl.hxx>
30 : #include <vcl/button.hxx>
31 : #include <svtools/treelistbox.hxx>
32 :
33 : #include <boost/shared_ptr.hpp>
34 : #include <vector>
35 : #include "formula/omoduleclient.hxx"
36 :
37 : namespace formula
38 : {
39 :
40 : class IFunctionDescription;
41 : class IFunctionManager;
42 : class IFunctionCategory;
43 :
44 :
45 0 : class FormulaListBox : public ListBox
46 : {
47 : protected:
48 :
49 : virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
50 : virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
51 :
52 : public:
53 : FormulaListBox( vcl::Window* pParent, WinBits nBits );
54 :
55 : };
56 :
57 :
58 :
59 : typedef const IFunctionDescription* TFunctionDesc;
60 :
61 : class FuncPage : public TabPage
62 : {
63 : private:
64 : OModuleClient m_aModuleClient;
65 : Link<> aDoubleClickLink;
66 : Link<> aSelectionLink;
67 : VclPtr<ListBox> m_pLbCategory;
68 : VclPtr<FormulaListBox> m_pLbFunction;
69 : const IFunctionManager*
70 : m_pFunctionManager;
71 :
72 : ::std::vector< TFunctionDesc > aLRUList;
73 : OString m_aHelpId;
74 :
75 :
76 : void impl_addFunctions(const IFunctionCategory* _pCategory);
77 : DECL_LINK( SelHdl, ListBox* );
78 : DECL_LINK(DblClkHdl, void *);
79 :
80 : protected:
81 :
82 : void UpdateFunctionList();
83 : void InitLRUList();
84 :
85 :
86 : public:
87 :
88 : FuncPage( vcl::Window* pParent,const IFunctionManager* _pFunctionManager);
89 : virtual ~FuncPage();
90 : virtual void dispose() SAL_OVERRIDE;
91 :
92 : void SetCategory(sal_Int32 nCat);
93 : void SetFunction(sal_Int32 nFunc);
94 : void SetFocus();
95 : sal_Int32 GetCategory();
96 : sal_Int32 GetFunction();
97 : sal_Int32 GetFunctionEntryCount();
98 :
99 : sal_Int32 GetFuncPos(const IFunctionDescription* _pDesc);
100 : const IFunctionDescription* GetFuncDesc( sal_Int32 nPos ) const;
101 : OUString GetSelFunctionName() const;
102 :
103 0 : void SetDoubleClickHdl( const Link<>& rLink ) { aDoubleClickLink = rLink; }
104 : const Link<>& GetDoubleClickHdl() const { return aDoubleClickLink; }
105 :
106 0 : void SetSelectHdl( const Link<>& rLink ) { aSelectionLink = rLink; }
107 : const Link<>& GetSelectHdl() const { return aSelectionLink; }
108 :
109 : };
110 :
111 : } // formula
112 : #endif
113 :
114 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|