• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • 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 
00056     static void setMainWidget( QWidget *widget );
00057 
00062     QWidget *mainWidget();
00063 
00064   public Q_SLOTS: // DBUS methods
00065     int newInstance( const QByteArray &asn_id, const QByteArray &args );
00066     bool load();
00067 
00068   protected:
00069     virtual int newInstance();
00070 
00071   private:
00072     class Private;
00073     Private *const d;
00074 };
00075 
00077 class UniqueAppHandlerFactoryBase
00078 {
00079   public:
00080     virtual ~UniqueAppHandlerFactoryBase(){}
00081     virtual UniqueAppHandler *createHandler( Plugin * ) = 0;
00082 };
00083 
00090 template <class T> class UniqueAppHandlerFactory : public UniqueAppHandlerFactoryBase
00091 {
00092   public:
00093     virtual UniqueAppHandler *createHandler( Plugin *plugin ) {
00094       plugin->registerClient();
00095       return new T( plugin );
00096     }
00097 };
00098 
00106 class KONTACTINTERFACE_EXPORT UniqueAppWatcher : public QObject
00107 {
00108   Q_OBJECT
00109 
00110   public:
00120     UniqueAppWatcher( UniqueAppHandlerFactoryBase *factory, Plugin *plugin );
00121 
00122     virtual ~UniqueAppWatcher();
00123 
00124     bool isRunningStandalone() const;
00125 
00126   private Q_SLOTS:
00127     void slotApplicationRemoved( const QString &name, const QString &oldOwner,
00128                                  const QString &newOwner );
00129 
00130   private:
00131     class Private;
00132     Private *const d;
00133 };
00134 
00135 } // namespace
00136 
00137 #endif
00138 
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:10 by doxygen 1.7.5 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.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 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