kontact

plugin.h

00001 /*
00002    This file is part of KDE Kontact.
00003 
00004    Copyright (c) 2001 Matthias Hoelzer-Kluepfel <mhk@kde.org>
00005    Copyright (c) 2002-2003 Daniel Molkentin <molkentin@kde.org>
00006    Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
00007 
00008    This library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public
00010    License as published by the Free Software Foundation; either
00011    version 2 of the License, or (at your option) any later version.
00012 
00013    This library is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public License
00019    along with this library; see the file COPYING.LIB.  If not, write to
00020    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.
00022 */
00023 
00024 #ifndef KONTACT_PLUGIN_H
00025 #define KONTACT_PLUGIN_H
00026 
00027 #include <qobject.h>
00028 #include <kxmlguiclient.h>
00029 #include <kdepimmacros.h>
00030 #include <qptrlist.h>
00031 
00032 class QStringList;
00033 class DCOPClient;
00034 class DCOPObject;
00035 class KAboutData;
00036 class KAction;
00037 class QWidget;
00038 namespace KParts { class ReadOnlyPart; }
00039 
00044 #define KONTACT_PLUGIN_VERSION 4
00045 
00046 namespace Kontact
00047 {
00048 
00049 class Core;
00050 class Summary;
00051 
00057 class KDE_EXPORT Plugin : public QObject, virtual public KXMLGUIClient
00058 {
00059   Q_OBJECT
00060 
00061   public:
00070     Plugin( Core *core, QObject *parent, const char *name );
00071 
00072     ~Plugin();
00073 
00077     void setIdentifier( const QString &identifier );
00078 
00083     QString identifier() const;
00084 
00088     void setTitle( const QString &title );
00089 
00093     QString title() const;
00094 
00098     void setIcon( const QString &icon );
00099 
00103     QString icon() const;
00104 
00108     void setExecutableName( const QString &bin );
00109 
00113     QString executableName() const;
00114 
00118     void setPartLibraryName( const QCString & );
00119 
00124     virtual bool createDCOPInterface( const QString& /*serviceType*/ ) { return false; }
00125 
00130     virtual bool isRunningStandalone() { return false; }
00131 
00137     virtual void bringToForeground();
00138 
00143     virtual const KAboutData *aboutData();
00144 
00150     KParts::ReadOnlyPart *part();
00151 
00155     virtual QString tipFile() const;
00156 
00161     virtual void select();
00162 
00167     virtual void configUpdated();
00168 
00173     virtual Summary *createSummaryWidget( QWidget * /*parent*/ ) { return 0; }
00174 
00178     virtual bool showInSideBar() const;
00179 
00183     void setShowInSideBar( bool hasPart );
00184 
00190     virtual bool queryClose() const { return true; }
00191 
00201     DCOPClient *dcopClient() const;
00202 
00207     virtual int weight() const { return 0; }
00208 
00212     void insertNewAction( KAction *action );
00213 
00217     QPtrList<KAction>* newActions() const;
00218 
00222     virtual QStringList invisibleToolbarActions() const { return QStringList(); }
00223 
00227     virtual bool canDecodeDrag( QMimeSource * ) { return false; }
00228 
00232     virtual void processDropEvent( QDropEvent * ) {}
00233 
00234     Core *core() const;
00235 
00236   public slots:
00240     void slotConfigUpdated();
00241 
00242   protected:
00247     virtual KParts::ReadOnlyPart *createPart() = 0;
00248 
00249     KParts::ReadOnlyPart *loadPart();
00250 
00251     virtual void virtual_hook(  int id, void* data );
00252 
00253   private slots:
00254     void partDestroyed();
00255 
00256   private:
00257     class Private;
00258     Private *d;
00259 };
00260 
00261 }
00262 
00263 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys