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 <davidsansome@gmail.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_GLOBALSHORTCUTBACKEND_H_
|
|
|
|
#define CORE_GLOBALSHORTCUTBACKEND_H_
|
2010-05-17 13:06:50 +02:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class GlobalShortcuts;
|
|
|
|
|
|
|
|
class GlobalShortcutBackend : public QObject {
|
2011-01-10 00:11:51 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2014-11-01 19:26:05 +01:00
|
|
|
explicit GlobalShortcutBackend(GlobalShortcuts* parent = nullptr);
|
2010-05-17 13:06:50 +02:00
|
|
|
virtual ~GlobalShortcutBackend() {}
|
|
|
|
|
|
|
|
bool is_active() const { return active_; }
|
|
|
|
|
2011-01-22 13:47:19 +01:00
|
|
|
bool Register();
|
2010-05-17 13:06:50 +02:00
|
|
|
void Unregister();
|
2011-01-10 00:11:51 +01:00
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
signals:
|
2011-01-10 00:11:51 +01:00
|
|
|
void RegisterFinished(bool success);
|
2010-05-17 13:06:50 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
protected:
|
2010-05-17 13:06:50 +02:00
|
|
|
virtual bool DoRegister() = 0;
|
|
|
|
virtual void DoUnregister() = 0;
|
|
|
|
|
|
|
|
GlobalShortcuts* manager_;
|
|
|
|
bool active_;
|
|
|
|
};
|
|
|
|
|
2014-11-01 19:26:05 +01:00
|
|
|
#endif // CORE_GLOBALSHORTCUTBACKEND_H_
|