AccountViewItem Class Reference

This class is used by AccountViewModel to hold a list of the accounts. More...

#include <accountviewitem.h>

List of all members.

Public Member Functions

 AccountViewItem (bool active, const QString &name, const QString &server, const QString &user, int numberMails, long totalSize, QPointer< Account > account)
 Contructor.
bool isActive () const
 Returns whether the account is active.
QString getName () const
 Returns the account name.
QString getServer () const
 Returns ther server host name.
QString getUser () const
 Returns the user.
int getNumberMails () const
 Returns the number of mails.
QString getTotalSizeUnit () const
 Returns the total size of mails with appended unit.
long getTotalSize () const
 Returns the total size of mails.
QPointer< AccountgetAccount () const
 Returns the pointer to the account.
int compare (const AccountViewItem &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.

Private Attributes

bool active
 true - the account is active
QString name
 account name
QString server
 server
QString user
 user
int numberMails
 number of mails
long totalSize
 total size of mails, inclusive unit
QPointer< Accountaccount
 pointer to the account

Detailed Description

This class is used by AccountViewModel to hold a list of the accounts.

It can't use a list of pointers to a account because this pointers can be invalid for a short time after an account was removed. When the account view refreshes in this time the app crashed.

Definition at line 37 of file accountviewitem.h.


Constructor & Destructor Documentation

AccountViewItem::AccountViewItem ( bool  active,
const QString &  name,
const QString &  server,
const QString &  user,
int  numberMails,
long  totalSize,
QPointer< Account account 
)

Contructor.

Parameters:
active true - the account is active; false - the account is not active
Parameters:
name Name of the account
Parameters:
server server
Parameters:
user user
Parameters:
numberMails number of mails
Parameters:
totalSize total size of all mails
Parameters:
account pointer to the associated account

Definition at line 20 of file accountviewitem.cpp.


Member Function Documentation

int AccountViewItem::compare ( const AccountViewItem 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.

Parameters:
other other account
Parameters:
property the account property which will be compared

Definition at line 77 of file accountviewitem.cpp.

QPointer< Account > AccountViewItem::getAccount (  )  const

Returns the pointer to the account.

Returns:
pointer to the associated account

Definition at line 40 of file accountviewitem.cpp.

QString AccountViewItem::getName (  )  const

Returns the account name.

Returns:
account name

Definition at line 30 of file accountviewitem.cpp.

int AccountViewItem::getNumberMails (  )  const

Returns the number of mails.

Returns:
number of mails

Definition at line 45 of file accountviewitem.cpp.

QString AccountViewItem::getServer (  )  const

Returns ther server host name.

Returns:
server host

Definition at line 35 of file accountviewitem.cpp.

long int AccountViewItem::getTotalSize (  )  const

Returns the total size of mails.

Returns:
total size of mails

Definition at line 132 of file accountviewitem.cpp.

QString AccountViewItem::getTotalSizeUnit (  )  const

Returns the total size of mails with appended unit.

Returns:
total size of mails

Definition at line 50 of file accountviewitem.cpp.

QString AccountViewItem::getUser (  )  const

Returns the user.

Returns:
user

Definition at line 72 of file accountviewitem.cpp.

bool AccountViewItem::isActive (  )  const

Returns whether the account is active.

Returns:
true - account is active; false - account isn't active

Definition at line 25 of file accountviewitem.cpp.


Member Data Documentation

QPointer<Account> AccountViewItem::account [private]

pointer to the account

Definition at line 147 of file accountviewitem.h.

bool AccountViewItem::active [private]

true - the account is active

Definition at line 117 of file accountviewitem.h.

QString AccountViewItem::name [private]

account name

Definition at line 122 of file accountviewitem.h.

number of mails

Definition at line 137 of file accountviewitem.h.

QString AccountViewItem::server [private]

server

Definition at line 127 of file accountviewitem.h.

total size of mails, inclusive unit

Definition at line 142 of file accountviewitem.h.

QString AccountViewItem::user [private]

user

Definition at line 132 of file accountviewitem.h.


The documentation for this class was generated from the following files:
Generated on Sun Mar 13 15:27:10 2011 for KShowmail by  doxygen 1.6.3