xref: /aoo41x/main/formula/source/ui/dlg/structpg.hxx (revision 5116778e)
1*5116778eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5116778eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5116778eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5116778eSAndrew Rist  * distributed with this work for additional information
6*5116778eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5116778eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5116778eSAndrew Rist  * "License"); you may not use this file except in compliance
9*5116778eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*5116778eSAndrew Rist  *
11*5116778eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*5116778eSAndrew Rist  *
13*5116778eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5116778eSAndrew Rist  * software distributed under the License is distributed on an
15*5116778eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5116778eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*5116778eSAndrew Rist  * specific language governing permissions and limitations
18*5116778eSAndrew Rist  * under the License.
19*5116778eSAndrew Rist  *
20*5116778eSAndrew Rist  *************************************************************/
21*5116778eSAndrew Rist 
22*5116778eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_STRUCTPG_HXX
25cdf0e10cSrcweir #define SC_STRUCTPG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
28cdf0e10cSrcweir #include <vcl/lstbox.hxx>
29cdf0e10cSrcweir #include <vcl/group.hxx>
30cdf0e10cSrcweir #include <svtools/svmedit.hxx>
31cdf0e10cSrcweir #include <vcl/tabpage.hxx>
32cdf0e10cSrcweir #include <vcl/tabctrl.hxx>
33cdf0e10cSrcweir #include <svtools/svtreebx.hxx>
34cdf0e10cSrcweir #include "formula/IFunctionDescription.hxx"
35cdf0e10cSrcweir #include "ModuleHelper.hxx"
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //============================================================================
38cdf0e10cSrcweir 
39cdf0e10cSrcweir //============================================================================
40cdf0e10cSrcweir namespace formula
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class IFormulaToken;
44cdf0e10cSrcweir class	StructListBox : public SvTreeListBox
45cdf0e10cSrcweir {
46cdf0e10cSrcweir private:
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 	sal_Bool			bActiveFlag;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir protected:
51cdf0e10cSrcweir 					virtual void MouseButtonDown( const MouseEvent& rMEvt );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir public:
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 					StructListBox(Window* pParent, const ResId& rResId );
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     /** Inserts an entry with static image (no difference between collapsed/expanded). */
58cdf0e10cSrcweir     SvLBoxEntry*    InsertStaticEntry(
59cdf0e10cSrcweir                         const XubString& rText,
60cdf0e10cSrcweir                         const Image& rEntryImg,
61cdf0e10cSrcweir                         const Image& rEntryImgHC,
62cdf0e10cSrcweir                         SvLBoxEntry* pParent = NULL,
63cdf0e10cSrcweir                         sal_uLong nPos = LIST_APPEND,
64cdf0e10cSrcweir                         IFormulaToken* pToken = NULL );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	void			SetActiveFlag(sal_Bool bFlag=sal_True);
67cdf0e10cSrcweir 	sal_Bool			GetActiveFlag();
68cdf0e10cSrcweir 	void			GetFocus();
69cdf0e10cSrcweir 	void			LoseFocus();
70cdf0e10cSrcweir };
71cdf0e10cSrcweir 
72cdf0e10cSrcweir //============================================================================
73cdf0e10cSrcweir 
74cdf0e10cSrcweir class StructPage : public TabPage
75cdf0e10cSrcweir                     , public IStructHelper
76cdf0e10cSrcweir {
77cdf0e10cSrcweir private:
78cdf0e10cSrcweir     OModuleClient   m_aModuleClient;
79cdf0e10cSrcweir 	Link			aSelLink;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	FixedText		aFtStruct;
82cdf0e10cSrcweir 	StructListBox	aTlbStruct;
83cdf0e10cSrcweir     Image           maImgEnd;
84cdf0e10cSrcweir     Image           maImgError;
85cdf0e10cSrcweir     Image           maImgEndHC;
86cdf0e10cSrcweir     Image           maImgErrorHC;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	IFormulaToken*	pSelectedToken;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	DECL_LINK( SelectHdl, SvTreeListBox* );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     using Window::GetParent;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir protected:
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	IFormulaToken*		GetFunctionEntry(SvLBoxEntry* pEntry);
97cdf0e10cSrcweir 
98cdf0e10cSrcweir public:
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 					StructPage( Window* pParent);
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	void			ClearStruct();
103cdf0e10cSrcweir 	virtual SvLBoxEntry*	InsertEntry(const XubString& rText, SvLBoxEntry* pParent,
104cdf0e10cSrcweir 								sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL);
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 	virtual String	        GetEntryText(SvLBoxEntry* pEntry) const;
107cdf0e10cSrcweir     virtual SvLBoxEntry*    GetParent(SvLBoxEntry* pEntry) const;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	String			GetSelectedEntryText();
110cdf0e10cSrcweir 	IFormulaToken*	GetSelectedToken();
111cdf0e10cSrcweir 
SetSelectionHdl(const Link & rLink)112cdf0e10cSrcweir 	void            SetSelectionHdl( const Link& rLink ) { aSelLink = rLink; }
GetSelectionHdl() const113cdf0e10cSrcweir 	const Link&     GetSelectionHdl() const { return aSelLink; }
114cdf0e10cSrcweir };
115cdf0e10cSrcweir 
116cdf0e10cSrcweir } // formula
117cdf0e10cSrcweir 
118cdf0e10cSrcweir #endif
119cdf0e10cSrcweir 
120