/* * QtMoleculeItem_visibility.hpp * * Created on: Jan 18, 2015 * Author: heber */ #ifndef QTMOLECULEITEM_VISIBILITY_HPP_ #define QTMOLECULEITEM_VISIBILITY_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "UIElements/Views/Qt4/MoleculeList/QtMoleculeItem.hpp" class QtMoleculeItemFactory; /** This class contains the visibility of a molecule and keeps it up to date. * */ class QtMoleculeItem_visibility : public QtMoleculeItem { //!> only allow factory to instantiate items friend class QtMoleculeItemFactory; QtMoleculeItem_visibility( QtObservedMolecule::ptr &_ObservedMolecule) : id(_ObservedMolecule->getIndex()) { setFlags(flags() | Qt::ItemIsUserCheckable); setCheckState(Qt::Unchecked); // cannot call pure virtual function in QtMoleculeItem's cstor updateState(_ObservedMolecule); } /** Performs the update of the molecule's visibility. * * \param _ObservedMolecule object to update state from */ void updateState(const QtObservedMolecule::ptr &_ObservedMolecule) {} QtMoleculeItem::COLUMNTYPES getType() const { return QtMoleculeItem::VISIBILITY; } /** Getter for the id of the observed molecule for this item. * * \return id of the observed molecule */ ObservedValue_Index_t getMoleculeIndex() const { return id; } private: const ObservedValue_Index_t id; }; #endif /* QTMOLECULEITEM_VISIBILITY_HPP_ */