summaryrefslogtreecommitdiff
Side-by-side diff
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 @@
+#ifndef OPIE_MAIN_WINDOW_H
+#define OPIE_MAIN_WINDOW_H
+
+#include <qmainwindow.h>
+#include <qlist.h>
+
+#include "session.h"
+
+/**
+ * this is the MainWindow of the new opie console
+ * it's also the dispatcher between the different
+ * actions supported by the gui
+ */
+class MetaFactory;
+class MainWindow : public QMainWindow {
+ Q_OBJECT
+public:
+ MainWindow( );
+ ~MainWindow();
+
+ /**
+ * our factory to generate IOLayer and so on
+ *
+ */
+ MetaFactory* factory();
+
+ /**
+ * A session contains a QWidget*,
+ * an IOLayer* and some infos for us
+ */
+ Session* currentSession();
+
+ /**
+ * the session list
+ */
+ QList<Session> sessions();
+
+private:
+ /**
+ * the current session
+ */
+ Session* m_curSession;
+
+ /**
+ * the session list
+ */
+ QList<Session> m_sessions;
+
+ /**
+ * the metafactory
+ */
+ MetaFactory* m_factory;
+
+};
+
+
+#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 @@
+#ifndef OPIE_META_FACTORY_H
+#define OPIE_META_FACTORY_H
+
+/**
+ * meta factory is our factory servie
+ */
+
+#include <qwidget.h>
+#include <qmap.h>
+
+#include <qpe/config.h>
+
+#include "io_layer.h"
+#include "file_layer.h"
+
+
+class MetaFactory {
+public:
+ typedef QWidget* (*configWidget)(QWidget* parent);
+ typedef IOLayer* (*iolayer)(const Config& );
+ typedef FileTransferLayer* (*filelayer)(IOLayer*);
+ MetaFactory();
+ ~MetaFactory();
+
+ void addConfigWidgetFactory( const QString&,
+ configWidget );
+ void addIOLayerFactory(const QString&,
+ iolayer );
+ void addFileTransferLayer( const QString&,
+ filelayer );
+ QStringList ioLayers()const;
+ QStringList configWidgets()const;
+ QStringList fileTransferLayers()const;
+
+
+private:
+ QMap<QString, configWidget> m_confFact;
+ QMap<QString, iolayer> m_layerFact;
+ QMap<QString, filelayer> m_fileFact;
+
+
+
+};
+
+
+#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 @@
+#ifndef OPIE_SESSION_H
+#define OPIE_SESSION_H
+
+#include <qwidget.h>
+
+class IOLayer;
+/**
+ * This is a Session. A session contains
+ * a QWidget pointer and a IOLayer
+ * Imagine a session like a collection of what
+ * is needed to show your widget in a tab ;)
+ */
+class Session {
+public:
+ /**
+ * c'tor with widget and layer
+ * ownership get's transfered
+ */
+ Session( QWidget* widget, IOLayer* );
+ ~Session();
+
+ /**
+ * return the widget
+ */
+ QWidget* widget();
+
+ /**
+ * return the layer
+ */
+ IOLayer* layer();
+ void setWidget( QWidget* widget );
+ void setIOLayer( IOLayer* );
+
+private:
+ QWidget* m_widget;
+ IOLayer* m_layer;
+};
+
+#endif