kaddressbook Library API Documentation

kabcore.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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 KABCORE_H
00025 #define KABCORE_H
00026 
00027 #include <kabc/field.h>
00028 
00029 #include <qdict.h>
00030 #include <qwidget.h>
00031 
00032 #include "core.h"
00033 
00034 namespace KABC {
00035 class AddressBook;
00036 class Ticket;
00037 }
00038 
00039 namespace KPIM {
00040 class AddresseeView;
00041 class CategoryEditDialog;
00042 class CategorySelectDialog;
00043 }
00044 
00045 class KAboutData;
00046 class KAction;
00047 class KActionCollection;
00048 class KConfig;
00049 class KStatusBar;
00050 class KToggleAction;
00051 class KXMLGUIClient;
00052 
00053 class QSplitter;
00054 
00055 class AddresseeEditorDialog;
00056 class ExtensionManager;
00057 class FilterSelectionWidget;
00058 class IncSearchWidget;
00059 class JumpButtonBar;
00060 class KAddressBookIface;
00061 class KAddressBookService;
00062 class KIMProxy;
00063 class LDAPSearchDialog;
00064 class ViewManager;
00065 class XXPortManager;
00066 
00067 typedef struct {
00068   KABC::Ticket *ticket;
00069   int counter;
00070 } ResourceMapEntry;
00071 
00072 class KABCore : public KAB::Core
00073 {
00074   Q_OBJECT
00075 
00076   public:
00077     KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent,
00078              const QString &file = QString::null, const char *name = 0 );
00079     ~KABCore();
00080 
00084     void restoreSettings();
00085 
00089     void saveSettings();
00090 
00094     KABC::AddressBook *addressBook() const;
00095 
00099     KConfig *config() const;
00100 
00105     KActionCollection *actionCollection() const;
00106 
00110     KABC::Field *currentSortField() const;
00111 
00115     QStringList selectedUIDs() const;
00116 
00122     KABC::Resource *requestResource( QWidget *parent );
00123 
00127     QWidget *widget() const;
00128 
00129     static KAboutData *createAboutData();
00130 
00131     void setStatusBar( KStatusBar *statusBar );
00132 
00133     KStatusBar *statusBar() const;
00134 
00135     KAB::SearchManager *searchManager() const { return mSearchManager; }
00136 
00140     virtual KPIM::DistributionList::List distributionLists() const;
00141 
00145     virtual QStringList distributionListNames() const;
00146 
00147   public slots:
00151     void setContactSelected( const QString &uid );
00152 
00157     void sendMail();
00158 
00163     void sendMail( const QString& email );
00164 
00165 
00166     void mailVCard();
00167     void mailVCard(const QStringList& uids);
00168 
00172     void startChat();
00173 
00177     void browse( const QString& url );
00178 
00182     void selectAllContacts();
00183 
00187     void deleteContacts();
00188 
00194     void deleteContacts( const QStringList &uids );
00195 
00199     void copyContacts();
00200 
00204     void cutContacts();
00205 
00209     void pasteContacts();
00210 
00216     void pasteContacts( KABC::Addressee::List &list );
00217 
00218 
00222     void mergeContacts();
00223 
00228     void setWhoAmI();
00229 
00234     void setCategories();
00235 
00240     void incrementalTextSearch( const QString& text );
00241 
00242     void incrementalJumpButtonSearch( const QStringList& characters );
00243 
00247     void setModified();
00248 
00252     void setModified( bool modified );
00253 
00257     bool modified() const;
00258 
00263     void contactModified( const KABC::Addressee &addr );
00264 
00268     virtual void addEmail( const QString& addr );
00269 
00273     virtual void importVCard( const KURL& url );
00274 
00278     virtual void importVCard( const QString& vCardURL );
00279 
00283     virtual void newContact();
00284 
00289     virtual QString getNameByPhone( const QString& phone );
00290 
00295     bool handleCommandLine( KAddressBookIface* iface );
00296 
00297 
00301     void save();
00302 
00306     void undo();
00307 
00311     void redo();
00312 
00317     void editContact( const QString &uid = QString::null );
00318 
00323     void storeContactIn( const QString &uid = QString::null );
00324 
00328     void openLDAPDialog();
00329 
00333     void configure();
00334 
00339     void print();
00340 
00341     void detailsHighlighted( const QString& );
00342 
00343     void showContactsAddress( const QString &uid );
00344 
00345     void configurationChanged();
00346 
00347   private slots:
00348     void setJumpButtonBarVisible( bool visible );
00349     void setDetailsVisible( bool visible );
00350 
00351     void extensionModified( const KABC::Addressee::List &list );
00352     void extensionDeleted( const QStringList &uidList );
00353     void clipboardDataChanged();
00354     void updateActionMenu();
00355 
00356     void slotEditorDestroyed( const QString &uid );
00357     void addressBookChanged();
00358 
00359     void categoriesSelected( const QStringList& );
00360     void editCategories();
00361 
00362   private:
00363     void initGUI();
00364     void initActions();
00365 
00366     KABC::Addressee mergeContacts( const KABC::Addressee::List &list );
00367 
00368     AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
00369                                                         const char *name = 0 );
00370 
00371     QWidget *mWidget;
00372     KABC::AddressBook *mAddressBook;
00373     KStatusBar *mStatusBar;
00374 
00375     ViewManager *mViewManager;
00376     ExtensionManager *mExtensionManager;
00377     XXPortManager *mXXPortManager;
00378 
00379     JumpButtonBar *mJumpButtonBar;
00380     FilterSelectionWidget *mFilterSelectionWidget;
00381     IncSearchWidget *mIncSearchWidget;
00382     KPIM::AddresseeView *mDetails;
00383     KPIM::CategorySelectDialog *mCategorySelectDialog;
00384     KPIM::CategoryEditDialog *mCategoryEditDialog;
00385     QWidget *mDetailsPage;
00386     QSplitter *mDetailsSplitter;
00387     QSplitter *mExtensionBarSplitter;
00388 
00389     LDAPSearchDialog *mLdapSearchDialog;
00390     QDict<AddresseeEditorDialog> mEditorDict;
00391 
00392     bool mReadWrite;
00393     bool mModified;
00394     bool mIsPart;
00395 
00396     KAction *mActionPaste;
00397     KAction *mActionCut;
00398     KAction *mActionDelete;
00399     KAction *mActionCopy;
00400     KAction *mActionEditAddressee;
00401     KAction *mActionStoreAddresseeIn;
00402     KAction *mActionMerge;
00403     KAction *mActionMail;
00404     KAction *mActionMailVCard;
00405     KAction *mActionChat;
00406     KAction *mActionUndo;
00407     KAction *mActionRedo;
00408     KAction *mActionSave;
00409     KAction *mActionDeleteView;
00410     KAction *mActionWhoAmI;
00411     KAction *mActionCategories;
00412     KToggleAction *mActionJumpBar;
00413     KToggleAction *mActionDetails;
00414 
00415     KAddressBookService *mAddressBookService;
00416 
00417     KAB::SearchManager *mSearchManager;
00418     // KIMProxy provides access to up to date instant messaging presence data
00419     ::KIMProxy *mKIMProxy;
00420 
00421     class KABCorePrivate;
00422     KABCorePrivate *d;
00423 };
00424 
00425 #endif
KDE Logo
This file is part of the documentation for kaddressbook Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 2 09:54:31 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003