1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: textedit.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
38 class BreakpointWindow
;
40 #include <vcl/timer.hxx>
41 #include <tools/table.hxx>
42 #include <tools/debug.hxx>
43 #include <svtools/lstner.hxx>
44 #include <svtools/svmedit.hxx>
46 #include "dataedit.hxx"
48 //#include <xtextedt.hxx>
50 class TextEditImp
: public Window
, public SfxListener
55 void DoSyntaxHighlight( ULONG nPara
);
62 Timer aSyntaxIdleTimer
;
63 Timer aImplSyntaxIdleTimer
;
64 DECL_LINK( SyntaxTimerHdl
, Timer
* );
65 Table aSyntaxLineTable
;
67 void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
69 void ImpDoHighlight( const String
& rSource
, ULONG nLineOff
);
71 BOOL bDoSyntaxHighlight
;
75 SbxBase
* GetSbxAtMousePos( String
&aWord
);
76 virtual void MouseMove( const MouseEvent
& rMEvt
);
77 DECL_LINK( HideVarContents
, void* );
78 DECL_LINK( ShowVarContents
, void* );
89 TextEditImp( AppEdit
*pParent
, const WinBits
& aBits
);
92 TextEngine
*pTextEngine
;
95 void SetFont( const Font
& rNewFont
);
97 void SetModifyHdl( Link l
){ ModifyHdl
= l
; }
99 void KeyInput( const KeyEvent
& rKeyEvent
);
100 void Paint( const Rectangle
& rRect
);
101 void MouseButtonUp( const MouseEvent
& rMouseEvent
);
102 void MouseButtonDown( const MouseEvent
& rMouseEvent
);
103 // void MouseMove( const MouseEvent& rMouseEvent );
104 void Command( const CommandEvent
& rCEvt
);
105 //BOOL Drop( const DropEvent& rEvt );
106 //BOOL QueryDrop( DropEvent& rEvt );
110 void DoDelayedSyntaxHighlight( xub_StrLen nPara
);
111 void InvalidateSyntaxHighlight();
112 void SyntaxHighlight( BOOL bNew
);
113 void BuildKontextMenu( PopupMenu
*&pMenu
);
119 class TextEdit
: public DataEdit
{
121 BreakpointWindow
*pBreakpointWindow
;
126 TextEdit( AppEdit
*, const WinBits
& );
128 void Highlight( ULONG nLine
, xub_StrLen nCol1
, xub_StrLen nCol2
);
129 TextEditImp
& GetTextEditImp() { return aEdit
; }
131 void SetBreakpointWindow( BreakpointWindow
*pBPWindow
){ pBreakpointWindow
= pBPWindow
; }
132 BreakpointWindow
*GetBreakpointWindow(){ return pBreakpointWindow
; }
134 DATA_FUNC_DEF( aEdit
, TextEditImp
)
136 virtual void BuildKontextMenu( PopupMenu
*&pMenu
);
138 void SaveAsUTF8( BOOL bUTF8
) { bSaveAsUTF8
= bUTF8
; }