kmail
identitylistview.h
Go to the documentation of this file.00001 /* -*- c++ -*- 00002 identitylistview.h 00003 00004 This file is part of KMail, the KDE mail client. 00005 Copyright (c) 2002 Marc Mutz <mutz@kde.org> 00006 2007 Mathias Soeken <msoeken@tzi.de> 00007 00008 KMail is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU General Public License, version 2, as 00010 published by the Free Software Foundation. 00011 00012 KMail is distributed in the hope that it will be useful, but 00013 WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 00021 In addition, as a special exception, the copyright holders give 00022 permission to link the code of this program with any edition of 00023 the Qt library by Trolltech AS, Norway (or with modified versions 00024 of Qt that use the same license as Qt), and distribute linked 00025 combinations including the two. You must obey the GNU General 00026 Public License in all respects for all of the code used other than 00027 Qt. If you modify this file, you may extend this exception to 00028 your version of the file, but you are not obligated to do so. If 00029 you do not wish to do so, delete this exception statement from 00030 your version. 00031 */ 00032 00033 #ifndef __KMAIL_IDENTITYLISTVIEW_H__ 00034 #define __KMAIL_IDENTITYLISTVIEW_H__ 00035 00036 #include <QTreeWidget> 00037 #include <QTreeWidgetItem> 00038 00039 namespace KPIMIdentities { class Identity; } 00040 00041 namespace KMail { 00042 00043 class IdentityListView; 00044 00048 class IdentityListViewItem : public QTreeWidgetItem { 00049 public: 00050 IdentityListViewItem( IdentityListView *parent, 00051 const KPIMIdentities::Identity &ident ); 00052 IdentityListViewItem( IdentityListView *parent, QTreeWidgetItem *after, 00053 const KPIMIdentities::Identity &ident ); 00054 00055 uint uoid() const { return mUOID; } 00056 KPIMIdentities::Identity &identity() const; 00057 virtual void setIdentity( const KPIMIdentities::Identity &ident ); 00058 void redisplay(); 00059 private: 00060 void init( const KPIMIdentities::Identity &ident ); 00061 00062 protected: 00063 uint mUOID; 00064 }; 00065 00069 class IdentityListView : public QTreeWidget { 00070 Q_OBJECT 00071 public: 00072 IdentityListView( QWidget *parent = 0 ); 00073 virtual ~IdentityListView() {} 00074 00075 public: 00076 void editItem( QTreeWidgetItem *item, int column = 0 ); 00077 00078 protected slots: 00079 void commitData( QWidget *editor ); 00080 00081 public slots: 00082 void slotCustomContextMenuRequested( const QPoint& ); 00083 00084 signals: 00085 void contextMenu( KMail::IdentityListViewItem *, const QPoint& ); 00086 void rename( KMail::IdentityListViewItem *, const QString& ); 00087 00088 protected: 00089 virtual void startDrag ( Qt::DropActions supportedActions ); 00090 }; 00091 00092 00093 } // namespace KMail 00094 00095 #endif // __KMAIL_IDENTITYLISTVIEW_H__
KDE 4.2 API Reference