| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2017~2017 CSSlayer <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 |
*/ |
| 6 |
#ifndef _WIDGETSADDONS_FCITXQTCONFIGUIFACTORY_H_ |
| 7 |
#define _WIDGETSADDONS_FCITXQTCONFIGUIFACTORY_H_ |
| 8 |
|
| 9 |
#include <QMap> |
| 10 |
#include <QObject> |
| 11 |
#include <QStringList> |
| 12 |
|
| 13 |
#include "fcitx5qt5widgetsaddons_export.h" |
| 14 |
#include "fcitxqtconfiguiplugin.h" |
| 15 |
#include "fcitxqtconfiguiwidget.h" |
| 16 |
|
| 17 |
namespace fcitx { |
| 18 |
|
| 19 |
class FcitxQtConfigUIFactoryPrivate; |
| 20 |
/** |
| 21 |
* ui plugin factory. |
| 22 |
**/ |
| 23 |
class FCITX5QT5WIDGETSADDONS_EXPORT FcitxQtConfigUIFactory : public QObject { |
| 24 |
Q_OBJECT |
| 25 |
public: |
| 26 |
/** |
| 27 |
* create a plugin factory |
| 28 |
* |
| 29 |
* @param parent object parent |
| 30 |
**/ |
| 31 |
explicit FcitxQtConfigUIFactory(QObject *parent = 0); |
| 32 |
virtual ~FcitxQtConfigUIFactory(); |
| 33 |
/** |
| 34 |
* create widget based on file name, it might return 0 if there is no match |
| 35 |
* |
| 36 |
* @param file file name need to be configured |
| 37 |
* @return FcitxQtConfigUIWidget* |
| 38 |
**/ |
| 39 |
FcitxQtConfigUIWidget *create(const QString &file); |
| 40 |
/** |
| 41 |
* a simplified version of create, but it just test if there is a valid |
| 42 |
*entry or not |
| 43 |
* |
| 44 |
* @param file file name |
| 45 |
* @return bool |
| 46 |
**/ |
| 47 |
bool test(const QString &file); |
| 48 |
|
| 49 |
private: |
| 50 |
FcitxQtConfigUIFactoryPrivate *d_ptr; |
| 51 |
Q_DECLARE_PRIVATE(FcitxQtConfigUIFactory); |
| 52 |
}; |
| 53 |
} // namespace fcitx |
| 54 |
|
| 55 |
#endif // _WIDGETSADDONS_FCITXQTCONFIGUIFACTORY_H_ |