File indexing completed on 2024-05-12 05:37:16

0001 /*
0002     SPDX-FileCopyrightText: 2009 Chani Armitage <chani@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QMenu>
0010 
0011 #include <KServiceGroup>
0012 
0013 #include <plasma/containmentactions.h>
0014 
0015 #include "ui_config.h"
0016 
0017 class QAction;
0018 
0019 class AppLauncher : public Plasma::ContainmentActions
0020 {
0021     Q_OBJECT
0022 public:
0023     AppLauncher(QObject *parent, const QVariantList &args);
0024     ~AppLauncher() override;
0025 
0026     void init(const KConfigGroup &config);
0027 
0028     QList<QAction *> contextualActions() override;
0029 
0030     QWidget *createConfigurationInterface(QWidget *parent) override;
0031     void configurationAccepted() override;
0032 
0033     void restore(const KConfigGroup &config) override;
0034     void save(KConfigGroup &config) override;
0035 
0036 protected:
0037     void makeMenu(QMenu *menu, const KServiceGroup::Ptr &group);
0038 
0039 private:
0040     KServiceGroup::Ptr m_group;
0041     QList<QAction *> m_actions;
0042 
0043     Ui::Config m_ui;
0044     bool m_showAppsByName = true;
0045 };