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