summaryrefslogtreecommitdiffstats
path: root/doc/html/tqtextedit-h.html
blob: 83ee2a0a31389cbd00231e96fe85e1f978e61355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/tqtextedit.h:1 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>tqtextedit.h Include File</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>tqtextedit.h</h1>

<p>This is the verbatim text of the tqtextedit.h include file. It is provided only for illustration; the copyright remains with Trolltech.
<hr>
<pre>
/****************************************************************************
** $Id: qt/tqtextedit.h   3.3.8   edited Jan 11 14:39 $
**
** Definition of the TQTextEdit class
**
** Created : 990101
**
** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
**
** This file is part of the widgets module of the TQt GUI Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Alternatively you may (at your option) use any
** later version of the GNU General Public License if such license has
** been publicly approved by Trolltech ASA (or its successors, if any)
** and the KDE Free TQt Foundation.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/.
** If you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at [email protected].
**
** This file may be used under the terms of the Q Public License as
** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
** included in the packaging of this file.  Licensees holding valid TQt
** Commercial licenses may use this file in accordance with the TQt
** Commercial License Agreement provided with the Software.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
** herein.
**
**********************************************************************/

#ifndef TQTEXTEDIT_H
#define TQTEXTEDIT_H

#ifndef QT_H
#include "tqscrollview.h"
#include "tqstylesheet.h"
#include "tqptrvector.h"
#include "tqvaluelist.h"
#include "tqptrlist.h"
#endif // QT_H

#ifndef TQT_NO_TEXTEDIT
// uncomment below to enable optimization mode - also uncomment the
// optimDoAutoScroll() private slot since moc ignores #ifdefs..
#define QT_TEXTEDIT_OPTIMIZATION

class TQPainter;
class TQTextDocument;
class TQTextCursor;
class TQKeyEvent;
class TQResizeEvent;
class TQMouseEvent;
class TQTimer;
class TQTextString;
class TQTextCommand;
class TQTextParagraph;
class TQTextFormat;
class TQFont;
class TQColor;
class TQTextEdit;
class TQTextBrowser;
class TQTextString;
struct TQUndoRedoInfoPrivate;
class TQPopupMenu;
class TQTextEditPrivate;
class TQSyntaxHighlighter;

#ifdef QT_TEXTEDIT_OPTIMIZATION
class TQTextEditOptimPrivate
{
public:
    // Note: no left-tag has any value for leftTag or parent, and
    // no right-tag has any formatting flags set.
    enum TagType { Color = 0, Format = 1 };
    struct Tag {
	TagType type:2;
	bool bold:1;
	bool italic:1;
	bool underline:1;
	int line;
	int index;
	Tag * leftTag; // ptr to left-tag in a left-right tag pair
	Tag * parent;  // ptr to parent left-tag in a nested tag
	Tag * prev;
	Tag * next;
	TQString tag;
    };
    TQTextEditOptimPrivate()
    {
	len = numLines = maxLineWidth = 0;
	selStart.line = selStart.index = -1;
	selEnd.line = selEnd.index = -1;
	search.line = search.index = 0;
	tags = lastTag = 0;
    }
    void clearTags()
    {
	Tag * itr = tags;
	while ( tags ) {
	    itr  = tags;
	    tags = tags-&gt;next;
	    delete itr;
	}
	tags = lastTag = 0;
	tagIndex.clear();
    }
    ~TQTextEditOptimPrivate()
    {
	clearTags();
    }
    int len;
    int numLines;
    int maxLineWidth;
    struct Selection {
	int line;
	int index;
    };
    Selection selStart, selEnd, search;
    Tag * tags, * lastTag;
    TQMap&lt;int, TQString&gt; lines;
    TQMap&lt;int, Tag *&gt; tagIndex;
};
#endif

class TQ_EXPORT TQTextEdit : public TQScrollView
{
    friend class TQTextBrowser;
    friend class TQSyntaxHighlighter;

