Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / quick / items / qquicktextinput_p.h
index 447f333..3f3e926 100644 (file)
@@ -1,9 +1,8 @@
 // Commit: 2f173e4945dd8414636c1061acfaf9c2d8b718d8
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
 **
 ** This file is part of the QtDeclarative module of the Qt Toolkit.
 **
@@ -36,6 +35,7 @@
 **
 **
 **
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
@@ -64,6 +64,7 @@ class Q_AUTOTEST_EXPORT QQuickTextInput : public QQuickImplicitSizeItem
     Q_ENUMS(CursorPosition)
 
     Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+    Q_PROPERTY(int length READ length NOTIFY textChanged)
     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)
@@ -98,6 +99,8 @@ class Q_AUTOTEST_EXPORT QQuickTextInput : public QQuickImplicitSizeItem
     Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
     Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged)
     Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged)
+    Q_PROPERTY(bool canUndo READ canUndo NOTIFY canUndoChanged)
+    Q_PROPERTY(bool canRedo READ canRedo NOTIFY canRedoChanged)
     Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged)
 
 public:
@@ -156,6 +159,8 @@ public:
     QString text() const;
     void setText(const QString &);
 
+    int length() const;
+
     QFont font() const;
     void setFont(const QFont &font);
 
@@ -235,11 +240,16 @@ public:
     QRectF boundingRect() const;
     bool canPaste() const;
 
+    bool canUndo() const;
+    bool canRedo() const;
+
     bool isInputMethodComposing() const;
 
     Qt::InputMethodHints imHints() const;
     void setIMHints(Qt::InputMethodHints hints);
 
+    Q_INVOKABLE QString getText(int start, int end) const;
+
 Q_SIGNALS:
     void textChanged();
     void cursorPositionChanged();
@@ -270,6 +280,8 @@ Q_SIGNALS:
     void selectByMouseChanged(bool selectByMouse);
     void mouseSelectionModeChanged(SelectionMode mode);
     void canPasteChanged();
+    void canUndoChanged();
+    void canRedoChanged();
     void inputMethodComposingChanged();
     void effectiveHorizontalAlignmentChanged();
 
@@ -301,25 +313,62 @@ public Q_SLOTS:
     void copy();
     void paste();
 #endif
+    void undo();
+    void redo();
+    void insert(int position, const QString &text);
+    void remove(int start, int end);
 
 private Q_SLOTS:
     void selectionChanged();
     void createCursor();
     void updateCursorRectangle();
-    void updateRect(const QRect &r = QRect());
     void q_canPasteChanged();
+    void q_updateAlignment();
+    void triggerPreprocess();
 
 private:
     Q_DECLARE_PRIVATE(QQuickTextInput)
 };
 
+#ifndef QT_NO_VALIDATOR
+class Q_AUTOTEST_EXPORT QQuickIntValidator : public QIntValidator
+{
+    Q_OBJECT
+    Q_PROPERTY(QString locale READ localeName WRITE setLocaleName RESET resetLocaleName NOTIFY localeNameChanged)
+public:
+    QQuickIntValidator(QObject *parent = 0);
+
+    QString localeName() const;
+    void setLocaleName(const QString &name);
+    void resetLocaleName();
+
+Q_SIGNALS:
+    void localeNameChanged();
+};
+
+class Q_AUTOTEST_EXPORT QQuickDoubleValidator : public QDoubleValidator
+{
+    Q_OBJECT
+    Q_PROPERTY(QString locale READ localeName WRITE setLocaleName RESET resetLocaleName NOTIFY localeNameChanged)
+public:
+    QQuickDoubleValidator(QObject *parent = 0);
+
+    QString localeName() const;
+    void setLocaleName(const QString &name);
+    void resetLocaleName();
+
+Q_SIGNALS:
+    void localeNameChanged();
+};
+#endif
+
 QT_END_NAMESPACE
 
 QML_DECLARE_TYPE(QQuickTextInput)
 #ifndef QT_NO_VALIDATOR
 QML_DECLARE_TYPE(QValidator)
-QML_DECLARE_TYPE(QIntValidator)
-QML_DECLARE_TYPE(QDoubleValidator)
+QML_DECLARE_TYPE(QQuickIntValidator)
+QML_DECLARE_TYPE(QQuickDoubleValidator)
 QML_DECLARE_TYPE(QRegExpValidator)
 #endif