Qmmp
general.h
1 /***************************************************************************
2  * Copyright (C) 2008-2022 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 #ifndef GENERAL_H
21 #define GENERAL_H
22 
23 #include <QObject>
24 #include <QStringList>
25 #include <QHash>
26 #include "generalfactory.h"
27 #include "qmmpui_export.h"
28 
29 class QmmpUiPluginCache;
30 
34 class QMMPUI_EXPORT General
35 {
36 public:
41  static void create(QObject *parent);
45  static QList<GeneralFactory *> factories();
49  static QList<GeneralFactory *> enabledFactories();
53  static QStringList enabledWidgets();
58  static WidgetDescription widgetDescription(const QString &id);
65  static QWidget *createWidget(const QString &id, QWidget *parent);
70  static QString file(const GeneralFactory *factory);
76  static void setEnabled(GeneralFactory *factory, bool enable = true);
82  static void showSettings(GeneralFactory *factory, QWidget *parentWidget);
87  static bool isEnabled(const GeneralFactory* factory);
88 
89 private:
90  General() {}
91  ~General() {}
92  static void loadPlugins();
93  static QHash <GeneralFactory*, QObject*> *m_generals;
94  static QObject *m_parent;
95  static QList<QmmpUiPluginCache*> *m_cache;
96  static QStringList m_enabledNames;
97 };
98 
99 #endif
General plugin interface.
Definition: generalfactory.h:61
The General class provides simple access to general plugins.
Definition: general.h:35
static QString file(const GeneralFactory *factory)
static QList< GeneralFactory * > enabledFactories()
static void create(QObject *parent)
static void setEnabled(GeneralFactory *factory, bool enable=true)
static QStringList enabledWidgets()
static bool isEnabled(const GeneralFactory *factory)
static WidgetDescription widgetDescription(const QString &id)
static QWidget * createWidget(const QString &id, QWidget *parent)
static QList< GeneralFactory * > factories()
static void showSettings(GeneralFactory *factory, QWidget *parentWidget)
Structure to store widget description provided by general plugin.
Definition: generalfactory.h:35