PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 5ms RepoModel.GetById 36ms app.codeStats 0ms

/src/libtomahawk/database/DatabaseCommand_RenamePlaylist.h

http://github.com/tomahawk-player/tomahawk
C Header | 64 lines | 32 code | 15 blank | 17 comment | 0 complexity | db8afd0a9a09803715c66c2da678f920 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_RENAMEPLAYLIST_H
20#define DATABASECOMMAND_RENAMEPLAYLIST_H
21
22#include "Typedefs.h"
23#include "DatabaseCommandLoggable.h"
24
25#include "DllMacro.h"
26
27namespace Tomahawk
28{
29
30class DatabaseImpl;
31
32class DLLEXPORT DatabaseCommand_RenamePlaylist : public DatabaseCommandLoggable
33{
34Q_OBJECT
35Q_PROPERTY( QString playlistguid READ playlistguid WRITE setPlaylistguid )
36Q_PROPERTY( QString playlistTitle READ playlistTitle WRITE setPlaylistTitle )
37
38public:
39    explicit DatabaseCommand_RenamePlaylist( QObject* parent = 0 )
40            : DatabaseCommandLoggable( parent )
41    {}
42
43    explicit DatabaseCommand_RenamePlaylist( const Tomahawk::source_ptr& source, const QString& playlistguid, const QString& playlistTitle );
44
45    QString commandname() const { return "renameplaylist"; }
46
47    virtual void exec( DatabaseImpl* lib );
48    virtual void postCommitHook();
49    virtual bool doesMutates() const { return true; }
50
51    QString playlistguid() const { return m_playlistguid; }
52    void setPlaylistguid( const QString& s ) { m_playlistguid = s; }
53
54    QString playlistTitle() const { return m_playlistTitle; }
55    void setPlaylistTitle( const QString& s ) { m_playlistTitle = s; }
56
57private:
58    QString m_playlistguid;
59    QString m_playlistTitle;
60};
61
62}
63
64#endif // DATABASECOMMAND_RENAMEPLAYLIST_H