From 48b3a7159c613b59ca3f838517373620b8afd1d5 Mon Sep 17 00:00:00 2001 From: zecke Date: Thu, 26 Sep 2002 20:04:21 +0000 Subject: The basic gui outline a MainWindow a Session and a Factory --- (limited to 'noncore/apps/opie-console') 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 +#include + +#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 sessions(); + +private: + /** + * the current session + */ + Session* m_curSession; + + /** + * the session list + */ + QList 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 +#include + +#include + +#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 m_confFact; + QMap m_layerFact; + QMap 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 + +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 -- cgit v0.9.0.2