From bb624c5ec2ab2e13dedcba67fd60e3d2f03216d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Wed, 11 Jan 2017 13:06:55 +0100 Subject: Add Contact as new domain type --- common/domain/contact.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 common/domain/contact.cpp (limited to 'common/domain/contact.cpp') diff --git a/common/domain/contact.cpp b/common/domain/contact.cpp new file mode 100644 index 0000000..ea7cac2 --- /dev/null +++ b/common/domain/contact.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2017 Sandro Knauß + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "contact.h" + +#include +#include +#include + +#include "../propertymapper.h" +#include "../typeindex.h" +#include "entity_generated.h" + +#include "contact_generated.h" + +using namespace Sink::ApplicationDomain; + +void TypeImplementation::configure(TypeIndex &index) +{ + index.addProperty(Contact::Uid::name); +} + +void TypeImplementation::configure(ReadPropertyMapper &propertyMapper) +{ + propertyMapper.addMapping(&Buffer::uid); + propertyMapper.addMapping(&Buffer::fn); + propertyMapper.addMapping(&Buffer::emails); + propertyMapper.addMapping(&Buffer::vcard); +} + +void TypeImplementation::configure(WritePropertyMapper &propertyMapper) +{ + propertyMapper.addMapping(&BufferBuilder::add_uid); + propertyMapper.addMapping(&BufferBuilder::add_fn); + propertyMapper.addMapping(&BufferBuilder::add_emails); + propertyMapper.addMapping(&BufferBuilder::add_vcard); +} + +void TypeImplementation::configure(IndexPropertyMapper &) +{ + +} -- cgit v1.2.3