Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

page.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2002 by Yann Hodique                                    *
00003  *   Yann.Hodique@lifl.fr                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef _PAGE_H_
00012 #define _PAGE_H_
00013 
00014 #include <qwidget.h>
00015 
00016 #include "master.h"
00017 
00018 
00019 #define PLUGIN_FACTORY(a,b) \
00020 extern "C" Page* create(QWidget *parent, const char *name, Master *master) {\
00021     return new a(parent,name,master);\
00022 }\
00023 \
00024 extern "C" void destroy(Page* p) {\
00025     delete p;\
00026 }\
00027 extern "C" QString name() {\
00028 return b;\
00029 }
00030 
00035 class Page : public QWidget {
00036     Q_OBJECT
00037 
00038 public:
00039     Page(QWidget *parent, const char *name, Master *master, WFlags f = 0) : QWidget(parent,name,f) {
00040         m_master = master;
00041     }
00042     virtual ~Page() {}
00043 
00044     Master * getMaster() {
00045         return m_master;
00046     }
00047 
00048     virtual bool isSlave() {return true;}
00049     virtual void append(const QString &) = 0;
00050 
00051 private:
00052     Master * m_master;
00053 
00054 signals:
00055     void textDisplayed(QWidget *);
00056 };
00057 
00058 typedef Page* create_t(QWidget *, const char *, Master *);
00059 typedef void destroy_t(Page*);
00060 typedef QString name_t();
00061 
00062 #endif

Generated on Sat May 10 15:09:27 2003 for qnet by doxygen1.3