/src/libtomahawk/database/DatabaseCommand_LoadPlaylistEntries.h

http://github.com/tomahawk-player/tomahawk · C Header · 69 lines · 37 code · 14 blank · 18 comment · 0 complexity · 00f41b2bea607638527b775d43464143 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. * Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
  5. *
  6. * Tomahawk is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Tomahawk is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef DATABASECOMMAND_LOADPLAYLIST_H
  20. #define DATABASECOMMAND_LOADPLAYLIST_H
  21. #include "DatabaseCommand.h"
  22. #include "DllMacro.h"
  23. #include "Playlist.h"
  24. #include <QObject>
  25. #include <QStringList>
  26. #include <QVariantMap>
  27. namespace Tomahawk
  28. {
  29. class DLLEXPORT DatabaseCommand_LoadPlaylistEntries : public DatabaseCommand
  30. {
  31. Q_OBJECT
  32. public:
  33. explicit DatabaseCommand_LoadPlaylistEntries( QString revision_guid, QObject* parent = 0 );
  34. virtual void exec( DatabaseImpl* );
  35. virtual bool doesMutates() const { return false; }
  36. virtual QString commandname() const { return "loadplaylistentries"; }
  37. QString revisionGuid() const { return m_revguid; }
  38. signals:
  39. void done( const QString& rev,
  40. const QList<QString>& orderedguid,
  41. const QList<QString>& oldorderedguid,
  42. bool islatest,
  43. const QMap< QString, Tomahawk::plentry_ptr >& added,
  44. bool applied );
  45. protected:
  46. void generateEntries( DatabaseImpl* dbi );
  47. QStringList m_guids;
  48. QMap< QString, Tomahawk::plentry_ptr > m_entrymap;
  49. bool m_islatest;
  50. QStringList m_oldentries;
  51. private:
  52. QString m_revguid;
  53. };
  54. }
  55. #endif