• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kaddressbook

xxport.h

Go to the documentation of this file.
00001 /*
00002     This file is part of KAddressbook.
00003     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License along
00016     with this program; if not, write to the Free Software Foundation, Inc.,
00017     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 
00024 #ifndef KAB_XXPORT_H
00025 #define KAB_XXPORT_H
00026 
00027 #include <QtCore/QObject>
00028 
00029 #include "kaddressbook_export.h"
00030 #include <kabc/addressbook.h>
00031 #include <kabc/addresseelist.h>
00032 #include <kpluginfactory.h>
00033 #include <kxmlguiclient.h>
00034 
00035 #define KAB_XXPORT_PLUGIN_VERSION 1
00036 
00037 class KApplication;
00038 
00046 #define K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libname, XXPortClass, catalog ) \
00047 class KDE_NO_EXPORT LocalXXPortFactory : public KAB::XXPortFactory { \
00048     public: LocalXXPortFactory() : KAB::XXPortFactory(#libname, catalog) {} \
00049       KAB::XXPort *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name ) \
00050       { return new XXPortClass( ab, parent, name ); } \
00051 }; \
00052 K_EXPORT_PLUGIN( LocalXXPortFactory )
00053 
00060 #define K_EXPORT_KADDRESSBOOK_XXFILTER( libname, XXPortClass ) \
00061     K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libname, XXPortClass, NULL )
00062 
00063 
00064 namespace KAB {
00065 
00066 class KABINTERFACES_EXPORT XXPort : public QObject, virtual public KXMLGUIClient
00067 {
00068   Q_OBJECT
00069 
00070   public:
00071     explicit XXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 );
00072     ~XXPort();
00073 
00078     virtual QString identifier() const = 0;
00079 
00084     virtual bool requiresSorting() const { return false; }
00085 
00090     void setKApplication( KApplication *app );
00091 
00098     void processEvents() const;
00099 
00100   public Q_SLOTS:
00104     virtual bool exportContacts( const KABC::AddresseeList &list, const QString& identifier );
00105 
00109     virtual KABC::Addressee::List importContacts( const QString& identifier ) const;
00110 
00111   Q_SIGNALS:
00117     void exportActivated( const QString&, const QString& );
00118 
00124     void importActivated( const QString&, const QString& );
00125 
00126   protected:
00130     void createImportAction( const QString &label, const QString &identifier = QString() );
00131 
00135     void createExportAction( const QString &label, const QString &identifier = QString() );
00136 
00140     KABC::AddressBook *addressBook() const;
00141 
00146     QWidget *parentWidget() const;
00147 
00148   private Q_SLOTS:
00149     void slotImportActivated( const QString& );
00150     void slotExportActivated( const QString& );
00151 
00152   private:
00153     KABC::AddressBook *mAddressBook;
00154     QWidget *mParentWidget;
00155 
00156     class XXPortPrivate;
00157     XXPortPrivate *d;
00158 };
00159 
00160 class KABINTERFACES_EXPORT XXPortFactory : public KPluginFactory
00161 {
00162   Q_OBJECT
00163 
00164   public:
00165     explicit XXPortFactory(const char *componentName = 0, const char *catalogName = 0)
00166       : KPluginFactory(componentName, catalogName) {}
00167 
00168     virtual XXPort *xxportObject( KABC::AddressBook *ab, QWidget *parent,
00169                                   const char *name = 0 ) = 0;
00170 };
00171 
00172 
00173 } /* namespace KAB */
00174 
00175 #endif

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
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