KGlobalAccel

kserviceactioncomponent.h
1 /*
2  SPDX-FileCopyrightText: 2008 Michael Jansen <[email protected]>
3  SPDX-FileCopyrightText: 2016 Marco Martin <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef KSERVICEACTIONCOMPONENT_H
9 #define KSERVICEACTIONCOMPONENT_H
10 
11 #include "component.h"
12 
13 #include <KDesktopFile>
14 
15 namespace KdeDGlobalAccel
16 {
17 /**
18  * @author Michael Jansen <[email protected]>
19  */
21 {
22  Q_OBJECT
23 
24 public:
25  //! Creates a new component. The component will be registered with @p
26  //! registry if specified and registered with dbus.
27  KServiceActionComponent(const QString &serviceStorageId, const QString &friendlyName, GlobalShortcutsRegistry *registry = nullptr);
28 
29  ~KServiceActionComponent() override;
30 
31  void loadFromService();
32  void emitGlobalShortcutPressed(const GlobalShortcut &shortcut) override;
33 
34  bool cleanUp() override;
35 
36 private:
37  QString m_serviceStorageId;
38  QScopedPointer<KDesktopFile> m_desktopFile;
39 };
40 
41 }
42 
43 #endif /* #ifndef COMPONENT_H */
bool cleanUp() override
Remove all currently not used global shortcuts registrations for this component and if nothing is lef...
Global Shortcut Registry.
Q_OBJECTQ_OBJECT
QString friendlyName() const
Returns the friendly name.
Represents a global shortcut.
KServiceActionComponent(const QString &serviceStorageId, const QString &friendlyName, GlobalShortcutsRegistry *registry=nullptr)
Creates a new component.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Sep 23 2021 22:54:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.