• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

Kontact Plugin Interface Library

uniqueapphandler.h

00001 /*
00002   This file is part of the KDE Kontact Plugin Interface Library.
00003 
00004   Copyright (c) 2003,2008 David Faure <faure@kde.org>
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010 
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Library General Public License for more details.
00015 
00016   You should have received a copy of the GNU Library General Public License
00017   along with this library; see the file COPYING.LIB.  If not, write to
00018   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019   Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KONTACTINTERFACE_UNIQUEAPPHANDLER_H
00023 #define KONTACTINTERFACE_UNIQUEAPPHANDLER_H
00024 
00025 #include "kontactinterface_export.h"
00026 #include "plugin.h"
00027 
00028 namespace KontactInterface
00029 {
00030 
00038 class KONTACTINTERFACE_EXPORT UniqueAppHandler : public QObject
00039 {
00040   Q_OBJECT
00041   // We implement the KUniqueApplication interface
00042   Q_CLASSINFO( "D-Bus Interface", "org.kde.KUniqueApplication" )
00043 
00044   public:
00045     UniqueAppHandler( Plugin *plugin );
00046     virtual ~UniqueAppHandler();
00047 
00049     virtual void loadCommandLineOptions() = 0;
00050 
00051     Plugin *plugin() const;
00052 
00053     // for kontact
00054     static void setMainWidget( QWidget *widget );
00055 
00056   public Q_SLOTS: // DBUS methods
00057     int newInstance( const QByteArray &asn_id, const QByteArray &args );
00058     bool load();
00059 
00060   protected:
00061     virtual int newInstance();
00062 
00063   private:
00064     class Private;
00065     Private *const d;
00066 };
00067 
00069 class UniqueAppHandlerFactoryBase
00070 {
00071   public:
00072     virtual ~UniqueAppHandlerFactoryBase(){}
00073     virtual UniqueAppHandler *createHandler( Plugin * ) = 0;
00074 };
00075 
00082 template <class T> class UniqueAppHandlerFactory : public UniqueAppHandlerFactoryBase
00083 {
00084   public:
00085     virtual UniqueAppHandler *createHandler( Plugin *plugin ) {
00086       plugin->registerClient();
00087       return new T( plugin );
00088     }
00089 };
00090 
00098 class KONTACTINTERFACE_EXPORT UniqueAppWatcher : public QObject
00099 {
00100   Q_OBJECT
00101 
00102   public:
00112     UniqueAppWatcher( UniqueAppHandlerFactoryBase *factory, Plugin *plugin );
00113 
00114     virtual ~UniqueAppWatcher();
00115 
00116     bool isRunningStandalone() const;
00117 
00118   private Q_SLOTS:
00119     void slotApplicationRemoved( const QString &name, const QString &oldOwner,
00120                                  const QString &newOwner );
00121 
00122   private:
00123     class Private;
00124     Private *const d;
00125 };
00126 
00127 } // namespace
00128 
00129 #endif
00130 

Kontact Plugin Interface Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.2-20100208
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal