/src/libtomahawk/database/DatabaseCommand_PlaybackHistory.h

http://github.com/tomahawk-player/tomahawk · C Header · 65 lines · 36 code · 12 blank · 17 comment · 0 complexity · 449b4758e71853a2f2363cf19172f9ee MD5 · raw file

  1. /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2. *
  3. * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
  4. *
  5. * Tomahawk 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. *
  10. * Tomahawk is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef DATABASECOMMAND_PLAYBACKHISTORY_H
  19. #define DATABASECOMMAND_PLAYBACKHISTORY_H
  20. #include <QDateTime>
  21. #include <QObject>
  22. #include <QVariantMap>
  23. #include "DatabaseCommand.h"
  24. #include "Track.h"
  25. #include "Typedefs.h"
  26. #include "DllMacro.h"
  27. namespace Tomahawk
  28. {
  29. class DLLEXPORT DatabaseCommand_PlaybackHistory : public DatabaseCommand
  30. {
  31. Q_OBJECT
  32. public:
  33. explicit DatabaseCommand_PlaybackHistory( const Tomahawk::source_ptr& source, QObject* parent = 0 )
  34. : DatabaseCommand( parent )
  35. , m_amount( 0 )
  36. {
  37. setSource( source );
  38. }
  39. virtual void exec( DatabaseImpl* );
  40. virtual bool doesMutates() const { return false; }
  41. virtual QString commandname() const { return "playbackhistory"; }
  42. void setLimit( unsigned int amount ) { m_amount = amount; }
  43. void setDateFrom( const QDate& date ) { m_dateFrom = date; }
  44. void setDateTo( const QDate& date ) { m_dateTo = date; }
  45. signals:
  46. void tracks( const QList<Tomahawk::track_ptr>& tracks, QList<Tomahawk::PlaybackLog> logs );
  47. private:
  48. unsigned int m_amount;
  49. QDate m_dateFrom;
  50. QDate m_dateTo;
  51. };
  52. }
  53. #endif // DATABASECOMMAND_PLAYBACKHISTORY_H