Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / funcpage.hxx
blob232bb74c8555135a8cbb835fc3d4fd76585e2f16
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 SC_FUNCPAGE_HXX
21 #define SC_FUNCPAGE_HXX
23 #include "funcutl.hxx"
24 #include "global.hxx"
25 #include <svtools/stdctrl.hxx>
26 #include <vcl/lstbox.hxx>
27 #include <vcl/group.hxx>
28 #include <svtools/svmedit.hxx>
29 #include <vcl/tabpage.hxx>
31 #include <vcl/tabctrl.hxx>
32 #include "parawin.hxx"
33 #include <svtools/treelistbox.hxx>
34 #include "compiler.hxx"
36 class ScFuncDesc;
38 //============================================================================
40 #define LRU_MAX 10
42 //============================================================================
43 class ScListBox : public ListBox
45 protected:
47 virtual void KeyInput( const KeyEvent& rKEvt );
48 virtual long PreNotify( NotifyEvent& rNEvt );
50 public:
51 ScListBox( Window* pParent, const ResId& rResId );
57 //============================================================================
58 class ScFuncPage : public TabPage
60 private:
62 Link aDoubleClickLink;
63 Link aSelectionLink;
64 FixedText aFtCategory;
65 ListBox aLbCategory;
66 FixedText aFtFunction;
67 ScListBox aLbFunction;
68 ImageButton aIBFunction;
70 const ScFuncDesc* aLRUList[LRU_MAX];
73 DECL_LINK( SelHdl, ListBox* );
74 DECL_LINK( DblClkHdl, ListBox* );
76 protected:
78 void UpdateFunctionList();
79 void InitLRUList();
82 public:
84 ScFuncPage( Window* pParent);
86 void SetCategory(sal_uInt16 nCat);
87 void SetFunction(sal_uInt16 nFunc);
88 void SetFocus();
89 sal_uInt16 GetCategory();
90 sal_uInt16 GetFunction();
91 sal_uInt16 GetFunctionEntryCount();
93 sal_uInt16 GetFuncPos(const ScFuncDesc*);
94 const ScFuncDesc* GetFuncDesc( sal_uInt16 nPos ) const;
95 OUString GetSelFunctionName() const;
97 void SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; }
98 const Link& GetDoubleClickHdl() const { return aDoubleClickLink; }
100 void SetSelectHdl( const Link& rLink ) { aSelectionLink = rLink; }
101 const Link& GetSelectHdl() const { return aSelectionLink; }
106 #endif
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */