Qt 4.8
qtextedit_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QTEXTEDIT_P_H
43 #define QTEXTEDIT_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "private/qabstractscrollarea_p.h"
57 #include "QtGui/qtextdocumentfragment.h"
58 #include "QtGui/qscrollbar.h"
59 #include "QtGui/qtextcursor.h"
60 #include "QtGui/qtextformat.h"
61 #include "QtGui/qmenu.h"
62 #include "QtGui/qabstracttextdocumentlayout.h"
63 #include "QtCore/qbasictimer.h"
64 #include "QtCore/qurl.h"
65 #include "private/qtextcontrol_p.h"
66 #include "qtextedit.h"
67 
69 
70 #ifndef QT_NO_TEXTEDIT
71 
72 class QMimeData;
74 {
76 public:
78 
79  void init(const QString &html = QString());
80  void paint(QPainter *p, QPaintEvent *e);
81  void _q_repaintContents(const QRectF &contentsRect);
82 
83  inline QPoint mapToContents(const QPoint &point) const
84  { return QPoint(point.x() + horizontalOffset(), point.y() + verticalOffset()); }
85 
86  void _q_adjustScrollbars();
87  void _q_ensureVisible(const QRectF &rect);
88  void relayoutDocument();
89 
90  void createAutoBulletList();
92 
93  inline int horizontalOffset() const
94  { return q_func()->isRightToLeft() ? (hbar->maximum() - hbar->value()) : hbar->value(); }
95  inline int verticalOffset() const
96  { return vbar->value(); }
97 
98  inline void sendControlEvent(QEvent *e)
100 
102 
104 
105  // re-implemented by QTextBrowser, called by QTextDocument::loadResource
106  virtual QUrl resolveUrl(const QUrl &url) const
107  { return url; }
108 
110 
111  QTextEdit::AutoFormatting autoFormatting;
113 
116 
120 
126 
127  // Qt3 COMPAT only, for setText
129 
131 
132 #ifdef QT_KEYPAD_NAVIGATION
133  QBasicTimer deleteAllTimer;
134 #endif
135 };
136 #endif // QT_NO_TEXTEDIT
137 
138 
140 
141 #endif // QTEXTEDIT_P_H
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
void pageUpDown(QTextCursor::MoveOperation op, QTextCursor::MoveMode moveMode)
Definition: qtextedit.cpp:211
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
Definition: qtextformat.h:372
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
int horizontalOffset() const
Definition: qtextedit_p.h:93
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
WrapMode
This enum describes how text is wrapped in a document.
Definition: qtextoption.h:102
QPoint mapToContents(const QPoint &point) const
Definition: qtextedit_p.h:83
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
void relayoutDocument()
Definition: qtextedit.cpp:1434
virtual void processEvent(QEvent *e, const QMatrix &matrix, QWidget *contextWidget=0)
void _q_currentCharFormatChanged(const QTextCharFormat &format)
Definition: qtextedit.cpp:1546
void _q_repaintContents(const QRectF &contentsRect)
Definition: qtextedit.cpp:193
uint ignoreAutomaticScrollbarAdjustment
Definition: qtextedit_p.h:121
QTextEdit::AutoFormatting autoFormatting
Definition: qtextedit_p.h:111
int value() const
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
MoveMode
If the anchor() is kept where it is and the position() is moved, the text in between will be selected...
Definition: qtextcursor.h:85
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
void updateDefaultTextOption()
Definition: qtextedit.cpp:1557
QBasicTimer autoScrollTimer
Definition: qtextedit_p.h:114
unsigned int uint
Definition: qglobal.h:996
void _q_ensureVisible(const QRectF &rect)
Definition: qtextedit.cpp:308
The QMimeData class provides a container for data that records information about its MIME type...
Definition: qmimedata.h:57
QTextOption::WrapMode wordWrap
Definition: qtextedit_p.h:119
TextFormat
Definition: qnamespace.h:1310
void sendControlEvent(QEvent *e)
Definition: qtextedit_p.h:98
void paint(QPainter *p, QPaintEvent *e)
Definition: qtextedit.cpp:1508
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
virtual QUrl resolveUrl(const QUrl &url) const
Definition: qtextedit_p.h:106
QPoint autoScrollDragPos
Definition: qtextedit_p.h:115
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QTextControl * control
Definition: qtextedit_p.h:109
void _q_adjustScrollbars()
Definition: qtextedit.cpp:258
int verticalOffset() const
Definition: qtextedit_p.h:95
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
uint showCursorOnInitialShow
Definition: qtextedit_p.h:123
The QBasicTimer class provides timer events for objects.
Definition: qbasictimer.h:55
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
QTextEdit::LineWrapMode lineWrap
Definition: qtextedit_p.h:117
The QPaintEvent class contains event parameters for paint events.
Definition: qevent.h:298
int maximum() const
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
Qt::TextFormat textFormat
Definition: qtextedit_p.h:128
void createAutoBulletList()
Definition: qtextedit.cpp:121
The QTextEdit class provides a widget that is used to edit and display both plain and rich text...
Definition: qtextedit.h:70
QString anchorToScrollToWhenVisible
Definition: qtextedit_p.h:130