File indexing completed on 2024-11-24 04:39:26

0001 /*
0002     This file is part of Akonadi Contact.
0003 
0004     SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #include "abstractcontactformatter.h"
0010 
0011 #include <Akonadi/Item>
0012 #include <KContacts/Addressee>
0013 
0014 using namespace Akonadi;
0015 
0016 class Akonadi::AbstractContactFormatterPrivate
0017 {
0018 public:
0019     KContacts::Addressee mContact;
0020     Akonadi::Item mItem;
0021     QList<QVariantMap> mCustomFieldDescriptions;
0022 };
0023 
0024 AbstractContactFormatter::AbstractContactFormatter()
0025     : d(new AbstractContactFormatterPrivate)
0026 {
0027 }
0028 
0029 AbstractContactFormatter::~AbstractContactFormatter() = default;
0030 
0031 void AbstractContactFormatter::setContact(const KContacts::Addressee &contact)
0032 {
0033     d->mContact = contact;
0034 }
0035 
0036 KContacts::Addressee AbstractContactFormatter::contact() const
0037 {
0038     return d->mContact;
0039 }
0040 
0041 void AbstractContactFormatter::setItem(const Akonadi::Item &item)
0042 {
0043     d->mItem = item;
0044 }
0045 
0046 Akonadi::Item AbstractContactFormatter::item() const
0047 {
0048     return d->mItem;
0049 }
0050 
0051 void AbstractContactFormatter::setCustomFieldDescriptions(const QList<QVariantMap> &descriptions)
0052 {
0053     d->mCustomFieldDescriptions = descriptions;
0054 }
0055 
0056 QList<QVariantMap> AbstractContactFormatter::customFieldDescriptions() const
0057 {
0058     return d->mCustomFieldDescriptions;
0059 }