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 #include <mailtransport/transporttype.h> 00025 00026 #include <QtCore/QList> 00027 #include <QtCore/QObject> 00028 00029 #include <akonadi/agenttype.h> 00030 00031 class KJob; 00032 00033 namespace KWallet { 00034 class Wallet; 00035 } 00036 00037 namespace MailTransport { 00038 00039 class Transport; 00040 class TransportConfigWidget; 00041 class TransportJob; 00042 class TransportManagerPrivate; 00043 00055 class MAILTRANSPORT_EXPORT TransportManager : public QObject 00056 { 00057 Q_OBJECT 00058 Q_CLASSINFO( "D-Bus Interface", "org.kde.pim.TransportManager" ) 00059 00060 friend class Transport; 00061 friend class TransportManagerPrivate; 00062 00063 public: 00064 00068 virtual ~TransportManager(); 00069 00073 static TransportManager *self(); 00074 00080 void loadPasswordsAsync(); 00081 00091 Transport *transportById( int id, bool def = true ) const; 00092 00101 Transport *transportByName( const QString &name, bool def = true ) const; 00102 00108 QList<Transport *>transports() const; 00109 00113 TransportType::List types() const; 00114 00120 Transport *createTransport() const; 00121 00127 void addTransport( Transport *transport ); 00128 00137 MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob( int transportId ); 00138 00148 MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob( const QString &transport ); 00149 00159 MAILTRANSPORT_DEPRECATED void schedule( TransportJob *job ); 00160 00165 void createDefaultTransport(); 00166 00168 enum ShowCondition { 00169 Always, 00170 IfNoTransportExists 00171 00172 00173 }; 00174 00182 bool showTransportCreationDialog( QWidget *parent, ShowCondition showCondition = Always ); 00183 00192 bool configureTransport( Transport *transport, QWidget *parent ); 00193 00194 public Q_SLOTS: 00198 Q_SCRIPTABLE bool isEmpty() const; 00199 00203 Q_SCRIPTABLE QList<int> transportIds() const; 00204 00208 Q_SCRIPTABLE QStringList transportNames() const; 00209 00213 Q_SCRIPTABLE QString defaultTransportName() const; 00214 00219 Q_SCRIPTABLE int defaultTransportId() const; 00220 00225 Q_SCRIPTABLE void setDefaultTransport( int id ); 00226 00231 Q_SCRIPTABLE void removeTransport( int id ); 00232 00233 Q_SIGNALS: 00238 Q_SCRIPTABLE void transportsChanged(); 00239 00245 Q_SCRIPTABLE void changesCommitted(); 00246 00252 void passwordsChanged(); 00253 00259 void transportRemoved( int id, const QString &name ); 00260 00267 void transportRenamed( int id, const QString &oldName, const QString &newName ); 00268 00269 protected: 00274 KWallet::Wallet *wallet(); 00275 00279 void loadPasswords(); 00280 00284 TransportManager(); 00285 00286 private: 00287 00288 // These are used by our friend, Transport 00289 void emitChangesCommitted(); 00290 00291 private: 00292 TransportManagerPrivate *const d; 00293 00294 Q_PRIVATE_SLOT( d, void slotTransportsChanged() ) 00295 Q_PRIVATE_SLOT( d, void slotWalletOpened( bool success ) ) 00296 Q_PRIVATE_SLOT( d, void dbusServiceUnregistered() ) 00297 Q_PRIVATE_SLOT( d, void agentTypeAdded( const Akonadi::AgentType &atype ) ) 00298 Q_PRIVATE_SLOT( d, void agentTypeRemoved( const Akonadi::AgentType &atype ) ) 00299 Q_PRIVATE_SLOT( d, void jobResult( KJob *job ) ) 00300 }; 00301 00302 } // namespace MailTransport 00303 00304 #endif // MAILTRANSPORT_TRANSPORTMANAGER_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Apr 30 2012 21:49:03 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Apr 30 2012 21:49:03 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.