Files
qt4-x11/tools/accessibilityinspector/screenreader.h
2025-08-24 20:55:26 +08:00

43 lines
1018 B
C++

#ifndef SCREENREADER_H
#define SCREENREADER_H
#include <QObject>
#include <QAccessible>
#include <QAccessibleBridge>
/*
A Simple screen reader for touch-based user interfaces.
Requires a text-to-speach backend. Currently implemented on
Mac OS X and using festival on unix.
*/
class OptionsWidget;
class ScreenReader : public QObject
{
Q_OBJECT
public:
explicit ScreenReader(QObject *parent = 0);
~ScreenReader();
void setRootObject(QObject *rootObject);
void setOptionsWidget(OptionsWidget *optionsWidget);
public slots:
void touchPoint(const QPoint &point);
void activate();
protected slots:
void processTouchPoint();
signals:
void selected(QObject *object);
protected:
void speak(const QString &text, const QString &voice = QString());
private:
QAccessibleInterface *m_selectedInterface;
QAccessibleInterface *m_rootInterface;
OptionsWidget *m_optionsWidget;
QPoint m_currentTouchPoint;
bool m_activateCalled;
};
#endif // SCREENREADER_H