File indexing completed on 2024-11-17 04:40:40

0001 /*
0002     This file is part of Contact Editor.
0003 
0004     SPDX-FileCopyrightText: 2009 Tobias Koenig <tokoe@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #pragma once
0010 
0011 #include <QWidget>
0012 
0013 namespace KContacts
0014 {
0015 class Addressee;
0016 }
0017 
0018 namespace Akonadi
0019 {
0020 /**
0021  * @short The base class for custom ContactEditor page plugins.
0022  *
0023  * @author Tobias Koenig <tokoe@kde.org>
0024  * @since 4.4
0025  */
0026 class ContactEditorPagePlugin : public QWidget
0027 {
0028 public:
0029     /**
0030      * Returns the i18n'd page title.
0031      */
0032     virtual QString title() const = 0;
0033 
0034     /**
0035      * This method is called to fill the editor widget with the data from @p contact.
0036      */
0037     virtual void loadContact(const KContacts::Addressee &contact) = 0;
0038 
0039     /**
0040      * This method is called to store the data from the editor widget into @p contact.
0041      */
0042     virtual void storeContact(KContacts::Addressee &contact) const = 0;
0043 
0044     /**
0045      * This method is called to set the editor widget @p readOnly.
0046      */
0047     virtual void setReadOnly(bool readOnly) = 0;
0048 };
0049 }
0050 
0051 Q_DECLARE_INTERFACE(Akonadi::ContactEditorPagePlugin, "org.freedesktop.Akonadi.ContactEditorPagePlugin/1.0")