2
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
4
This library is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or (at your
7
option) any later version.
9
This library is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12
License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#ifndef AKONADI_CONTACTGROUPEDITOR_H
21
#define AKONADI_CONTACTGROUPEDITOR_H
23
#include "akonadi-kabccommon_export.h"
24
#include <QtGui/QWidget>
32
* @short An editor for contact groups.
34
* @author Tobias Koenig <tokoe@kde.org>
37
class AKONADI_KABCCOMMON_EXPORT ContactGroupEditor : public QWidget
43
* Describes the mode of the contact group editor.
47
CreateMode, ///< Creates a new contact group
48
EditMode ///< Edits an existing contact group
52
* Creates a new contact group editor.
54
* @param mode The mode of the editor.
55
* @param parent The parent widget of the editor.
57
explicit ContactGroupEditor( Mode mode, QWidget *parent = 0 );
60
* Destroys the contact group editor.
62
virtual ~ContactGroupEditor();
66
* Loads the contact @p group into the editor.
68
void loadContactGroup( const Akonadi::Item &group );
71
* Saves the contact group from the editor back to the storage.
73
* @returns @c true if the contact group has been saved successfully, false otherwise.
75
bool saveContactGroup();
78
* Sets the @p collection which shall be used to store new
81
void setDefaultCollection( const Akonadi::Collection &collection );
85
* This signal is emitted when the contact @p group has been saved back
88
void contactGroupStored( const Akonadi::Item &group );
91
* This signal is emitted when an error occurred during the save.
93
* @p errorMsg The error message.
95
void error( const QString &errorMsg );
101
Q_DISABLE_COPY( ContactGroupEditor )
103
Q_PRIVATE_SLOT( d, void fetchDone( KJob* ) )
104
Q_PRIVATE_SLOT( d, void storeDone( KJob* ) )
105
Q_PRIVATE_SLOT( d, void itemChanged( const Akonadi::Item&, const QSet<QByteArray>& ) )
106
Q_PRIVATE_SLOT( d, void memberChanged() )