Debian Codegraph @

qt5/widgetsaddons/fcitxqtconfiguifactory.h

raw
1 /***************************************************************************
2 * Copyright (C) 2012~2012 by CSSlayer *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
19
20 #ifndef FCITX_QT_CONFIG_UI_FACTORY_H
21 #define FCITX_QT_CONFIG_UI_FACTORY_H
22
23 #include <QtCore/QMap>
24 #include <QtCore/QObject>
25 #include <QtCore/QStringList>
26
27 #include "fcitxqtconfiguiplugin.h"
28 #include "fcitxqtconfiguiwidget.h"
29 #include "fcitxqtwidgetsaddons_export.h"
30
31 class FcitxQtConfigUIFactoryPrivate;
32 /**
33 * ui plugin factory.
34 **/
35 class FCITXQTWIDGETSADDONS_EXPORT FcitxQtConfigUIFactory : public QObject {
36 Q_OBJECT
37 public:
38 /**
39 * create a plugin factory
40 *
41 * @param parent object parent
42 **/
43 explicit FcitxQtConfigUIFactory(QObject *parent = 0);
44 virtual ~FcitxQtConfigUIFactory();
45 /**
46 * create widget based on file name, it might return 0 if there is no match
47 *
48 * @param file file name need to be configured
49 * @return FcitxQtConfigUIWidget*
50 **/
51 FcitxQtConfigUIWidget *create(const QString &file);
52 /**
53 * a simplified version of create, but it just test if there is a valid
54 *entry or not
55 *
56 * @param file file name
57 * @return bool
58 **/
59 bool test(const QString &file);
60
61 private:
62 FcitxQtConfigUIFactoryPrivate *d_ptr;
63 Q_DECLARE_PRIVATE(FcitxQtConfigUIFactory);
64 };
65
66 #endif // FCITX_CONFIG_UI_FACTORY_H