PageRenderTime 109ms CodeModel.GetById 61ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 7ms

/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
20#ifndef DATABASECOMMAND_LOADPLAYLIST_H
21#define DATABASECOMMAND_LOADPLAYLIST_H
22
23#include "DatabaseCommand.h"
24#include "DllMacro.h"
25#include "Playlist.h"
26
27#include <QObject>
28#include <QStringList>
29#include <QVariantMap>
30
31namespace Tomahawk
32{
33
34class DLLEXPORT DatabaseCommand_LoadPlaylistEntries : public DatabaseCommand
35{
36Q_OBJECT
37
38public:
39    explicit DatabaseCommand_LoadPlaylistEntries( QString revision_guid, QObject* parent = 0 );
40
41    virtual void exec( DatabaseImpl* );
42    virtual bool doesMutates() const { return false; }
43    virtual QString commandname() const { return "loadplaylistentries"; }
44
45    QString revisionGuid() const { return m_revguid; }
46
47signals:
48    void done( const QString& rev,
49               const QList<QString>& orderedguid,
50               const QList<QString>& oldorderedguid,
51               bool islatest,
52               const QMap< QString, Tomahawk::plentry_ptr >& added,
53               bool applied );
54
55protected:
56    void generateEntries( DatabaseImpl* dbi );
57
58    QStringList m_guids;
59    QMap< QString, Tomahawk::plentry_ptr > m_entrymap;
60    bool m_islatest;
61    QStringList m_oldentries;
62
63private:
64    QString m_revguid;
65};
66
67}
68
69#endif