/thirdparty/liblastfm2/src/ws/linux/LNetworkConnectionMonitor.h

http://github.com/tomahawk-player/tomahawk · C Header · 54 lines · 26 code · 9 blank · 19 comment · 0 complexity · 70e2f126f08808bc894e99a97044fa79 MD5 · raw file

  1. /*
  2. Copyright 2010 Last.fm Ltd.
  3. - Primarily authored by Max Howell, Jono Cole and Doug Mansell
  4. This file is part of liblastfm.
  5. liblastfm is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. liblastfm is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with liblastfm. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef LNETWORK_CONNECTION_MONITOR_H
  17. #define LNETWORK_CONNECTION_MONITOR_H
  18. #include "../NetworkConnectionMonitor.h"
  19. #include <lastfm/global.h>
  20. #include <QObject>
  21. class QDBusConnection;
  22. class QDBusInterface;
  23. class LNetworkConnectionMonitor : public NetworkConnectionMonitor
  24. {
  25. Q_OBJECT
  26. enum NMState
  27. {
  28. Unknown=1,
  29. Asleep,
  30. Connected,
  31. Disconnected
  32. };
  33. public:
  34. LNetworkConnectionMonitor( QObject* parent = 0 );
  35. ~LNetworkConnectionMonitor();
  36. private slots:
  37. void onStateChange( uint newState );
  38. private:
  39. QDBusInterface* m_nmInterface;
  40. };
  41. #endif // LNETWORK_CONNECTION_MONITOR_H