| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 |
*/ |
| 6 |
#ifndef _WIDGETSADDONS_FCITXQTCONFIGUIPLUGIN_H_ |
| 7 |
#define _WIDGETSADDONS_FCITXQTCONFIGUIPLUGIN_H_ |
| 8 |
|
| 9 |
#include "fcitx5qt5widgetsaddons_export.h" |
| 10 |
#include <QObject> |
| 11 |
#include <QString> |
| 12 |
#include <QStringList> |
| 13 |
|
| 14 |
namespace fcitx { |
| 15 |
|
| 16 |
class FcitxQtConfigUIWidget; |
| 17 |
|
| 18 |
/** |
| 19 |
* interface for qt config ui |
| 20 |
*/ |
| 21 |
struct FCITX5QT5WIDGETSADDONS_EXPORT FcitxQtConfigUIFactoryInterface { |
| 22 |
/** |
| 23 |
* create new widget based on key |
| 24 |
* |
| 25 |
* @see FcitxQtConfigUIPlugin::files |
| 26 |
* |
| 27 |
* @return plugin name |
| 28 |
*/ |
| 29 |
virtual FcitxQtConfigUIWidget *create(const QString &key) = 0; |
| 30 |
}; |
| 31 |
|
| 32 |
#define FcitxQtConfigUIFactoryInterface_iid \ |
| 33 |
"org.fcitx.Fcitx.FcitxQtConfigUIFactoryInterface" |
| 34 |
} // namespace fcitx |
| 35 |
|
| 36 |
Q_DECLARE_INTERFACE(fcitx::FcitxQtConfigUIFactoryInterface, |
| 37 |
FcitxQtConfigUIFactoryInterface_iid) |
| 38 |
namespace fcitx { |
| 39 |
|
| 40 |
/** |
| 41 |
* base class for qt config ui |
| 42 |
*/ |
| 43 |
class FCITX5QT5WIDGETSADDONS_EXPORT FcitxQtConfigUIPlugin |
| 44 |
: public QObject, |
| 45 |
public FcitxQtConfigUIFactoryInterface { |
| 46 |
Q_OBJECT |
| 47 |
Q_INTERFACES(fcitx::FcitxQtConfigUIFactoryInterface) |
| 48 |
public: |
| 49 |
explicit FcitxQtConfigUIPlugin(QObject *parent = 0); |
| 50 |
virtual ~FcitxQtConfigUIPlugin(); |
| 51 |
}; |
| 52 |
} // namespace fcitx |
| 53 |
|
| 54 |
#endif // _WIDGETSADDONS_FCITXQTCONFIGUIPLUGIN_H_ |