Home · Modules · Classes · Namespaces · Functions

QxtPop3 Class Reference
[QxtNetwork module]

The QxtPop3 class implements a POP3 client. More...

    #include <QxtPop3>

Inherits QObject.

Public Functions

Signals

Additional Inherited Members


Detailed Description

The QxtPop3 class implements a POP3 client.

Implements the IETF standard 53 http://www.faqs.org/rfcs/std/std53.html

The API is asynchronous: when calling a POP3 method, the call returns immediately and one gets a pointer to a QxtPop3Reply, that can be used to get feedback (typically connect its finished() signal to some slot handling the result, and get the result of the command once finished, if applicable).


Member Function Documentation

QxtPop3::QxtPop3 ( QObject * parent = 0 )

Constructs a new QxtPop3 whith parent parent.

void QxtPop3::authenticated ()   [signal]

Emitted when the connections becomes authenticated.

void QxtPop3::authenticationFailed ( const QByteArray & msg )   [signal]

Emitted if the authentication fails, msg holding a desription of the cause of the failure.

void QxtPop3::clearReplies ()

Deletes all finished replies in the queue. Run this to free memory when you don't need to access the finished replies anymore (to get results for example). A good moment to do this is after closing the connection to the server, if you keep the QxtPop3 object for later connections (when the QxtPop3 object is deleted, all replies associated to it are deleted automatically).

void QxtPop3::connectToHost ( const QString & hostName, quint16 port = 110 )

Opens a connection to the server hostName on port. Authentication is performed, and startTLS is sent if enabled (else the connection isn't encrypted).

See also connectToSecureHost(), disconnectFromHost(), and startTlsDisabled().

void QxtPop3::connectToHost ( const QHostAddress & address, quint16 port = 110 )

Overloaded function.

void QxtPop3::connectToSecureHost ( const QString & hostName, quint16 port = 995 )

Opens a SSL connection to the server hostName on port.

See also connectToHost().

void QxtPop3::connectToSecureHost ( const QHostAddress & address, quint16 port = 995 )

Overloaded function.

void QxtPop3::connected ()   [signal]

Emitted once the connection to the server is established.

void QxtPop3::connectionFailed ( const QByteArray & msg )   [signal]

Emitted when the connection fails, msg containing a description of the failure.

QxtPop3Reply * QxtPop3::deleteMessage ( int which, int timeout = 100000 )

Delete the message nb which. Until the session is closed, the message can be undeleted by a reset.

void QxtPop3::disconnectFromHost ()

Closes the connection.

void QxtPop3::disconnected ()   [signal]

Emitted when the client is disconnected from the server.

void QxtPop3::encrypted ()   [signal]

Emitted when the SSL negotiation succeeds, and the connection becomes encrypted (either from start, with connectToSecureHost(), or after the startTLS method is used).

void QxtPop3::encryptionFailed ( const QByteArray & msg )   [signal]

Emitted if the SSL negotiation fails, msg holding a desription of the cause of the failure.

bool QxtPop3::isConnected () const

Returns true if the client is connected to the server, false otherwise.

QxtPop3ListReply * QxtPop3::messageList ( int timeout = 100000 )

Implement the LIST POP3 command. When the command is completed, the result can be read from the QxtPop3ListReply object returned.

QByteArray QxtPop3::password () const

Returns the connection's password; it may be empty.

See also setPassword().

QxtPop3Reply * QxtPop3::quit ( int timeout = 3000 )

Close the session, and disconnect from the server.

QxtPop3Reply * QxtPop3::reset ( int timeout = 10000 )

Reset the session. All messages marked as deleted are undeleted.

QxtPop3RetrReply * QxtPop3::retrieveMessage ( int which, int timeout = 300000 )

Retrieve message nb which. When the command is completed, the result can be read from the QxtPop3RetrReply object returned.

void QxtPop3::setPassword ( const QByteArray & password )

Sets the connection's password to password. To have effect, the password must be set before the connection is opened. Alternatively, you can quit(), set the password, and call connectToHost() again.

See also password().

void QxtPop3::setStartTlsDisabled ( bool disable )

Disable the startTLS method if disable is true, enables it if it is false.

See also startTlsDisabled().

void QxtPop3::setUsername ( const QByteArray & username )

Sets the connection's user name to username. To have effect, the user name must be set before the connection is opened. Alternatively, you can quit(), set the user name, and call connectToHost() again.

See also username().

QTcpSocket * QxtPop3::socket () const

Returns a pointer to the socket used for the connection to the server.

QSslSocket * QxtPop3::sslSocket () const

Returns a pointer to the SSL socket used for the connection to the server.

See also socket().

bool QxtPop3::startTlsDisabled () const

Returns true if startTLS is disabled, false if it is enabled. Default value is false (startTLS enabled).

See also setStartTlsDisabled().

QxtPop3StatReply * QxtPop3::stat ( int timeout = 3000 )

Implement the STAT POP3 command. When the command is completed, the message count in the mailbox and total size in bytes can be retrieved via the count() and size() methods of the QxtPop3StatReply object returned.

QByteArray QxtPop3::username () const

Returns the connection's user name; it may be empty.

See also setUsername().


Copyright © 2007-2010 Qxt Foundation
Qxt 0.7.0