    TQ_OBJECT
    TQ_ENUMS( WordWrap WrapPolicy )
    TQ_SETS( AutoFormatting )
    TQ_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat )
    TQ_PROPERTY( TQString text READ text WRITE setText )
    TQ_PROPERTY( TQBrush paper READ paper WRITE setPaper )
    TQ_PROPERTY( bool linkUnderline READ linkUnderline WRITE setLinkUnderline )
    TQ_PROPERTY( TQString documentTitle READ documentTitle )
    TQ_PROPERTY( int length READ length )
    TQ_PROPERTY( WordWrap wordWrap READ wordWrap WRITE setWordWrap )
    TQ_PROPERTY( int wrapColumnOrWidth READ wrapColumnOrWidth WRITE setWrapColumnOrWidth )
    TQ_PROPERTY( WrapPolicy wrapPolicy READ wrapPolicy WRITE setWrapPolicy )
    TQ_PROPERTY( bool hasSelectedText READ hasSelectedText )
    TQ_PROPERTY( TQString selectedText READ selectedText )
    TQ_PROPERTY( int undoDepth READ undoDepth WRITE setUndoDepth )
    TQ_PROPERTY( bool overwriteMode READ isOverwriteMode WRITE setOverwriteMode )
    TQ_PROPERTY( bool modified READ isModified WRITE setModified DESIGNABLE false )
    TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
    TQ_PROPERTY( bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled )
    TQ_PROPERTY( int tabStopWidth READ tabStopWidth WRITE setTabStopWidth )
    TQ_PROPERTY( bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus )
    TQ_PROPERTY( AutoFormatting autoFormatting READ autoFormatting WRITE setAutoFormatting )

public:
    enum WordWrap {
	NoWrap,
	WidgetWidth,
	FixedPixelWidth,
	FixedColumnWidth
    };

    enum WrapPolicy {
	AtWordBoundary,
	AtWhiteSpace = AtWordBoundary, // AtWhiteSpace is deprecated
	Anywhere,
	AtWordOrDocumentBoundary
    };

    enum AutoFormatting {
	AutoNone = 0,
	AutoBulletList = 0x00000001,
	AutoAll = 0xffffffff
    };

    enum KeyboardAction {
	ActionBackspace,
	ActionDelete,
	ActionReturn,
	ActionKill,
	ActionWordBackspace,
	ActionWordDelete
    };

    enum CursorAction {
	MoveBackward,
	MoveForward,
	MoveWordBackward,
	MoveWordForward,
	MoveUp,
	MoveDown,
	MoveLineStart,
	MoveLineEnd,
	MoveHome,
	MoveEnd,
	MovePgUp,
	MovePgDown
    };

    enum VerticalAlignment {
	AlignNormal,
	AlignSuperScript,
	AlignSubScript
    };

    enum TextInsertionFlags {
	RedoIndentation = 0x0001,
	CheckNewLines = 0x0002,
	RemoveSelected = 0x0004
    };

    TQTextEdit( const TQString&amp; text, const TQString&amp; context = TQString::null,
	       TQWidget* parent=0, const char* name=0);
    TQTextEdit( TQWidget* parent=0, const char* name=0 );
    virtual ~TQTextEdit();
    void setPalette( const TQPalette &amp; );

    TQString text() const;
    TQString text( int para ) const;
    TextFormat textFormat() const;
    TQString context() const;
    TQString documentTitle() const;

    void getSelection( int *paraFrom, int *indexFrom,
		    int *paraTo, int *indexTo, int selNum = 0 ) const;
    virtual bool find( const TQString &amp;expr, bool cs, bool wo, bool forward = TRUE,
		       int *para = 0, int *index = 0 );

    int paragraphs() const;
    int lines() const;
    int linesOfParagraph( int para ) const;
    int lineOfChar( int para, int chr );
    int length() const;
    TQRect paragraphRect( int para ) const;
    int paragraphAt( const TQPoint &amp;pos ) const;
    int charAt( const TQPoint &amp;pos, int *para ) const;
    int paragraphLength( int para ) const;

    TQStyleSheet* styleSheet() const;
#ifndef TQT_NO_MIME
    TQMimeSourceFactory* mimeSourceFactory() const;
