Message.h 991 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. #ifndef MESSAGE_H
  5. #define MESSAGE_H
  6. #include <QObject>
  7. // QtMobility API headers
  8. // Messaging
  9. #include <QMessage>
  10. #include <QMessageManager>
  11. #include <QMessageService>
  12. // Location
  13. #include <QGeoPositionInfo>
  14. // QtMobility namespace
  15. QTM_USE_NAMESPACE
  16. class Message: public QObject
  17. {
  18. Q_OBJECT
  19. public:
  20. Message(QObject *parent = 0);
  21. ~Message();
  22. bool sendLocationSMS(QString typeStr, QGeoPositionInfo& position, QString phoneNumber);
  23. private:
  24. void processIncomingSMS(const QMessageId& id);
  25. public slots:
  26. // Listening QMessageManager
  27. void messageAdded(const QMessageId &id,
  28. const QMessageManager::NotificationFilterIdSet &matchingFilterIds);
  29. signals:
  30. void friendAskLocationSMS(QString friendPhoneNumber);
  31. private:
  32. QMessageService* m_service;
  33. QMessageManager* m_manager;
  34. QMessageManager::NotificationFilterIdSet m_notifFilterSet;
  35. QMessageId m_messageId;
  36. };
  37. #endif // MESSAGE_H