File indexing completed on 2024-05-19 05:29:57

0001 /*
0002     SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz>
0003     SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KSERVICEACTIONCOMPONENT_H
0009 #define KSERVICEACTIONCOMPONENT_H
0010 
0011 #include "component.h"
0012 
0013 #include <KService>
0014 
0015 #include <memory>
0016 
0017 /**
0018  * @author Michael Jansen <kde@michael-jansen.biz>
0019  */
0020 class KServiceActionComponent : public Component
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     ~KServiceActionComponent() override;
0026 
0027     void loadFromService();
0028     void emitGlobalShortcutPressed(const GlobalShortcut &shortcut) override;
0029     void writeSettings(KConfigGroup &config) const override;
0030     void loadSettings(KConfigGroup &config) override;
0031     bool cleanUp() override;
0032 
0033 private:
0034     friend class ::GlobalShortcutsRegistry;
0035     //! Constructs a KServiceActionComponent. This is a private constuctor, to create
0036     //! a KServiceActionComponent, use GlobalShortcutsRegistry::self()->createServiceActionComponent().
0037     KServiceActionComponent(KService::Ptr service);
0038 
0039     KService::Ptr m_service;
0040 };
0041 
0042 #endif /* #ifndef KSERVICEACTIONCOMPONENT_H */