landlinedialer.h Example File
declarative/landlinedialer/landlinedialer.h
#ifndef LANDLINEDIALER_H
#define LANDLINEDIALER_H
#include <QObject>
class LandlineDialer : public QObject
{
Q_OBJECT
Q_ENUMS(ConnectionState)
public:
LandlineDialer(QObject *parent = 0);
enum ConnectionState {
Disconnected = 0,
Connecting,
Connected,
Engaged
};
Q_PROPERTY( ConnectionState state READ state NOTIFY stateChanged);
ConnectionState state() const;
public slots:
void dialNumber(const QString& number);
void hangup();
signals:
void stateChanged();
protected:
void timerEvent(QTimerEvent* event);
private:
void setNewState();
int timerId;
ConnectionState m_state;
};
#endif