/* * MoleculeView.hpp * * Created on: Mar 4, 2010 * Author: crueger */ #ifndef QTINFOBOX_HPP_ #define QTINFOBOX_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "CodePatterns/Observer/Observer.hpp" #include "types.hpp" class molecule; class atom; // Forwarding of the Tab-Pages class QtAtomInfoPage; class QtMoleculeInfoPage; class QtInfoBox : public QTabWidget { Q_OBJECT public: QtInfoBox(); virtual ~QtInfoBox(); void showAtom(const atomId_t _id); void showMolecule(const moleculeId_t _id); public slots: void atomHover(const atomId_t _id); void moleculeHover(const moleculeId_t _id); void timerTimeout(); void clearTabs(); private: atomId_t curAtomId; atomId_t nextAtomId; moleculeId_t curMoleculeId; moleculeId_t nextMoleculeId; QtMoleculeInfoPage *page_mol; QtAtomInfoPage *page_atom; QTimer *timer; int currentPage; }; /** * Widget to display the tab page for a single atom */ class QtAtomInfoPage : public QTreeWidget, public Observer { Q_OBJECT public: QtAtomInfoPage(const atom *_atom, QWidget *parent); virtual ~QtAtomInfoPage(); void update(Observable *subject); void subjectKilled(Observable *subject); signals: void atomKilled(); private: void updatePage(); private: const atom *atomRef; QTreeWidget *info; }; /** * Widget to display the tab page for a single molecule */ class QtMoleculeInfoPage : public QTreeWidget, public Observer { Q_OBJECT public: QtMoleculeInfoPage(const molecule *_mol, QWidget *parent); virtual ~QtMoleculeInfoPage(); void update(Observable *subject); void subjectKilled(Observable *subject); signals: void moleculeKilled(); private: void updatePage(); private: const molecule *mol; QTreeWidget *info; }; #endif /* QTINFOBOX_HPP_ */