PageRenderTime 88ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 6ms

/src/libtomahawk/database/DatabaseCommand_LoadFiles.h

http://github.com/tomahawk-player/tomahawk
C Header | 62 lines | 29 code | 11 blank | 22 comment | 0 complexity | 7c860e0112a8bc7e1a0443d098c52e19 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_LOADFILES_H
20#define DATABASECOMMAND_LOADFILES_H
21
22#include <QObject>
23#include <QVariantMap>
24#include <QStringList>
25#include <QMap>
26
27#include "DatabaseCommand.h"
28#include "Result.h"
29#include "DllMacro.h"
30
31namespace Tomahawk
32{
33
34/**
35  Loads a result_ptr from the database from a track dbid.
36
37  If use use the QStringList constructor, isten to results() instead of result()
38  */
39class DLLEXPORT DatabaseCommand_LoadFiles : public DatabaseCommand
40{
41Q_OBJECT
42
43public:
44    explicit DatabaseCommand_LoadFiles( unsigned int id, QObject* parent = 0 );
45    explicit DatabaseCommand_LoadFiles( const QList<unsigned int>& ids, QObject* parent = 0 );
46
47    virtual void exec( DatabaseImpl* );
48    virtual bool doesMutates() const { return false; }
49    virtual QString commandname() const { return "loadfiles"; }
50
51signals:
52    void result( const Tomahawk::result_ptr& result );
53    void results( const QList<Tomahawk::result_ptr>& results );
54
55private:
56    bool m_single;
57    QList<unsigned int> m_ids;
58};
59
60}
61
62#endif // DATABASECOMMAND_LOADFILE_H