/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. #ifndef DATABASECOMMAND_RESOLVE_H
  19. #define DATABASECOMMAND_RESOLVE_H
  20. #include "DatabaseCommand.h"
  21. #include "DatabaseImpl.h"
  22. #include "Result.h"
  23. #include "Artist.h"
  24. #include "Album.h"
  25. #include <QVariant>
  26. #include "DllMacro.h"
  27. namespace Tomahawk
  28. {
  29. class DLLEXPORT DatabaseCommand_Resolve : public DatabaseCommand
  30. {
  31. Q_OBJECT
  32. public:
  33. explicit DatabaseCommand_Resolve( const Tomahawk::query_ptr& query );
  34. virtual ~DatabaseCommand_Resolve();
  35. QString commandname() const override { return "dbresolve"; }
  36. bool doesMutates() const override { return false; }
  37. void exec( DatabaseImpl *lib ) override;
  38. signals:
  39. void results( Tomahawk::QID qid, QList<Tomahawk::result_ptr> results );
  40. void albums( Tomahawk::QID qid, QList<Tomahawk::album_ptr> albums );
  41. void artists( Tomahawk::QID qid, QList<Tomahawk::artist_ptr> artists );
  42. private:
  43. DatabaseCommand_Resolve();
  44. void fullTextResolve( DatabaseImpl* lib );
  45. void resolve( DatabaseImpl* lib );
  46. Tomahawk::query_ptr m_query;
  47. };
  48. }
  49. #endif // DATABASECOMMAND_RESOLVE_H