#endif
    TQBrush paper() const;
    bool linkUnderline() const;

    int heightForWidth( int w ) const;

    bool hasSelectedText() const;
    TQString selectedText() const;
    bool isUndoAvailable() const;
    bool isRedoAvailable() const;

    WordWrap wordWrap() const;
    int wrapColumnOrWidth() const;
    WrapPolicy wrapPolicy() const;

    int tabStopWidth() const;

    TQString anchorAt( const TQPoint&amp; pos );
    TQString anchorAt( const TQPoint&amp; pos, AnchorAttribute a );

    TQSize sizeHint() const;

    bool isReadOnly() const { return readonly; }

    void getCursorPosition( int *parag, int *index ) const;

    bool isModified() const;
    bool italic() const;
    bool bold() const;
    bool underline() const;
    TQString family() const;
    int pointSize() const;
    TQColor color() const;
    TQFont font() const;
    TQFont currentFont() const;
    int alignment() const;
    int undoDepth() const;

    // do not use, will go away
    virtual bool getFormat( int para, int index, TQFont *font, TQColor *color, VerticalAlignment *verticalAlignment );
    // do not use, will go away
    virtual bool getParagraphFormat( int para, TQFont *font, TQColor *color,
				     VerticalAlignment *verticalAlignment, int *alignment,
				     TQStyleSheetItem::DisplayMode *displayMode,
				     TQStyleSheetItem::ListStyle *listStyle,
				     int *listDepth );


    bool isOverwriteMode() const { return overWrite; }
    TQColor paragraphBackgroundColor( int para ) const;

    bool isUndoRedoEnabled() const;
    bool eventFilter( TQObject *o, TQEvent *e );
    bool tabChangesFocus() const;

    void setAutoFormatting( uint features );
    uint autoFormatting() const;
    TQSyntaxHighlighter *syntaxHighlighter() const;

public slots:
    void setEnabled( bool );
#ifndef TQT_NO_MIME
    virtual void setMimeSourceFactory( TQMimeSourceFactory* factory );
#endif
    virtual void setStyleSheet( TQStyleSheet* styleSheet );
    virtual void scrollToAnchor( const TQString&amp; name );
    virtual void setPaper( const TQBrush&amp; pap );
    virtual void setLinkUnderline( bool );

    virtual void setWordWrap( WordWrap mode );
    virtual void setWrapColumnOrWidth( int );
    virtual void setWrapPolicy( WrapPolicy policy );

    virtual void copy();
    virtual void append( const TQString&amp; text );

    void setText( const TQString &amp;txt ) { setText( txt, TQString::null ); }
    virtual void setText( const TQString &amp;txt, const TQString &amp;context );
    virtual void setTextFormat( TextFormat f );

    virtual void selectAll( bool select = TRUE );
    virtual void setTabStopWidth( int ts );
    virtual void zoomIn( int range );
    virtual void zoomIn() { zoomIn( 1 ); }
    virtual void zoomOut( int range );
    virtual void zoomOut() { zoomOut( 1 ); }
    virtual void zoomTo( int size );

    virtual void sync();
    virtual void setReadOnly( bool b );

    virtual void undo();
    virtual void redo();
    virtual void cut();
    virtual void paste();
#ifndef TQT_NO_CLIPBOARD
    virtual void pasteSubType( const TQCString &amp;subtype );
#endif
    virtual void clear();
    virtual void del();
    virtual void indent();
    virtual void setItalic( bool b );
    virtual void setBold( bool b );
    virtual void setUnderline( bool b );
    virtual void setFamily( const TQString &amp;f );
    virtual void setPointSize( int s );
    virtual void setColor( const TQColor &amp;c );
    virtual void setFont( const TQFont &amp;f );
    virtual void setVerticalAlignment( VerticalAlignment a );
    virtual void setAlignment( int a );

    // do not use, will go away
    virtual void setParagType( TQStyleSheetItem::DisplayMode dm, TQStyleSheetItem::ListStyle listStyle );

    virtual void setCursorPosition( int parag, int index );
    virtual void setSelection( int parag_from, int index_from, int parag_to, int index_to, int selNum = 0 );
    virtual void setSelectionAttributes( int selNum, const TQColor &amp;back, bool invertText );
    virtual void setModified( bool m );
    virtual void resetFormat();
    virtual void setUndoDepth( int d );
    virtual void setFormat( TQTextFormat *f, int flags );
    virtual void ensureCursorVisible();
    virtual void placeCursor( const TQPoint &amp;pos, TQTextCursor *c = 0 );
    virtual void moveCursor( CursorAction action, bool select );
    virtual void doKeyboardAction( KeyboardAction action );
    virtual void removeSelectedText( int selNum = 0 );
    virtual void removeSelection( int selNum = 0 );
    virtual void setCurrentFont( const TQFont &amp;f );
    virtual void setOverwriteMode( bool b ) { overWrite = b; }

    virtual void scrollToBottom();

    void insert( const TQString &amp;text, uint insertionFlags = CheckNewLines | RemoveSelected ); // ## virtual in 4.0

    // obsolete
    virtual void insert( const TQString &amp;text, bool, bool = TRUE, bool = TRUE );

    virtual void insertAt( const TQString &amp;text, int para, int index );
    virtual void removeParagraph( int para );
    virtual void insertParagraph( const TQString &amp;text, int para );

    virtual void setParagraphBackgroundColor( int para, const TQColor &amp;bg );
    virtual void clearParagraphBackground( int para );

    virtual void setUndoRedoEnabled( bool b );
    void setTabChangesFocus( bool b ); // ### make virtual in 4.0

