File indexing completed on 2023-05-30 11:30:45
0001 /** 0002 * Copyright (C) 2009 Michael Pyne <mpyne@kde.org> 0003 * 0004 * This program is free software; you can redistribute it and/or modify it under 0005 * the terms of the GNU General Public License as published by the Free Software 0006 * Foundation; either version 2 of the License, or (at your option) any later 0007 * version. 0008 * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY 0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details. 0012 * 0013 * You should have received a copy of the GNU General Public License along with 0014 * this program. If not, see <http://www.gnu.org/licenses/>. 0015 */ 0016 0017 #ifndef DBUS_COLLECTION_PROXY_H 0018 #define DBUS_COLLECTION_PROXY_H 0019 0020 #include <QObject> 0021 #include <QStringList> // Required for Q_CLASSINFO ? 0022 0023 class PlaylistCollection; 0024 0025 class DBusCollectionProxy : public QObject 0026 { 0027 Q_OBJECT 0028 Q_CLASSINFO("D-Bus Interface", "org.kde.juk.collection") 0029 0030 public: 0031 DBusCollectionProxy (QObject *parent, PlaylistCollection *collection); 0032 ~DBusCollectionProxy(); 0033 0034 public slots: // Expose to D-Bus 0035 void openFile(const QString &file); 0036 void openFile(const QStringList &files); 0037 void openFile(const QString &playlist, const QString &file); 0038 void openFile(const QString &playlist, const QStringList &files); 0039 0040 QString visiblePlaylist(); 0041 QString playingPlaylist(); 0042 QStringList playlists(); 0043 QStringList playlistTracks(const QString &playlist); 0044 QString trackProperty(const QString &file, const QString &property); 0045 0046 void createPlaylist(const QString &name); 0047 void setPlaylist(const QString &name); 0048 void remove(); 0049 void removeTrack(const QString &playlist, const QStringList &files); 0050 0051 /** 0052 * Returns the path to the cover art for the given file. Returns the empty 0053 * string if the track has no cover art. Some tracks have embedded cover 0054 * art -- in this case JuK returns the path to a temporary file with the 0055 * extracted cover art. 0056 */ 0057 QString trackCover(const QString &track); 0058 0059 private: 0060 PlaylistCollection *m_collection; 0061 QString m_lastCover; 0062 }; 0063 0064 #endif /* DBUS_COLLECTION_PROXY_H */ 0065 0066 // vim: set et sw=4 tw=0 sta: