// -*- c++ -*- /*! * * Copyright (C) 2015 Jolla Ltd. * * Contact: Valerio Valerio * Author: Andres Gomez * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ // // W A R N I N G // ------------- // // This file is not part of the public API. This header file may // change from version to version without notice, or even be // removed. // // We mean it. // // #ifndef MPRISPLAYER_P_H #define MPRISPLAYER_P_H #include #include QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; QT_END_NAMESPACE class MprisPlayer; /* * Adaptor class for interface org.mpris.MediaPlayer2 */ class MprisRootAdaptor: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.mpris.MediaPlayer2") Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: MprisRootAdaptor(MprisPlayer *parent); virtual ~MprisRootAdaptor(); public: // PROPERTIES Q_PROPERTY(bool CanQuit READ canQuit) bool canQuit() const; Q_PROPERTY(bool CanRaise READ canRaise) bool canRaise() const; Q_PROPERTY(bool CanSetFullscreen READ canSetFullscreen) bool canSetFullscreen() const; Q_PROPERTY(QString DesktopEntry READ desktopEntry) QString desktopEntry() const; Q_PROPERTY(bool Fullscreen READ fullscreen WRITE setFullscreen) bool fullscreen() const; void setFullscreen(bool value); Q_PROPERTY(bool HasTrackList READ hasTrackList) bool hasTrackList() const; Q_PROPERTY(QString Identity READ identity) QString identity() const; Q_PROPERTY(QStringList SupportedMimeTypes READ supportedMimeTypes) QStringList supportedMimeTypes() const; Q_PROPERTY(QStringList SupportedUriSchemes READ supportedUriSchemes) QStringList supportedUriSchemes() const; public Q_SLOTS: // METHODS void Quit(); void Raise(); Q_SIGNALS: // SIGNALS private Q_SLOTS: void onCanQuitChanged() const; void onCanRaiseChanged() const; void onCanSetFullscreenChanged() const; void onDesktopEntryChanged() const; void onFullscreenChanged() const; void onHasTrackListChanged() const; void onIdentityChanged() const; void onSupportedUriSchemesChanged() const; void onSupportedMimeTypesChanged() const; }; /* * Adaptor class for interface org.mpris.MediaPlayer2.Player */ class MprisPlayerAdaptor: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.mpris.MediaPlayer2.Player") Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: MprisPlayerAdaptor(MprisPlayer *parent); virtual ~MprisPlayerAdaptor(); public: // PROPERTIES Q_PROPERTY(bool CanControl READ canControl) bool canControl() const; Q_PROPERTY(bool CanGoNext READ canGoNext) bool canGoNext() const; Q_PROPERTY(bool CanGoPrevious READ canGoPrevious) bool canGoPrevious() const; Q_PROPERTY(bool CanPause READ canPause) bool canPause() const; Q_PROPERTY(bool CanPlay READ canPlay) bool canPlay() const; Q_PROPERTY(bool CanSeek READ canSeek) bool canSeek() const; Q_PROPERTY(QString LoopStatus READ loopStatus WRITE setLoopStatus) QString loopStatus() const; void setLoopStatus(const QString &value); Q_PROPERTY(double MaximumRate READ maximumRate) double maximumRate() const; Q_PROPERTY(QVariantMap Metadata READ metadata) QVariantMap metadata() const; Q_PROPERTY(double MinimumRate READ minimumRate) double minimumRate() const; Q_PROPERTY(QString PlaybackStatus READ playbackStatus) QString playbackStatus() const; Q_PROPERTY(qlonglong Position READ position) qlonglong position() const; Q_PROPERTY(double Rate READ rate WRITE setRate) double rate() const; void setRate(double value); Q_PROPERTY(bool Shuffle READ shuffle WRITE setShuffle) bool shuffle() const; void setShuffle(bool value); Q_PROPERTY(double Volume READ volume WRITE setVolume) double volume() const; void setVolume(double value); public Q_SLOTS: // METHODS void Next(); void OpenUri(const QString &Uri); void Pause(); void Play(); void PlayPause(); void Previous(); void Seek(qlonglong Offset); void SetPosition(const QDBusObjectPath &TrackId, qlonglong Position); void Stop(); Q_SIGNALS: // SIGNALS void Seeked(qlonglong Position); private Q_SLOTS: void onCanControlChanged() const; void onCanGoNextChanged() const; void onCanGoPreviousChanged() const; void onCanPauseChanged() const; void onCanPlayChanged() const; void onCanSeekChanged() const; void onLoopStatusChanged() const; void onMaximumRateChanged() const; void onMetadataChanged() const; void onMinimumRateChanged() const; void onPlaybackStatusChanged() const; void onRateChanged() const; void onShuffleChanged() const; void onVolumeChanged() const; }; #endif /* MPRISPLAYER_P_H */