kaddressbook

core.h

00001 /*
00002     This file is part of KAddressbook.
00003     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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 KAB_CORE_H
00025 #define KAB_CORE_H
00026 
00027 #include <config.h> // for KDEPIM_NEW_DISTRLISTS
00028 
00029 #ifdef KDEPIM_NEW_DISTRLISTS
00030 #include <libkdepim/distributionlist.h>
00031 #endif
00032 
00033 #include <qobject.h>
00034 
00035 #include <kabc/field.h>
00036 #include <kcommand.h>
00037 #include <kxmlguiclient.h>
00038 #include <kdepimmacros.h>
00039 
00040 namespace KABC {
00041 class AddressBook;
00042 class Resource;
00043 }
00044 
00045 class QWidget;
00046 
00047 class KActionCollection;
00048 class KConfig;
00049 class KURL;
00050 
00051 namespace KAB {
00052 
00053 class SearchManager;
00054 
00055 class KDE_EXPORT Core : public QObject
00056 {
00057   Q_OBJECT
00058 
00059   public:
00060     Core( KXMLGUIClient *client, QObject *parent, const char *name = 0 );
00061 
00065     virtual KABC::AddressBook *addressBook() const = 0;
00066 
00070     virtual KConfig *config() const = 0;
00071 
00076     virtual KActionCollection *actionCollection() const = 0;
00077 
00081     virtual KXMLGUIClient *guiClient() const { return mGUIClient; }
00082 
00086     virtual KABC::Field *currentSortField() const = 0;
00087 
00091     virtual QStringList selectedUIDs() const = 0;
00092 
00098     virtual KABC::Resource *requestResource( QWidget *parent ) = 0;
00099 
00103     virtual QWidget *widget() const = 0;
00104 
00110     virtual void deleteContacts( const QStringList &uids ) = 0;
00111 
00117     virtual void deleteDistributionLists( const QStringList &uids ) = 0;
00118 
00119 #ifdef KDEPIM_NEW_DISTRLISTS
00120 
00123     virtual KPIM::DistributionList::List distributionLists() const = 0;
00124 
00125 
00129     virtual QStringList distributionListNames() const = 0;
00130 
00135     virtual void setSelectedDistributionList( const QString &name ) = 0;
00136 #endif
00137 
00139     virtual SearchManager *searchManager() const = 0;
00140 
00141     virtual KCommandHistory *commandHistory() const = 0;
00142 
00143     signals:
00148     void contactsUpdated();
00149 
00150   public slots:
00154     virtual void setContactSelected( const QString &uid ) = 0;
00155 
00159     virtual void addEmail( const QString& addr ) = 0;
00160 
00164     virtual void importVCard( const KURL& url ) = 0;
00165 
00169     virtual void importVCardFromData( const QString& vCard ) = 0;
00170 
00174     virtual void newContact() = 0;
00175 
00179     virtual void newDistributionList() = 0;
00180 
00185     virtual QString getNameByPhone( const QString& phone ) = 0;
00186 
00190     virtual void editContact( const QString &uid = QString::null ) = 0;
00191 
00195     virtual void editDistributionList( const QString &name ) = 0;
00196 
00197   private:
00198     KXMLGUIClient *mGUIClient;
00199 };
00200 
00201 }
00202 
00203 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys