/* * UIFactory.hpp * * Created on: Jan 5, 2010 * Author: crueger */ #ifndef UIFACTORY_HPP_ #define UIFACTORY_HPP_ class MainWindow; class Dialog; class MoleculeListClass; class config; class periodentafel; struct menuPopulaters; #include "Patterns/Singleton.hpp" /** * Abstract Factory to create any kind of User interface object needed by the programm. * * The factory can be created and has to be set to a certain type upon creation. It will then * only create UIelements of that certain type, so that all UIElements match. This way different * UIs can be handled in a concise abstract way. */ class UIFactory : public Singleton { public: enum InterfaceTypes {Text}; virtual ~UIFactory(); /** * Produce some kind of main window, of whichever type was chosen when the factory was created */ virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *)=0; /** * Produce a User Interaction Dialog, that can query values from the User. * Again the type is determined upon factory creation. */ virtual Dialog* makeDialog()=0; protected: UIFactory(); public: /** * create a Factory of a certain type. From that moment on only those UIElements can be produced by the factory */ static void makeUserInterface(InterfaceTypes type); }; #endif /* UIFACTORY_HPP_ */