xref: /AOO41X/main/basctl/source/basicide/baside2.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _BASIDE2_HXX
29*cdf0e10cSrcweir #define _BASIDE2_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <svheader.hxx>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <bastypes.hxx>
34*cdf0e10cSrcweir #include <bastype3.hxx>
35*cdf0e10cSrcweir #include <basidesh.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir class ExtTextEngine;
38*cdf0e10cSrcweir class ExtTextView;
39*cdf0e10cSrcweir class SvxSearchItem;
40*cdf0e10cSrcweir #include <svtools/svtabbx.hxx>
41*cdf0e10cSrcweir #include <svtools/headbar.hxx>
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX //autogen
44*cdf0e10cSrcweir #include <vcl/button.hxx>
45*cdf0e10cSrcweir #endif
46*cdf0e10cSrcweir #include <basic/sbmod.hxx>
47*cdf0e10cSrcweir #include <vcl/split.hxx>
48*cdf0e10cSrcweir #include "svl/lstner.hxx"
49*cdf0e10cSrcweir #include <svtools/colorcfg.hxx>
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir #include <sfx2/progress.hxx>
52*cdf0e10cSrcweir #include <svtools/syntaxhighlight.hxx>
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir DBG_NAMEEX( ModulWindow )
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir #define MARKER_NOMARKER	0xFFFF
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir namespace utl
59*cdf0e10cSrcweir {
60*cdf0e10cSrcweir     class SourceViewConfig;
61*cdf0e10cSrcweir }
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir // #108672 Helper functions to get/set text in TextEngine
64*cdf0e10cSrcweir // using the stream interface (get/setText() only supports
65*cdf0e10cSrcweir // tools Strings limited to 64K).
66*cdf0e10cSrcweir ::rtl::OUString getTextEngineText( ExtTextEngine* pEngine );
67*cdf0e10cSrcweir void setTextEngineText( ExtTextEngine* pEngine, const ::rtl::OUString aStr );
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir class ProgressInfo : public SfxProgress
70*cdf0e10cSrcweir {
71*cdf0e10cSrcweir private:
72*cdf0e10cSrcweir 	sal_uLong					nCurState;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir public:
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 	inline			ProgressInfo( SfxObjectShell* pObjSh, const String& rText, sal_uLong nRange );
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir //	inline void		StartProgress( const String& rName, sal_uLong nStates );
79*cdf0e10cSrcweir //	inline void		EndProgress();
80*cdf0e10cSrcweir 	inline void		StepProgress();
81*cdf0e10cSrcweir };
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir inline ProgressInfo::ProgressInfo( SfxObjectShell* pObjSh, const String& rText, sal_uLong nRange )
84*cdf0e10cSrcweir 	: SfxProgress( pObjSh, rText, nRange )
85*cdf0e10cSrcweir {
86*cdf0e10cSrcweir 	nCurState = 0;
87*cdf0e10cSrcweir }
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir // inline void ProgressInfo::StartProgress( const String& rName, sal_uLong nStates )
90*cdf0e10cSrcweir // {
91*cdf0e10cSrcweir // 	nCurState = 0;
92*cdf0e10cSrcweir // 	if ( pStbMgr )
93*cdf0e10cSrcweir // 		pStbMgr->StartProgressMode( rName, nStates );
94*cdf0e10cSrcweir // }
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir // inline void ProgressInfo::EndProgress()
97*cdf0e10cSrcweir // {
98*cdf0e10cSrcweir // 	if ( pStbMgr )
99*cdf0e10cSrcweir // 		pStbMgr->EndProgressMode();
100*cdf0e10cSrcweir //}
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir inline void ProgressInfo::StepProgress()
103*cdf0e10cSrcweir {
104*cdf0e10cSrcweir 	SetState( ++nCurState );
105*cdf0e10cSrcweir }
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir namespace svt {
109*cdf0e10cSrcweir class SourceViewConfig;
110*cdf0e10cSrcweir }
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir class EditorWindow : public Window, public SfxListener, public utl::ConfigurationListener
113*cdf0e10cSrcweir {
114*cdf0e10cSrcweir private:
115*cdf0e10cSrcweir 	ExtTextView*	pEditView;
116*cdf0e10cSrcweir 	ExtTextEngine*	pEditEngine;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     utl::SourceViewConfig* pSourceViewConfig;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	long			nCurTextWidth;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 	SyntaxHighlighter	aHighlighter;
123*cdf0e10cSrcweir 	Timer			aSyntaxIdleTimer;
124*cdf0e10cSrcweir 	Table			aSyntaxLineTable;
125*cdf0e10cSrcweir 	DECL_LINK( SyntaxTimerHdl, Timer * );
126*cdf0e10cSrcweir 	ProgressInfo*	pProgress;
127*cdf0e10cSrcweir 	ModulWindow*	pModulWindow;
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir     virtual void DataChanged(DataChangedEvent const & rDCEvt);
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir 	using			Window::Notify;
132*cdf0e10cSrcweir 	virtual void	Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 	void			ImpDoHighlight( sal_uLong nLineOff );
135*cdf0e10cSrcweir     void            ImplSetFont();
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 	sal_Bool			bHighlightning;
138*cdf0e10cSrcweir 	sal_Bool			bDoSyntaxHighlight;
139*cdf0e10cSrcweir 	sal_Bool			bDelayHighlight;
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir     virtual
142*cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
143*cdf0e10cSrcweir     GetComponentInterface(sal_Bool bCreate = sal_True);
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir protected:
146*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& );
147*cdf0e10cSrcweir 	virtual void	Resize();
148*cdf0e10cSrcweir 	virtual void	KeyInput( const KeyEvent& rKeyEvt );
149*cdf0e10cSrcweir 	virtual void	MouseMove( const MouseEvent& rMEvt );
150*cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
151*cdf0e10cSrcweir 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
152*cdf0e10cSrcweir 	virtual void	Command( const CommandEvent& rCEvt );
153*cdf0e10cSrcweir 	virtual void	LoseFocus();
154*cdf0e10cSrcweir 	virtual void	RequestHelp( const HelpEvent& rHEvt );
155*cdf0e10cSrcweir     virtual void    ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir 	void			DoSyntaxHighlight( sal_uLong nPara );
158*cdf0e10cSrcweir 	String			GetWordAtCursor();
159*cdf0e10cSrcweir 	sal_Bool			ImpCanModify();
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir public:
162*cdf0e10cSrcweir 					EditorWindow( Window* pParent );
163*cdf0e10cSrcweir 					~EditorWindow();
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir 	ExtTextEngine*	GetEditEngine()	const	{ return (ExtTextEngine*)pEditEngine; }
166*cdf0e10cSrcweir 	ExtTextView*	GetEditView() const		{ return pEditView; }
167*cdf0e10cSrcweir 	ProgressInfo*	GetProgress() const		{ return pProgress; }
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 	void			CreateProgress( const String& rText, sal_uLong nRange );
170*cdf0e10cSrcweir 	void			DestroyProgress();
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir 	void			ParagraphInsertedDeleted( sal_uLong nNewPara, sal_Bool bInserted );
173*cdf0e10cSrcweir 	void			DoDelayedSyntaxHighlight( sal_uLong nPara );
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir 	void			CreateEditEngine();
176*cdf0e10cSrcweir 	void			SetScrollBarRanges();
177*cdf0e10cSrcweir 	void			InitScrollBars();
178*cdf0e10cSrcweir 	void			SetModulWindow( ModulWindow* pWin )
179*cdf0e10cSrcweir 						{ pModulWindow = pWin; }
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 	void			ForceSyntaxTimeout();
182*cdf0e10cSrcweir 	sal_Bool			SetSourceInBasic( sal_Bool bQuiet = sal_True );
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir 	sal_Bool			CanModify() { return ImpCanModify(); }
185*cdf0e10cSrcweir };
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir class BreakPointWindow : public Window
189*cdf0e10cSrcweir {
190*cdf0e10cSrcweir private:
191*cdf0e10cSrcweir 	long			nCurYOffset;
192*cdf0e10cSrcweir 	sal_uInt16			nMarkerPos;
193*cdf0e10cSrcweir 	BreakPointList	aBreakPointList;
194*cdf0e10cSrcweir 	ModulWindow*	pModulWindow;
195*cdf0e10cSrcweir 	sal_Bool			bErrorMarker;
196*cdf0e10cSrcweir     bool m_bHighContrastMode;
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir     virtual void DataChanged(DataChangedEvent const & rDCEvt);
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir     void setBackgroundColor(Color aColor);
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir protected:
203*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& );
204*cdf0e10cSrcweir 	virtual void	Resize();
205*cdf0e10cSrcweir 	BreakPoint* 	FindBreakPoint( const Point& rMousePos );
206*cdf0e10cSrcweir 	void			ShowMarker( sal_Bool bShow );
207*cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
208*cdf0e10cSrcweir 	virtual void	Command( const CommandEvent& rCEvt );
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir 	sal_Bool			SyncYOffset();
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir public:
213*cdf0e10cSrcweir 					BreakPointWindow( Window* pParent );
214*cdf0e10cSrcweir 					~BreakPointWindow();
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir 	void			SetModulWindow( ModulWindow* pWin )
217*cdf0e10cSrcweir 						{ pModulWindow = pWin; }
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir 	void			SetMarkerPos( sal_uInt16 nLine, sal_Bool bErrorMarker = sal_False );
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir 	void			DoScroll( long nHorzScroll, long nVertScroll );
222*cdf0e10cSrcweir 	long&			GetCurYOffset() 		{ return nCurYOffset; }
223*cdf0e10cSrcweir 	BreakPointList&	GetBreakPoints()		{ return aBreakPointList; }
224*cdf0e10cSrcweir };
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir class WatchTreeListBox : public SvHeaderTabListBox
228*cdf0e10cSrcweir {
229*cdf0e10cSrcweir 	String aEditingRes;
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir protected:
232*cdf0e10cSrcweir 	virtual sal_Bool	EditingEntry( SvLBoxEntry* pEntry, Selection& rSel  );
233*cdf0e10cSrcweir 	virtual sal_Bool	EditedEntry( SvLBoxEntry* pEntry, const String& rNewText );
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir 	sal_Bool 			ImplBasicEntryEdited( SvLBoxEntry* pEntry, const String& rResult );
236*cdf0e10cSrcweir 	SbxBase*		ImplGetSBXForEntry( SvLBoxEntry* pEntry, bool& rbArrayElement );
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir //	virtual DragDropMode	NotifyBeginDrag( SvLBoxEntry* );
239*cdf0e10cSrcweir //	virtual sal_Bool	NotifyQueryDrop( SvLBoxEntry* );
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir //	virtual sal_Bool	NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
242*cdf0e10cSrcweir //						SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos );
243*cdf0e10cSrcweir //	virtual sal_Bool	NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
244*cdf0e10cSrcweir //						SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos );
245*cdf0e10cSrcweir //	sal_Bool			NotifyCopyingMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
246*cdf0e10cSrcweir //						SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos, sal_Bool bMove );
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir public:
249*cdf0e10cSrcweir 	WatchTreeListBox( Window* pParent, WinBits nWinBits );
250*cdf0e10cSrcweir 	~WatchTreeListBox();
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir 	void			RequestingChilds( SvLBoxEntry * pParent );
253*cdf0e10cSrcweir 	void			UpdateWatches( bool bBasicStopped = false );
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir 	using			SvTabListBox::SetTabs;
256*cdf0e10cSrcweir 	virtual void	SetTabs();
257*cdf0e10cSrcweir };
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir class WatchWindow : public BasicDockingWindow
262*cdf0e10cSrcweir {
263*cdf0e10cSrcweir private:
264*cdf0e10cSrcweir 	String				aWatchStr;
265*cdf0e10cSrcweir 	ExtendedEdit		aXEdit;
266*cdf0e10cSrcweir 	ImageButton 		aRemoveWatchButton;
267*cdf0e10cSrcweir 	WatchTreeListBox	aTreeListBox;
268*cdf0e10cSrcweir 	HeaderBar			aHeaderBar;
269*cdf0e10cSrcweir 
270*cdf0e10cSrcweir protected:
271*cdf0e10cSrcweir 	virtual void	Resize();
272*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRect );
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir 	DECL_LINK( ButtonHdl, ImageButton * );
275*cdf0e10cSrcweir 	DECL_LINK( TreeListHdl, SvTreeListBox * );
276*cdf0e10cSrcweir 	DECL_LINK( implEndDragHdl, HeaderBar * );
277*cdf0e10cSrcweir 	DECL_LINK( EditAccHdl, Accelerator * );
278*cdf0e10cSrcweir 
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir public:
281*cdf0e10cSrcweir 					WatchWindow( Window* pParent );
282*cdf0e10cSrcweir 					~WatchWindow();
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir 	void			AddWatch( const String& rVName );
285*cdf0e10cSrcweir 	sal_Bool			RemoveSelectedWatch();
286*cdf0e10cSrcweir 	void			UpdateWatches( bool bBasicStopped = false );
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir 	WatchTreeListBox&	GetWatchTreeListBox() { return aTreeListBox; }
289*cdf0e10cSrcweir };
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir class StackWindow : public BasicDockingWindow
293*cdf0e10cSrcweir {
294*cdf0e10cSrcweir private:
295*cdf0e10cSrcweir 	SvTreeListBox	aTreeListBox;
296*cdf0e10cSrcweir 	ImageButton 	aGotoCallButton;
297*cdf0e10cSrcweir 	String			aStackStr;
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir protected:
300*cdf0e10cSrcweir 	virtual void	Resize();
301*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRect );
302*cdf0e10cSrcweir 	DECL_LINK( ButtonHdl, ImageButton * );
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir public:
305*cdf0e10cSrcweir 					StackWindow( Window* pParent );
306*cdf0e10cSrcweir 					~StackWindow();
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir 	void			UpdateCalls();
309*cdf0e10cSrcweir };
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir class ComplexEditorWindow : public Window
313*cdf0e10cSrcweir {
314*cdf0e10cSrcweir private:
315*cdf0e10cSrcweir 	BreakPointWindow	aBrkWindow;
316*cdf0e10cSrcweir 	EditorWindow		aEdtWindow;
317*cdf0e10cSrcweir 	ScrollBar			aEWVScrollBar;
318*cdf0e10cSrcweir 
319*cdf0e10cSrcweir     virtual void DataChanged(DataChangedEvent const & rDCEvt);
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir protected:
322*cdf0e10cSrcweir 	virtual void		Resize();
323*cdf0e10cSrcweir 	DECL_LINK( ScrollHdl, ScrollBar * );
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir public:
326*cdf0e10cSrcweir 						ComplexEditorWindow( ModulWindow* pParent );
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir 	BreakPointWindow&	GetBrkWindow() 		{ return aBrkWindow; }
329*cdf0e10cSrcweir 	EditorWindow&		GetEdtWindow() 		{ return aEdtWindow; }
330*cdf0e10cSrcweir 	ScrollBar&			GetEWVScrollBar() 	{ return aEWVScrollBar; }
331*cdf0e10cSrcweir };
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir #define SYNTAX_COLOR_MAX	5
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir class ModulWindow: public IDEBaseWindow
337*cdf0e10cSrcweir {
338*cdf0e10cSrcweir 	friend class BasicIDEShell;
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir private:
341*cdf0e10cSrcweir     StarBASICRef        xBasic;
342*cdf0e10cSrcweir 	short				nValid;
343*cdf0e10cSrcweir 	ComplexEditorWindow aXEditorWindow;
344*cdf0e10cSrcweir 	BasicStatus 		aStatus;
345*cdf0e10cSrcweir 	SbModuleRef 		xModule;
346*cdf0e10cSrcweir 	ModulWindowLayout*	pLayout;
347*cdf0e10cSrcweir 	String				aCurPath;
348*cdf0e10cSrcweir     ::rtl::OUString		m_aModule;
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir 	DECL_LINK( BasicErrorHdl, StarBASIC * );
351*cdf0e10cSrcweir 	long				BasicBreakHdl( StarBASIC* pBasic );
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir 	void				CheckCompileBasic();
354*cdf0e10cSrcweir 	sal_Bool				BasicExecute();
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir 	void				GoOnTop();
357*cdf0e10cSrcweir 	void				AssertValidEditEngine();
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir     sal_Int32           FormatAndPrint( Printer* pPrinter, sal_Int32 nPage = -1 );
360*cdf0e10cSrcweir 	SbModuleRef 		XModule();
361*cdf0e10cSrcweir protected:
362*cdf0e10cSrcweir 	virtual void	Resize();
363*cdf0e10cSrcweir 	virtual void	GetFocus();
364*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& );
365*cdf0e10cSrcweir 	virtual void	Deactivating();
366*cdf0e10cSrcweir 	virtual void	DoInit();
367*cdf0e10cSrcweir 	virtual void	DoScroll( ScrollBar* pCurScrollBar );
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir public:
370*cdf0e10cSrcweir 					TYPEINFO();
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir                     ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, String aLibName,
373*cdf0e10cSrcweir                         String aName, ::rtl::OUString& aModule );
374*cdf0e10cSrcweir 
375*cdf0e10cSrcweir 					~ModulWindow();
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir 	virtual void	ExecuteCommand( SfxRequest& rReq );
378*cdf0e10cSrcweir 	virtual void	GetState( SfxItemSet& );
379*cdf0e10cSrcweir 	virtual void	StoreData();
380*cdf0e10cSrcweir 	virtual void	UpdateData();
381*cdf0e10cSrcweir 	virtual sal_Bool 	CanClose();
382*cdf0e10cSrcweir 	// virtual void	PrintData( Printer* pPrinter );
383*cdf0e10cSrcweir     // return number of pages to be printed
384*cdf0e10cSrcweir     virtual sal_Int32 countPages( Printer* pPrinter );
385*cdf0e10cSrcweir     // print page
386*cdf0e10cSrcweir     virtual void printPage( sal_Int32 nPage, Printer* pPrinter );
387*cdf0e10cSrcweir 	virtual String	GetTitle();
388*cdf0e10cSrcweir     virtual BasicEntryDescriptor CreateEntryDescriptor();
389*cdf0e10cSrcweir 	virtual sal_Bool	AllowUndo();
390*cdf0e10cSrcweir 	virtual void	SetReadOnly( sal_Bool bReadOnly );
391*cdf0e10cSrcweir     virtual sal_Bool    IsReadOnly();
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir     StarBASIC*      GetBasic() { XModule(); return xBasic; }
394*cdf0e10cSrcweir 
395*cdf0e10cSrcweir 	SbModule*		GetSbModule() { return xModule; }
396*cdf0e10cSrcweir     void			SetSbModule( SbModule* pModule ) { xModule = pModule; }
397*cdf0e10cSrcweir 	String			GetSbModuleName();
398*cdf0e10cSrcweir 
399*cdf0e10cSrcweir 	sal_Bool			CompileBasic();
400*cdf0e10cSrcweir 	sal_Bool			BasicRun();
401*cdf0e10cSrcweir 	sal_Bool			BasicStepOver();
402*cdf0e10cSrcweir 	sal_Bool			BasicStepInto();
403*cdf0e10cSrcweir 	sal_Bool			BasicStepOut();
404*cdf0e10cSrcweir 	void			BasicStop();
405*cdf0e10cSrcweir 	sal_Bool			BasicToggleBreakPoint();
406*cdf0e10cSrcweir 	void			BasicToggleBreakPointEnabled();
407*cdf0e10cSrcweir 	void			ManageBreakPoints();
408*cdf0e10cSrcweir 	void			UpdateBreakPoint( const BreakPoint& rBrk );
409*cdf0e10cSrcweir 	void			BasicAddWatch();
410*cdf0e10cSrcweir 	void			BasicRemoveWatch();
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir 	sal_Bool			LoadBasic();
413*cdf0e10cSrcweir 	sal_Bool			SaveBasicSource();
414*cdf0e10cSrcweir 	sal_Bool			ImportDialog();
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir 	void			EditMacro( const String& rMacroName );
417*cdf0e10cSrcweir 
418*cdf0e10cSrcweir //	void			InsertFromObjectCatalog( ObjectCatalog* pObjDlg );
419*cdf0e10cSrcweir 
420*cdf0e10cSrcweir 	sal_Bool			ToggleBreakPoint( sal_uLong nLine );
421*cdf0e10cSrcweir 
422*cdf0e10cSrcweir 	BasicStatus&	GetBasicStatus() { return aStatus; }
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir 	virtual sal_Bool	IsModified();
425*cdf0e10cSrcweir     virtual sal_Bool    IsPasteAllowed();
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir 	void			FrameWindowMoved();
428*cdf0e10cSrcweir 	void			ShowCursor( sal_Bool bOn );
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir 	virtual sal_uInt16	GetSearchOptions();
431*cdf0e10cSrcweir 	sal_uInt16			StartSearchAndReplace( const SvxSearchItem& rSearchItem, sal_Bool bFromStart = sal_False );
432*cdf0e10cSrcweir 
433*cdf0e10cSrcweir 	virtual Window* GetLayoutWindow();
434*cdf0e10cSrcweir 
435*cdf0e10cSrcweir 	EditorWindow&		GetEditorWindow() 		{ return aXEditorWindow.GetEdtWindow(); }
436*cdf0e10cSrcweir 	BreakPointWindow&	GetBreakPointWindow() 	{ return aXEditorWindow.GetBrkWindow(); }
437*cdf0e10cSrcweir 	ScrollBar&			GetEditVScrollBar() 	{ return aXEditorWindow.GetEWVScrollBar(); }
438*cdf0e10cSrcweir 	ExtTextEngine*		GetEditEngine() 		{ return GetEditorWindow().GetEditEngine(); }
439*cdf0e10cSrcweir 	ExtTextView*		GetEditView() 			{ return GetEditorWindow().GetEditView(); }
440*cdf0e10cSrcweir 	BreakPointList& 	GetBreakPoints()		{ return GetBreakPointWindow().GetBreakPoints(); }
441*cdf0e10cSrcweir 	ModulWindowLayout*	GetLayout() const 		{ return pLayout; }
442*cdf0e10cSrcweir 
443*cdf0e10cSrcweir 	virtual void		BasicStarted();
444*cdf0e10cSrcweir 	virtual void		BasicStopped();
445*cdf0e10cSrcweir 
446*cdf0e10cSrcweir     virtual ::svl::IUndoManager*
447*cdf0e10cSrcweir                         GetUndoManager();
448*cdf0e10cSrcweir 
449*cdf0e10cSrcweir     const ::rtl::OUString&	GetModule() const { return m_aModule; }
450*cdf0e10cSrcweir     void					SetModule( const ::rtl::OUString& aModule ) { m_aModule = aModule; }
451*cdf0e10cSrcweir };
452*cdf0e10cSrcweir 
453*cdf0e10cSrcweir class ModulWindowLayout: public Window, public utl::ConfigurationListener
454*cdf0e10cSrcweir {
455*cdf0e10cSrcweir private:
456*cdf0e10cSrcweir 
457*cdf0e10cSrcweir 	Splitter		aVSplitter;
458*cdf0e10cSrcweir 	Splitter		aHSplitter;
459*cdf0e10cSrcweir 
460*cdf0e10cSrcweir 	WatchWindow 	aWatchWindow;
461*cdf0e10cSrcweir 	StackWindow 	aStackWindow;
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir 	sal_Bool			bVSplitted;
464*cdf0e10cSrcweir 	sal_Bool			bHSplitted;
465*cdf0e10cSrcweir 
466*cdf0e10cSrcweir     ModulWindow * m_pModulWindow;
467*cdf0e10cSrcweir 
468*cdf0e10cSrcweir     Color m_aSyntaxColors[TT_KEYWORDS + 1];
469*cdf0e10cSrcweir     svtools::ColorConfig m_aColorConfig;
470*cdf0e10cSrcweir 
471*cdf0e10cSrcweir     ImageList m_aImagesNormal;
472*cdf0e10cSrcweir     ImageList m_aImagesHighContrast;
473*cdf0e10cSrcweir 
474*cdf0e10cSrcweir     virtual void DataChanged(DataChangedEvent const & rDCEvt);
475*cdf0e10cSrcweir 
476*cdf0e10cSrcweir     virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir     void updateSyntaxHighlighting();
479*cdf0e10cSrcweir 
480*cdf0e10cSrcweir     DECL_LINK( SplitHdl, Splitter * );
481*cdf0e10cSrcweir 
482*cdf0e10cSrcweir     void            ArrangeWindows();
483*cdf0e10cSrcweir 
484*cdf0e10cSrcweir protected:
485*cdf0e10cSrcweir 	virtual void	Resize();
486*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRect );
487*cdf0e10cSrcweir 
488*cdf0e10cSrcweir public:
489*cdf0e10cSrcweir 					ModulWindowLayout( Window* pParent );
490*cdf0e10cSrcweir 					~ModulWindowLayout();
491*cdf0e10cSrcweir 
492*cdf0e10cSrcweir 	void			DockaWindow( DockingWindow* pDockingWin );
493*cdf0e10cSrcweir 	sal_Bool			IsToBeDocked( DockingWindow* pDockingWin, const Point& rPos, Rectangle& rRect );
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir 	void			SetModulWindow( ModulWindow* pModWin );
496*cdf0e10cSrcweir 	ModulWindow*	GetModulWindow() const { return m_pModulWindow; }
497*cdf0e10cSrcweir 
498*cdf0e10cSrcweir 	WatchWindow& 	GetWatchWindow()	{ return aWatchWindow; }
499*cdf0e10cSrcweir 	StackWindow& 	GetStackWindow()	{ return aStackWindow; }
500*cdf0e10cSrcweir 
501*cdf0e10cSrcweir     Image getImage(sal_uInt16 nId, bool bHighContrastMode) const;
502*cdf0e10cSrcweir 
503*cdf0e10cSrcweir     inline Color const & getSyntaxColor(TokenTypes eType) const
504*cdf0e10cSrcweir     { return m_aSyntaxColors[eType]; }
505*cdf0e10cSrcweir };
506*cdf0e10cSrcweir 
507*cdf0e10cSrcweir #endif	// _BASIDE2_HXX
508