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

mailtransport

transportmanager.h

00001 /*
00002     Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef MAILTRANSPORT_TRANSPORTMANAGER_H
00021 #define MAILTRANSPORT_TRANSPORTMANAGER_H
00022 
00023 #include <mailtransport/mailtransport_export.h>
00024 
00025 #include <QtCore/QList>
00026 #include <QtCore/QObject>
00027 
00028 class KJob;
00029 
00030 namespace KWallet {
00031   class Wallet;
00032 }
00033 
00034 namespace MailTransport {
00035 
00036 class Transport;
00037 class TransportJob;
00038 
00043 class MAILTRANSPORT_EXPORT TransportManager : public QObject
00044 {
00045   Q_OBJECT
00046   Q_CLASSINFO( "D-Bus Interface", "org.kde.pim.TransportManager" )
00047 
00048   friend class Transport;
00049   friend class Private;
00050 
00051   public:
00052     class Private;
00053 
00057     virtual ~TransportManager();
00058 
00062     static TransportManager *self();
00063 
00069     void loadPasswordsAsync();
00070 
00080     Transport *transportById( int id, bool def = true ) const;
00081 
00090     Transport *transportByName( const QString &name, bool def = true ) const;
00091 
00097     QList<Transport *>transports() const;
00098 
00104     Transport *createTransport() const;
00105 
00111     void addTransport( Transport *transport );
00112 
00118     TransportJob *createTransportJob( int transportId );
00119 
00126     TransportJob *createTransportJob( const QString &transport );
00127 
00134     void schedule( TransportJob *job );
00135 
00140     void createDefaultTransport();
00141 
00142   public Q_SLOTS:
00146     Q_SCRIPTABLE bool isEmpty() const;
00147 
00151     Q_SCRIPTABLE QList<int> transportIds() const;
00152 
00156     Q_SCRIPTABLE QStringList transportNames() const;
00157 
00161     Q_SCRIPTABLE QString defaultTransportName() const;
00162 
00167     Q_SCRIPTABLE int defaultTransportId() const;
00168 
00173     Q_SCRIPTABLE void setDefaultTransport( int id );
00174 
00179     Q_SCRIPTABLE void removeTransport( int id );
00180 
00181   Q_SIGNALS:
00186     Q_SCRIPTABLE void transportsChanged();
00187 
00193     Q_SCRIPTABLE void changesCommitted();
00194 
00200     void passwordsChanged();
00201 
00207     void transportRemoved( int id, const QString &name );
00208 
00215     void transportRenamed( int id, const QString &oldName, const QString &newName );
00216 
00217   protected:
00222     KWallet::Wallet *wallet();
00223 
00227     void loadPasswords();
00228 
00229     TransportManager();
00230 
00231   private:
00232     void readConfig();
00233     void writeConfig();
00234     void emitChangesCommitted();
00235     int createId() const;
00236     void prepareWallet();
00237     void validateDefault();
00238     void migrateToWallet();
00239 
00240   private Q_SLOTS:
00241     void slotTransportsChanged();
00242     void slotWalletOpened( bool success );
00243     void dbusServiceOwnerChanged( const QString &service,
00244                                   const QString &oldOwner,
00245                                   const QString &newOwner );
00246     void jobResult( KJob *job );
00247 
00248   private:
00249     Private *const d;
00250 };
00251 
00252 }
00253 
00254 #endif

mailtransport

Skip menu "mailtransport"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.1
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