Branch data 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 FORMULA_FUNCPAGE_HXX
21 : : #define FORMULA_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/svtreebx.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 );
50 : : virtual long PreNotify( NotifyEvent& rNEvt );
51 : :
52 : : public:
53 : : FormulaListBox( Window* pParent, const ResId& rResId );
54 : :
55 : : };
56 : :
57 : :
58 : :
59 : : typedef const IFunctionDescription* TFunctionDesc;
60 : : //============================================================================
61 [ # # ][ # # ]: 0 : class FuncPage : public TabPage
[ # # ][ # # ]
[ # # ][ # # ]
62 : : {
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;
73 : :
74 : : ::std::vector< TFunctionDesc > aLRUList;
75 : : rtl::OString m_aHelpId;
76 : :
77 : :
78 : : void impl_addFunctions(const IFunctionCategory* _pCategory);
79 : : DECL_LINK( SelHdl, ListBox* );
80 : : DECL_LINK(DblClkHdl, void *);
81 : :
82 : : protected:
83 : :
84 : : void UpdateFunctionList();
85 : : void InitLRUList();
86 : :
87 : :
88 : : public:
89 : :
90 : : FuncPage( Window* pParent,const IFunctionManager* _pFunctionManager);
91 : :
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();
98 : :
99 : : sal_uInt16 GetFuncPos(const IFunctionDescription* _pDesc);
100 : : const IFunctionDescription* GetFuncDesc( sal_uInt16 nPos ) const;
101 : : String 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: */
|