1 | /* |
2 | Copyright (c) 2009 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 TRANSPORT_H |
21 | #define TRANSPORT_H |
22 | |
23 | #include "setupobject.h" |
24 | #include <mailtransport/transport.h> |
25 | |
26 | |
27 | class Transport : public SetupObject |
28 | { |
29 | Q_OBJECT |
30 | public: |
31 | explicit Transport( const QString &type, QObject *parent = 0 ); |
32 | void create(); |
33 | void destroy(); |
34 | |
35 | int transportId() const; |
36 | |
37 | public slots: |
38 | Q_SCRIPTABLE void setName( const QString &name ); |
39 | Q_SCRIPTABLE void setHost( const QString &host ); |
40 | Q_SCRIPTABLE void setPort( int port ); |
41 | Q_SCRIPTABLE void setUsername( const QString &user ); |
42 | Q_SCRIPTABLE void setPassword( const QString &password ); |
43 | Q_SCRIPTABLE void setEncryption( const QString &encryption ); |
44 | Q_SCRIPTABLE void setAuthenticationType( const QString &authType ); |
45 | |
46 | private: |
47 | MailTransport::Transport::EnumEncryption stringToEncryption( const QString &encryptionString ); |
48 | MailTransport::Transport::EnumAuthenticationType stringToAuthType( const QString &authString ); |
49 | |
50 | private: |
51 | int m_transportId; |
52 | MailTransport::Transport::EnumType::type m_transportType; |
53 | QString m_name; |
54 | QString m_host; |
55 | int m_port; |
56 | QString m_user; |
57 | QString m_password; |
58 | MailTransport::Transport::EnumEncryption::type m_encr; |
59 | MailTransport::Transport::EnumAuthenticationType::type m_auth; |
60 | }; |
61 | |
62 | #endif |
63 | |