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 TQt, and distribute the resulting executable, 00021 without including the source code for TQt 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 <tqobject.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 TQWidget; 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 TQObject 00056 { 00057 Q_OBJECT 00058 TQ_OBJECT 00059 00060 public: 00061 Core( KXMLGUIClient *client, TQObject *parent, const char *name = 0 ); 00062 00066 virtual KABC::AddressBook *addressBook() const = 0; 00067 00071 virtual KConfig *config() const = 0; 00072 00077 virtual KActionCollection *actionCollection() const = 0; 00078 00082 virtual KXMLGUIClient *guiClient() const { return mGUIClient; } 00083 00087 virtual KABC::Field *currentSortField() const = 0; 00088 00092 virtual TQStringList selectedUIDs() const = 0; 00093 00099 virtual KABC::Resource *requestResource( TQWidget *parent ) = 0; 00100 00104 virtual TQWidget *widget() const = 0; 00105 00111 virtual void deleteContacts( const TQStringList &uids ) = 0; 00112 00118 virtual void deleteDistributionLists( const TQStringList &uids ) = 0; 00119 00120 #ifdef KDEPIM_NEW_DISTRLISTS 00121 00124 virtual KPIM::DistributionList::List distributionLists() const = 0; 00125 00126 00130 virtual TQStringList distributionListNames() const = 0; 00131 00136 virtual void setSelectedDistributionList( const TQString &name ) = 0; 00137 #endif 00138 00140 virtual SearchManager *searchManager() const = 0; 00141 00142 virtual KCommandHistory *commandHistory() const = 0; 00143 00144 signals: 00149 void contactsUpdated(); 00150 00151 public slots: 00155 virtual void setContactSelected( const TQString &uid ) = 0; 00156 00160 virtual void addEmail( const TQString& addr ) = 0; 00161 00165 virtual void importVCard( const KURL& url ) = 0; 00166 00170 virtual void importVCardFromData( const TQString& vCard ) = 0; 00171 00175 virtual void newContact() = 0; 00176 00180 virtual void newDistributionList() = 0; 00181 00186 virtual TQString getNameByPhone( const TQString& phone ) = 0; 00187 00191 virtual void editContact( const TQString &uid = TQString() ) = 0; 00192 00196 virtual void editDistributionList( const TQString &name ) = 0; 00197 00198 private: 00199 KXMLGUIClient *mGUIClient; 00200 }; 00201 00202 } 00203 00204 #endif