#ifdef QT_TEXTEDIT_OPTIMIZATION
    void polish();
    void setMaxLogLines( int numLines );
    int maxLogLines();
#endif

signals:
    void textChanged();
    void selectionChanged();
    void copyAvailable( bool );
    void undoAvailable( bool yes );
    void redoAvailable( bool yes );
    void currentFontChanged( const TQFont &amp;f );
    void currentColorChanged( const TQColor &amp;c );
    void currentAlignmentChanged( int a );
    void currentVerticalAlignmentChanged( VerticalAlignment a );
    void cursorPositionChanged( TQTextCursor *c );
    void cursorPositionChanged( int para, int pos );
    void returnPressed();
    void modificationChanged( bool m );
    void clicked( int parag, int index );
    void doubleClicked( int parag, int index );

protected:
    void repaintChanged();
    void updateStyles();
    void drawContents( TQPainter *p, int cx, int cy, int cw, int ch );
    bool event( TQEvent *e );
    void keyPressEvent( TQKeyEvent *e );
    void resizeEvent( TQResizeEvent *e );
    void viewportResizeEvent( TQResizeEvent* );
    void contentsMousePressEvent( TQMouseEvent *e );
    void contentsMouseMoveEvent( TQMouseEvent *e );
    void contentsMouseReleaseEvent( TQMouseEvent *e );
    void contentsMouseDoubleClickEvent( TQMouseEvent *e );
#ifndef TQT_NO_WHEELEVENT
    void contentsWheelEvent( TQWheelEvent *e );
#endif
    void imStartEvent( TQIMEvent * );
    void imComposeEvent( TQIMEvent * );
    void imEndEvent( TQIMEvent * );
#ifndef TQT_NO_DRAGANDDROP
    void contentsDragEnterEvent( TQDragEnterEvent *e );
    void contentsDragMoveEvent( TQDragMoveEvent *e );
    void contentsDragLeaveEvent( TQDragLeaveEvent *e );
    void contentsDropEvent( TQDropEvent *e );
#endif
    void contentsContextMenuEvent( TQContextMenuEvent *e );
    bool focusNextPrevChild( bool next );
    TQTextDocument *document() const;
    TQTextCursor *textCursor() const;
    void setDocument( TQTextDocument *doc );
    virtual TQPopupMenu *createPopupMenu( const TQPoint&amp; pos );
    virtual TQPopupMenu *createPopupMenu();
    void drawCursor( bool visible );

    void windowActivationChange( bool );

protected slots:
    virtual void doChangeInterval();
    void sliderReleased(); // ### make virtual in 4.0

private slots:
    void formatMore();
    void doResize();
    void autoScrollTimerDone();
    void blinkCursor();
    void setModified();
    void startDrag();
    void documentWidthChanged( int w );
    void clipboardChanged();

private:
    struct TQ_EXPORT UndoRedoInfo {
	enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Style, IME };

	UndoRedoInfo( TQTextDocument *dc );
	~UndoRedoInfo();
	void clear();
	bool valid() const;

	TQUndoRedoInfoPrivate *d;
	int id;
	int index;
	int eid;
	int eindex;
	TQTextFormat *format;
	int flags;
	Type type;
	TQTextDocument *doc;
	TQByteArray styleInformation;
    };

private:
    void updateCursor( const TQPoint &amp; pos );
    void handleMouseMove( const TQPoint&amp; pos );
    void drawContents( TQPainter * );
    virtual bool linksEnabled() const { return FALSE; }
    void init();
    void checkUndoRedoInfo( UndoRedoInfo::Type t );
    void updateCurrentFormat();
    bool handleReadOnlyKeyEvent( TQKeyEvent *e );
    void makeParagVisible( TQTextParagraph *p );
    void normalCopy();
    void copyToClipboard();
