abstractcontactgroupformatter.cpp 1.98 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
    This file is part of Akonadi Contact.

    Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>

    This library is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or (at your
    option) any later version.

    This library 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 Library General Public
    License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to the
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
*/

#include "abstractcontactgroupformatter.h"

24
#include <item.h>
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
25
#include <kcontacts/contactgroup.h>
26 27 28

using namespace Akonadi;

29
class Q_DECL_HIDDEN AbstractContactGroupFormatter::Private
30
{
Guy Maurel's avatar
Guy Maurel committed
31
public:
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
32
    KContacts::ContactGroup mContactGroup;
33
    Akonadi::Item mItem;
Laurent Montel's avatar
Laurent Montel committed
34
    QVector<QVariantMap> mAdditionalFields;
35 36 37
};

AbstractContactGroupFormatter::AbstractContactGroupFormatter()
Guy Maurel's avatar
Guy Maurel committed
38
    : d(new Private)
39 40 41 42 43
{
}

AbstractContactGroupFormatter::~AbstractContactGroupFormatter()
{
Guy Maurel's avatar
Guy Maurel committed
44
    delete d;
45 46
}

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
47
void AbstractContactGroupFormatter::setContactGroup(const KContacts::ContactGroup &group)
48
{
Guy Maurel's avatar
Guy Maurel committed
49
    d->mContactGroup = group;
50 51
}

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
52
KContacts::ContactGroup AbstractContactGroupFormatter::contactGroup() const
53
{
Guy Maurel's avatar
Guy Maurel committed
54
    return d->mContactGroup;
55 56
}

Guy Maurel's avatar
Guy Maurel committed
57
void AbstractContactGroupFormatter::setItem(const Akonadi::Item &item)
58
{
Guy Maurel's avatar
Guy Maurel committed
59
    d->mItem = item;
60 61 62 63
}

Akonadi::Item AbstractContactGroupFormatter::item() const
{
Guy Maurel's avatar
Guy Maurel committed
64
    return d->mItem;
65 66
}

Laurent Montel's avatar
Laurent Montel committed
67
void AbstractContactGroupFormatter::setAdditionalFields(const QVector<QVariantMap> &fields)
68
{
Guy Maurel's avatar
Guy Maurel committed
69
    d->mAdditionalFields = fields;
70 71
}

Laurent Montel's avatar
Laurent Montel committed
72
QVector<QVariantMap> AbstractContactGroupFormatter::additionalFields() const
73
{
Guy Maurel's avatar
Guy Maurel committed
74
    return d->mAdditionalFields;
75
}