#ifndef _BAKERY_GATEWAY_VIEWLINKEDNOTE_HH_ #define _BAKERY_GATEWAY_VIEWLINKEDNOTE_HH_ #include "config.h" #include "bakery/bakery.h" #include "BakeryExtras/View_Linked.hh" #include "BakeryGateway/Document.hh" #include "GEDCOMParser/NoteStructure.hh" namespace BakeryGateway { template < class T_ParentEntity, class MMI > class ViewLinkedNote : public BakeryExtras::View_Linked < BakeryGateway::Document, T_ParentEntity > { public: ViewLinkedNote(MMI * mmi) : _mmi(mmi) { return; }; ~ViewLinkedNote(void) { return; }; virtual void load_from_document() { _mmi->clear(); if (_parent_entity != 0) { GEDCOMParser::NoteStructures_t notes = _parent_entity->getNoteStructures(); for (GEDCOMParser::NoteStructures_t::const_iterator note_iter = notes.begin(); note_iter != notes.end(); note_iter++) { _mmi->add_text((*note_iter)->getSubmitterText()); } } return; }; private: MMI * _mmi; }; }; #endif