#ifndef TQT_NO_MIME
    TQCString pickSpecial(TQMimeSource* ms, bool always_ask, const TQPoint&amp;);
    TQTextDrag *dragObject( TQWidget *parent = 0 ) const;
#endif
#ifndef TQT_NO_MIMECLIPBOARD
    void pasteSpecial(const TQPoint&amp;);
#endif
    void setFontInternal( const TQFont &amp;f );

    virtual void emitHighlighted( const TQString &amp; ) {}
    virtual void emitLinkClicked( const TQString &amp; ) {}

    void readFormats( TQTextCursor &amp;c1, TQTextCursor &amp;c2, TQTextString &amp;text, bool fillStyles = FALSE );
    void clearUndoRedo();
    void paintDocument( bool drawAll, TQPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1 );
    void moveCursor( CursorAction action );
    void ensureFormatted( TQTextParagraph *p );
    void placeCursor( const TQPoint &amp;pos, TQTextCursor *c, bool link );
    void updateMicroFocusHint();

#ifdef QT_TEXTEDIT_OPTIMIZATION
    bool checkOptimMode();
    TQString optimText() const;
    void optimSetText( const TQString &amp;str );
    void optimAppend( const TQString &amp;str );
    void optimInsert( const TQString &amp;str, int line, int index );
    void optimDrawContents( TQPainter * p, int cx, int cy, int cw, int ch );
    void optimMousePressEvent( TQMouseEvent * e );
    void optimMouseReleaseEvent( TQMouseEvent * e );
    void optimMouseMoveEvent( TQMouseEvent * e );
    int  optimCharIndex( const TQString &amp;str, int mx ) const;
    void optimSelectAll();
    void optimRemoveSelection();
    void optimSetSelection( int startLine, int startIdx, int endLine,
			    int endIdx );
    bool optimHasSelection() const;
    TQString optimSelectedText() const;
    bool optimFind( const TQString &amp; str, bool, bool, bool, int *, int * );
    void optimParseTags( TQString * str, int lineNo = -1, int indexOffset = 0 );
    TQTextEditOptimPrivate::Tag * optimPreviousLeftTag( int line );
    void optimSetTextFormat( TQTextDocument *, TQTextCursor *, TQTextFormat * f,
			     int, int, TQTextEditOptimPrivate::Tag * t );
    TQTextEditOptimPrivate::Tag * optimAppendTag( int index, const TQString &amp; tag );
    TQTextEditOptimPrivate::Tag * optimInsertTag( int line, int index, const TQString &amp; tag );
    void optimCheckLimit( const TQString&amp; str );
    bool optimHasBoldMetrics( int line );

private slots:
    void optimDoAutoScroll();
#endif // QT_TEXTEDIT_OPTIMIZATION

private:
#ifndef TQT_NO_CLIPBOARD
    void pasteSubType( const TQCString &amp;subtype, TQMimeSource *m );
#endif

private:
    TQTextDocument *doc;
    TQTextCursor *cursor;
    TQTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer;
    TQTextParagraph *lastFormatted;
    int interval;
    UndoRedoInfo undoRedoInfo;
    TQTextFormat *currentFormat;
    int currentAlignment;
    TQPoint oldMousePos, mousePos;
    TQPoint dragStartPos;
    TQString onLink;
    WordWrap wrapMode;
    WrapPolicy wPolicy;
    int wrapWidth;
    TQString pressedLink;
    TQTextEditPrivate *d;
    bool inDoubleClick : 1;
    bool mousePressed : 1;
    bool cursorVisible : 1;
    bool blinkCursorVisible : 1;
    bool readOnly : 1;
    bool modified : 1;
    bool mightStartDrag : 1;
    bool inDnD : 1;
    bool readonly : 1;
    bool undoEnabled : 1;
    bool overWrite : 1;

private:	// Disabled copy constructor and operator=
#if defined(TQ_DISABLE_COPY)
    TQTextEdit( const TQTextEdit &amp; );
    TQTextEdit &amp;operator=( const TQTextEdit &amp; );
#endif
};

inline TQTextDocument *TQTextEdit::document() const
{
    return doc;
}

inline TQTextCursor *TQTextEdit::textCursor() const
{
    return cursor;
}

inline void TQTextEdit::setCurrentFont( const TQFont &amp;f )
{
    TQTextEdit::setFontInternal( f );
}

#endif //TQT_NO_TEXTEDIT
#endif //TQTEXTVIEW_H
</pre>
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>