• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

mailtransport

  • sources
  • kde-4.14
  • kdepimlibs
  • mailtransport
transportmanager.h
1 /*
2  Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef MAILTRANSPORT_TRANSPORTMANAGER_H
21 #define MAILTRANSPORT_TRANSPORTMANAGER_H
22 
23 #include <mailtransport/mailtransport_export.h>
24 #include <mailtransport/transporttype.h>
25 
26 #include <QtCore/QList>
27 #include <QtCore/QObject>
28 
29 #include <akonadi/agenttype.h>
30 
31 class KJob;
32 
33 namespace KWallet {
34  class Wallet;
35 }
36 
37 namespace MailTransport {
38 
39 class Transport;
40 class TransportJob;
41 class TransportManagerPrivate;
42 
54 class MAILTRANSPORT_EXPORT TransportManager : public QObject
55 {
56  Q_OBJECT
57  Q_CLASSINFO( "D-Bus Interface", "org.kde.pim.TransportManager" )
58 
59  friend class Transport;
60  friend class TransportManagerPrivate;
61 
62  public:
63 
67  virtual ~TransportManager();
68 
72  static TransportManager *self();
73 
79  void loadPasswordsAsync();
80 
90  Transport *transportById( int id, bool def = true ) const;
91 
100  Transport *transportByName( const QString &name, bool def = true ) const;
101 
107  QList<Transport *>transports() const;
108 
112  TransportType::List types() const;
113 
119  Transport *createTransport() const;
120 
126  void addTransport( Transport *transport );
127 
136  MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob( int transportId );
137 
147  MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob( const QString &transport );
148 
158  MAILTRANSPORT_DEPRECATED void schedule( TransportJob *job );
159 
164  void createDefaultTransport();
165 
167  enum ShowCondition {
168  Always,
169  IfNoTransportExists
170  };
173 
181  bool showTransportCreationDialog( QWidget *parent, ShowCondition showCondition = Always );
182 
191  bool configureTransport( Transport *transport, QWidget *parent );
192 
193  public Q_SLOTS:
197  Q_SCRIPTABLE bool isEmpty() const;
198 
202  Q_SCRIPTABLE QList<int> transportIds() const;
203 
207  Q_SCRIPTABLE QStringList transportNames() const;
208 
212  Q_SCRIPTABLE QString defaultTransportName() const;
213 
218  Q_SCRIPTABLE int defaultTransportId() const;
219 
224  Q_SCRIPTABLE void setDefaultTransport( int id );
225 
230  Q_SCRIPTABLE void removeTransport( int id );
231 
232  Q_SIGNALS:
237  Q_SCRIPTABLE void transportsChanged();
238 
244  Q_SCRIPTABLE void changesCommitted();
245 
251  void passwordsChanged();
252 
258  void transportRemoved( int id, const QString &name );
259 
266  void transportRenamed( int id, const QString &oldName, const QString &newName );
267 
268  protected:
273  KWallet::Wallet *wallet();
274 
278  void loadPasswords();
279 
283  TransportManager();
284 
285  private:
286 
287  // These are used by our friend, Transport
288  void emitChangesCommitted();
289 
290  private:
291  TransportManagerPrivate *const d;
292 
293  Q_PRIVATE_SLOT( d, void slotTransportsChanged() )
294  Q_PRIVATE_SLOT( d, void slotWalletOpened( bool success ) )
295  Q_PRIVATE_SLOT( d, void dbusServiceUnregistered() )
296  Q_PRIVATE_SLOT( d, void agentTypeAdded( const Akonadi::AgentType &atype ) )
297  Q_PRIVATE_SLOT( d, void agentTypeRemoved( const Akonadi::AgentType &atype ) )
298  Q_PRIVATE_SLOT( d, void jobResult( KJob *job ) )
299 };
300 
301 } // namespace MailTransport
302 
303 #endif // MAILTRANSPORT_TRANSPORTMANAGER_H
QWidget
MailTransport::TransportManager
Central transport management interface.
Definition: transportmanager.h:54
MailTransport::TransportManager::ShowCondition
ShowCondition
Describes when to show the transport creation dialog.
Definition: transportmanager.h:167
QObject
MailTransport::TransportManager::Always
Show the transport creation dialog unconditionally.
Definition: transportmanager.h:168
QString
QList
QStringList
MailTransport::TransportJob
Abstract base class for all mail transport jobs.
Definition: transportjob.h:41
MailTransport::Transport
Represents the settings of a specific mail transport.
Definition: transport.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:49 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailtransport

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



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