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

    Copyright (c) 2009 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.
*/

Allen Winter's avatar
Allen Winter committed
22 23
#ifndef AKONADI_ABSTRACTCONTACTEDITORWIDGET_P_H
#define AKONADI_ABSTRACTCONTACTEDITORWIDGET_P_H
24

25
#include <QWidget>
26

Laurent Montel's avatar
Laurent Montel committed
27 28
namespace KContacts
{
29 30 31
class Addressee;
}

Laurent Montel's avatar
Laurent Montel committed
32 33
namespace Akonadi
{
34

35
class ContactMetaDataBase;
36

37 38
class AbstractContactEditorWidget : public QWidget
{
Guy Maurel's avatar
Guy Maurel committed
39 40 41 42 43 44
public:
    /**
     * Creates a new abstract contact editor widget.
     *
     * @param parent The parent widget.
     */
45
    explicit AbstractContactEditorWidget(QWidget *parent = nullptr)
Guy Maurel's avatar
Guy Maurel committed
46 47 48 49 50 51 52
        : QWidget(parent)
    {
    }

    /**
     * Destroys the abstract contact editor widget.
     */
Guy Maurel's avatar
Guy Maurel committed
53 54 55
    ~AbstractContactEditorWidget()
    {
    }
Guy Maurel's avatar
Guy Maurel committed
56

Kevin Krammer's avatar
Kevin Krammer committed
57 58 59
    /**
     * @param contact loads the given contact into the editor widget
     */
60
    virtual void loadContact(const KContacts::Addressee &contact, const Akonadi::ContactMetaDataBase &metaData) = 0;
Guy Maurel's avatar
Guy Maurel committed
61

Kevin Krammer's avatar
Kevin Krammer committed
62 63 64
    /**
     * @param contact store the given contact into the editor widget
     */
65
    virtual void storeContact(KContacts::Addressee &contact, Akonadi::ContactMetaDataBase &metaData) const = 0;
Guy Maurel's avatar
Guy Maurel committed
66

Kevin Krammer's avatar
Kevin Krammer committed
67 68 69
    /**
     * @param readOnly set read-only mode
     */
Guy Maurel's avatar
Guy Maurel committed
70
    virtual void setReadOnly(bool readOnly) = 0;
71 72 73 74 75
};

}

#endif