24 |
#include "OneChildToFamilyLink.hh" |
#include "OneChildToFamilyLink.hh" |
25 |
#include "OneChildToFamilyLinkHandler.hh" |
#include "OneChildToFamilyLinkHandler.hh" |
26 |
#include "MMIMenuLinkEditor.hh" |
#include "MMIMenuLinkEditor.hh" |
27 |
|
#include "GEDCOMParser/Predicates/GenericPredicateIndividualRecords.hh" |
28 |
|
#include "GEDCOMParser/Predicates/PredicateIndividualRecords.hh" |
29 |
|
#include "GEDCOMParser/Predicates/IsMale.hh" |
30 |
|
#include "GEDCOMParser/Predicates/HasChild.hh" |
31 |
|
#include "GEDCOMParser/Predicates/NameEqualsTo.hh" |
32 |
|
|
33 |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
34 |
_mmi_childtofamilylink(mmi) |
_mmi_childtofamilylink(mmi) |
124 |
std::string * individu_id = new std::string(_parent_entity->getId()); |
std::string * individu_id = new std::string(_parent_entity->getId()); |
125 |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_father = getNavigationSlotHandler(father_id); |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_father = getNavigationSlotHandler(father_id); |
126 |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_mother = getNavigationSlotHandler(mother_id); |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_mother = getNavigationSlotHandler(mother_id); |
127 |
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_father = getPopdownLinkEditionSlotHandler(individu_id); |
|
128 |
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_mother = getPopdownLinkEditionSlotHandler(individu_id); |
GEDCOMParser::LineageLinkageGedcom const * const lineage = get_document(); |
129 |
|
std::string const name = _parent_entity->getPersonalNames()[0]->getGivn(); |
130 |
|
SmartPtr < GEDCOMParser::Predicates::PredicateIndividualRecords > * father_predicate = new SmartPtr < GEDCOMParser::Predicates::PredicateIndividualRecords > (GEDCOMParser::Predicates::getGenericPredicateIndividualRecords( std::compose2(std::logical_and<bool>(), |
131 |
|
std::compose1( |
132 |
|
std::logical_not<bool>(), |
133 |
|
std::bind1st(GEDCOMParser::Predicates::HasChild(),lineage)), |
134 |
|
std::compose2(std::logical_and<bool>(), |
135 |
|
GEDCOMParser::Predicates::IsMale(), |
136 |
|
std::bind1st(GEDCOMParser::Predicates::NameEqualsTo(), name) |
137 |
|
|
138 |
|
) |
139 |
|
) |
140 |
|
); |
141 |
|
|
142 |
|
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_father = getPopdownLinkEditionSlotHandler(individu_id, father_predicate); |
143 |
|
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_mother = getPopdownLinkEditionSlotHandler(individu_id, father_predicate); |
144 |
|
|
145 |
OneFamilyLinkHandler * familylink_handler_tmp = new OneChildToFamilyLinkHandler(father, mother, navigation_slot_father, navigation_slot_mother, popdownlinkedition_slot_father, popdownlinkedition_slot_mother); |
OneFamilyLinkHandler * familylink_handler_tmp = new OneChildToFamilyLinkHandler(father, mother, navigation_slot_father, navigation_slot_mother, popdownlinkedition_slot_father, popdownlinkedition_slot_mother); |
146 |
*familylink_handler = familylink_handler_tmp; |
*familylink_handler = familylink_handler_tmp; |
162 |
std::cerr << "Family edited : individu id = " << id << std::endl; |
std::cerr << "Family edited : individu id = " << id << std::endl; |
163 |
return; |
return; |
164 |
} |
} |
165 |
|
|