LibreOffice Module formula (master) 1
funcpage.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <vcl/weld.hxx>
23#include <vector>
24
25namespace formula
26{
27
28class IFunctionDescription;
29class IFunctionManager;
30class IFunctionCategory;
31
33
34class FuncPage final
35{
36private:
37 std::unique_ptr<weld::Builder> m_xBuilder;
38 std::unique_ptr<weld::Container> m_xContainer;
39
40 std::unique_ptr<weld::ComboBox> m_xLbCategory;
41 std::unique_ptr<weld::TreeView> m_xLbFunction;
42 std::unique_ptr<weld::Entry> m_xLbFunctionSearchString;
43
47
48 ::std::vector< TFunctionDesc > aLRUList;
49 OUString m_aHelpId;
50
51 // tdf#104487 - remember last used function category
53
54 void impl_addFunctions(const IFunctionCategory* _pCategory);
55
56 DECL_LINK(SelComboBoxHdl, weld::ComboBox&, void);
57 DECL_LINK(SelTreeViewHdl, weld::TreeView&, void);
58 DECL_LINK(DblClkHdl, weld::TreeView&, bool);
59 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
60 DECL_LINK(ModifyHdl, weld::Entry&, void);
61
62 void UpdateFunctionList(const OUString&);
63
64public:
65
66 FuncPage(weld::Container* pContainer, const IFunctionManager* _pFunctionManager);
67 ~FuncPage();
68
69 void SetCategory(sal_Int32 nCat);
70 void SetFunction(sal_Int32 nFunc);
71 void SetFocus();
72 sal_Int32 GetCategory() const;
73 sal_Int32 GetCategoryEntryCount() const;
74 sal_Int32 GetFunction() const;
75 sal_Int32 GetFunctionEntryCount() const;
76
77 // tdf#104487 - remember last used function category
79
80 sal_Int32 GetFuncPos(const IFunctionDescription* _pDesc);
81 const IFunctionDescription* GetFuncDesc( sal_Int32 nPos ) const;
82 OUString GetSelFunctionName() const;
83
85
86 void SetSelectHdl( const Link<FuncPage&,void>& rLink ) { aSelectionLink = rLink; }
87
88 bool IsVisible() const { return m_xContainer->get_visible(); }
89};
90
91} // formula
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Link< FuncPage &, void > aDoubleClickLink
Definition: funcpage.hxx:44
static sal_Int32 m_nRememberedFunctionCategory
Definition: funcpage.hxx:52
std::unique_ptr< weld::Entry > m_xLbFunctionSearchString
Definition: funcpage.hxx:42
const IFunctionManager * m_pFunctionManager
Definition: funcpage.hxx:46
std::unique_ptr< weld::ComboBox > m_xLbCategory
Definition: funcpage.hxx:40
std::unique_ptr< weld::TreeView > m_xLbFunction
Definition: funcpage.hxx:41
OUString m_aHelpId
Definition: funcpage.hxx:49
void SetDoubleClickHdl(const Link< FuncPage &, void > &rLink)
Definition: funcpage.hxx:84
sal_Int32 GetCategoryEntryCount() const
Definition: funcpage.cxx:249
OUString GetSelFunctionName() const
Definition: funcpage.cxx:255
DECL_LINK(DblClkHdl, weld::TreeView &, bool)
DECL_LINK(SelComboBoxHdl, weld::ComboBox &, void)
::std::vector< TFunctionDesc > aLRUList
Definition: funcpage.hxx:48
bool IsVisible() const
Definition: funcpage.hxx:88
void impl_addFunctions(const IFunctionCategory *_pCategory)
Definition: funcpage.cxx:82
sal_Int32 GetFunctionEntryCount() const
Definition: funcpage.cxx:253
sal_Int32 GetFuncPos(const IFunctionDescription *_pDesc)
Definition: funcpage.cxx:232
std::unique_ptr< weld::Container > m_xContainer
Definition: funcpage.hxx:38
Link< FuncPage &, void > aSelectionLink
Definition: funcpage.hxx:45
void UpdateFunctionList(const OUString &)
Definition: funcpage.cxx:97
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
sal_Int32 GetCategory() const
Definition: funcpage.cxx:247
static sal_Int32 GetRememeberdFunctionCategory()
Definition: funcpage.hxx:78
void SetFunction(sal_Int32 nFunc)
Definition: funcpage.cxx:237
FuncPage(weld::Container *pContainer, const IFunctionManager *_pFunctionManager)
Definition: funcpage.cxx:43
DECL_LINK(SelTreeViewHdl, weld::TreeView &, void)
const IFunctionDescription * GetFuncDesc(sal_Int32 nPos) const
Definition: funcpage.cxx:257
void SetSelectHdl(const Link< FuncPage &, void > &rLink)
Definition: funcpage.hxx:86
std::unique_ptr< weld::Builder > m_xBuilder
Definition: funcpage.hxx:37
DECL_LINK(ModifyHdl, weld::Entry &, void)
void SetCategory(sal_Int32 nCat)
Definition: funcpage.cxx:224
sal_Int32 GetFunction() const
Definition: funcpage.cxx:251
const IFunctionDescription * TFunctionDesc
Definition: funcpage.hxx:30