KCal Library
Go to the documentation of this file.
36 #include "kpimutils/email.h"
38 #include <QtCore/QRegExp>
41 #include <klocalizedstring.h>
50 class KCal::Person::Private
65 KPIMUtils::extractEmailAddressAndName(
fullName, d->mEmail, d->mName );
76 : d( new KCal::
Person::Private )
83 : d( new KCal::
Person::Private( *person.d ) )
92 #if defined(Q_CC_MSVC)
99 d->mName == person.d->mName &&
100 d->mEmail == person.d->mEmail;
106 if ( &person ==
this ) {
116 if ( d->mName.isEmpty() ) {
119 if ( d->mEmail.isEmpty() ) {
123 QString
name = d->mName;
124 QRegExp needQuotes(
"[^ 0-9A-Za-z\\x0080-\\xFFFF]" );
125 bool weNeedToQuote =
name.indexOf( needQuotes ) != -1;
126 if ( weNeedToQuote ) {
130 if (
name[
name.length()-1 ] !=
'"' ) {
134 return name +
" <" + d->mEmail +
'>';
151 return d->mEmail.isEmpty() && d->mName.isEmpty();
161 if (
email.startsWith( QLatin1String(
"mailto:" ), Qt::CaseInsensitive ) ) {
162 d->mEmail =
email.mid( 7 );
bool operator==(const Person &person)
Compares this with person for equality.
QString fullName() const
Returns the full name of this person.
void setName(const QString &name)
Sets the name of the person to name.
QString name() const
Returns the person name string.
Represents a person, by name ane email address.
Person()
Constructs a blank person.
~Person()
Destroys a person.
Person & operator=(const Person &person)
Sets this person equal to person.
bool isEmpty() const
Returns true if the person name and email address are empty.
void setEmail(const QString &email)
Sets the email address for this person to email.
QString email() const
Returns the email address for this person.
static Person fromFullName(const QString &fullName)
Constructs a person with name and email address taken from fullName.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 28 2020 00:00:00 by
doxygen 1.8.18 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.