Changeset View
Changeset View
Standalone View
Standalone View
src/session.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 40 | enum State { | |||
---|---|---|---|---|---|
43 | Handshake, /**< (internal) */ | 43 | Handshake, /**< (internal) */ | ||
44 | NotAuthenticated, /**< The Session is ready for login. @sa KSmtp::LoginJob */ | 44 | NotAuthenticated, /**< The Session is ready for login. @sa KSmtp::LoginJob */ | ||
45 | Authenticated, /**< The Session is ready to send email. @sa KSmtp::SendJob */ | 45 | Authenticated, /**< The Session is ready to send email. @sa KSmtp::SendJob */ | ||
46 | Quitting /**< (internal) */ | 46 | Quitting /**< (internal) */ | ||
47 | }; | 47 | }; | ||
48 | Q_ENUM(State) | 48 | Q_ENUM(State) | ||
49 | 49 | | |||
50 | /** | 50 | /** | ||
51 | Creates a new Smtp session to the specified host and port. | 51 | Creates a new SMTP session to the specified host and port. | ||
52 | After creating the session, you should call either open() or openAndWait() to open the connection. | 52 | After creating the session, call setUseProxy() if necessary | ||
53 | and then either open() or openAndWait() to open the connection. | ||||
53 | @sa open(), openAndWait() | 54 | @sa open(), openAndWait() | ||
54 | */ | 55 | */ | ||
55 | explicit Session(const QString &hostName, quint16 port, QObject *parent = nullptr); | 56 | explicit Session(const QString &hostName, quint16 port, QObject *parent = nullptr); | ||
56 | ~Session() override; | 57 | ~Session() override; | ||
57 | 58 | | |||
58 | void setUiProxy(const SessionUiProxy::Ptr &uiProxy); | 59 | void setUiProxy(const SessionUiProxy::Ptr &uiProxy); | ||
59 | SessionUiProxy::Ptr uiProxy() const; | 60 | SessionUiProxy::Ptr uiProxy() const; | ||
60 | 61 | | |||
61 | /** | 62 | /** | ||
63 | Sets whether the SMTP network connection should use the system proxy settings | ||||
64 | | ||||
65 | The default is to not use the proxy. | ||||
66 | */ | ||||
67 | void setUseNetworkProxy(bool useProxy); | ||||
68 | | ||||
69 | /** | ||||
62 | Returns the host name that has been provided in the Session's constructor | 70 | Returns the host name that has been provided in the Session's constructor | ||
63 | @sa port() | 71 | @sa port() | ||
64 | */ | 72 | */ | ||
65 | QString hostName() const; | 73 | QString hostName() const; | ||
66 | 74 | | |||
67 | /** | 75 | /** | ||
68 | Returns the port number that has been provided in the Session's constructor | 76 | Returns the port number that has been provided in the Session's constructor | ||
69 | @sa hostName() | 77 | @sa hostName() | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 124 | /** | |||
119 | 127 | | |||
120 | @sa open() | 128 | @sa open() | ||
121 | */ | 129 | */ | ||
122 | void openAndWait(); | 130 | void openAndWait(); | ||
123 | 131 | | |||
124 | /** | 132 | /** | ||
125 | Requests the server to quit the connection. | 133 | Requests the server to quit the connection. | ||
126 | 134 | | |||
127 | This sends "QUIT" command to the server and will not close the connection until | 135 | This sends a "QUIT" command to the server and will not close the connection until | ||
128 | it receives a response. That means you should not delete this object right after | 136 | it receives a response. That means you should not delete this object right after | ||
129 | calling close, instead wait for stateChanged() to change to Disconnected, or use | 137 | calling close, instead wait for stateChanged() to change to Disconnected, or use | ||
130 | quitAndWait(). | 138 | quitAndWait(). | ||
131 | 139 | | |||
132 | See RFC 821, Chapter 4.1.1, "QUIT". | 140 | See RFC 821, Chapter 4.1.1, "QUIT". | ||
133 | 141 | | |||
134 | @sa quitAndWait() | 142 | @sa quitAndWait() | ||
135 | */ | 143 | */ | ||
Show All 27 Lines |