• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.9.3 API Reference
  • KDE Home
  • Contact Us
 

Kontact Plugin Interface Library

  • kontactinterface
plugin.h
1 /*
2  This file is part of the KDE Kontact Plugin Interface Library.
3 
4  Copyright (c) 2001 Matthias Hoelzer-Kluepfel <mhk@kde.org>
5  Copyright (c) 2002-2003 Daniel Molkentin <molkentin@kde.org>
6  Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #ifndef KONTACTINTERFACE_PLUGIN_H
25 #define KONTACTINTERFACE_PLUGIN_H
26 
27 #include "kontactinterface_export.h"
28 
29 #include <kpluginfactory.h>
30 #include <kxmlguiclient.h>
31 
32 #include <QtCore/QList>
33 #include <QtCore/QObject>
34 
35 class KAboutData;
36 class KAction;
37 class KConfig;
38 class KConfigGroup;
39 class QDropEvent;
40 class QMimeData;
41 class QStringList;
42 class QWidget;
43 namespace KParts {
44  class ReadOnlyPart;
45 }
46 
50 #define EXPORT_KONTACT_PLUGIN( pluginclass, pluginname ) \
51 class Instance \
52 { \
53  public: \
54  static QObject *createInstance( QWidget *, QObject *parent, const QVariantList &list ) \
55  { return new pluginclass( static_cast<KontactInterface::Core*>( parent ), list ); } \
56 }; \
57 K_PLUGIN_FACTORY( KontactPluginFactory, registerPlugin< pluginclass > \
58  ( QString(), Instance::createInstance ); ) \
59 K_EXPORT_PLUGIN( KontactPluginFactory( "kontact_" #pluginname "plugin" ) )
60 
64 #define KONTACT_PLUGIN_VERSION 9
65 
66 namespace KontactInterface
67 {
68 
69 class Core;
70 class Summary;
71 
78 class KONTACTINTERFACE_EXPORT Plugin : public QObject, virtual public KXMLGUIClient
79 {
80  Q_OBJECT
81 
82  public:
93  Plugin( Core *core, QObject *parent, const char *appName, const char *pluginName = 0 );
94 
98  virtual ~Plugin();
99 
103  void setIdentifier( const QString &identifier );
104 
108  QString identifier() const;
109 
113  void setTitle( const QString &title );
114 
118  QString title() const;
119 
123  void setIcon( const QString &icon );
124 
128  QString icon() const;
129 
133  void setExecutableName( const QString &name );
134 
138  QString executableName() const;
139 
143  void setPartLibraryName( const QByteArray &name );
144 
149  virtual bool createDBUSInterface( const QString &serviceType );
150 
156  virtual bool isRunningStandalone() const;
157 
163  virtual void bringToForeground();
164 
169  virtual const KAboutData *aboutData() const;
170 
176  KParts::ReadOnlyPart *part();
177 
183  virtual QString tipFile() const;
184 
189  virtual void select();
190 
196  void aboutToSelect();
197 
202  virtual void configUpdated();
203 
210  virtual Summary *createSummaryWidget( QWidget *parent );
211 
215  virtual bool showInSideBar() const;
216 
220  void setShowInSideBar( bool hasPart );
221 
228  virtual bool queryClose() const;
229 
233  QString registerClient();
234 
239  virtual int weight() const;
240 
244  void insertNewAction( KAction *action );
245 
249  void insertSyncAction( KAction *action );
250 
254  QList<KAction*> newActions() const;
255 
259  QList<KAction*> syncActions() const;
260 
264  virtual QStringList invisibleToolbarActions() const;
265 
269  virtual bool canDecodeMimeData( const QMimeData *data ) const;
270 
274  virtual void processDropEvent( QDropEvent * );
275 
279  virtual void readProperties( const KConfigGroup & );
280 
284  virtual void saveProperties( KConfigGroup & );
285 
289  Core *core() const;
290 
294  void setDisabled( bool value );
295 
299  bool disabled() const;
300 
301  public Q_SLOTS:
307  void slotConfigUpdated();
308 
309  protected:
314  virtual KParts::ReadOnlyPart *createPart() = 0;
315 
319  KParts::ReadOnlyPart *loadPart();
320 
324  virtual void virtual_hook( int id, void *data );
325 
326  private:
327  //@cond PRIVATE
328  class Private;
329  Private *const d;
330 
331  Q_PRIVATE_SLOT( d, void partDestroyed() )
332  //@endcond
333 };
334 
335 }
336 
337 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Nov 26 2012 16:48:08 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kontact Plugin Interface Library

Skip menu "Kontact Plugin Interface Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.9.3 API Reference

Skip menu "kdepimlibs-4.9.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal