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_STRUCTPG_HXX
21 : #define INCLUDED_FORMULA_SOURCE_UI_DLG_STRUCTPG_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 : #include <vcl/tabctrl.hxx>
29 : #include <svtools/treelistbox.hxx>
30 : #include "formula/IFunctionDescription.hxx"
31 : #include "formula/omoduleclient.hxx"
32 :
33 :
34 :
35 :
36 : namespace formula
37 : {
38 :
39 : class IFormulaToken;
40 0 : class StructListBox : public SvTreeListBox
41 : {
42 : private:
43 :
44 : bool bActiveFlag;
45 :
46 : protected:
47 : virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
48 :
49 : public:
50 :
51 : StructListBox(vcl::Window* pParent, WinBits nBits );
52 :
53 : /** Inserts an entry with static image (no difference between collapsed/expanded). */
54 : SvTreeListEntry* InsertStaticEntry(
55 : const OUString& rText,
56 : const Image& rEntryImg,
57 : SvTreeListEntry* pParent = NULL,
58 : sal_uLong nPos = TREELIST_APPEND,
59 : IFormulaToken* pToken = NULL );
60 :
61 : void SetActiveFlag(bool bFlag=true);
62 0 : bool GetActiveFlag() { return bActiveFlag;}
63 : void GetFocus() SAL_OVERRIDE;
64 : void LoseFocus() SAL_OVERRIDE;
65 : };
66 :
67 :
68 :
69 0 : class StructPage : public TabPage
70 : , public IStructHelper
71 : {
72 : private:
73 : OModuleClient m_aModuleClient;
74 : Link aSelLink;
75 :
76 : StructListBox *m_pTlbStruct;
77 : Image maImgEnd;
78 : Image maImgError;
79 :
80 : IFormulaToken* pSelectedToken;
81 :
82 : DECL_LINK( SelectHdl, SvTreeListBox* );
83 :
84 : using Window::GetParent;
85 :
86 : protected:
87 :
88 : IFormulaToken* GetFunctionEntry(SvTreeListEntry* pEntry);
89 :
90 : public:
91 :
92 : StructPage( vcl::Window* pParent);
93 :
94 : void ClearStruct();
95 : virtual SvTreeListEntry* InsertEntry(const OUString& rText, SvTreeListEntry* pParent,
96 : sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL) SAL_OVERRIDE;
97 :
98 : virtual OUString GetEntryText(SvTreeListEntry* pEntry) const SAL_OVERRIDE;
99 : virtual SvTreeListEntry* GetParent(SvTreeListEntry* pEntry) const SAL_OVERRIDE;
100 :
101 0 : void SetSelectionHdl( const Link& rLink ) { aSelLink = rLink; }
102 : const Link& GetSelectionHdl() const { return aSelLink; }
103 : };
104 :
105 : } // formula
106 :
107 : #endif
108 :
109 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|