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 
00137   public slots:
00141     void setContactSelected( const QString &uid );
00142 
00147     void sendMail();
00148 
00153     void sendMail( const QString& email );
00154 
00155 
00156     void mailVCard();
00157     void mailVCard(const QStringList& uids);
00158 
00162     void startChat();
00163 
00167     void browse( const QString& url );
00168 
00172     void selectAllContacts();
00173 
00177     void deleteContacts();
00178 
00184     void deleteContacts( const QStringList &uids );
00185 
00189     void copyContacts();
00190 
00194     void cutContacts();
00195 
00199     void pasteContacts();
00200 
00206     void pasteContacts( KABC::Addressee::List &list );
00207 
00208 
00212     void mergeContacts();
00213 
00218     void setWhoAmI();
00219 
00224     void setCategories();
00225 
00230     void incrementalTextSearch( const QString& text );
00231 
00232     void incrementalJumpButtonSearch( const QStringList& characters );
00233 
00237     void setModified();
00238 
00242     void setModified( bool modified );
00243 
00247     bool modified() const;
00248 
00253     void contactModified( const KABC::Addressee &addr );
00254 
00258     virtual void addEmail( const QString& addr );
00259 
00263     virtual void importVCard( const KURL& url );
00264 
00268     virtual void importVCard( const QString& vCardURL );
00269 
00273     virtual void newContact();
00274 
00279     virtual QString getNameByPhone( const QString& phone );
00280 
00285     bool handleCommandLine( KAddressBookIface* iface );
00286 
00287 
00291     void save();
00292 
00296     void undo();
00297 
00301     void redo();
00302 
00307     void editContact( const QString &uid = QString::null );
00308 
00312     void openLDAPDialog();
00313 
00317     void configure();
00318 
00323     void print();
00324 
00325     void detailsHighlighted( const QString& );
00326 
00327     void showContactsAddress( const QString &uid );
00328 
00329     void configurationChanged();
00330 
00331   private slots:
00332     void setJumpButtonBarVisible( bool visible );
00333     void setDetailsVisible( bool visible );
00334 
00335     void extensionModified( const KABC::Addressee::List &list );
00336     void clipboardDataChanged();
00337     void updateActionMenu();
00338 
00339     void slotEditorDestroyed( const QString &uid );
00340     void addressBookChanged();
00341 
00342     void categoriesSelected( const QStringList& );
00343     void editCategories();
00344 
00345   private:
00346     void initGUI();
00347     void initActions();
00348 
00349     KABC::Addressee mergeContacts( const KABC::Addressee::List &list );
00350 
00351     AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
00352                                                         const char *name = 0 );
00353 
00354     QWidget *mWidget;
00355     KABC::AddressBook *mAddressBook;
00356     KStatusBar *mStatusBar;
00357 
00358     ViewManager *mViewManager;
00359     ExtensionManager *mExtensionManager;
00360     XXPortManager *mXXPortManager;
00361 
00362     JumpButtonBar *mJumpButtonBar;
00363     FilterSelectionWidget *mFilterSelectionWidget;
00364     IncSearchWidget *mIncSearchWidget;
00365     KPIM::AddresseeView *mDetails;
00366     KPIM::CategorySelectDialog *mCategorySelectDialog;
00367     KPIM::CategoryEditDialog *mCategoryEditDialog;
00368     QWidget *mDetailsPage;
00369     QSplitter *mDetailsSplitter;
00370     QSplitter *mExtensionBarSplitter;
00371 
00372     LDAPSearchDialog *mLdapSearchDialog;
00373     QDict<AddresseeEditorDialog> mEditorDict;
00374 
00375     bool mReadWrite;
00376     bool mModified;
00377     bool mIsPart;
00378 
00379     KAction *mActionPaste;
00380     KAction *mActionCut;
00381     KAction *mActionDelete;
00382     KAction *mActionCopy;
00383     KAction *mActionEditAddressee;
00384     KAction *mActionMerge;
00385     KAction *mActionMail;
00386     KAction *mActionMailVCard;
00387     KAction *mActionChat;
00388     KAction *mActionUndo;
00389     KAction *mActionRedo;
00390     KAction *mActionSave;
00391     KAction *mActionDeleteView;
00392     KAction *mActionWhoAmI;
00393     KAction *mActionCategories;
00394     KToggleAction *mActionJumpBar;
00395     KToggleAction *mActionDetails;
00396 
00397     KAddressBookService *mAddressBookService;
00398 
00399     KAB::SearchManager *mSearchManager;
00400     // KIMProxy provides access to up to date instant messaging presence data
00401     ::KIMProxy *mKIMProxy;
00402 
00403     class KABCorePrivate;
00404     KABCorePrivate *d;
00405 };
00406 
00407 #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 Wed Mar 23 22:42:47 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003