summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.h57
-rw-r--r--noncore/apps/opie-console/metafactory.h46
-rw-r--r--noncore/apps/opie-console/session.h39
3 files changed, 142 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
new file mode 100644
index 0000000..7786c95
--- a/dev/null
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -0,0 +1,57 @@
1#ifndef OPIE_MAIN_WINDOW_H
2#define OPIE_MAIN_WINDOW_H
3
4#include <qmainwindow.h>
5#include <qlist.h>
6
7#include "session.h"
8
9/**
10 * this is the MainWindow of the new opie console
11 * it's also the dispatcher between the different
12 * actions supported by the gui
13 */
14class MetaFactory;
15class MainWindow : public QMainWindow {
16 Q_OBJECT
17public:
18 MainWindow( );
19 ~MainWindow();
20
21 /**
22 * our factory to generate IOLayer and so on
23 *
24 */
25 MetaFactory* factory();
26
27 /**
28 * A session contains a QWidget*,
29 * an IOLayer* and some infos for us
30 */
31 Session* currentSession();
32
33 /**
34 * the session list
35 */
36 QList<Session> sessions();
37
38private:
39 /**
40 * the current session
41 */
42 Session* m_curSession;
43
44 /**
45 * the session list
46 */
47 QList<Session> m_sessions;
48
49 /**
50 * the metafactory
51 */
52 MetaFactory* m_factory;
53
54};
55
56
57#endif
diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h
new file mode 100644
index 0000000..9c0f0a1
--- a/dev/null
+++ b/noncore/apps/opie-console/metafactory.h
@@ -0,0 +1,46 @@
1#ifndef OPIE_META_FACTORY_H
2#define OPIE_META_FACTORY_H
3
4/**
5 * meta factory is our factory servie
6 */
7
8#include <qwidget.h>
9#include <qmap.h>
10
11#include <qpe/config.h>
12
13#include "io_layer.h"
14#include "file_layer.h"
15
16
17class MetaFactory {
18public:
19 typedef QWidget* (*configWidget)(QWidget* parent);
20 typedef IOLayer* (*iolayer)(const Config& );
21 typedef FileTransferLayer* (*filelayer)(IOLayer*);
22 MetaFactory();
23 ~MetaFactory();
24
25 void addConfigWidgetFactory( const QString&,
26 configWidget );
27 void addIOLayerFactory(const QString&,
28 iolayer );
29 void addFileTransferLayer( const QString&,
30 filelayer );
31 QStringList ioLayers()const;
32 QStringList configWidgets()const;
33 QStringList fileTransferLayers()const;
34
35
36private:
37 QMap<QString, configWidget> m_confFact;
38 QMap<QString, iolayer> m_layerFact;
39 QMap<QString, filelayer> m_fileFact;
40
41
42
43};
44
45
46#endif
diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h
new file mode 100644
index 0000000..3978e1b
--- a/dev/null
+++ b/noncore/apps/opie-console/session.h
@@ -0,0 +1,39 @@
1#ifndef OPIE_SESSION_H
2#define OPIE_SESSION_H
3
4#include <qwidget.h>
5
6class IOLayer;
7/**
8 * This is a Session. A session contains
9 * a QWidget pointer and a IOLayer
10 * Imagine a session like a collection of what
11 * is needed to show your widget in a tab ;)
12 */
13class Session {
14public:
15 /**
16 * c'tor with widget and layer
17 * ownership get's transfered
18 */
19 Session( QWidget* widget, IOLayer* );
20 ~Session();
21
22 /**
23 * return the widget
24 */
25 QWidget* widget();
26
27 /**
28 * return the layer
29 */
30 IOLayer* layer();
31 void setWidget( QWidget* widget );
32 void setIOLayer( IOLayer* );
33
34private:
35 QWidget* m_widget;
36 IOLayer* m_layer;
37};
38
39#endif