• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

KCalCore Library

  • KCalCore
  • Person
Public Types | Public Member Functions | Static Public Member Functions | Friends
KCalCore::Person Class Reference

#include <person.h>

Inheritance diagram for KCalCore::Person:
Inheritance graph
[legend]

List of all members.

Public Types

typedef QVector< Ptr > List
typedef QSharedPointer< Person > Ptr

Public Member Functions

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

Static Public Member Functions

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

Friends

KCALCORE_EXPORT QDataStream & operator<< (QDataStream &s, const KCalCore::Person::Ptr &person)
KCALCORE_EXPORT QDataStream & operator>> (QDataStream &s, KCalCore::Person::Ptr &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\ <mail@domain\>" format.

Definition at line 50 of file person.h.


Member Typedef Documentation

typedef QVector<Ptr> KCalCore::Person::List

List of persons.

Reimplemented in KCalCore::Attendee.

Definition at line 61 of file person.h.

typedef QSharedPointer<Person> KCalCore::Person::Ptr

A shared pointer to a Person object.

Reimplemented in KCalCore::Attendee.

Definition at line 56 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 56 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 60 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 67 of file person.cpp.

Person::~Person ( ) [virtual]

Destroys a person.

Definition at line 72 of file person.cpp.


Member Function Documentation

int Person::count ( ) const

Returns the number of references or zero if it is not initialized.

See also:
setCount()

Definition at line 166 of file person.cpp.

QString Person::email ( ) const

Returns the email address for this person.

See also:
setEmail()

Definition at line 130 of file person.cpp.

Person::Ptr Person::fromFullName ( const QString &  fullName) [static]

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

static

Parameters:
fullNameis the name and email of the person in the form "FirstName LastName \<mail@domain\>".

Definition at line 392 of file person.cpp.

QString Person::fullName ( ) const

Returns the full name of this person.

Definition at line 100 of file person.cpp.

bool Person::isEmpty ( ) const

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

Definition at line 135 of file person.cpp.

bool Person::isValidEmail ( const QString &  email) [static]

Returns true if person's email address is valid.

static

 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 155 of file person.cpp.

QString Person::name ( ) const

Returns the person name string.

See also:
setName()

Definition at line 125 of file person.cpp.

bool KCalCore::Person::operator!= ( const Person &  person) const

Compares this with person for non-equality.

Parameters:
personis the person to compare.

Definition at line 84 of file person.cpp.

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

Sets this person equal to person.

Parameters:
personis the person to copy.

Definition at line 89 of file person.cpp.

bool KCalCore::Person::operator== ( const Person &  person) const

Compares this with person for equality.

Parameters:
personis the person to compare.

Definition at line 77 of file person.cpp.

void Person::setCount ( int  count)

Sets the number of references for this person.

This can be initialized in a loading function (see ExtendedStorage), where the number of contact appearances etc. are counted.

Parameters:
countnumber of references
See also:
count()

Definition at line 161 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 145 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 140 of file person.cpp.


Friends And Related Function Documentation

KCALCORE_EXPORT QDataStream& operator<< ( QDataStream &  s,
const KCalCore::Person::Ptr &  person 
) [friend]

Serializes the person object into the stream.

KCALCORE_EXPORT QDataStream& operator>> ( QDataStream &  s,
KCalCore::Person::Ptr &  person 
) [friend]

Initializes the person object from the stream.


The documentation for this class was generated from the following files:
  • person.h
  • person.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 22:16:58 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal