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 
00112 #ifdef KDEPIM_NEW_DISTRLISTS
00113 
00116     virtual KPIM::DistributionList::List distributionLists() const = 0;
00117 
00121     virtual QStringList distributionListNames() const = 0;
00122 #endif
00123 
00125     virtual SearchManager *searchManager() const = 0;
00126 
00127     virtual KCommandHistory *commandHistory() const = 0;
00128 
00129     signals:
00134     void contactsUpdated();
00135 
00136   public slots:
00140     virtual void setContactSelected( const QString &uid ) = 0;
00141 
00145     virtual void addEmail( const QString& addr ) = 0;
00146 
00150     virtual void importVCard( const KURL& url ) = 0;
00151 
00155     virtual void importVCard( const QString& vCard ) = 0;
00156 
00160     virtual void newContact() = 0;
00161 
00166     virtual QString getNameByPhone( const QString& phone ) = 0;
00167 
00171     virtual void editContact( const QString &uid = QString::null ) = 0;
00172 
00173   private:
00174     KXMLGUIClient *mGUIClient;
00175 };
00176 
00177 }
00178 
00179 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys