kaddressbook

kaddressbookmain.h
00001 /*
00002     This file is part of KAddressbook.
00003     Copyright (c) 1999 Don Sanders <dsanders@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 KADDRESSBOOKMAIN_H
00025 #define KADDRESSBOOKMAIN_H
00026 
00027 #include <tqptrlist.h>
00028 
00029 #include <kaction.h>
00030 #include <kapplication.h>
00031 #include <kmainwindow.h>
00032 
00033 #include "kaddressbookiface.h"
00034 
00035 class KABCore;
00036 
00045 class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
00046 {
00047   Q_OBJECT
00048   TQ_OBJECT
00049 
00050   public:
00051     KAddressBookMain( const TQString &file = TQString() );
00052     virtual ~KAddressBookMain();
00053 
00054   public slots:
00055     virtual void addEmail( TQString addr );
00056     virtual void importVCard( const KURL& url );
00057     virtual void importVCardFromData( const TQString& vCard );
00058 #ifndef Q_MOC_RUN
00059     virtual ASYNC showContactEditor( TQString uid );
00060 #else // QT_MOC_RUN
00061     virtual void showContactEditor( TQString uid );
00062 #endif // QT_MOC_RUN
00063     virtual void newContact();
00064     virtual void newDistributionList();
00065     virtual TQString getNameByPhone( TQString phone );
00066     virtual void save();
00067     virtual void exit();
00068     virtual bool handleCommandLine();
00069     virtual void syncAllResources();
00070 
00071   protected:
00072     void initActions();
00073 
00078     void saveProperties( KConfig* );
00079 
00085     void readProperties( KConfig* );
00086 
00087     virtual bool queryClose();
00088 
00089     //override
00090     void loadProfile( const TQString& path );
00091 
00092     //override
00093     void saveToProfile( const TQString& path ) const;
00094 
00095   private slots:
00096     void configureKeyBindings();
00097     void configureToolbars();
00098     void newToolbarConfig();
00099 
00100   private:
00101     KABCore *mCore;
00102 };
00103 
00104 #endif