kontact Library API Documentation

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., 59 Temple Place - Suite 330,
00021    Boston, MA 02111-1307, USA.
00022 */
00023 
00024 #ifndef KONTACT_PLUGIN_H
00025 #define KONTACT_PLUGIN_H
00026 
00027 #include <qobject.h>
00028 #include <kxmlguiclient.h>
00029 #include <qptrlist.h>
00030 
00031 class QStringList;
00032 class DCOPClient;
00033 class DCOPObject;
00034 class KAboutData;
00035 class KAction;
00036 class QWidget;
00037 namespace KParts { class Part; }
00038 
00043 #define KONTACT_PLUGIN_VERSION 4
00044 
00045 namespace Kontact
00046 {
00047 
00048 class Core;
00049 class Summary;
00050 
00056 class Plugin : public QObject, virtual public KXMLGUIClient
00057 {
00058   Q_OBJECT
00059 
00060   public:
00069     Plugin( Core *core, QObject *parent, const char *name );
00070 
00071     ~Plugin();
00072 
00076     void setIdentifier( const QString &identifier );
00077 
00082     QString identifier() const;
00083 
00087     void setTitle( const QString &title );
00088 
00092     QString title() const;
00093 
00097     void setIcon( const QString &icon );
00098 
00102     QString icon() const;
00103 
00107     void setExecutableName( const QString &bin );
00108 
00112     QString executableName() const;
00113 
00117     void setPartLibraryName( const QCString & );
00118 
00123     virtual bool createDCOPInterface( const QString& /*serviceType*/ ) { return false; }
00124 
00129     virtual bool isRunningStandalone() { return false; }
00130 
00136     virtual void bringToForeground();
00137 
00142     virtual const KAboutData *aboutData();
00143 
00149     KParts::Part *part();
00150 
00154     virtual QString tipFile() const;
00155 
00160     virtual void select();
00161 
00166     virtual void configUpdated();
00167 
00174     virtual Summary *createSummaryWidget( QWidget * /*parent*/ ) { return 0; }
00175 
00179     virtual bool showInSideBar() const { return true; }
00180 
00186     virtual bool queryClose() const { return true; }
00187 
00197     DCOPClient *dcopClient() const;
00198 
00203     virtual int weight() const { return 0; }
00204 
00208     void insertNewAction( KAction *action );
00209 
00213     QPtrList<KAction>* newActions() const;
00214 
00218     virtual QStringList invisibleToolbarActions() const { return QStringList(); }
00219 
00223     virtual bool canDecodeDrag( QMimeSource * ) { return false; }
00224 
00228     virtual void processDropEvent( QDropEvent * ) {}
00229 
00230     Core *core() const;
00231 
00232   protected:
00237     virtual KParts::Part *createPart() = 0;
00238 
00239     KParts::Part *loadPart();
00240 
00241     virtual void virtual_hook(  int id, void* data );
00242 
00243   private slots:
00244     void partDestroyed();
00245 
00246   private:
00247     class Private;
00248     Private *d;
00249 };
00250 
00251 }
00252 
00253 #endif
KDE Logo
This file is part of the documentation for kontact Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu May 3 20:25:58 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003