contactviewerdialog.h 2.29 KB
Newer Older
1 2 3 4 5
/*
    This file is part of Akonadi Contact.

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

Tobias Koenig's avatar
Tobias Koenig committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19
    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.
20 21 22 23 24 25 26
*/

#ifndef AKONADI_CONTACTVIEWERDIALOG_H
#define AKONADI_CONTACTVIEWERDIALOG_H

#include "akonadi-contact_export.h"

Laurent Montel's avatar
Laurent Montel committed
27
#include <QDialog>
28

Laurent Montel's avatar
Laurent Montel committed
29 30
namespace KContacts
{
31 32
}

Laurent Montel's avatar
Laurent Montel committed
33 34
namespace Akonadi
{
35 36 37

class Item;

38 39
class ContactViewer;

40 41 42
/**
 * @short A dialog for displaying a contact in Akonadi.
 *
Tobias Koenig's avatar
Tobias Koenig committed
43 44 45 46 47 48 49
 * This dialog provides a way to show a contact from the
 * Akonadi storage.
 *
 * Example:
 *
 * @code
 *
50 51 52
 * using namespace Akonadi;
 *
 * const Item contact = ...
Tobias Koenig's avatar
Tobias Koenig committed
53
 *
54 55 56
 * ContactViewerDialog *dlg = new ContactViewerDialog( this );
 * dlg->setContact( contact );
 * dlg->show();
Tobias Koenig's avatar
Tobias Koenig committed
57 58 59
 *
 * @endcode
 *
60
 * @author Tobias Koenig <tokoe@kde.org>
Tobias Koenig's avatar
Tobias Koenig committed
61
 * @since 4.4
62
 */
Laurent Montel's avatar
Laurent Montel committed
63
class AKONADI_CONTACT_EXPORT ContactViewerDialog : public QDialog
64
{
Guy Maurel's avatar
Guy Maurel committed
65
    Q_OBJECT
66

Guy Maurel's avatar
Guy Maurel committed
67
public:
68 69 70 71 72
    /**
     * Creates a new contact viewer dialog.
     *
     * @param parent The parent widget of the dialog.
     */
Laurent Montel's avatar
Laurent Montel committed
73
    explicit ContactViewerDialog(QWidget *parent = nullptr);
74 75 76 77 78 79 80 81 82 83 84 85

    /**
     * Destroys the contact viewer dialog.
     */
    ~ContactViewerDialog();

    /**
     * Returns the contact that is currently displayed.
     */
    Akonadi::Item contact() const;

    /**
86
     * Returns the ContactViewer that is used by this dialog.
87
     */
88
    ContactViewer *viewer() const;
89

Guy Maurel's avatar
Guy Maurel committed
90
public Q_SLOTS:
91
    /**
92
     * Sets the @p contact that shall be displayed in the dialog.
93
     */
Guy Maurel's avatar
Guy Maurel committed
94
    void setContact(const Akonadi::Item &contact);
95

Guy Maurel's avatar
Guy Maurel committed
96
private:
97 98
    //@cond PRIVATE
    class Private;
Guy Maurel's avatar
Guy Maurel committed
99
    Private *const d;
100 101 102 103 104 105
    //@endcond
};

}

#endif