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 3 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 00190 DCOPClient *dcopClient() const; 00191 00196 virtual int weight() const { return 0; } 00197 00201 void insertNewAction( KAction *action ); 00202 00206 QPtrList<KAction>* newActions() const; 00207 00211 virtual QStringList invisibleToolbarActions() const { return QStringList(); } 00212 00216 virtual bool canDecodeDrag( QMimeSource * ) { return false; } 00217 00221 virtual void processDropEvent( QDropEvent * ) {} 00222 00223 Core *core() const; 00224 00225 protected: 00230 virtual KParts::Part *createPart() = 0; 00231 00232 KParts::Part *loadPart(); 00233 00234 private slots: 00235 void partDestroyed(); 00236 00237 private: 00238 class Private; 00239 Private *d; 00240 }; 00241 00242 } 00243 00244 #endif