/src/libtomahawk/database/DatabaseCommand_ModifyPlaylist.h

http://github.com/tomahawk-player/tomahawk · C Header · 64 lines · 33 code · 14 blank · 17 comment · 0 complexity · c62d23c55effe1f27fcde1a21f2b9d06 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_MODIFYPLAYLIST_H
  19. #define DATABASECOMMAND_MODIFYPLAYLIST_H
  20. #include <QObject>
  21. #include <QVariantMap>
  22. #include "Typedefs.h"
  23. #include "DatabaseCommand.h"
  24. #include "DllMacro.h"
  25. namespace Tomahawk
  26. {
  27. class DLLEXPORT DatabaseCommand_ModifyPlaylist : public DatabaseCommand
  28. {
  29. Q_OBJECT
  30. Q_PROPERTY( int mode READ mode WRITE setMode )
  31. public:
  32. enum Mode
  33. {
  34. ADD = 1,
  35. REMOVE = 2,
  36. UPDATE = 3
  37. };
  38. explicit DatabaseCommand_ModifyPlaylist( Tomahawk::Playlist* playlist, const QList< Tomahawk::plentry_ptr >& entries, Mode mode );
  39. virtual ~DatabaseCommand_ModifyPlaylist();
  40. virtual bool doesMutates() const { return true; }
  41. virtual void exec( DatabaseImpl* lib );
  42. int mode() const { return m_mode; }
  43. void setMode( int m ) { m_mode = (Mode)m; }
  44. private:
  45. Tomahawk::Playlist* m_playlist;
  46. QList< Tomahawk::plentry_ptr > m_entries;
  47. Mode m_mode;
  48. };
  49. }
  50. #endif // DATABASECOMMAND_MODIFYPLAYLIST_H