Make the boss happy.
[kdepim.git] / kmail / identitylistview.h
blob2d61ed100ef4b0c708cb650fec72f60d146c8a25
1 /* -*- c++ -*-
2 identitylistview.h
4 This file is part of KMail, the KDE mail client.
5 Copyright (c) 2002 Marc Mutz <mutz@kde.org>
6 2007 Mathias Soeken <msoeken@tzi.de>
8 KMail is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License, version 2, as
10 published by the Free Software Foundation.
12 KMail is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 In addition, as a special exception, the copyright holders give
22 permission to link the code of this program with any edition of
23 the Qt library by Trolltech AS, Norway (or with modified versions
24 of Qt that use the same license as Qt), and distribute linked
25 combinations including the two. You must obey the GNU General
26 Public License in all respects for all of the code used other than
27 Qt. If you modify this file, you may extend this exception to
28 your version of the file, but you are not obligated to do so. If
29 you do not wish to do so, delete this exception statement from
30 your version.
33 #ifndef __KMAIL_IDENTITYLISTVIEW_H__
34 #define __KMAIL_IDENTITYLISTVIEW_H__
36 #include <QTreeWidget>
37 #include <QTreeWidgetItem>
39 namespace KPIMIdentities { class Identity; class IdentityManager;
42 namespace KMail {
44 class IdentityListView;
46 /** @short A QWidgetTreeItem for use in IdentityListView
47 * @author Marc Mutz <mutz@kde.org>
48 **/
49 class IdentityListViewItem : public QTreeWidgetItem {
50 public:
51 IdentityListViewItem( IdentityListView *parent,
52 const KPIMIdentities::Identity &ident );
53 IdentityListViewItem( IdentityListView *parent, QTreeWidgetItem *after,
54 const KPIMIdentities::Identity &ident );
56 uint uoid() const { return mUOID; }
57 KPIMIdentities::Identity &identity() const;
58 virtual void setIdentity( const KPIMIdentities::Identity &ident );
59 void redisplay();
60 private:
61 void init( const KPIMIdentities::Identity &ident );
63 protected:
64 uint mUOID;
67 /** @short A QTreeWidget for KPIMIdentities::Identity
68 * @author Marc Mutz <mutz@kde.org>
69 **/
70 class IdentityListView : public QTreeWidget {
71 Q_OBJECT
72 public:
73 explicit IdentityListView( QWidget *parent = 0 );
74 virtual ~IdentityListView() {}
76 public:
77 void editItem( QTreeWidgetItem *item, int column = 0 );
78 KPIMIdentities::IdentityManager *identityManager() const;
79 void setIdentityManager( KPIMIdentities::IdentityManager* im );
81 protected slots:
82 void commitData( QWidget *editor );
84 public slots:
85 void slotCustomContextMenuRequested( const QPoint& );
87 signals:
88 void contextMenu( KMail::IdentityListViewItem *, const QPoint& );
89 void rename( KMail::IdentityListViewItem *, const QString& );
91 protected:
92 #ifndef QT_NO_DRAGANDDROP
93 virtual void startDrag ( Qt::DropActions supportedActions );
94 #endif
96 private:
97 KPIMIdentities::IdentityManager* mIdentityManager;
101 } // namespace KMail
103 #endif // __KMAIL_IDENTITYLISTVIEW_H__