dbuscollectionproxy.h 2.18 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/**
 * Copyright (C) 2009 Michael Pyne <mpyne@kde.org>
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */
16 17 18 19

#ifndef DBUS_COLLECTION_PROXY_H
#define DBUS_COLLECTION_PROXY_H

Michael Pyne's avatar
Michael Pyne committed
20 21
#include <QObject>
#include <QStringList> // Required for Q_CLASSINFO ?
22 23 24 25 26 27 28 29 30 31

class PlaylistCollection;

class DBusCollectionProxy : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "org.kde.juk.collection")

public:
    DBusCollectionProxy (QObject *parent, PlaylistCollection *collection);
32
    ~DBusCollectionProxy();
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

public slots: // Expose to D-Bus
    void openFile(const QString &file);
    void openFile(const QStringList &files);
    void openFile(const QString &playlist, const QString &file);
    void openFile(const QString &playlist, const QStringList &files);

    QString visiblePlaylist();
    QString playingPlaylist();
    QStringList playlists();
    QStringList playlistTracks(const QString &playlist);
    QString trackProperty(const QString &file, const QString &property);

    void createPlaylist(const QString &name);
    void setPlaylist(const QString &name);
    void remove();
    void removeTrack(const QString &playlist, const QStringList &files);

51 52 53 54 55 56 57 58
    /**
     * Returns the path to the cover art for the given file.  Returns the empty
     * string if the track has no cover art.  Some tracks have embedded cover
     * art -- in this case JuK returns the path to a temporary file with the
     * extracted cover art.
     */
    QString trackCover(const QString &track);

59 60
private:
    PlaylistCollection *m_collection;
61
    QString m_lastCover;
62 63 64 65 66
};

#endif /* DBUS_COLLECTION_PROXY_H */

// vim: set et sw=4 tw=0 sta: