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

mailtransport

  • 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 TransportConfigWidget;
41 class TransportJob;
42 class TransportManagerPrivate;
43 
55 class MAILTRANSPORT_EXPORT TransportManager : public QObject
56 {
57  Q_OBJECT
58  Q_CLASSINFO( "D-Bus Interface", "org.kde.pim.TransportManager" )
59 
60  friend class Transport;
61  friend class TransportManagerPrivate;
62 
63  public:
64 
68  virtual ~TransportManager();
69 
73  static TransportManager *self();
74 
80  void loadPasswordsAsync();
81 
91  Transport *transportById( int id, bool def = true ) const;
92 
101  Transport *transportByName( const QString &name, bool def = true ) const;
102 
108  QList<Transport *>transports() const;
109 
113  TransportType::List types() const;
114 
120  Transport *createTransport() const;
121 
127  void addTransport( Transport *transport );
128 
137  MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob( int transportId );
138 
148  MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob( const QString &transport );
149 
159  MAILTRANSPORT_DEPRECATED void schedule( TransportJob *job );
160 
165  void createDefaultTransport();
166 
168  enum ShowCondition {
169  Always,
170  IfNoTransportExists
171 
172 
173  };
174 
182  bool showTransportCreationDialog( QWidget *parent, ShowCondition showCondition = Always );
183 
192  bool configureTransport( Transport *transport, QWidget *parent );
193 
194  public Q_SLOTS:
198  Q_SCRIPTABLE bool isEmpty() const;
199 
203  Q_SCRIPTABLE QList<int> transportIds() const;
204 
208  Q_SCRIPTABLE QStringList transportNames() const;
209 
213  Q_SCRIPTABLE QString defaultTransportName() const;
214 
219  Q_SCRIPTABLE int defaultTransportId() const;
220 
225  Q_SCRIPTABLE void setDefaultTransport( int id );
226 
231  Q_SCRIPTABLE void removeTransport( int id );
232 
233  Q_SIGNALS:
238  Q_SCRIPTABLE void transportsChanged();
239 
245  Q_SCRIPTABLE void changesCommitted();
246 
252  void passwordsChanged();
253 
259  void transportRemoved( int id, const QString &name );
260 
267  void transportRenamed( int id, const QString &oldName, const QString &newName );
268 
269  protected:
274  KWallet::Wallet *wallet();
275 
279  void loadPasswords();
280 
284  TransportManager();
285 
286  private:
287 
288  // These are used by our friend, Transport
289  void emitChangesCommitted();
290 
291  private:
292  TransportManagerPrivate *const d;
293 
294  Q_PRIVATE_SLOT( d, void slotTransportsChanged() )
295  Q_PRIVATE_SLOT( d, void slotWalletOpened( bool success ) )
296  Q_PRIVATE_SLOT( d, void dbusServiceUnregistered() )
297  Q_PRIVATE_SLOT( d, void agentTypeAdded( const Akonadi::AgentType &atype ) )
298  Q_PRIVATE_SLOT( d, void agentTypeRemoved( const Akonadi::AgentType &atype ) )
299  Q_PRIVATE_SLOT( d, void jobResult( KJob *job ) )
300 };
301 
302 } // namespace MailTransport
303 
304 #endif // MAILTRANSPORT_TRANSPORTMANAGER_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:26:53 by doxygen 1.8.3.1 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-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 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
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