/src/libtomahawk/database/DatabaseCommand_LoadAllPlaylists.h

http://github.com/tomahawk-player/tomahawk · C Header · 81 lines · 36 code · 15 blank · 30 comment · 0 complexity · 084b8ff8d506543076e64c446868d5da 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 2011, Leo Franchi <lfranchi@kde.org>
  5. * Copyright 2013, Uwe L. Korn <uwelk@xhochy.com>
  6. *
  7. * Tomahawk is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * Tomahawk is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #pragma once
  21. #ifndef DATABASECOMMAND_LOADALLPLAYLIST_H
  22. #define DATABASECOMMAND_LOADALLPLAYLIST_H
  23. #include "DatabaseCommand.h"
  24. namespace Tomahawk
  25. {
  26. class DatabaseCommand_LoadAllPlaylistsPrivate;
  27. class DLLEXPORT DatabaseCommand_LoadAllPlaylists : public DatabaseCommand
  28. {
  29. Q_OBJECT
  30. public:
  31. enum SortOrder {
  32. None = 0,
  33. ModificationTime = 1
  34. };
  35. enum SortAscDesc {
  36. NoOrder = 0,
  37. Ascending = 1,
  38. Descending = 2
  39. };
  40. explicit DatabaseCommand_LoadAllPlaylists( const Tomahawk::source_ptr& s, QObject* parent = 0 );
  41. virtual void exec( DatabaseImpl* );
  42. virtual bool doesMutates() const { return false; }
  43. virtual QString commandname() const { return "loadallplaylists"; }
  44. void setLimit( unsigned int limit );
  45. void setSortOrder( SortOrder order );
  46. void setSortDescending( bool descending );
  47. /**
  48. * By default, only playlists with no revision will be loaded as fully
  49. * loading a revision is a lot of work which cannot be integrated into
  50. * one query.
  51. *
  52. * Often one only needs to know the trackIds of a playlist, not the
  53. * whole revision information.
  54. */
  55. void setReturnPlEntryIds( bool returnPlEntryIds );
  56. signals:
  57. void done( const QList<Tomahawk::playlist_ptr>& playlists );
  58. /**
  59. * This signal is only emitted if returnTrackIds == true.
  60. */
  61. void done( const QHash< Tomahawk::playlist_ptr, QStringList >& playlists );
  62. private:
  63. Q_DECLARE_PRIVATE( DatabaseCommand_LoadAllPlaylists )
  64. };
  65. } // namespace Tomahawk
  66. #endif // DATABASECOMMAND_LOADALLPLAYLIST_H