File indexing completed on 2024-05-12 04:19:46
0001 /* 0002 Gwenview: an image viewer 0003 Copyright 2018 Friedrich W. H. Kossebau <kossebau@kde.org> 0004 0005 This program is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU General Public License 0007 as published by the Free Software Foundation; either version 2 0008 of the License, or (at your option) any later version. 0009 0010 This program is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 GNU General Public License for more details. 0014 0015 You should have received a copy of the GNU General Public License 0016 along with this program; if not, write to the Free Software 0017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef MPRIS2SERVICE_H 0021 #define MPRIS2SERVICE_H 0022 0023 #include <gwenviewlib_export.h> 0024 // Qt 0025 #include <QAction> 0026 #include <QObject> 0027 #include <QString> 0028 0029 class QAction; 0030 0031 namespace Gwenview 0032 { 0033 class SlideShow; 0034 class ContextManager; 0035 0036 class GWENVIEWLIB_EXPORT Mpris2Service : public QObject 0037 { 0038 Q_OBJECT 0039 0040 public: 0041 Mpris2Service(SlideShow *slideShow, 0042 ContextManager *contextManager, 0043 QAction *toggleSlideShowAction, 0044 QAction *fullScreenAction, 0045 QAction *previousAction, 0046 QAction *nextAction, 0047 QObject *parent); 0048 ~Mpris2Service() override; 0049 0050 private: 0051 void registerOnDBus(); 0052 void unregisterOnDBus(); 0053 0054 void onLockScreenLockedChanged(bool isLocked); 0055 0056 private: 0057 QString mMpris2ServiceName; 0058 void onFullScreenActionToggled(); 0059 QAction *m_fullscreenAction; 0060 }; 0061 0062 } 0063 0064 #endif