summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2012-08-23 15:27:44 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-11 12:09:47 +0200
commitee4903282a8a50309849d9bb4c3372b680794840 (patch)
tree58fadef3fba194e608d2e7bd59257f0d0dd944d2
parente06999bd625c8e787d429a1296739a68e48a4e6f (diff)
Add TableModelChange event for accessibility.
Change-Id: I4ff892c076b516cee0f6605705854ee8828d4363 Reviewed-by: José Millán Soto <fid@gpul.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
-rw-r--r--src/gui/accessible/qaccessible.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index ce7c54e00b..5b76a04b07 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -452,6 +452,7 @@ public:
Q_ASSERT(m_type != QAccessible::TextInserted);
Q_ASSERT(m_type != QAccessible::TextRemoved);
Q_ASSERT(m_type != QAccessible::TextUpdated);
+ Q_ASSERT(m_type != QAccessible::TableModelChanged);
}
virtual ~QAccessibleEvent()
@@ -616,6 +617,45 @@ protected:
QVariant m_value;
};
+class Q_GUI_EXPORT QAccessibleTableModelChangeEvent : public QAccessibleEvent
+{
+public:
+ enum ModelChangeType {
+ ModelReset,
+ DataChanged,
+ RowsInserted,
+ ColumnsInserted,
+ RowsRemoved,
+ ColumnsRemoved
+ };
+
+ inline QAccessibleTableModelChangeEvent(QObject *obj, ModelChangeType changeType)
+ : QAccessibleEvent(obj, QAccessible::InvalidEvent)
+ , m_modelChangeType(changeType)
+ , m_firstRow(-1), m_firstColumn(-1), m_lastRow(-1), m_lastColumn(-1)
+ {
+ m_type = QAccessible::TableModelChanged;
+ }
+ void setModelChangeType(ModelChangeType changeType) { m_modelChangeType = changeType; }
+ ModelChangeType modelChangeType() const { return m_modelChangeType; }
+
+ void setFirstRow(int row) { m_firstRow = row; }
+ void setFirstColumn(int col) { m_firstColumn = col; }
+ void setLastRow(int row) { m_lastRow = row; }
+ void setLastColumn(int col) { m_lastColumn = col; }
+ int firstRow() const { return m_firstRow; }
+ int firstColumn() const { return m_firstColumn; }
+ int lastRow() const { return m_lastRow; }
+ int lastColumn() const { return m_lastColumn; }
+
+protected:
+ ModelChangeType m_modelChangeType;
+ int m_firstRow;
+ int m_firstColumn;
+ int m_lastRow;
+ int m_lastColumn;
+};
+
#define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface"
Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid)