kaddressbook
kaddressbookiconview.h
Go to the documentation of this file.00001 /* 00002 This file is part of KAddressBook. 00003 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 00019 As a special exception, permission is given to link this program 00020 with any edition of Qt, and distribute the resulting executable, 00021 without including the source code for Qt in the source distribution. 00022 */ 00023 00024 #ifndef KADDRESSBOOKICONVIEW_H 00025 #define KADDRESSBOOKICONVIEW_H 00026 00027 #include "kaddressbookview.h" 00028 00029 #include <QtCore/QList> 00030 #include <QtCore/QString> 00031 00032 #include <k3iconview.h> 00033 #include <Qt3Support/Q3ValueList> 00034 00035 class QDropEvent; 00036 class Q3IconViewItem; 00037 class KConfigGroup; 00038 class AddresseeIconView; 00039 class AddresseeIconViewItem; 00040 00041 namespace KABC { class AddressBook; } 00042 00047 class KAddressBookIconView : public KAddressBookView 00048 { 00049 Q_OBJECT 00050 00051 public: 00052 KAddressBookIconView( KAB::Core *core, QWidget *parent ); 00053 virtual ~KAddressBookIconView(); 00054 00055 virtual QStringList selectedUids(); 00056 virtual QString type() const { return "Icon"; } 00057 virtual KABC::Field *sortField() const; 00058 virtual void readConfig( KConfigGroup &config ); 00059 00060 void scrollUp(); 00061 void scrollDown(); 00062 00063 public Q_SLOTS: 00064 void refresh( const QString &uid = QString() ); 00065 void setSelected( const QString &uid = QString(), bool selected = true ); 00066 virtual void setFirstSelected( bool selected = true ); 00067 00068 protected Q_SLOTS: 00069 void addresseeExecuted( Q3IconViewItem *item ); 00070 void addresseeSelected(); 00071 void rmbClicked( Q3IconViewItem*, const QPoint& ); 00072 00073 private: 00074 AddresseeIconView *mIconView; 00075 QList<AddresseeIconViewItem*> mIconList; 00076 }; 00077 00078 00079 class AddresseeIconView : public K3IconView 00080 { 00081 Q_OBJECT 00082 00083 public: 00084 explicit AddresseeIconView( QWidget *parent, const char *name = 0 ); 00085 ~AddresseeIconView(); 00086 00087 Q_SIGNALS: 00088 void addresseeDropped( QDropEvent* ); 00089 void startAddresseeDrag(); 00090 00091 protected: 00092 virtual Q3DragObject *dragObject(); 00093 00094 protected Q_SLOTS: 00095 void itemDropped( QDropEvent*, const Q3ValueList<Q3IconDragItem> & ); 00096 }; 00097 #endif
KDE 4.2 API Reference