• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kaddressbook

kaddressbookview.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 along
00016     with this program; if not, write to the Free Software Foundation, Inc.,
00017     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 KADDRESSBOOKVIEW_H
00025 #define KADDRESSBOOKVIEW_H
00026 
00027 #define KAB_VIEW_PLUGIN_VERSION 1
00028 
00029 #include "kaddressbook_export.h"
00030 #include "filter.h"
00031 #include "viewconfigurewidget.h"
00032 #include <kabc/field.h>
00033 #include <KPluginFactory>
00034 
00035 #include <QtCore/QStringList>
00036 #include <QtGui/QDropEvent>
00037 #include <QtGui/QWidget>
00038 
00039 class KConfigGroup;
00040 
00041 class QDropEvent;
00042 
00043 namespace KAB { class Core; }
00044 namespace KABC { class AddressBook; }
00045 
00055 class KADDRESSBOOK_EXPORT KAddressBookView : public QWidget
00056 {
00057   Q_OBJECT
00058 
00059   public:
00060     enum DefaultFilterType { None = 0, Active = 1, Specific = 2 };
00061 
00062     KAddressBookView( KAB::Core *core, QWidget *parent );
00063     virtual ~KAddressBookView();
00064 
00069     virtual QStringList selectedUids() = 0;
00070 
00084     virtual void readConfig( KConfigGroup &config );
00085 
00095     // The KConfig object is unused so we do not document it
00096     // else doxygen will complain.
00097     virtual void writeConfig( KConfigGroup& );
00098 
00103     virtual QString selectedEmails();
00104 
00110     virtual QString type() const = 0;
00111 
00122     KABC::Field::List fields() const;
00123 
00130     void setFilter( const Filter& );
00131 
00137     DefaultFilterType defaultFilterType() const;
00138 
00143     const QString &defaultFilterName() const;
00144 
00148     KAB::Core *core() const;
00149 
00153     virtual KABC::Field *sortField() const = 0;
00154 
00155     virtual void scrollUp() = 0;
00156     virtual void scrollDown() = 0;
00157 
00158   public Q_SLOTS:
00166     virtual void refresh( const QString &uid = QString() ) = 0;
00167 
00173     virtual void setSelected( const QString &uid = QString(), bool selected = true ) = 0;
00174 
00178     virtual void setFirstSelected( bool selected = true ) = 0;
00179 
00185     void popup( const QPoint &point );
00186 
00187   Q_SIGNALS:
00192     void modified();
00193 
00205     void selected( const QString &uid );
00206 
00216     void executed( const QString &uid );
00217 
00223     void startDrag();
00224 
00230     void dropped( QDropEvent* );
00231 
00235     void sortFieldChanged();
00236 
00240     void viewFieldsChanged();
00241 
00242   protected:
00249     KABC::Addressee::List addressees();
00250 
00257     QWidget *viewWidget();
00258 
00259   private Q_SLOTS:
00260     void updateView();
00261 
00262   private:
00263     void initGUI();
00264 
00265     DefaultFilterType mDefaultFilterType;
00266     Filter mFilter;
00267     QString mDefaultFilterName;
00268     KAB::Core *mCore;
00269     KABC::Field::List mFieldList;
00270 
00271     QWidget *mViewWidget;
00272 };
00273 
00274 class KADDRESSBOOK_EXPORT ViewFactory : public KPluginFactory
00275 {
00276   public:
00277     virtual KAddressBookView *view( KAB::Core *core, QWidget *parent ) = 0;
00282     virtual QString type() const = 0;
00283 
00289     virtual QString description() const = 0;
00290 
00300     virtual ViewConfigureWidget *configureWidget( KABC::AddressBook *ab,
00301                                                   QWidget *parent );
00302 };
00303 
00304 #endif

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal