Qmmp
general.h
1 /***************************************************************************
2  * Copyright (C) 2008-2013 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 
28 class QmmpUiPluginCache;
29 
33 class General
34 {
35 public:
40  static void create(QObject *parent);
44  static QList<GeneralFactory *> factories();
48  static QList<GeneralFactory *> enabledFactories();
53  static QString file(GeneralFactory *factory);
59  static void setEnabled(GeneralFactory* factory, bool enable = true);
65  static void showSettings(GeneralFactory* factory, QWidget* parentWidget);
70  static bool isEnabled(GeneralFactory* factory);
71 
72 private:
73  static void loadPlugins();
74  static QHash <GeneralFactory*, QObject*> *m_generals;
75  static QObject *m_parent;
76  static QList<QmmpUiPluginCache*> *m_cache;
77  static QStringList m_enabledNames;
78 };
79 
80 #endif
static void showSettings(GeneralFactory *factory, QWidget *parentWidget)
The General class provides simple access to general plugins.
Definition: general.h:33
static QList< GeneralFactory * > factories()
static void create(QObject *parent)
static void setEnabled(GeneralFactory *factory, bool enable=true)
static QList< GeneralFactory * > enabledFactories()
General plugin interface.
Definition: generalfactory.h:55
static QString file(GeneralFactory *factory)
static bool isEnabled(GeneralFactory *factory)