2011-04-27 12:13:26 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2016-01-19 09:38:36 +00:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-04-27 12:13:26 +00:00
|
|
|
**
|
2013-09-30 05:28:31 +00:00
|
|
|
** This file is part of the QtQuick module of the Qt Toolkit.
|
2011-04-27 12:13:26 +00:00
|
|
|
**
|
2016-01-19 09:38:36 +00:00
|
|
|
** $QT_BEGIN_LICENSE:LGPL$
|
2012-09-20 05:21:40 +00:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-28 11:55:39 +00:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
2016-01-19 09:38:36 +00:00
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-09-20 05:21:40 +00:00
|
|
|
**
|
2011-04-27 12:13:26 +00:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-09-20 05:21:40 +00:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2016-01-19 09:38:36 +00:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 3 requirements
|
|
|
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
2011-04-27 12:13:26 +00:00
|
|
|
**
|
2016-01-19 09:38:36 +00:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 2.0 or (at your option) the GNU General
|
|
|
|
** Public license version 3 or any later version approved by the KDE Free
|
|
|
|
** Qt Foundation. The licenses are as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
|
|
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-04-27 12:13:26 +00:00
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
#ifndef QQUICKTEXTINPUT_P_H
|
|
|
|
#define QQUICKTEXTINPUT_P_H
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2015-10-05 08:45:54 +00:00
|
|
|
//
|
|
|
|
// W A R N I N G
|
|
|
|
// -------------
|
|
|
|
//
|
|
|
|
// This file is not part of the Qt API. It exists purely as an
|
|
|
|
// implementation detail. This header file may change from version to
|
|
|
|
// version without notice, or even be removed.
|
|
|
|
//
|
|
|
|
// We mean it.
|
|
|
|
//
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
#include "qquickimplicitsizeitem_p.h"
|
2011-12-15 01:36:54 +00:00
|
|
|
#include <QtGui/qtextoption.h>
|
2011-04-27 12:13:26 +00:00
|
|
|
#include <QtGui/qvalidator.h>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
class QQuickTextInputPrivate;
|
2011-04-27 12:13:26 +00:00
|
|
|
class QValidator;
|
2013-01-16 09:06:11 +00:00
|
|
|
class Q_QUICK_PRIVATE_EXPORT QQuickTextInput : public QQuickImplicitSizeItem
|
2011-04-27 12:13:26 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
|
2012-01-04 00:53:26 +00:00
|
|
|
Q_PROPERTY(int length READ length NOTIFY textChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
|
|
|
|
Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
|
|
|
|
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
|
|
|
|
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
|
|
|
|
Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
|
|
|
|
Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged)
|
2011-12-15 01:36:54 +00:00
|
|
|
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
|
|
|
|
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
|
|
|
|
Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
|
|
|
|
Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
|
2012-02-23 04:11:48 +00:00
|
|
|
Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
|
2012-02-16 04:43:03 +00:00
|
|
|
Q_PROPERTY(QQmlComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged)
|
2015-08-28 15:11:57 +00:00
|
|
|
Q_PROPERTY(bool overwriteMode READ overwriteMode WRITE setOverwriteMode NOTIFY overwriteModeChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
|
|
|
|
Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
|
|
|
|
Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(int maximumLength READ maxLength WRITE setMaxLength NOTIFY maximumLengthChanged)
|
|
|
|
Q_PROPERTY(QValidator* validator READ validator WRITE setValidator NOTIFY validatorChanged)
|
|
|
|
Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask NOTIFY inputMaskChanged)
|
2012-02-15 12:30:44 +00:00
|
|
|
Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
|
|
|
|
Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
|
|
|
|
Q_PROPERTY(bool activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
|
|
|
|
Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
|
2014-03-11 10:04:52 +00:00
|
|
|
Q_PROPERTY(int passwordMaskDelay READ passwordMaskDelay WRITE setPasswordMaskDelay RESET resetPasswordMaskDelay NOTIFY passwordMaskDelayChanged REVISION 3)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
|
2015-12-30 09:43:22 +00:00
|
|
|
Q_PROPERTY(QString preeditText READ preeditText NOTIFY preeditTextChanged REVISION 7)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
|
|
|
|
Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
|
|
|
|
Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged)
|
2012-01-20 06:10:23 +00:00
|
|
|
Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged)
|
2012-01-10 01:52:43 +00:00
|
|
|
Q_PROPERTY(bool canUndo READ canUndo NOTIFY canUndoChanged)
|
|
|
|
Q_PROPERTY(bool canRedo READ canRedo NOTIFY canRedoChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged)
|
2012-02-07 01:57:42 +00:00
|
|
|
Q_PROPERTY(qreal contentWidth READ contentWidth NOTIFY contentSizeChanged)
|
|
|
|
Q_PROPERTY(qreal contentHeight READ contentHeight NOTIFY contentSizeChanged)
|
2012-07-04 12:56:38 +00:00
|
|
|
Q_PROPERTY(RenderType renderType READ renderType WRITE setRenderType NOTIFY renderTypeChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2015-02-02 16:51:16 +00:00
|
|
|
Q_PROPERTY(qreal padding READ padding WRITE setPadding RESET resetPadding NOTIFY paddingChanged REVISION 6)
|
|
|
|
Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding NOTIFY topPaddingChanged REVISION 6)
|
|
|
|
Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding NOTIFY leftPaddingChanged REVISION 6)
|
|
|
|
Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding NOTIFY rightPaddingChanged REVISION 6)
|
|
|
|
Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding NOTIFY bottomPaddingChanged REVISION 6)
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
public:
|
2011-10-14 08:51:42 +00:00
|
|
|
QQuickTextInput(QQuickItem * parent=0);
|
|
|
|
~QQuickTextInput();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2014-08-09 14:18:01 +00:00
|
|
|
void componentComplete() Q_DECL_OVERRIDE;
|
2011-12-15 01:36:54 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
enum EchoMode {//To match QLineEdit::EchoMode
|
|
|
|
Normal,
|
|
|
|
NoEcho,
|
|
|
|
Password,
|
|
|
|
PasswordEchoOnEdit
|
|
|
|
};
|
2015-05-13 07:59:40 +00:00
|
|
|
Q_ENUM(EchoMode)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
enum HAlignment {
|
|
|
|
AlignLeft = Qt::AlignLeft,
|
|
|
|
AlignRight = Qt::AlignRight,
|
|
|
|
AlignHCenter = Qt::AlignHCenter
|
|
|
|
};
|
2015-05-13 07:59:40 +00:00
|
|
|
Q_ENUM(HAlignment)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2011-12-15 01:36:54 +00:00
|
|
|
enum VAlignment {
|
|
|
|
AlignTop = Qt::AlignTop,
|
|
|
|
AlignBottom = Qt::AlignBottom,
|
|
|
|
AlignVCenter = Qt::AlignVCenter
|
|
|
|
};
|
2015-05-13 07:59:40 +00:00
|
|
|
Q_ENUM(VAlignment)
|
2011-12-15 01:36:54 +00:00
|
|
|
|
|
|
|
enum WrapMode {
|
|
|
|
NoWrap = QTextOption::NoWrap,
|
|
|
|
WordWrap = QTextOption::WordWrap,
|
|
|
|
WrapAnywhere = QTextOption::WrapAnywhere,
|
|
|
|
WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere, // COMPAT
|
|
|
|
Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
|
|
|
|
};
|
2015-05-13 07:59:40 +00:00
|
|
|
Q_ENUM(WrapMode)
|
2011-12-15 01:36:54 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
enum SelectionMode {
|
|
|
|
SelectCharacters,
|
|
|
|
SelectWords
|
|
|
|
};
|
2015-05-13 07:59:40 +00:00
|
|
|
Q_ENUM(SelectionMode)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
enum CursorPosition {
|
|
|
|
CursorBetweenCharacters,
|
|
|
|
CursorOnCharacter
|
|
|
|
};
|
2015-05-13 07:59:40 +00:00
|
|
|
Q_ENUM(CursorPosition)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2012-07-04 12:56:38 +00:00
|
|
|
enum RenderType { QtRendering,
|
|
|
|
NativeRendering
|
|
|
|
};
|
2015-05-13 07:59:40 +00:00
|
|
|
Q_ENUM(RenderType)
|
2011-12-15 01:36:54 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
//Auxilliary functions needed to control the TextInput from QML
|
2013-05-08 14:22:39 +00:00
|
|
|
Q_INVOKABLE void positionAt(QQmlV4Function *args) const;
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_INVOKABLE QRectF positionToRectangle(int pos) const;
|
|
|
|
Q_INVOKABLE void moveCursorSelection(int pos);
|
|
|
|
Q_INVOKABLE void moveCursorSelection(int pos, SelectionMode mode);
|
|
|
|
|
2012-07-04 12:56:38 +00:00
|
|
|
RenderType renderType() const;
|
|
|
|
void setRenderType(RenderType renderType);
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QString text() const;
|
|
|
|
void setText(const QString &);
|
|
|
|
|
2012-01-04 00:53:26 +00:00
|
|
|
int length() const;
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QFont font() const;
|
|
|
|
void setFont(const QFont &font);
|
|
|
|
|
|
|
|
QColor color() const;
|
|
|
|
void setColor(const QColor &c);
|
|
|
|
|
|
|
|
QColor selectionColor() const;
|
|
|
|
void setSelectionColor(const QColor &c);
|
|
|
|
|
|
|
|
QColor selectedTextColor() const;
|
|
|
|
void setSelectedTextColor(const QColor &c);
|
|
|
|
|
|
|
|
HAlignment hAlign() const;
|
|
|
|
void setHAlign(HAlignment align);
|
|
|
|
void resetHAlign();
|
|
|
|
HAlignment effectiveHAlign() const;
|
|
|
|
|
2011-12-15 01:36:54 +00:00
|
|
|
VAlignment vAlign() const;
|
|
|
|
void setVAlign(VAlignment align);
|
|
|
|
|
|
|
|
WrapMode wrapMode() const;
|
|
|
|
void setWrapMode(WrapMode w);
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool isReadOnly() const;
|
|
|
|
void setReadOnly(bool);
|
|
|
|
|
|
|
|
bool isCursorVisible() const;
|
|
|
|
void setCursorVisible(bool on);
|
|
|
|
|
|
|
|
int cursorPosition() const;
|
|
|
|
void setCursorPosition(int cp);
|
|
|
|
|
2012-02-23 04:11:48 +00:00
|
|
|
QRectF cursorRectangle() const;
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
int selectionStart() const;
|
|
|
|
int selectionEnd() const;
|
|
|
|
|
|
|
|
QString selectedText() const;
|
|
|
|
|
|
|
|
int maxLength() const;
|
|
|
|
void setMaxLength(int ml);
|
|
|
|
|
|
|
|
QValidator * validator() const;
|
|
|
|
void setValidator(QValidator* v);
|
2014-09-09 15:35:33 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QString inputMask() const;
|
|
|
|
void setInputMask(const QString &im);
|
|
|
|
|
|
|
|
EchoMode echoMode() const;
|
|
|
|
void setEchoMode(EchoMode echo);
|
|
|
|
|
|
|
|
QString passwordCharacter() const;
|
|
|
|
void setPasswordCharacter(const QString &str);
|
|
|
|
|
2014-03-11 10:04:52 +00:00
|
|
|
int passwordMaskDelay() const;
|
|
|
|
void setPasswordMaskDelay(int delay);
|
|
|
|
void resetPasswordMaskDelay();
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QString displayText() const;
|
2015-12-30 09:43:22 +00:00
|
|
|
Q_REVISION(7) QString preeditText() const;
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2012-02-16 04:43:03 +00:00
|
|
|
QQmlComponent* cursorDelegate() const;
|
|
|
|
void setCursorDelegate(QQmlComponent*);
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2015-08-28 15:11:57 +00:00
|
|
|
bool overwriteMode() const;
|
|
|
|
void setOverwriteMode(bool overwrite);
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool focusOnPress() const;
|
|
|
|
void setFocusOnPress(bool);
|
|
|
|
|
|
|
|
bool autoScroll() const;
|
|
|
|
void setAutoScroll(bool);
|
|
|
|
|
|
|
|
bool selectByMouse() const;
|
|
|
|
void setSelectByMouse(bool);
|
|
|
|
|
|
|
|
SelectionMode mouseSelectionMode() const;
|
|
|
|
void setMouseSelectionMode(SelectionMode mode);
|
|
|
|
|
2012-01-20 06:10:23 +00:00
|
|
|
bool persistentSelection() const;
|
|
|
|
void setPersistentSelection(bool persist);
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool hasAcceptableInput() const;
|
|
|
|
|
2016-11-16 13:22:36 +00:00
|
|
|
#if QT_CONFIG(im)
|
2014-08-09 14:18:01 +00:00
|
|
|
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
|
2014-12-04 08:50:44 +00:00
|
|
|
Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
|
2012-11-22 17:47:45 +00:00
|
|
|
#endif
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2014-08-09 14:18:01 +00:00
|
|
|
QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
|
|
QRectF clipRect() const Q_DECL_OVERRIDE;
|
2012-04-19 01:08:28 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool canPaste() const;
|
|
|
|
|
2012-01-10 01:52:43 +00:00
|
|
|
bool canUndo() const;
|
|
|
|
bool canRedo() const;
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool isInputMethodComposing() const;
|
|
|
|
|
2012-02-15 12:30:44 +00:00
|
|
|
Qt::InputMethodHints inputMethodHints() const;
|
|
|
|
void setInputMethodHints(Qt::InputMethodHints hints);
|
2011-05-04 07:53:51 +00:00
|
|
|
|
2012-01-04 00:53:26 +00:00
|
|
|
Q_INVOKABLE QString getText(int start, int end) const;
|
|
|
|
|
2012-02-07 01:57:42 +00:00
|
|
|
qreal contentWidth() const;
|
|
|
|
qreal contentHeight() const;
|
|
|
|
|
2015-02-02 16:51:16 +00:00
|
|
|
qreal padding() const;
|
|
|
|
void setPadding(qreal padding);
|
|
|
|
void resetPadding();
|
|
|
|
|
|
|
|
qreal topPadding() const;
|
|
|
|
void setTopPadding(qreal padding);
|
|
|
|
void resetTopPadding();
|
|
|
|
|
|
|
|
qreal leftPadding() const;
|
|
|
|
void setLeftPadding(qreal padding);
|
|
|
|
void resetLeftPadding();
|
|
|
|
|
|
|
|
qreal rightPadding() const;
|
|
|
|
void setRightPadding(qreal padding);
|
|
|
|
void resetRightPadding();
|
|
|
|
|
|
|
|
qreal bottomPadding() const;
|
|
|
|
void setBottomPadding(qreal padding);
|
|
|
|
void resetBottomPadding();
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void textChanged();
|
|
|
|
void cursorPositionChanged();
|
2011-07-25 02:55:57 +00:00
|
|
|
void cursorRectangleChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void selectionStartChanged();
|
|
|
|
void selectionEndChanged();
|
|
|
|
void selectedTextChanged();
|
|
|
|
void accepted();
|
|
|
|
void acceptableInputChanged();
|
2013-11-21 10:06:24 +00:00
|
|
|
Q_REVISION(2) void editingFinished();
|
2012-02-20 07:18:20 +00:00
|
|
|
void colorChanged();
|
|
|
|
void selectionColorChanged();
|
|
|
|
void selectedTextColorChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void fontChanged(const QFont &font);
|
2016-04-07 09:22:33 +00:00
|
|
|
void horizontalAlignmentChanged(QQuickTextInput::HAlignment alignment);
|
|
|
|
void verticalAlignmentChanged(QQuickTextInput::VAlignment alignment);
|
2011-12-15 01:36:54 +00:00
|
|
|
void wrapModeChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void readOnlyChanged(bool isReadOnly);
|
|
|
|
void cursorVisibleChanged(bool isCursorVisible);
|
|
|
|
void cursorDelegateChanged();
|
2015-08-28 15:11:57 +00:00
|
|
|
void overwriteModeChanged(bool overwriteMode);
|
2011-04-27 12:13:26 +00:00
|
|
|
void maximumLengthChanged(int maximumLength);
|
|
|
|
void validatorChanged();
|
|
|
|
void inputMaskChanged(const QString &inputMask);
|
2016-04-07 09:22:33 +00:00
|
|
|
void echoModeChanged(QQuickTextInput::EchoMode echoMode);
|
2011-04-27 12:13:26 +00:00
|
|
|
void passwordCharacterChanged();
|
2014-03-11 10:04:52 +00:00
|
|
|
Q_REVISION(3) void passwordMaskDelayChanged(int delay);
|
2011-04-27 12:13:26 +00:00
|
|
|
void displayTextChanged();
|
2015-12-30 09:43:22 +00:00
|
|
|
Q_REVISION(7) void preeditTextChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void activeFocusOnPressChanged(bool activeFocusOnPress);
|
|
|
|
void autoScrollChanged(bool autoScroll);
|
|
|
|
void selectByMouseChanged(bool selectByMouse);
|
2016-04-07 09:22:33 +00:00
|
|
|
void mouseSelectionModeChanged(QQuickTextInput::SelectionMode mode);
|
2012-01-20 06:10:23 +00:00
|
|
|
void persistentSelectionChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void canPasteChanged();
|
2012-01-10 01:52:43 +00:00
|
|
|
void canUndoChanged();
|
|
|
|
void canRedoChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void inputMethodComposingChanged();
|
|
|
|
void effectiveHorizontalAlignmentChanged();
|
2012-02-07 01:57:42 +00:00
|
|
|
void contentSizeChanged();
|
2012-02-15 12:30:44 +00:00
|
|
|
void inputMethodHintsChanged();
|
2012-07-04 12:56:38 +00:00
|
|
|
void renderTypeChanged();
|
2015-02-02 16:51:16 +00:00
|
|
|
Q_REVISION(6) void paddingChanged();
|
|
|
|
Q_REVISION(6) void topPaddingChanged();
|
|
|
|
Q_REVISION(6) void leftPaddingChanged();
|
|
|
|
Q_REVISION(6) void rightPaddingChanged();
|
|
|
|
Q_REVISION(6) void bottomPaddingChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2014-10-16 14:57:08 +00:00
|
|
|
private:
|
|
|
|
void invalidateFontCaches();
|
2015-03-17 13:26:35 +00:00
|
|
|
void ensureActiveFocus();
|
2014-10-16 14:57:08 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
protected:
|
2015-06-18 19:38:57 +00:00
|
|
|
QQuickTextInput(QQuickTextInputPrivate &dd, QQuickItem *parent = 0);
|
|
|
|
|
2014-08-09 14:18:01 +00:00
|
|
|
void geometryChanged(const QRectF &newGeometry,
|
|
|
|
const QRectF &oldGeometry) Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void keyPressEvent(QKeyEvent* ev) Q_DECL_OVERRIDE;
|
2016-11-16 13:22:36 +00:00
|
|
|
#if QT_CONFIG(im)
|
2014-08-09 14:18:01 +00:00
|
|
|
void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
|
2012-11-22 17:47:45 +00:00
|
|
|
#endif
|
2014-08-09 14:18:01 +00:00
|
|
|
void mouseUngrabEvent() Q_DECL_OVERRIDE;
|
|
|
|
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
|
|
|
void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) Q_DECL_OVERRIDE;
|
2015-02-04 23:10:21 +00:00
|
|
|
void updatePolish() Q_DECL_OVERRIDE;
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void selectAll();
|
|
|
|
void selectWord();
|
|
|
|
void select(int start, int end);
|
|
|
|
void deselect();
|
|
|
|
bool isRightToLeft(int start, int end);
|
2016-11-16 13:22:36 +00:00
|
|
|
#if QT_CONFIG(clipboard)
|
2011-04-27 12:13:26 +00:00
|
|
|
void cut();
|
|
|
|
void copy();
|
|
|
|
void paste();
|
|
|
|
#endif
|
2012-01-10 01:52:43 +00:00
|
|
|
void undo();
|
|
|
|
void redo();
|
2012-01-04 00:53:26 +00:00
|
|
|
void insert(int position, const QString &text);
|
|
|
|
void remove(int start, int end);
|
2014-05-16 12:35:23 +00:00
|
|
|
Q_REVISION(3) void ensureVisible(int position);
|
2016-01-13 11:55:46 +00:00
|
|
|
Q_REVISION(7) void clear();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void selectionChanged();
|
|
|
|
void createCursor();
|
2014-05-16 12:35:23 +00:00
|
|
|
void updateCursorRectangle(bool scroll = true);
|
2011-04-27 12:13:26 +00:00
|
|
|
void q_canPasteChanged();
|
2012-01-09 11:41:36 +00:00
|
|
|
void q_updateAlignment();
|
2011-11-24 12:48:19 +00:00
|
|
|
void triggerPreprocess();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2016-11-16 13:22:36 +00:00
|
|
|
#if QT_CONFIG(validator)
|
2012-06-21 06:44:30 +00:00
|
|
|
void q_validatorChanged();
|
|
|
|
#endif
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
private:
|
2012-05-04 06:07:32 +00:00
|
|
|
friend class QQuickTextUtil;
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
Q_DECLARE_PRIVATE(QQuickTextInput)
|
2011-04-27 12:13:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
QML_DECLARE_TYPE(QQuickTextInput)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
#endif // QQUICKTEXTINPUT_P_H
|