| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktextcontrol_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - |
| 4 | ** Contact: https://www.qt.io/licensing/ | - |
| 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 The Qt Company. For licensing terms | - |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
| 15 | ** information use the contact form at https://www.qt.io/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 3 as published by the Free Software | - |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
| 21 | ** packaging of this file. Please review the following information to | - |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
| 24 | ** | - |
| 25 | ** GNU General Public License Usage | - |
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - |
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
| 31 | ** included in the packaging of this file. Please review the following | - |
| 32 | ** information to ensure the GNU General Public License requirements will | - |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
| 35 | ** | - |
| 36 | ** $QT_END_LICENSE$ | - |
| 37 | ** | - |
| 38 | ****************************************************************************/ | - |
| 39 | - | |
| 40 | #ifndef QQUICKTEXTCONTROL_P_H | - |
| 41 | #define QQUICKTEXTCONTROL_P_H | - |
| 42 | - | |
| 43 | // | - |
| 44 | // W A R N I N G | - |
| 45 | // ------------- | - |
| 46 | // | - |
| 47 | // This file is not part of the Qt API. It exists purely as an | - |
| 48 | // implementation detail. This header file may change from version to | - |
| 49 | // version without notice, or even be removed. | - |
| 50 | // | - |
| 51 | // We mean it. | - |
| 52 | // | - |
| 53 | - | |
| 54 | #include <QtGui/qtextdocument.h> | - |
| 55 | #include <QtGui/qtextoption.h> | - |
| 56 | #include <QtGui/qtextcursor.h> | - |
| 57 | #include <QtGui/qtextformat.h> | - |
| 58 | #include <QtCore/qrect.h> | - |
| 59 | #include <QtGui/qabstracttextdocumentlayout.h> | - |
| 60 | #include <QtGui/qtextdocumentfragment.h> | - |
| 61 | #include <QtGui/qclipboard.h> | - |
| 62 | #include <QtGui/private/qinputcontrol_p.h> | - |
| 63 | #include <QtCore/qmimedata.h> | - |
| 64 | - | |
| 65 | QT_BEGIN_NAMESPACE | - |
| 66 | - | |
| 67 | - | |
| 68 | class QStyleSheet; | - |
| 69 | class QTextDocument; | - |
| 70 | class QQuickTextControlPrivate; | - |
| 71 | class QAbstractScrollArea; | - |
| 72 | class QEvent; | - |
| 73 | class QTimerEvent; | - |
| 74 | - | |
| 75 | class Q_AUTOTEST_EXPORT QQuickTextControl : public QInputControl | - |
| 76 | { | - |
| 77 | Q_OBJECT | - |
| 78 | Q_DECLARE_PRIVATE(QQuickTextControl) executed 25898 times by 6 tests: return reinterpret_cast<QQuickTextControlPrivate *>(qGetPtrHelper(d_ptr));Executed by:
executed 61222 times by 6 tests: return reinterpret_cast<const QQuickTextControlPrivate *>(qGetPtrHelper(d_ptr));Executed by:
| 25898-61222 |
| 79 | public: | - |
| 80 | explicit QQuickTextControl(QTextDocument *doc, QObject *parent = nullptr); | - |
| 81 | virtual ~QQuickTextControl(); | - |
| 82 | - | |
| 83 | QTextDocument *document() const; | - |
| 84 | - | |
| 85 | void setTextCursor(const QTextCursor &cursor); | - |
| 86 | QTextCursor textCursor() const; | - |
| 87 | - | |
| 88 | void setTextInteractionFlags(Qt::TextInteractionFlags flags); | - |
| 89 | Qt::TextInteractionFlags textInteractionFlags() const; | - |
| 90 | - | |
| 91 | QString toPlainText() const; | - |
| 92 | - | |
| 93 | #if QT_CONFIG(texthtmlparser) | - |
| 94 | QString toHtml() const; | - |
| 95 | #endif | - |
| 96 | - | |
| 97 | bool hasImState() const; | - |
| 98 | bool overwriteMode() const; | - |
| 99 | void setOverwriteMode(bool overwrite); | - |
| 100 | bool cursorVisible() const; | - |
| 101 | void setCursorVisible(bool visible); | - |
| 102 | QRectF anchorRect() const; | - |
| 103 | QRectF cursorRect(const QTextCursor &cursor) const; | - |
| 104 | QRectF cursorRect() const; | - |
| 105 | QRectF selectionRect(const QTextCursor &cursor) const; | - |
| 106 | QRectF selectionRect() const; | - |
| 107 | - | |
| 108 | QString hoveredLink() const; | - |
| 109 | QString anchorAt(const QPointF &pos) const; | - |
| 110 | - | |
| 111 | void setCursorWidth(int width); | - |
| 112 | - | |
| 113 | void setAcceptRichText(bool accept); | - |
| 114 | - | |
| 115 | void moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor); | - |
| 116 | - | |
| 117 | bool canPaste() const; | - |
| 118 | - | |
| 119 | void setCursorIsFocusIndicator(bool b); | - |
| 120 | void setWordSelectionEnabled(bool enabled); | - |
| 121 | - | |
| 122 | void updateCursorRectangle(bool force); | - |
| 123 | - | |
| 124 | virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const; | - |
| 125 | virtual QRectF blockBoundingRect(const QTextBlock &block) const; | - |
| 126 | - | |
| 127 | QString preeditText() const; | - |
| 128 | - | |
| 129 | public Q_SLOTS: | - |
| 130 | void setPlainText(const QString &text); | - |
| 131 | void setHtml(const QString &text); | - |
| 132 | - | |
| 133 | #if QT_CONFIG(clipboard) | - |
| 134 | void cut(); | - |
| 135 | void copy(); | - |
| 136 | void paste(QClipboard::Mode mode = QClipboard::Clipboard); | - |
| 137 | #endif | - |
| 138 | - | |
| 139 | void undo(); | - |
| 140 | void redo(); | - |
| 141 | void clear(); | - |
| 142 | - | |
| 143 | void selectAll(); | - |
| 144 | - | |
| 145 | Q_SIGNALS: | - |
| 146 | void textChanged(); | - |
| 147 | void preeditTextChanged(); | - |
| 148 | void contentsChange(int from, int charsRemoved, int charsAdded); | - |
| 149 | void undoAvailable(bool b); | - |
| 150 | void redoAvailable(bool b); | - |
| 151 | void currentCharFormatChanged(const QTextCharFormat &format); | - |
| 152 | void copyAvailable(bool b); | - |
| 153 | void selectionChanged(); | - |
| 154 | void cursorPositionChanged(); | - |
| 155 | void overwriteModeChanged(bool overwriteMode); | - |
| 156 | - | |
| 157 | // control signals | - |
| 158 | void updateCursorRequest(); | - |
| 159 | void updateRequest(); | - |
| 160 | void cursorRectangleChanged(); | - |
| 161 | void linkActivated(const QString &link); | - |
| 162 | void linkHovered(const QString &link); | - |
| 163 | - | |
| 164 | public: | - |
| 165 | virtual void processEvent(QEvent *e, const QMatrix &matrix); | - |
| 166 | void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF()); | - |
| 167 | - | |
| 168 | #if QT_CONFIG(im) | - |
| 169 | virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const; | - |
| 170 | Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; | - |
| 171 | #endif | - |
| 172 | - | |
| 173 | virtual QMimeData *createMimeDataFromSelection() const; | - |
| 174 | virtual bool canInsertFromMimeData(const QMimeData *source) const; | - |
| 175 | virtual void insertFromMimeData(const QMimeData *source); | - |
| 176 | - | |
| 177 | bool cursorOn() const; | - |
| 178 | - | |
| 179 | protected: | - |
| 180 | void timerEvent(QTimerEvent *e) override; | - |
| 181 | - | |
| 182 | bool event(QEvent *e) override; | - |
| 183 | - | |
| 184 | private: | - |
| 185 | Q_DISABLE_COPY(QQuickTextControl) | - |
| 186 | Q_PRIVATE_SLOT(d_func(), void _q_updateCurrentCharFormatAndSelection()) | - |
| 187 | Q_PRIVATE_SLOT(d_func(), void _q_updateCursorPosChanged(const QTextCursor &)) | - |
| 188 | }; | - |
| 189 | - | |
| 190 | - | |
| 191 | // also used by QLabel | - |
| 192 | class QQuickTextEditMimeData : public QMimeData | - |
| 193 | { | - |
| 194 | public: | - |
| 195 | inline QQuickTextEditMimeData(const QTextDocumentFragment &aFragment) : fragment(aFragment) {} executed 614 times by 1 test: end of blockExecuted by:
| 614 |
| 196 | - | |
| 197 | QStringList formats() const override; | - |
| 198 | - | |
| 199 | protected: | - |
| 200 | QVariant retrieveData(const QString &mimeType, QVariant::Type type) const override; | - |
| 201 | - | |
| 202 | private: | - |
| 203 | void setup() const; | - |
| 204 | - | |
| 205 | mutable QTextDocumentFragment fragment; | - |
| 206 | }; | - |
| 207 | - | |
| 208 | QT_END_NAMESPACE | - |
| 209 | - | |
| 210 | #endif // QQuickTextControl_H | - |
| Source code | Switch to Preprocessed file |