/src/libtomahawk/database/DatabaseCommand_ModifyPlaylist.h
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 19#ifndef DATABASECOMMAND_MODIFYPLAYLIST_H 20#define DATABASECOMMAND_MODIFYPLAYLIST_H 21 22#include <QObject> 23#include <QVariantMap> 24 25#include "Typedefs.h" 26#include "DatabaseCommand.h" 27 28#include "DllMacro.h" 29 30namespace Tomahawk 31{ 32 33class DLLEXPORT DatabaseCommand_ModifyPlaylist : public DatabaseCommand 34{ 35Q_OBJECT 36Q_PROPERTY( int mode READ mode WRITE setMode ) 37 38public: 39 enum Mode 40 { 41 ADD = 1, 42 REMOVE = 2, 43 UPDATE = 3 44 }; 45 46 explicit DatabaseCommand_ModifyPlaylist( Tomahawk::Playlist* playlist, const QList< Tomahawk::plentry_ptr >& entries, Mode mode ); 47 virtual ~DatabaseCommand_ModifyPlaylist(); 48 49 virtual bool doesMutates() const { return true; } 50 51 virtual void exec( DatabaseImpl* lib ); 52 53 int mode() const { return m_mode; } 54 void setMode( int m ) { m_mode = (Mode)m; } 55 56private: 57 Tomahawk::Playlist* m_playlist; 58 QList< Tomahawk::plentry_ptr > m_entries; 59 Mode m_mode; 60}; 61 62} 63 64#endif // DATABASECOMMAND_MODIFYPLAYLIST_H