qs60telephony.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef QS60TELEPHONY_H
  2. #define QS60TELEPHONY_H
  3. // INCLUDES
  4. #include <QObject>
  5. #include "telephony_global.h"
  6. // FORWARD DECLARATIONS
  7. class QS60TelephonyPrivate;
  8. // CLASS DECLARATION
  9. class QS60Telephony : public QObject
  10. {
  11. Q_OBJECT
  12. Q_DECLARE_PRIVATE(QS60Telephony)
  13. Q_ENUMS(LineStatus)
  14. Q_ENUMS(Error)
  15. Q_CLASSINFO("Author", "Sebastiano Galazzo")
  16. Q_CLASSINFO("Email", "sebastiano.galazzo@gmail.com")
  17. public:
  18. enum Error {
  19. NoError = 0,
  20. OutOfMemoryError,
  21. AccessDeniedError,
  22. TimedOutError,
  23. UnknownError = -1
  24. };
  25. enum LineStatus {
  26. StatusUnknown,
  27. StatusIdle,
  28. StatusDialling,
  29. StatusRinging,
  30. StatusAnswering,
  31. StatusConnecting,
  32. StatusConnected,
  33. StatusReconnectPending,
  34. StatusDisconnecting,
  35. StatusHold,
  36. StatusTransferring,
  37. StatusTransferAlerting
  38. };
  39. explicit QS60Telephony(QObject* parent = 0);
  40. ~QS60Telephony();
  41. /**
  42. * @brief Read the IMEI Code
  43. */
  44. Q_INVOKABLE QString IMEI();
  45. Q_INVOKABLE QS60Telephony::Error error() const;
  46. public slots:
  47. /**
  48. * @brief Make a phone call
  49. * @param phone number
  50. */
  51. void call(const QString& phoneNumber);
  52. /**
  53. * @brief Answer incoming call
  54. */
  55. void answerIncomingCall();
  56. /**
  57. * @brief Terminate a call
  58. */
  59. void terminateCall();
  60. /**
  61. * @brief Reject a call
  62. */
  63. void rejectCall();
  64. #ifdef RECENT_CALLS
  65. void recentCalls();
  66. #endif
  67. bool startMonitoringLine();
  68. void toBackground();
  69. void stopMonitoringLine();
  70. void showOnTop();
  71. void showNormal();
  72. private slots:
  73. void showOnTopDelayed();
  74. signals:
  75. void lineStatusChanged(QS60Telephony::LineStatus status, QString number);
  76. void error(QS60Telephony::Error error);
  77. void answered();
  78. void terminated();
  79. private:
  80. LineStatus cStatus;
  81. private:
  82. friend class QS60TelephonyPrivate;
  83. QS60TelephonyPrivate* d;
  84. };
  85. #endif // QS60TELEPHONY_H
  86. // End of file