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 KToggleAction;
00050 class KXMLGUIClient;
00051 
00052 class QSplitter;
00053 class QStatusBar;
00054 
00055 class AddresseeEditorDialog;
00056 class ExtensionManager;
00057 class FilterSelectionWidget;
00058 class IncSearchWidget;
00059 class JumpButtonBar;
00060 class KAddressBookIface;
00061 class KAddressBookService;
00062 class LDAPSearchDialog;
00063 class ViewManager;
00064 class XXPortManager;
00065 
00066 typedef struct {
00067   KABC::Ticket *ticket;
00068   int counter;
00069 } ResourceMapEntry;
00070 
00071 
00072 class KABCore : public KAB::Core
00073 {
00074   Q_OBJECT
00075 
00076   public:
00077     KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent,
00078              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 *currentSearchField() const;
00111 
00115     KABC::Field *currentSortField() const;
00116 
00120     QStringList selectedUIDs() const;
00121 
00127     KABC::Resource *requestResource( QWidget *parent );
00128 
00132     QWidget *widget() const;
00133 
00134     static KAboutData *createAboutData();
00135 
00136     void setStatusBar( QStatusBar *statusBar );
00137 
00138     QStatusBar *statusBar() const;
00139 
00140   public slots:
00144     void setContactSelected( const QString &uid );
00145 
00150     void sendMail();
00151 
00156     void sendMail( const QString& email );
00157 
00158 
00159     void mailVCard();
00160     void mailVCard(const QStringList& uids);
00161 
00165     void browse( const QString& url );
00166 
00170     void selectAllContacts();
00171 
00175     void deleteContacts();
00176 
00182     void deleteContacts( const QStringList &uids );
00183 
00187     void copyContacts();
00188 
00192     void cutContacts();
00193 
00197     void pasteContacts();
00198 
00204     void pasteContacts( KABC::Addressee::List &list );
00205 
00210     void setWhoAmI();
00211 
00216     void setCategories();
00217 
00221     void setSearchFields( const KABC::Field::List &fields );
00222 
00227     void incrementalTextSearch( const QString& text );
00228 
00229     void incrementalJumpButtonSearch( const QString& text );
00230 
00234     void setModified();
00235 
00239     void setModified( bool modified );
00240 
00244     bool modified() const;
00245 
00250     void contactModified( const KABC::Addressee &addr );
00251 
00255     virtual void addEmail( const QString& addr );
00256 
00260     virtual void importVCard( const KURL& url );
00261 
00265     virtual void importVCard( const QString& vCardURL );
00266 
00270     virtual void newContact();
00271 
00276     virtual QString getNameByPhone( const QString& phone );
00277 
00282     bool handleCommandLine( KAddressBookIface* iface );
00283 
00284 
00288     void save();
00289 
00293     void undo();
00294 
00298     void redo();
00299 
00304     void editContact( const QString &uid = QString::null );
00305 
00309     void openLDAPDialog();
00310 
00314     void configure();
00315 
00320     void print();
00321 
00322     void detailsHighlighted( const QString& );
00323 
00324   signals:
00325     void contactSelected( const QString &name );
00326     void contactSelected( const QPixmap &pixmap );
00327 
00328   private slots:
00329     void setJumpButtonBarVisible( bool visible );
00330     void setDetailsVisible( bool visible );
00331 
00332     void extensionModified( const KABC::Addressee::List &list );
00333     void clipboardDataChanged();
00334     void updateActionMenu();
00335 
00336     void slotEditorDestroyed( const QString &uid );
00337     void configurationChanged();
00338     void addressBookChanged();
00339 
00340     void categoriesSelected( const QStringList& );
00341     void editCategories();
00342 
00343   private:
00344     void initGUI();
00345     void initActions();
00346 
00347     void incrementalSearch( const QString&, bool );
00348 
00349     AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
00350                                                         const char *name = 0 );
00351 
00352     QWidget *mWidget;
00353     KABC::AddressBook *mAddressBook;
00354     QStatusBar *mStatusBar;
00355 
00356     ViewManager *mViewManager;
00357     ExtensionManager *mExtensionManager;
00358     XXPortManager *mXXPortManager;
00359 
00360     JumpButtonBar *mJumpButtonBar;
00361     FilterSelectionWidget *mFilterSelectionWidget;
00362     IncSearchWidget *mIncSearchWidget;
00363     KPIM::AddresseeView *mDetails;
00364     KPIM::CategorySelectDialog *mCategorySelectDialog;
00365     KPIM::CategoryEditDialog *mCategoryEditDialog;
00366     QWidget *mDetailsPage;
00367     QSplitter *mDetailsSplitter;
00368     QSplitter *mExtensionBarSplitter;
00369 
00370     LDAPSearchDialog *mLdapSearchDialog;
00371     QDict<AddresseeEditorDialog> mEditorDict;
00372 
00373     bool mReadWrite;
00374     bool mModified;
00375     bool mIsPart;
00376 
00377     KAction *mActionPaste;
00378     KAction *mActionCut;
00379     KAction *mActionDelete;
00380     KAction *mActionCopy;
00381     KAction *mActionEditAddressee;
00382     KAction *mActionMail;
00383     KAction *mActionMailVCard;
00384     KAction *mActionUndo;
00385     KAction *mActionRedo;
00386     KAction *mActionSave;
00387     KAction *mActionDeleteView;
00388     KAction *mActionWhoAmI;
00389     KAction *mActionCategories;
00390     KToggleAction *mActionJumpBar;
00391     KToggleAction *mActionDetails;
00392 
00393     KAddressBookService *mAddressBookService;
00394 
00395     class KABCorePrivate;
00396     KABCorePrivate *d;
00397 };
00398 
00399 #endif
KDE Logo
This file is part of the documentation for kaddressbook Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:38:52 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003