kaddressbook

extensionmanager.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 Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 
00024 #ifndef EXTENSIONMANAGER_H
00025 #define EXTENSIONMANAGER_H
00026 
00027 #include <qhbox.h>
00028 #include <qptrlist.h>
00029 
00030 #include "extensionwidget.h"
00031 
00032 namespace KAB {
00033 class Core;
00034 }
00035 
00036 class QSignalMapper;
00037 class KActionCollection;
00038 
00039 class ExtensionData
00040 {
00041   public:
00042     typedef QValueList<ExtensionData> List;
00043 
00044     KAB::ExtensionWidget *widget;
00045     QString identifier;
00046     QString title;
00047 };
00048 
00049 class ExtensionManager : public QHBox
00050 {
00051   Q_OBJECT
00052 
00053   public:
00054     ExtensionManager( KAB::Core *core, QWidget *parent, const char *name = 0 );
00055     ~ExtensionManager();
00056 
00060     void restoreSettings();
00061 
00065     void saveSettings();
00066 
00071     void reconfigure();
00072 
00076     bool isQuickEditVisible() const;
00077 
00078   public slots:
00079     void setSelectionChanged();
00080     void createActions();
00081 
00082   signals:
00083     void modified( const KABC::Addressee::List& );
00084     void deleted( const QStringList& );
00085 
00086   private slots:
00087     void setActiveExtension( int id );
00088 
00089   private:
00090     void createExtensionWidgets();
00091 
00092     KAB::Core *mCore;
00093 
00094     KAB::ExtensionWidget *mCurrentExtensionWidget;
00095     ExtensionData::List mExtensionList;
00096     QSignalMapper *mMapper;
00097     QPtrList<KAction> mActionList;
00098     KActionCollection *mActionCollection;
00099 };
00100 
00101 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys