Diffstat (limited to 'noncore/apps/opie-console/metafactory.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/metafactory.h | 56 |
1 files changed, 45 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h index 216de03..3f7ddce 100644 --- a/noncore/apps/opie-console/metafactory.h +++ b/noncore/apps/opie-console/metafactory.h | |||
@@ -5,47 +5,81 @@ | |||
5 | * The MetaFactory is used to keep track of all IOLayers, FileTransferLayers and ConfigWidgets | 5 | * The MetaFactory is used to keep track of all IOLayers, FileTransferLayers and ConfigWidgets |
6 | * and to instantiate these implementations on demand | 6 | * and to instantiate these implementations on demand |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <qwidget.h> | 9 | #include <qwidget.h> |
10 | #include <qmap.h> | 10 | #include <qmap.h> |
11 | 11 | ||
12 | #include <qpe/config.h> | 12 | #include <qpe/config.h> |
13 | 13 | ||
14 | #include "io_layer.h" | 14 | #include "io_layer.h" |
15 | #include "file_layer.h" | 15 | #include "file_layer.h" |
16 | #include "profile.h" | 16 | #include "profile.h" |
17 | #include "profileeditorplugins.h" | 17 | #include "profiledialogwidget.h" |
18 | 18 | ||
19 | class MetaFactory { | 19 | class MetaFactory { |
20 | public: | 20 | public: |
21 | typedef ProfileEditorPlugin* (*configWidget)(QWidget* parent, Profile* prof); | 21 | typedef ProfileDialogWidget* (*configWidget)(const QString&, QWidget* parent); |
22 | typedef IOLayer* (*iolayer)(const Profile& ); | 22 | typedef IOLayer* (*iolayer)(const Profile& ); |
23 | typedef FileTransferLayer* (*filelayer)(IOLayer*); | 23 | typedef FileTransferLayer* (*filelayer)(IOLayer*); |
24 | 24 | ||
25 | MetaFactory(); | 25 | MetaFactory(); |
26 | ~MetaFactory(); | 26 | ~MetaFactory(); |
27 | 27 | ||
28 | void addConfigWidgetFactory( const QString&, | 28 | /** |
29 | const QString&, | 29 | * add a ProfileDialogWidget to the factory |
30 | * name is the name shown to the user | ||
31 | */ | ||
32 | void addConnectionWidgetFactory( const QCString& internalName, | ||
33 | const QString& uiString, | ||
30 | configWidget ); | 34 | configWidget ); |
31 | void addIOLayerFactory(const QString&, | 35 | void addTerminalWidgetFactory ( const QCString& internalName, |
36 | const QString& name, | ||
37 | configWidget ); | ||
38 | |||
39 | /** | ||
40 | * adds an IOLayer factory | ||
41 | */ | ||
42 | void addIOLayerFactory( const QCString&, | ||
43 | const QString&, | ||
32 | iolayer ); | 44 | iolayer ); |
33 | void addFileTransferLayer( const QString&, | 45 | |
46 | /** | ||
47 | * adds a FileTransfer Layer | ||
48 | */ | ||
49 | void addFileTransferLayer( const QCString& name, | ||
50 | const QString&, | ||
34 | filelayer ); | 51 | filelayer ); |
52 | |||
53 | /* translated UI Strings */ | ||
35 | QStringList ioLayers()const; | 54 | QStringList ioLayers()const; |
36 | QStringList configWidgets()const; | 55 | QStringList connectionWidgets()const; |
56 | QStringList terminalWidgets()const; | ||
37 | QStringList fileTransferLayers()const; | 57 | QStringList fileTransferLayers()const; |
38 | IOLayer* newIOLayer( const QString&,const Profile& ); | 58 | IOLayer* newIOLayer( const QString&,const Profile& ); |
39 | ProfileEditorPlugin *newConfigPlugin ( const QString&, QWidget*, Profile* ); | 59 | ProfileDialogWidget *newConnectionPlugin ( const QString&, QWidget* ); |
60 | ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* ); | ||
61 | |||
62 | /* | ||
63 | * internal takes the maybe translated | ||
64 | * public QString and maps it to the internal | ||
65 | * not translatable QCString | ||
66 | */ | ||
67 | QCString internal( const QString& )const; | ||
68 | |||
69 | /* | ||
70 | * external takes the internal name | ||
71 | * it returns a translated name | ||
72 | */ | ||
73 | QString external( const QCString& )const; | ||
40 | 74 | ||
41 | QString name( const QString& ); | ||
42 | 75 | ||
43 | private: | 76 | private: |
44 | QMap<QString, configWidget> m_confFact; | 77 | QMap<QString, QCString> m_strings; |
78 | QMap<QString, configWidget> m_conFact; | ||
79 | QMap<QString, configWidget> m_termFact; | ||
45 | QMap<QString, iolayer> m_layerFact; | 80 | QMap<QString, iolayer> m_layerFact; |
46 | QMap<QString, filelayer> m_fileFact; | 81 | QMap<QString, filelayer> m_fileFact; |
47 | QMap<QString, QString> m_namemap; | ||
48 | }; | 82 | }; |
49 | 83 | ||
50 | 84 | ||
51 | #endif | 85 | #endif |