2010-05-17 13:06:50 +02:00
|
|
|
/* This file is part of Clementine.
|
2014-11-02 19:36:21 +01:00
|
|
|
Copyright 2010-2011, David Sansome <me@davidsansome.com>
|
|
|
|
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
|
|
|
|
Copyright 2014, John Maguire <john.maguire@gmail.com>
|
2010-05-17 13:06:50 +02:00
|
|
|
|
|
|
|
Clementine 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 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
#ifndef CORE_GNOMEGLOBALSHORTCUTBACKEND_H_
|
|
|
|
#define CORE_GNOMEGLOBALSHORTCUTBACKEND_H_
|
2010-05-17 13:06:50 +02:00
|
|
|
|
|
|
|
#include "globalshortcutbackend.h"
|
|
|
|
|
2011-01-22 13:47:19 +01:00
|
|
|
class OrgGnomeSettingsDaemonMediaKeysInterface;
|
2010-05-17 13:06:50 +02:00
|
|
|
|
2011-10-14 23:01:25 +02:00
|
|
|
class QDBusPendingCallWatcher;
|
|
|
|
|
2010-05-17 13:06:50 +02:00
|
|
|
class GnomeGlobalShortcutBackend : public GlobalShortcutBackend {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2014-11-01 19:26:05 +01:00
|
|
|
explicit GnomeGlobalShortcutBackend(GlobalShortcuts* parent);
|
2010-05-17 13:06:50 +02:00
|
|
|
|
|
|
|
static const char* kGsdService;
|
2019-01-09 05:11:28 +01:00
|
|
|
static const char* kGsdService2;
|
2010-05-17 13:06:50 +02:00
|
|
|
static const char* kGsdPath;
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
protected:
|
2011-01-10 00:11:51 +01:00
|
|
|
bool RegisterInNewThread() const { return true; }
|
2010-05-17 13:06:50 +02:00
|
|
|
bool DoRegister();
|
|
|
|
void DoUnregister();
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private slots:
|
2011-10-14 23:01:25 +02:00
|
|
|
void RegisterFinished(QDBusPendingCallWatcher* watcher);
|
|
|
|
|
2010-05-17 13:06:50 +02:00
|
|
|
void GnomeMediaKeyPressed(const QString& application, const QString& key);
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2011-01-22 13:47:19 +01:00
|
|
|
OrgGnomeSettingsDaemonMediaKeysInterface* interface_;
|
2011-10-14 23:01:25 +02:00
|
|
|
bool is_connected_;
|
2010-05-17 13:06:50 +02:00
|
|
|
};
|
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
#endif // CORE_GNOMEGLOBALSHORTCUTBACKEND_H_
|