• Skip to content
  • Skip to link menu
KDE 4.0 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 
00050   public:
00054     virtual ~TransportManager();
00055 
00059     static TransportManager* self();
00060 
00066     void loadPasswordsAsync();
00067 
00077     Transport* transportById( int id, bool def = true ) const;
00078 
00087     Transport* transportByName( const QString &name, bool def = true ) const;
00088 
00094     QList<Transport*> transports() const;
00095 
00101     Transport* createTransport() const;
00102 
00108     void addTransport( Transport* transport );
00109 
00115     TransportJob* createTransportJob( int transportId );
00116 
00123     TransportJob* createTransportJob( const QString &transport );
00124 
00131     void schedule( TransportJob* job );
00132 
00137     void createDefaultTransport();
00138 
00139   public Q_SLOTS:
00143     Q_SCRIPTABLE bool isEmpty() const;
00144 
00148     Q_SCRIPTABLE QList<int> transportIds() const;
00149 
00153     Q_SCRIPTABLE QStringList transportNames() const;
00154 
00158     Q_SCRIPTABLE QString defaultTransportName() const;
00159 
00164     Q_SCRIPTABLE int defaultTransportId() const;
00165 
00170     Q_SCRIPTABLE void setDefaultTransport( int id );
00171 
00176     Q_SCRIPTABLE void removeTransport( int id );
00177 
00178   Q_SIGNALS:
00183     Q_SCRIPTABLE void transportsChanged();
00184 
00190     Q_SCRIPTABLE void changesCommitted();
00191 
00195     void passwordsChanged();
00196 
00202     void transportRemoved( int id, const QString &name );
00203 
00210     void transportRenamed( int id, const QString &oldName, const QString &newName );
00211 
00212   protected:
00217     KWallet::Wallet* wallet();
00218 
00222     void loadPasswords();
00223 
00224   private:
00225     TransportManager();
00226     void readConfig();
00227     void writeConfig();
00228     void emitChangesCommitted();
00229     int createId() const;
00230     void prepareWallet();
00231     void validateDefault();
00232     void migrateToWallet();
00233 
00234   private Q_SLOTS:
00235     void slotTransportsChanged();
00236     void slotWalletOpened( bool success );
00237     void dbusServiceOwnerChanged( const QString &service,
00238                                   const QString &oldOwner,
00239                                   const QString &newOwner );
00240     void jobResult( KJob* job );
00241 
00242   private:
00243     class Private;
00244     Private *const d;
00245 };
00246 
00247 }
00248 
00249 #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"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
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