PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/src/libtomahawk/database/DatabaseCommand_Resolve.h

http://github.com/tomahawk-player/tomahawk
C Header | 63 lines | 32 code | 14 blank | 17 comment | 0 complexity | 3096e48ca4b48ddc429f7f7a1812e75c 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_RESOLVE_H
20#define DATABASECOMMAND_RESOLVE_H
21
22#include "DatabaseCommand.h"
23#include "DatabaseImpl.h"
24#include "Result.h"
25#include "Artist.h"
26#include "Album.h"
27
28#include <QVariant>
29
30#include "DllMacro.h"
31
32namespace Tomahawk
33{
34
35class DLLEXPORT DatabaseCommand_Resolve : public DatabaseCommand
36{
37Q_OBJECT
38public:
39    explicit DatabaseCommand_Resolve( const Tomahawk::query_ptr& query );
40    virtual ~DatabaseCommand_Resolve();
41
42    QString commandname() const override { return "dbresolve"; }
43    bool doesMutates() const override { return false; }
44
45    void exec( DatabaseImpl *lib ) override;
46
47signals:
48    void results( Tomahawk::QID qid, QList<Tomahawk::result_ptr> results );
49    void albums( Tomahawk::QID qid, QList<Tomahawk::album_ptr> albums );
50    void artists( Tomahawk::QID qid, QList<Tomahawk::artist_ptr> artists );
51
52private:
53    DatabaseCommand_Resolve();
54
55    void fullTextResolve( DatabaseImpl* lib );
56    void resolve( DatabaseImpl* lib );
57
58    Tomahawk::query_ptr m_query;
59};
60
61}
62
63#endif // DATABASECOMMAND_RESOLVE_H