contactgroupviewerdialog.h 2.35 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
    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.
10

Tobias Koenig's avatar
Tobias Koenig committed
11 12 13 14
    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.
15

Tobias Koenig's avatar
Tobias Koenig committed
16 17 18 19
    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_CONTACTGROUPVIEWERDIALOG_H
#define AKONADI_CONTACTGROUPVIEWERDIALOG_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 Akonadi
{
31 32 33

class Item;

34 35
class ContactGroupViewer;

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

Guy Maurel's avatar
Guy Maurel committed
63
public:
64 65 66 67 68
    /**
     * Creates a new contact group viewer dialog.
     *
     * @param parent The parent widget of the dialog.
     */
Laurent Montel's avatar
Laurent Montel committed
69
    ContactGroupViewerDialog(QWidget *parent = nullptr);
70 71 72 73 74 75 76 77 78 79 80

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

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

81 82 83 84 85
    /**
     * Returns the ContactGroupViewer that is used by this dialog.
     */
    ContactGroupViewer *viewer() const;

Guy Maurel's avatar
Guy Maurel committed
86
public Q_SLOTS:
87 88 89
    /**
     * Sets the contact @p group that shall be displayed in the dialog.
     */
Guy Maurel's avatar
Guy Maurel committed
90
    void setContactGroup(const Akonadi::Item &group);
91

Guy Maurel's avatar
Guy Maurel committed
92
private:
93 94
    //@cond PRIVATE
    class Private;
Guy Maurel's avatar
Guy Maurel committed
95
    Private *const d;
96 97 98 99 100 101
    //@endcond
};

}

#endif