123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef QS60TELEPHONY_H
- #define QS60TELEPHONY_H
- // INCLUDES
- #include <QObject>
- #include "telephony_global.h"
- // FORWARD DECLARATIONS
- class QS60TelephonyPrivate;
- // CLASS DECLARATION
- class QS60Telephony : public QObject
- {
- Q_OBJECT
- Q_DECLARE_PRIVATE(QS60Telephony)
- Q_ENUMS(LineStatus)
- Q_ENUMS(Error)
- Q_CLASSINFO("Author", "Sebastiano Galazzo")
- Q_CLASSINFO("Email", "sebastiano.galazzo@gmail.com")
- public:
- enum Error {
- NoError = 0,
- OutOfMemoryError,
- AccessDeniedError,
- TimedOutError,
- UnknownError = -1
- };
-
- enum LineStatus {
- StatusUnknown,
- StatusIdle,
- StatusDialling,
- StatusRinging,
- StatusAnswering,
- StatusConnecting,
- StatusConnected,
- StatusReconnectPending,
- StatusDisconnecting,
- StatusHold,
- StatusTransferring,
- StatusTransferAlerting
- };
-
- explicit QS60Telephony(QObject* parent = 0);
- ~QS60Telephony();
-
- /**
- * @brief Read the IMEI Code
- */
- Q_INVOKABLE QString IMEI();
- Q_INVOKABLE QS60Telephony::Error error() const;
- public slots:
- /**
- * @brief Make a phone call
- * @param phone number
- */
- void call(const QString& phoneNumber);
- /**
- * @brief Answer incoming call
- */
- void answerIncomingCall();
- /**
- * @brief Terminate a call
- */
- void terminateCall();
- /**
- * @brief Reject a call
- */
- void rejectCall();
- #ifdef RECENT_CALLS
- void recentCalls();
- #endif
- bool startMonitoringLine();
- void toBackground();
- void stopMonitoringLine();
- void showOnTop();
- void showNormal();
-
- private slots:
- void showOnTopDelayed();
- signals:
- void lineStatusChanged(QS60Telephony::LineStatus status, QString number);
- void error(QS60Telephony::Error error);
- void answered();
- void terminated();
-
- private:
- LineStatus cStatus;
- private:
- friend class QS60TelephonyPrivate;
- QS60TelephonyPrivate* d;
- };
- #endif // QS60TELEPHONY_H
- // End of file
|