KCalendarCore::Person

#include <person.h>

Public Types

typedef QVector< PersonList
 

Properties

QString email
 
QString fullName
 
bool isEmpty
 
QString name
 

Public Member Functions

 Person ()
 
 Person (const QString &name, const QString &email)
 
 Person (const Person &person)
 
virtual ~Person ()
 
QString email () const
 
QString fullName () const
 
bool isEmpty () const
 
QString name () const
 
bool operator!= (const Person &person) const
 
Personoperator= (const Person &person)
 
bool operator== (const Person &person) const
 
void setEmail (const QString &email)
 
void setName (const QString &name)
 

Static Public Member Functions

static Person fromFullName (const QString &fullName)
 
static bool isValidEmail (const QString &email)
 

Friends

KCALENDARCORE_EXPORT QDataStreamoperator<< (QDataStream &s, const KCalendarCore::Person &person)
 
KCALENDARCORE_EXPORT QDataStreamoperator>> (QDataStream &s, KCalendarCore::Person &person)
 

Detailed Description

Represents a person, by name and email address.

This class represents a person, with a name and an email address. It supports the "FirstName LastName\ <[email protected]\>" format.

Definition at line 38 of file person.h.

Member Typedef Documentation

List of persons.

Definition at line 50 of file person.h.

Constructor & Destructor Documentation

Person::Person ( )

Constructs a blank person.

Private class that helps to provide binary compatibility between releases.

Definition at line 44 of file person.cpp.

Person::Person ( const QString name,
const QString email 
)

Constructs a person with the name name and email address email.

Parameters
nameis the name of this person.
emailis the email address of this person.

Definition at line 48 of file person.cpp.

Person::Person ( const Person person)

Constructs a person as a copy of another person object.

Parameters
personis the person to copy.

Definition at line 55 of file person.cpp.

Person::~Person ( )
virtualdefault

Destroys a person.

Member Function Documentation

QString KCalendarCore::Person::email ( ) const

Returns the email address for this person.

Returns
A QString containing the person's email address.
See also
setEmail()
Person Person::fromFullName ( const QString fullName)
static

Constructs a person with name and email address taken from fullName.

Parameters
fullNameis the name and email of the person in the form "FirstName LastName \<[email protected]\>".
Returns
A Person object.

Definition at line 363 of file person.cpp.

QString KCalendarCore::Person::fullName ( ) const

Returns the full name of this person.

Returns
A QString containing the person's full name in the form "FirstName LastName \<[email protected]\>".
bool KCalendarCore::Person::isEmpty ( ) const

Returns true if the person name and email address are empty.

bool Person::isValidEmail ( const QString email)
static

Returns true if person's email address is valid.

Simple email validity check, test that there: is at least one @ is at least one character in the local part is at least one dot in the domain part is at least four characters in the domain (assuming that no-one has an address at the tld, that the tld is at least 2 chars)

Parameters
emailis the email address to validate

Definition at line 142 of file person.cpp.

QString KCalendarCore::Person::name ( ) const

Returns the person name string.

See also
setName()
bool KCalendarCore::Person::operator!= ( const Person person) const

Compares this with person for non-equality.

Parameters
personis the person to compare.

Definition at line 69 of file person.cpp.

Person & KCalendarCore::Person::operator= ( const Person person)

Sets this person equal to person.

Parameters
personis the person to copy.

Definition at line 74 of file person.cpp.

bool KCalendarCore::Person::operator== ( const Person person) const

Compares this with person for equality.

Parameters
personis the person to compare.

Definition at line 62 of file person.cpp.

void Person::setEmail ( const QString email)

Sets the email address for this person to email.

Parameters
emailis the email address for this person.
See also
email()

Definition at line 133 of file person.cpp.

void Person::setName ( const QString name)

Sets the name of the person to name.

Parameters
nameis the name of this person.
See also
name()

Definition at line 128 of file person.cpp.

Friends And Related Function Documentation

KCALENDARCORE_EXPORT QDataStream& operator<< ( QDataStream s,
const KCalendarCore::Person person 
)
friend

Serializes the person object into the stream.

KCALENDARCORE_EXPORT QDataStream& operator>> ( QDataStream s,
KCalendarCore::Person person 
)
friend

Initializes the person object from the stream.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Dec 3 2020 22:51:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.