categorieseditwidget.h 1.45 KB
Newer Older
Tobias Koenig's avatar
Tobias Koenig committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*
    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.
*/

#ifndef CATEGORIESEDITWIDGET_H
#define CATEGORIESEDITWIDGET_H

25
#include <QWidget>
Tobias Koenig's avatar
Tobias Koenig committed
26

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
27
#include <kcontacts/addressee.h>
Tobias Koenig's avatar
Tobias Koenig committed
28

Laurent Montel's avatar
Laurent Montel committed
29 30
namespace Akonadi
{
Guy Maurel's avatar
Guy Maurel committed
31
class TagWidget;
32
}
Tobias Koenig's avatar
Tobias Koenig committed
33 34 35 36 37 38

/**
 * @short A widget for editing the categories of a contact.
 */
class CategoriesEditWidget : public QWidget
{
Guy Maurel's avatar
Guy Maurel committed
39
    Q_OBJECT
Tobias Koenig's avatar
Tobias Koenig committed
40

Guy Maurel's avatar
Guy Maurel committed
41
public:
Laurent Montel's avatar
Laurent Montel committed
42
    explicit CategoriesEditWidget(QWidget *parent = nullptr);
Tobias Koenig's avatar
Tobias Koenig committed
43 44
    ~CategoriesEditWidget();

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
45 46
    void loadContact(const KContacts::Addressee &contact);
    void storeContact(KContacts::Addressee &contact) const;
Tobias Koenig's avatar
Tobias Koenig committed
47

Guy Maurel's avatar
Guy Maurel committed
48
    void setReadOnly(bool readOnly);
Tobias Koenig's avatar
Tobias Koenig committed
49

Guy Maurel's avatar
Guy Maurel committed
50
private:
51
    Akonadi::TagWidget *mTagWidget;
Tobias Koenig's avatar
Tobias Koenig committed
52 53 54
};

#endif