Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / formula / source / ui / dlg / structpg.hxx
blobec48d27a351099f5ac7e02cdceebdbbcd24750e2
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_STRUCTPG_HXX
21 #define SC_STRUCTPG_HXX
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"
33 //============================================================================
35 //============================================================================
36 namespace formula
39 class IFormulaToken;
40 class StructListBox : public SvTreeListBox
42 private:
44 sal_Bool bActiveFlag;
46 protected:
47 virtual void MouseButtonDown( const MouseEvent& rMEvt );
49 public:
51 StructListBox(Window* pParent, const ResId& rResId );
53 /** Inserts an entry with static image (no difference between collapsed/expanded). */
54 SvTreeListEntry* InsertStaticEntry(
55 const XubString& rText,
56 const Image& rEntryImg,
57 SvTreeListEntry* pParent = NULL,
58 sal_uLong nPos = LIST_APPEND,
59 IFormulaToken* pToken = NULL );
61 void SetActiveFlag(sal_Bool bFlag=sal_True);
62 sal_Bool GetActiveFlag();
63 void GetFocus();
64 void LoseFocus();
67 //============================================================================
69 class StructPage : public TabPage
70 , public IStructHelper
72 private:
73 OModuleClient m_aModuleClient;
74 Link aSelLink;
76 FixedText aFtStruct;
77 StructListBox aTlbStruct;
78 Image maImgEnd;
79 Image maImgError;
81 IFormulaToken* pSelectedToken;
83 DECL_LINK( SelectHdl, SvTreeListBox* );
85 using Window::GetParent;
87 protected:
89 IFormulaToken* GetFunctionEntry(SvTreeListEntry* pEntry);
91 public:
93 StructPage( Window* pParent);
95 void ClearStruct();
96 virtual SvTreeListEntry* InsertEntry(const XubString& rText, SvTreeListEntry* pParent,
97 sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL);
99 virtual String GetEntryText(SvTreeListEntry* pEntry) const;
100 virtual SvTreeListEntry* GetParent(SvTreeListEntry* pEntry) const;
102 void SetSelectionHdl( const Link& rLink ) { aSelLink = rLink; }
103 const Link& GetSelectionHdl() const { return aSelLink; }
106 } // formula
108 #endif
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */