This class represents an POP3-Account. More...
#include <account.h>
Signals | |
void | sigDeleteReady (QString account) |
Will be emitted when all selected mails are deleted. | |
void | sigShowBodiesReady (QString account) |
Will be emitted when the bodies of all selected mails are downloaded and shown. | |
void | sigConfigChanged () |
Will be emitted when the settings have been changed. | |
void | sigMessageWindowOpened () |
Will be emitted, when a window to show a message was opened. | |
void | sigMessageWindowClosed () |
Will be emitted, when a window to show a message was closed. | |
void | sigRefreshReady (QString account) |
Will be emitted, when the mail list was refreshed. | |
Public Member Functions | |
Account (QString name, AccountList *accountList, QObject *parent) | |
Constructor. | |
~Account () | |
Destructor. | |
void | print () const |
Prints all data of this account to stdout. | |
QString | getName () const |
Returns the account name. | |
bool | isActive () const |
Returns whether the account is active. | |
void | setActive (bool active) |
Sets the account active. | |
void | load () |
Loads the options of this account from the application config. | |
void | refreshMailList (FilterLog *log=NULL) |
Refreshes the mail list. | |
QString | getPassword () const |
Gets the account password. | |
void | setPassword (const QString &password) |
Sets the account password. | |
void | setHost (const QString &host) |
Sets the host name. | |
QString | getHost () const |
Returns the hostname. | |
void | setProtocol (const QString &protocol) |
Sets the protocol. | |
QString | getProtocol (bool upperCase=false) const |
Returns the protocol. | |
void | setPort (unsigned short int port) |
Sets the port. | |
unsigned short int | getPort () const |
Returns the port number. | |
void | setUser (const QString &user) |
Sets the user. | |
QString | getUser () const |
Returns the user name. | |
void | setPasswordStorage (int storage) |
Sets the password storage type. | |
int | getPasswordStorage () const |
Returns the password storage type. The Constants are defined in constants.h. | |
Types::AccountState_Type | getState () |
Returns the state of the account. | |
bool | isUnsecureLoginAllowed () const |
Return whether an unsecure login is allowed. | |
int | getNumberMails () const |
Returns the number of mails if this account is active. Otherwise returns 0. | |
void | addMailToDelete (int number) |
Adds a mail number to the list of mails to delete. | |
void | addMailToShow (int number) |
Adds a mail number to the list of mails to show. | |
virtual void | deleteMails () |
Deletes mails which are listed in mailsToDelete. | |
int | numberDeletedMailsLastRefresh () |
Returns the number of deleted mails by last refresh. | |
int | numberDeletedMailsStart () |
Returns the number of deleted mails since start. | |
int | numberMovedMailsLastRefresh () |
Returns the number of moved mails by last refresh. | |
int | numberMovedMailsStart () |
Returns the number of moved mails since start. | |
int | numberIgnoredMails () |
Returns the number of ignored mails by last refresh. | |
void | reloadFilterSettings () |
Reloads the settings of the filters. | |
void | saveOptions (QDomDocument &doc, QDomElement &parent) |
Saves the stored mails into the given DOM document. | |
void | showMails () |
Downloads and shows the bodies of mails in mailsToShow . | |
int | getNumberNewMails () |
Returns the number of new mails. | |
long | getTotalSize () const |
Returns the total size (bytes) of all mails. | |
QString | getTotalSizeUnit () const |
Returns the total size of all mails with unit. | |
void | readStoredMails (QDomElement &parent) |
Gets the stored mails. | |
int | compare (Account *other, AccountSort_Type property) |
Compares this account with other and returns an integer less than, equal to, or greater than zero if this account is less than, equal to, or greater than other. | |
QList< Mail > | getAllMails () const |
Returns a list which contains the pointers to all mails. | |
void | cancelTask () |
Cancels the current running task. | |
AccountViewItem | getViewItem () |
Returns a appropriate view item. | |
Protected Slots | |
virtual void | slotConnected () |
Connected with signal connected of the socket. Will be invoked after the socket has connected the host. | |
virtual void | slotHostFound () |
Connected with signal hostFound of the socket. Will be invoked after the socket has done the DNS lookup. | |
void | slotSocketError (KTcpSocket::Error errorCode) |
Connected with signal error of the socket. Will be invoked, when an socket error occures. | |
void | slotSSLError (const QList< KSslError > &errors) |
Connected with signale sslErrors of the socket. | |
void | slotReadFirstServerMessage () |
Reads the first message send by server. | |
void | slotCapabilitiesResponse () |
Reads the capabilities from the server. | |
void | slotAuthMechResponse () |
Connected with the signal readyRead of the socket by getAuthMech(). Analyzes the response and sets the authentication mechanism flags of this account. | |
void | slotCommitResponse () |
Connected with signal readyRead of the socket by commit(). Analyzes the commit response of the server. | |
void | slotLoginUserResponse () |
Received the response of the USER command during login. | |
void | slotLoginPasswdResponse () |
Received the response of the PASS command during login. | |
void | slotLoginApopResponse () |
Receives the response of a login using APOP. | |
void | slotUIDListResponse () |
Reiceves the response of the UIDL command, which gets the UID's of the mails. | |
void | slotMailSizesResponse () |
Receives the response of the LIST command, which gets the numbers and sizes of the mails. | |
void | slotGetHeaderResponse () |
Receives the header requested by getNextHeader(). | |
void | slotMailDeleted () |
Removes the deleted mail from the internal mail list (m_pshowrecord). | |
void | slotBodyDownloaded () |
Opens a window (class ShowMailDialog) with the downloaded mail body. | |
void | slotMailDownloadedForAction () |
Downloads a mail to write it into a mailbox or do a spam check. | |
void | slotCommitBeforeRefreshDone () |
Restarts a second refresh cycle after a deletion performed by the filter. | |
void | slotTimeout () |
Connected with the timeout timer. | |
void | slotStartTLSResponse () |
Receives the response of the STLS command. | |
Protected Member Functions | |
void | init () |
Initiate the account. | |
bool | hasPassword () const |
Returns whether a password is stored. | |
bool | assertPassword (bool force=false) |
Opens a dialog to ask for a password, stores it temporarily in the account settings and emits the signal sigConfigChanged. | |
void | doConnect () |
Establishes a connection to the server. | |
void | closeConnection () |
Closes the connection. | |
void | initBeforeConnect () |
Initiates the account to do a connect. | |
void | handleError (QString error) |
Shows the given error, sets the state to idle and emits a ready signal if necessary. | |
QStringList | readfromSocket (bool singleLine) |
Reads all data from the socket. | |
void | sendCommand (const QString &command) |
Sends a command to the server. | |
void | getCapabilities () |
Gets the capabilities from the server. Sends the CAPA-command connect the socket with slot slotReceiveCapabilities(). | |
void | printServerMessage (QStringList &text) const |
Prints the a text received from the server to stdout. | |
bool | isPositiveServerMessage (QStringList &message) const |
Returns whether the server answer is positive or negative. | |
void | getAuthMech () |
Sends the command to get the authentication mechanism of this server. | |
virtual void | commit () |
Sends the commit command to end the session. | |
void | finishTask () |
Finishes the running task (Refreshing, Deleting, ...). | |
void | loginUser () |
Sends the login name. | |
void | loginPasswd () |
Sends the password for login. | |
void | loginApop () |
Initiates a login using APOP. | |
QString | removeStatusIndicator (const QString &message) |
Removes the status indicator from a single line server message. | |
void | removeStatusIndicator (QStringList *response) |
If the first line of the server response is the status indicator (+OK or -ERR), this methode will remove this line. | |
void | removeEndOfResponseMarker (QStringList *response) |
If the last line of the server response is the end of response marker, this methode will remove this line. | |
void | getUIDList () |
Sends the UIDL command to get a list of the mail UID's. | |
void | swapMailLists () |
Copies the pointer to the temporary list to the mail list. | |
void | getMailSizes () |
Sends the LIST command to get a list of mail sizes. | |
void | getHeaders () |
Gets the headers of the new mails from the server. | |
virtual void | getNextHeader () |
Get the header of the first mail in newMails. | |
bool | isNegativeResponse (const QString &response) |
Returns whether the given string is a negative server response. | |
void | copyHeaders () |
Copies the known headers of the old mails from the old mail list to the new one. | |
void | deleteNextMail () |
Deletes the first mail of MailsToDelete. | |
void | showNextMail () |
Shows the body of the first mail in MailsToShow. | |
void | doDownloadActions () |
Does all filter actions for which we have to download the mails. | |
void | getNextMailForDownloadActions () |
Gets the body of the first mail in MailsToDownload. | |
void | applyFiltersDeleted () |
If there are mails to delete by filters applyFilters will call the regular deletion cycle of this class with set byFilter-flag. | |
void | commitBeforeRefresh () |
Send a commit and restart the refresh cycle. | |
void | applyFilters () |
Applies the filters to the mails in the mail list. | |
bool | writeToMailBox (const QStringList &mail, const QString &box) |
Writes the given mail into the mailbox. | |
bool | isMailDir (const QDir &path) |
Returns whether the given directory is a maildir directory. | |
bool | isSpam (QStringList mail) const |
Forwards the given mail to SpamAssassin and returns the test result. | |
bool | isSpamAssassinRunning () const |
Looks for a running spamd daemon of SpamAssassin. | |
void | startTLS () |
Invites the server to crypt using TLS (STARTTLS). | |
Private Attributes | |
QString | name |
Name of this account. | |
bool | active |
TRUE - account is active; FALSE - account is not active. | |
TransferSecurity_Type | transferSecurity |
Type of the transfer security. | |
KUrl | url |
Uniform Resource Locator of the account on the mail server. | |
int | passwordStorage |
Type of password storage. | |
MailList * | mails |
The mail container. | |
MailList * | tempMailList |
While refreshing, this mail list instance will be used to build a new mail list. After that this pointer will be assigned to maillist. | |
QPointer< KTcpSocket > | socket |
The socket. Handles all server operations. | |
AccountList * | accountList |
Pointer to the account list object. | |
bool | quitSent |
TRUE - the QUIT command was sent to the server. Normally set by the commit methode. | |
QTimer * | timeoutTimer |
This timer kills a running operation after the preset time. | |
Types::AccountState_Type | state |
State of the account. | |
bool | apopAvail |
APOP available. | |
bool | dontUseAPOP |
Is set to TRUE by slotLoginAPOPResponse if the first login with APOP is failed. | |
QString | apopTimestamp |
Timestamp for APOP sent with the server greeting. | |
bool | allowUnsecureLogin |
TRUE - unsafe login is allowed if a secure login failed. | |
bool | filterApplied |
This is a flag whether the filters was applied during a refresh cycle. | |
bool | refreshPerformedByFilters |
This flag is set by applyFiltersDeleted() to indicate the refresh cycle is the second one after a deletion which was performed by filters. | |
MailNumberList_Type | newMails |
Contains the numbers of new mails. | |
MailNumberList_Type | mailsToDelete |
Contains the numbers of mails which will be deleted. | |
MailToDownloadMap_Type | mailsToDownload |
Contains the numbers of the mails shall be moved for actions like moving to mailbox or spam check. | |
MailNumberList_Type | mailsToShow |
Contains the numbers of mails for which the bodies will be shown. | |
FilterLog * | fLog |
Pointer to the filter log. | |
int | nmbDeletedMailsLastRefresh |
Number of deleted mails by last refresh. | |
int | nmbMovedMailsLastRefresh |
Number of moved mails by last refresh. | |
int | nmbMovedMailsLastStart |
Number of moved mails since start. | |
int | nmbIgnoredMails |
Number of ignored mails by last refresh. | |
int | moveCounter |
Counter for moving to create an unique file name. | |
int | nmbDeletedMailsLastStart |
Number of deleted mails since start. | |
bool | downloadActionsInvoked |
This flag is set to TRUE by applyFilters() to indicate the mailbodies are downloading and writing to the mailboxes or spam checking. | |
HeaderFilter | headerFilter |
Every account has is own header filter instance. | |
bool | deletionPerformedByFilters |
This flag is set by applyFilters() to indicate the deletion cycle is performed by filters and not by user. | |
QString | spamMailbox |
Mailbox for Spam, if configured. | |
FilterAction_Type | spamAction |
Action which shall be done, if the mail is Spam. | |
bool | dontHandleError |
TRUE - the error will not be handled by slotSocketError. | |
bool | informAboutErrors |
TRUE - informs the user about connection errors. | |
int | timeOutTime |
Seconds to Timeout. | |
bool | supportsStartTLS |
TRUE - the server supports StartTLS. |
This class represents an POP3-Account.
Definition at line 164 of file account.h.
Account::Account | ( | QString | name, | |
AccountList * | accountList, | |||
QObject * | parent | |||
) |
Constructor.
name | name of this account
|
Definition at line 21 of file account.cpp.
Account::~Account | ( | ) |
Destructor.
Definition at line 39 of file account.cpp.
void Account::addMailToDelete | ( | int | number | ) |
Adds a mail number to the list of mails to delete.
The number is the mail number given by the mail server.
number | mail number
|
Definition at line 1598 of file account.cpp.
void Account::addMailToShow | ( | int | number | ) |
Adds a mail number to the list of mails to show.
The number is the mail number given by the mail server.
number | mail number
|
Definition at line 1603 of file account.cpp.
void Account::applyFilters | ( | ) | [protected] |
Applies the filters to the mails in the mail list.
step of the refresh cycle. Invoked by swapMailLists(). This methode maybe starts a new refresh cycle because after a deletion or moving we need a actual list of mails on the server. To avoid a never-ending loop you must not call this methode during the second refresh cycle. Therefore it sets filterApplied to TRUE.
Definition at line 1303 of file account.cpp.
void Account::applyFiltersDeleted | ( | ) | [protected] |
If there are mails to delete by filters applyFilters will call the regular deletion cycle of this class with set byFilter-flag.
Therefore the deletion will not branch to commitDeletion() but to this methode. This performs a second refresh cycle to get an effective mail list from the server. This new cycle will not apply the filters again, because the flag filterApplied is set to TRUE.
Definition at line 2018 of file account.cpp.
bool Account::assertPassword | ( | bool | force = false |
) | [protected] |
Opens a dialog to ask for a password, stores it temporarily in the account settings and emits the signal sigConfigChanged.
Does not open a dialog if a password is already stored in the account settings.
force | ask for a new password even if a password is stored
|
Definition at line 271 of file account.cpp.
void Account::cancelTask | ( | ) |
Cancels the current running task.
Definition at line 2401 of file account.cpp.
void Account::closeConnection | ( | ) | [protected] |
Closes the connection.
Definition at line 387 of file account.cpp.
void Account::commit | ( | ) | [protected, virtual] |
Sends the commit command to end the session.
Connects the signal readyRead of the socket with the slot slotCommitResponse().
Definition at line 879 of file account.cpp.
void Account::commitBeforeRefresh | ( | ) | [protected] |
Send a commit and restart the refresh cycle.
We restart the refresh to get a fresh maillist after a deletion performed by the filter. We need a commit before because the mails server only after a commit reorders the mail numbers
Definition at line 2030 of file account.cpp.
int Account::compare | ( | Account * | other, | |
AccountSort_Type | property | |||
) |
Compares this account with other and returns an integer less than, equal to, or greater than zero if this account is less than, equal to, or greater than other.
other | other account
|
Definition at line 2334 of file account.cpp.
void Account::copyHeaders | ( | ) | [protected] |
Copies the known headers of the old mails from the old mail list to the new one.
At the end it invokes swapMailLists().
Definition at line 1566 of file account.cpp.
void Account::deleteMails | ( | ) | [virtual] |
Deletes mails which are listed in mailsToDelete.
This just starts the deletion and returns after then. When the deletion is ready the signal sigDeleteReady will be emitted.
Definition at line 1608 of file account.cpp.
void Account::deleteNextMail | ( | ) | [protected] |
Deletes the first mail of MailsToDelete.
After a successful deletion this mail will be removed from the list by slotMailDeleted() and this method will be invoked again. If the list is empty, it will call commitDelete.
Definition at line 1634 of file account.cpp.
void Account::doConnect | ( | ) | [protected] |
Establishes a connection to the server.
Definition at line 351 of file account.cpp.
void Account::doDownloadActions | ( | ) | [protected] |
Does all filter actions for which we have to download the mails.
These are: Moving, spam check It doesn't removes they from the server.
Definition at line 1847 of file account.cpp.
void Account::finishTask | ( | ) | [protected] |
Finishes the running task (Refreshing, Deleting, ...).
Emits the proper ready signal and closes the connection
Definition at line 900 of file account.cpp.
QList< Mail > Account::getAllMails | ( | ) | const |
Returns a list which contains the pointers to all mails.
Definition at line 2388 of file account.cpp.
void Account::getAuthMech | ( | ) | [protected] |
Sends the command to get the authentication mechanism of this server.
Connects the signal readyRead of the socket with the slot slotAuthMechResponse(). If the socket has got the server response it will send this signal
Definition at line 810 of file account.cpp.
void Account::getCapabilities | ( | ) | [protected] |
Gets the capabilities from the server. Sends the CAPA-command connect the socket with slot slotReceiveCapabilities().
Definition at line 728 of file account.cpp.
void Account::getHeaders | ( | ) | [protected] |
Gets the headers of the new mails from the server.
Definition at line 1478 of file account.cpp.
QString Account::getHost | ( | ) | const |
Returns the hostname.
Definition at line 253 of file account.cpp.
void Account::getMailSizes | ( | ) | [protected] |
Sends the LIST command to get a list of mail sizes.
The response will be received by slotMailListResponse.
Definition at line 1370 of file account.cpp.
QString Account::getName | ( | ) | const |
void Account::getNextHeader | ( | ) | [protected, virtual] |
Get the header of the first mail in newMails.
After a successful download this mail will be removed from the list by slotHeaderDownloaded() and this method will be invoked again. If the list is empty, it will call copyHeaders() to get the known headers from the old mail list.
Definition at line 1493 of file account.cpp.
void Account::getNextMailForDownloadActions | ( | ) | [protected] |
Gets the body of the first mail in MailsToDownload.
After a successful download and writing into the mailbox this mail will be removed from the list by slotMailDownloadedforDownloadActions() and this method will be invoked again. If the list is empty, it will call applyFilters() to continue the filtering.
Definition at line 1853 of file account.cpp.
int Account::getNumberMails | ( | ) | const |
Returns the number of mails if this account is active. Otherwise returns 0.
Definition at line 1591 of file account.cpp.
int Account::getNumberNewMails | ( | ) |
Returns the number of new mails.
Definition at line 2255 of file account.cpp.
QString Account::getPassword | ( | ) | const |
int Account::getPasswordStorage | ( | ) | const |
Returns the password storage type. The Constants are defined in constants.h.
Definition at line 346 of file account.cpp.
unsigned short int Account::getPort | ( | ) | const |
QString Account::getProtocol | ( | bool | upperCase = false |
) | const |
Returns the protocol.
upperCase | TRUE - transforms the protocol string to upper case
|
Definition at line 258 of file account.cpp.
Types::AccountState_Type Account::getState | ( | ) |
Returns the state of the account.
Definition at line 1127 of file account.cpp.
long Account::getTotalSize | ( | ) | const |
Returns the total size (bytes) of all mails.
Definition at line 2260 of file account.cpp.
QString Account::getTotalSizeUnit | ( | ) | const |
Returns the total size of all mails with unit.
Definition at line 2264 of file account.cpp.
void Account::getUIDList | ( | ) | [protected] |
Sends the UIDL command to get a list of the mail UID's.
The response will be received by the slotUIDListResponse.
Definition at line 1137 of file account.cpp.
QString Account::getUser | ( | ) | const |
Returns the user name.
Definition at line 248 of file account.cpp.
AccountViewItem Account::getViewItem | ( | ) |
void Account::handleError | ( | QString | error | ) | [protected] |
Shows the given error, sets the state to idle and emits a ready signal if necessary.
error | the error message |
Definition at line 514 of file account.cpp.
bool Account::hasPassword | ( | ) | const [protected] |
Returns whether a password is stored.
Definition at line 213 of file account.cpp.
void Account::init | ( | ) | [protected] |
Initiate the account.
Definition at line 66 of file account.cpp.
void Account::initBeforeConnect | ( | ) | [protected] |
Initiates the account to do a connect.
It also creates the socket.
Definition at line 408 of file account.cpp.
bool Account::isActive | ( | ) | const |
Returns whether the account is active.
Definition at line 92 of file account.cpp.
bool Account::isMailDir | ( | const QDir & | path | ) | [protected] |
Returns whether the given directory is a maildir directory.
path | the directory for test
|
Definition at line 2164 of file account.cpp.
bool Account::isNegativeResponse | ( | const QString & | response | ) | [protected] |
Returns whether the given string is a negative server response.
response | server response to check
|
Definition at line 1560 of file account.cpp.
bool Account::isPositiveServerMessage | ( | QStringList & | message | ) | const [protected] |
Returns whether the server answer is positive or negative.
message | server message
|
Definition at line 798 of file account.cpp.
bool Account::isSpam | ( | QStringList | ) | const [protected] |
Forwards the given mail to SpamAssassin and returns the test result.
the mail to test
|
Definition at line 2191 of file account.cpp.
bool Account::isSpamAssassinRunning | ( | ) | const [protected] |
Looks for a running spamd daemon of SpamAssassin.
Definition at line 2228 of file account.cpp.
bool Account::isUnsecureLoginAllowed | ( | ) | const |
Return whether an unsecure login is allowed.
Definition at line 1132 of file account.cpp.
void Account::load | ( | ) |
Loads the options of this account from the application config.
Definition at line 101 of file account.cpp.
void Account::loginApop | ( | ) | [protected] |
Initiates a login using APOP.
The response will be received by slotLoginApopResponse().
Definition at line 1049 of file account.cpp.
void Account::loginPasswd | ( | ) | [protected] |
Sends the password for login.
The response will be received by slotLoginPasswdResponse().
Definition at line 988 of file account.cpp.
void Account::loginUser | ( | ) | [protected] |
Sends the login name.
The response will be received by slotLoginUserResponse().
Definition at line 951 of file account.cpp.
int Account::numberDeletedMailsLastRefresh | ( | ) |
Returns the number of deleted mails by last refresh.
Definition at line 1817 of file account.cpp.
int Account::numberDeletedMailsStart | ( | ) |
Returns the number of deleted mails since start.
Definition at line 1822 of file account.cpp.
int Account::numberIgnoredMails | ( | ) |
Returns the number of ignored mails by last refresh.
Definition at line 1837 of file account.cpp.
int Account::numberMovedMailsLastRefresh | ( | ) |
Returns the number of moved mails by last refresh.
Definition at line 1827 of file account.cpp.
int Account::numberMovedMailsStart | ( | ) |
Returns the number of moved mails since start.
Definition at line 1832 of file account.cpp.
void Account::print | ( | ) | const |
Prints all data of this account to stdout.
Definition at line 50 of file account.cpp.
void Account::printServerMessage | ( | QStringList & | text | ) | const [protected] |
Prints the a text received from the server to stdout.
text | server message |
Definition at line 783 of file account.cpp.
QStringList Account::readfromSocket | ( | bool | singleLine | ) | [protected] |
Reads all data from the socket.
singleLine | TRUE - the response will be a single line; FALSE - the response has more lines
|
Definition at line 553 of file account.cpp.
void Account::readStoredMails | ( | QDomElement & | parent | ) |
Gets the stored mails.
parent | DOM element which contains the mails of this account |
Definition at line 2328 of file account.cpp.
void Account::refreshMailList | ( | FilterLog * | log = NULL |
) |
Refreshes the mail list.
This just starts the refresh and returns after then. When the refresh is ready, the signal sigRefreshReady will be emitted.
log | pointer to the filter log
|
Definition at line 166 of file account.cpp.
void Account::reloadFilterSettings | ( | ) |
Reloads the settings of the filters.
It just calls the load() methode of the header filter.
Definition at line 1842 of file account.cpp.
void Account::removeEndOfResponseMarker | ( | QStringList * | response | ) | [protected] |
If the last line of the server response is the end of response marker, this methode will remove this line.
Definition at line 1250 of file account.cpp.
void Account::removeStatusIndicator | ( | QStringList * | response | ) | [protected] |
If the first line of the server response is the status indicator (+OK or -ERR), this methode will remove this line.
Definition at line 1108 of file account.cpp.
QString Account::removeStatusIndicator | ( | const QString & | message | ) | [protected] |
Removes the status indicator from a single line server message.
message | server message
|
Definition at line 1030 of file account.cpp.
void Account::saveOptions | ( | QDomDocument & | doc, | |
QDomElement & | parent | |||
) |
Saves the stored mails into the given DOM document.
It doesn't create a new DOM element but used the given one. Saves the setup into the application config.
doc | DOM document which contains all application settings, mails and account settings
|
Definition at line 2058 of file account.cpp.
void Account::sendCommand | ( | const QString & | command | ) | [protected] |
Sends a command to the server.
command | the command to send |
Definition at line 699 of file account.cpp.
void Account::setActive | ( | bool | active | ) |
Sets the account active.
active | TRUE - active account; FALSE - deactivate account |
Definition at line 97 of file account.cpp.
void Account::setHost | ( | const QString & | host | ) |
void Account::setPassword | ( | const QString & | password | ) |
Sets the account password.
password | new password |
Definition at line 223 of file account.cpp.
void Account::setPasswordStorage | ( | int | storage | ) |
Sets the password storage type.
The Constants are defined in constants.h
storage | type of password storage; valid values are: CONFIG_VALUE_ACCOUNT_PASSWORD_DONT_SAVE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_FILE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_KWALLET |
Definition at line 333 of file account.cpp.
void Account::setPort | ( | unsigned short int | port | ) |
void Account::setProtocol | ( | const QString & | protocol | ) |
void Account::setUser | ( | const QString & | user | ) |
void Account::showMails | ( | ) |
Downloads and shows the bodies of mails in mailsToShow
.
This just starts the download and returns after then. When the download is ready and the body is shown the sigShowBodiesReady will be emitted.
Definition at line 2072 of file account.cpp.
void Account::showNextMail | ( | ) | [protected] |
Shows the body of the first mail in MailsToShow.
After a successful download and opening of the window this mail will be removed from the list by slotBodyDownloaded() and this method will be invoked again. If the list is empty, it will call commitDownloading().
Definition at line 1658 of file account.cpp.
void Account::sigConfigChanged | ( | ) | [signal] |
Will be emitted when the settings have been changed.
void Account::sigDeleteReady | ( | QString | account | ) | [signal] |
Will be emitted when all selected mails are deleted.
account | name of the account, which has emitted this signal |
void Account::sigMessageWindowClosed | ( | ) | [signal] |
Will be emitted, when a window to show a message was closed.
void Account::sigMessageWindowOpened | ( | ) | [signal] |
Will be emitted, when a window to show a message was opened.
void Account::sigRefreshReady | ( | QString | account | ) | [signal] |
Will be emitted, when the mail list was refreshed.
account | name of the account, which has emitted this signal |
void Account::sigShowBodiesReady | ( | QString | account | ) | [signal] |
Will be emitted when the bodies of all selected mails are downloaded and shown.
account | name of the account, which has emitted this signal |
void Account::slotAuthMechResponse | ( | ) | [protected, slot] |
Connected with the signal readyRead of the socket by getAuthMech(). Analyzes the response and sets the authentication mechanism flags of this account.
Definition at line 820 of file account.cpp.
void Account::slotBodyDownloaded | ( | ) | [protected, slot] |
Opens a window (class ShowMailDialog) with the downloaded mail body.
Removes the first mail from MailsToShow and invokes showNextMail() again to show the next mail. If the list is empty after it has removed the first item, it will call commitDownloading().
Definition at line 1730 of file account.cpp.
void Account::slotCapabilitiesResponse | ( | ) | [protected, slot] |
Reads the capabilities from the server.
Definition at line 738 of file account.cpp.
void Account::slotCommitBeforeRefreshDone | ( | ) | [protected, slot] |
Restarts a second refresh cycle after a deletion performed by the filter.
Definition at line 2052 of file account.cpp.
void Account::slotCommitResponse | ( | ) | [protected, slot] |
Connected with signal readyRead of the socket by commit(). Analyzes the commit response of the server.
Definition at line 928 of file account.cpp.
void Account::slotConnected | ( | ) | [protected, virtual, slot] |
Connected with signal connected of the socket. Will be invoked after the socket has connected the host.
Definition at line 453 of file account.cpp.
void Account::slotGetHeaderResponse | ( | ) | [protected, slot] |
Receives the header requested by getNextHeader().
Stores the received headers into the appropriate instance of the mail list. Removes the first mail from newMails and invokes getNextHeader() again to get the next header. If the list is empty after it has removed the first item, it will call copyHeaders().
Definition at line 1514 of file account.cpp.
void Account::slotHostFound | ( | ) | [protected, virtual, slot] |
Connected with signal hostFound of the socket. Will be invoked after the socket has done the DNS lookup.
Definition at line 457 of file account.cpp.
void Account::slotLoginApopResponse | ( | ) | [protected, slot] |
Receives the response of a login using APOP.
Definition at line 1064 of file account.cpp.
void Account::slotLoginPasswdResponse | ( | ) | [protected, slot] |
Received the response of the PASS command during login.
Definition at line 998 of file account.cpp.
void Account::slotLoginUserResponse | ( | ) | [protected, slot] |
Received the response of the USER command during login.
Definition at line 961 of file account.cpp.
void Account::slotMailDeleted | ( | ) | [protected, slot] |
Removes the deleted mail from the internal mail list (m_pshowrecord).
Removes the first mail from MailsToDelete and invokes deleteNextMail() again to delete the next mail. If the list is empty after it has removed the first item, it will call commitDelete().
Definition at line 1676 of file account.cpp.
void Account::slotMailDownloadedForAction | ( | ) | [protected, slot] |
Downloads a mail to write it into a mailbox or do a spam check.
Maybe it puts the number of the downloaded mail into the list of mails to delete (mailsToDelete). Removes the first mail from MailsToMove and invokes getNextMailForMove() again to get and write the next mail. If the list is empty after it has removed the first item, it will call applyFilters() to continue the filtering. If an error is occurred the current mail will not put into MailsToDelete. And it returns to applyFilters() immediately.
Definition at line 1872 of file account.cpp.
void Account::slotMailSizesResponse | ( | ) | [protected, slot] |
Receives the response of the LIST command, which gets the numbers and sizes of the mails.
Definition at line 1380 of file account.cpp.
void Account::slotReadFirstServerMessage | ( | ) | [protected, slot] |
Reads the first message send by server.
Definition at line 661 of file account.cpp.
void Account::slotSocketError | ( | KTcpSocket::Error | errorCode | ) | [protected, slot] |
Connected with signal error of the socket. Will be invoked, when an socket error occures.
errorCode | Error code of the socket |
Definition at line 461 of file account.cpp.
void Account::slotSSLError | ( | const QList< KSslError > & | errors | ) | [protected, slot] |
Connected with signale sslErrors of the socket.
Will be invoked, when a ssl socket error occures.
errors | list of errors |
Definition at line 2287 of file account.cpp.
void Account::slotStartTLSResponse | ( | ) | [protected, slot] |
Receives the response of the STLS command.
Definition at line 2421 of file account.cpp.
void Account::slotTimeout | ( | ) | [protected, slot] |
Connected with the timeout timer.
Closes the server connect and finishes the task
Definition at line 2396 of file account.cpp.
void Account::slotUIDListResponse | ( | ) | [protected, slot] |
Reiceves the response of the UIDL command, which gets the UID's of the mails.
Definition at line 1147 of file account.cpp.
void Account::startTLS | ( | ) | [protected] |
Invites the server to crypt using TLS (STARTTLS).
Definition at line 2410 of file account.cpp.
void Account::swapMailLists | ( | ) | [protected] |
Copies the pointer to the temporary list to the mail list.
The temporary list will be the current mail list.
Definition at line 1267 of file account.cpp.
bool Account::writeToMailBox | ( | const QStringList & | mail, | |
const QString & | box | |||
) | [protected] |
Writes the given mail into the mailbox.
the Mail
|
Definition at line 2098 of file account.cpp.
AccountList* Account::accountList [private] |
bool Account::active [private] |
bool Account::allowUnsecureLogin [private] |
bool Account::apopAvail [private] |
QString Account::apopTimestamp [private] |
bool Account::deletionPerformedByFilters [private] |
This flag is set by applyFilters() to indicate the deletion cycle is performed by filters and not by user.
The deletion methodes need it to decide on branch targets
bool Account::dontHandleError [private] |
bool Account::dontUseAPOP [private] |
bool Account::downloadActionsInvoked [private] |
This flag is set to TRUE by applyFilters() to indicate the mailbodies are downloading and writing to the mailboxes or spam checking.
When this is ended, applyFilters() will be called again and it reset this flag
bool Account::filterApplied [private] |
This is a flag whether the filters was applied during a refresh cycle.
If some mails was deleted (recommend by the filter), we need a actual list of mails from the server. Therefore a second refresh cycle will be started. To avoid a never-ending loop this flag will be set to TRUE by applyFilters(). If the second refresh is running this one will not invoke the filters.
FilterLog* Account::fLog [private] |
Pointer to the filter log.
Will be set by refreshMailList() at every refresh.
HeaderFilter Account::headerFilter [private] |
bool Account::informAboutErrors [private] |
MailList* Account::mails [private] |
MailNumberList_Type Account::mailsToDelete [private] |
Contains the numbers of mails which will be deleted.
Set by addMailToDelete() and used by deleteNextMail() to get the number of the next mail to delete.
MailToDownloadMap_Type Account::mailsToDownload [private] |
Contains the numbers of the mails shall be moved for actions like moving to mailbox or spam check.
Contains also some parameters (like mailbox) about the action which have to be performed. Set and used by applyFilters().
MailNumberList_Type Account::mailsToShow [private] |
Contains the numbers of mails for which the bodies will be shown.
Set by showSelectedMails() and used by showNextMail() to get the number of the next mail to show.
int Account::moveCounter [private] |
QString Account::name [private] |
MailNumberList_Type Account::newMails [private] |
Contains the numbers of new mails.
Set by getHeaders() and used by getNextHeader() to download the headers of the new mails.
int Account::nmbDeletedMailsLastRefresh [private] |
int Account::nmbDeletedMailsLastStart [private] |
int Account::nmbIgnoredMails [private] |
int Account::nmbMovedMailsLastRefresh [private] |
int Account::nmbMovedMailsLastStart [private] |
int Account::passwordStorage [private] |
Type of password storage.
valid values are: CONFIG_VALUE_ACCOUNT_PASSWORD_DONT_SAVE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_FILE, CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_KWALLET The Constants are defined in constants.h
bool Account::quitSent [private] |
TRUE - the QUIT command was sent to the server. Normally set by the commit methode.
Inititates by initBeforeConnect()
bool Account::refreshPerformedByFilters [private] |
This flag is set by applyFiltersDeleted() to indicate the refresh cycle is the second one after a deletion which was performed by filters.
The refresh cycle need it to hold the remaining mails as new.
QPointer<KTcpSocket> Account::socket [private] |
FilterAction_Type Account::spamAction [private] |
QString Account::spamMailbox [private] |
Types::AccountState_Type Account::state [private] |
bool Account::supportsStartTLS [private] |
TRUE - the server supports StartTLS.
Set by slotCapabilitiesResponse()
MailList* Account::tempMailList [private] |
int Account::timeOutTime [private] |
QTimer* Account::timeoutTimer [private] |
KUrl Account::url [private] |