1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
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.
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.
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/>.
19
#ifndef DATABASECOMMAND_SETDYNAMICPLAYLISTREVISION_H
20
#define DATABASECOMMAND_SETDYNAMICPLAYLISTREVISION_H
22
#include "DatabaseCommand_SetPlaylistRevision.h"
23
#include "playlist/dynamic/GeneratorInterface.h"
25
using namespace Tomahawk;
27
class DatabaseCommand_SetDynamicPlaylistRevision : public DatabaseCommand_SetPlaylistRevision
30
Q_PROPERTY( QString type READ type WRITE setType )
31
Q_PROPERTY( int mode READ mode WRITE setMode )
32
Q_PROPERTY( QVariantList controls READ controlsV WRITE setControlsV )
35
explicit DatabaseCommand_SetDynamicPlaylistRevision( QObject* parent = 0 )
36
: DatabaseCommand_SetPlaylistRevision( parent )
39
explicit DatabaseCommand_SetDynamicPlaylistRevision( const source_ptr& s,
40
const QString& playlistguid,
41
const QString& newrev,
42
const QString& oldrev,
43
const QStringList& orderedguids,
44
const QList<Tomahawk::plentry_ptr>& addedentries,
45
const QList<plentry_ptr>& entries,
48
const QList< dyncontrol_ptr >& controls );
50
explicit DatabaseCommand_SetDynamicPlaylistRevision( const source_ptr& s,
51
const QString& playlistguid,
52
const QString& newrev,
53
const QString& oldrev,
56
const QList< dyncontrol_ptr >& controls );
58
QString commandname() const { return "setdynamicplaylistrevision"; }
60
virtual void exec( DatabaseImpl* lib );
61
virtual void postCommitHook();
62
virtual bool doesMutates() const { return true; }
63
virtual bool groupable() const { return true; }
65
void setControlsV( const QVariantList& vlist )
70
QVariantList controlsV();
72
QString type() const { return m_type; }
73
int mode() const { return (int)m_mode; }
75
void setType( const QString& type ) { m_type = type; }
76
void setMode( int mode ) { m_mode = (GeneratorMode)mode; }
78
void setPlaylist( DynamicPlaylist* pl ); // raw pointer b/c we don't have the shared pointer from inside the shared pointer
83
QList< dyncontrol_ptr > m_controls;
84
QList< QVariant > m_controlsV;
86
// ARG i hate sharedpointers sometimes
87
DynamicPlaylist* m_playlist; // Only used if setting revision of a non-autoloaded playlist, as those aren't able to be looked up by guid
90
#endif // DATABASECOMMAND_SETDYNAMICPLAYLISTREVISION_H