~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/kabc/contactgroupeditor.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi, Alessandro Ghersi, Harald Sitter
  • Date: 2009-06-27 04:40:05 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627044005-4y2vm9xz7rvmzi4p
Tags: 4:4.2.95svn20090701-0ubuntu1
[ Alessandro Ghersi ]
* New upstream release
  - Bump build-deps
* Remove akonadi-kde and libmaildir4 packages
  - remove akonadi-kde.install and libmaildir4.install
  - remove libmaildir4 from debian/rules
  - remove akonadi-kde and libmaildir4 from depends
  - remove akonadi-kde and libmaildir4 from installgen
* Update kdepim-dev.install
* Update kpilot.install
* Add akonadi-kde and libmaildir4 transitional packages

[ Harald Sitter ]
* KAddressbook replaces Kontact << 4.2.85 (LP: #378373)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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
 
17
    02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef AKONADI_CONTACTGROUPEDITOR_H
 
21
#define AKONADI_CONTACTGROUPEDITOR_H
 
22
 
 
23
#include "akonadi-kabccommon_export.h"
 
24
#include <QtGui/QWidget>
 
25
 
 
26
namespace Akonadi {
 
27
 
 
28
class Collection;
 
29
class Item;
 
30
 
 
31
/**
 
32
 * @short An editor for contact groups.
 
33
 *
 
34
 * @author Tobias Koenig <tokoe@kde.org>
 
35
 * @since 4.3
 
36
 */
 
37
class AKONADI_KABCCOMMON_EXPORT ContactGroupEditor : public QWidget
 
38
{
 
39
  Q_OBJECT
 
40
 
 
41
  public:
 
42
    /**
 
43
     * Describes the mode of the contact group editor.
 
44
     */
 
45
    enum Mode
 
46
    {
 
47
      CreateMode, ///< Creates a new contact group
 
48
      EditMode    ///< Edits an existing contact group
 
49
    };
 
50
 
 
51
    /**
 
52
     * Creates a new contact group editor.
 
53
     *
 
54
     * @param mode The mode of the editor.
 
55
     * @param parent The parent widget of the editor.
 
56
     */
 
57
    explicit ContactGroupEditor( Mode mode, QWidget *parent = 0 );
 
58
 
 
59
    /**
 
60
     * Destroys the contact group editor.
 
61
     */
 
62
    virtual ~ContactGroupEditor();
 
63
 
 
64
  public Q_SLOTS:
 
65
    /**
 
66
     * Loads the contact @p group into the editor.
 
67
     */
 
68
    void loadContactGroup( const Akonadi::Item &group );
 
69
 
 
70
    /**
 
71
     * Saves the contact group from the editor back to the storage.
 
72
     *
 
73
     * @returns @c true if the contact group has been saved successfully, false otherwise.
 
74
     */
 
75
    bool saveContactGroup();
 
76
 
 
77
    /**
 
78
     * Sets the @p collection which shall be used to store new
 
79
     * contact groups.
 
80
     */
 
81
    void setDefaultCollection( const Akonadi::Collection &collection );
 
82
 
 
83
  Q_SIGNALS:
 
84
    /**
 
85
     * This signal is emitted when the contact @p group has been saved back
 
86
     * to the storage.
 
87
     */
 
88
    void contactGroupStored( const Akonadi::Item &group );
 
89
 
 
90
    /**
 
91
     * This signal is emitted when an error occurred during the save.
 
92
     *
 
93
     * @p errorMsg The error message.
 
94
     */
 
95
    void error( const QString &errorMsg );
 
96
 
 
97
  private:
 
98
    class Private;
 
99
    Private* const d;
 
100
 
 
101
    Q_DISABLE_COPY( ContactGroupEditor )
 
102
 
 
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() )
 
107
};
 
108
 
 
109
}
 
110
 
 
111
#endif