kaddressbook

kaddressbookiconview.h

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 <qstring.h>
00028 #include <kiconview.h>
00029 #include "kaddressbookview.h"
00030 
00031 class QIconViewItem;
00032 class KConfig;
00033 class AddresseeIconView;
00034 class AddresseeIconViewItem;
00035 
00036 namespace KABC { class AddressBook; }
00037 
00042 class KAddressBookIconView : public KAddressBookView
00043 {
00044   Q_OBJECT
00045 
00046   public:
00047     KAddressBookIconView( KAB::Core *core, QWidget *parent,
00048                           const char *name = 0 );
00049     virtual ~KAddressBookIconView();
00050 
00051     virtual QStringList selectedUids();
00052     virtual QString type() const { return "Icon"; }
00053     virtual KABC::Field *sortField() const;
00054     virtual void readConfig( KConfig *config );
00055 
00056     void scrollUp();
00057     void scrollDown();
00058 
00059   public slots:
00060     void refresh( const QString &uid = QString() );
00061     void setSelected( const QString &uid = QString(), bool selected = true );
00062     virtual void setFirstSelected( bool selected = true );
00063 
00064   protected slots:
00065     void addresseeExecuted( QIconViewItem *item );
00066     void addresseeSelected();
00067     void rmbClicked( QIconViewItem*, const QPoint& );
00068 
00069   private:
00070     AddresseeIconView *mIconView;
00071     QPtrList<AddresseeIconViewItem> mIconList;
00072 };
00073 
00074 
00075 class AddresseeIconView : public KIconView
00076 {
00077   Q_OBJECT
00078 
00079   public:
00080     AddresseeIconView( QWidget *parent, const char *name = 0 );
00081     ~AddresseeIconView();
00082 
00083   signals:
00084     void addresseeDropped( QDropEvent* );
00085     void startAddresseeDrag();
00086 
00087   protected:
00088     virtual QDragObject *dragObject();
00089 
00090   protected slots:
00091     void itemDropped( QDropEvent*, const QValueList<QIconDragItem>& );
00092 };
00093 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys