Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 module.h 00003 ---------- 00004 begin : Thu Nov 5 2009 00005 copyright : (C) 2009 by Stefan Jahn 00006 email : stefan@lkcc.org 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef MODULE_H 00019 #define MODULE_H 00020 00021 #include <QList> 00022 #include <QHash> 00023 #include <QMap> 00024 00025 // function typedefs for circuits and analyses 00026 typedef Element * (* pInfoFunc) (QString&, char * &, bool); 00027 typedef Element * (* pInfoVAFunc) (QString&, QString&, bool, QString); 00028 typedef Component * (* pCreatorFunc) (); 00029 00030 class Module 00031 { 00032 public: 00033 Module (); 00034 ~Module (); 00035 static void registerModule (QString, pInfoFunc); 00036 static void registerComponent (QString, pInfoFunc); 00037 static void intoCategory (Module *); 00038 static Component * getComponent (QString); 00039 static void registerDynamicComponents(void); 00040 00041 public: 00042 static QHash<QString, Module *> Modules; 00043 static QMap<QString, QString> vaComponents; 00044 00045 public: 00046 static void registerModules (void); 00047 static void unregisterModules (void); 00048 00049 public: 00050 pInfoFunc info; 00051 pInfoVAFunc infoVA; 00052 QString category; 00053 }; 00054 00055 class Category 00056 { 00057 public: 00058 Category (); 00059 Category (const QString); 00060 ~Category (); 00061 00062 public: 00063 static QList<Category *> Categories; 00064 00065 public: 00066 static QStringList getCategories (void); 00067 static QList<Module *> getModules (QString); 00068 static int getModulesNr (QString); 00069 00070 public: 00071 QString Name; 00072 QList<Module *> Content; 00073 }; 00074 00075 #endif /* __MODULE_H__ */