KCalendarCore::Person Class
class KCalendarCore::PersonRepresents a person, by name and email address. More...
Header: | #include <KCalendarCore/Person> |
CMake: | find_package(KF6 REQUIRED COMPONENTS CalendarCore) target_link_libraries(mytarget PRIVATE KF6::CalendarCore) |
In QML: | person |
Public Types
Properties
Public Functions
Person() | |
Person(const QString &name, const QString &email) | |
Person(const KCalendarCore::Person &person) | |
virtual | ~Person() |
QString | email() const |
QString | fullName() const |
bool | isEmpty() const |
QString | name() const |
void | setEmail(const QString &email) |
void | setName(const QString &name) |
bool | operator!=(const KCalendarCore::Person &person) const |
KCalendarCore::Person & | operator=(const KCalendarCore::Person &person) |
bool | operator==(const KCalendarCore::Person &person) const |
Static Public Members
KCalendarCore::Person | fromFullName(const QString &fullName) |
bool | isValidEmail(const QString &email) |
Detailed Description
This class represents a person, with a name and an email address. It supports the "FirstName LastName <mail@domain>" format.
Member Type Documentation
Person::List
List of persons.
Property Documentation
email : QString
Access functions:
[read-only]
fullName : const QString
Access functions:
QString | fullName() const |
[read-only]
isEmpty : const bool
Access functions:
bool | isEmpty() const |
name : QString
Access functions:
Member Function Documentation
Person::Person()
Constructs a blank person.
Person::Person(const QString &name, const QString &email)
Constructs a person with the name name and email address email.
name is the name of this person.
email is the email address of this person.
Person::Person(const KCalendarCore::Person &person)
Constructs a person as a copy of another person object. person is the person to copy.
[virtual noexcept]
Person::~Person()
Destroys a person.
QString Person::email() const
Returns the email address for this person. Returns A QString containing the person's email address.
Note: Getter function for property email.
See also setEmail().
[static]
KCalendarCore::Person Person::fromFullName(const QString &fullName)
Constructs a person with name and email address taken from fullName.
fullName is the name and email of the person in the form "FirstName LastName <mail@domain>".
Returns A Person object.
QString Person::fullName() const
Returns the full name of this person. Returns A QString containing the person's full name in the form "FirstName LastName <mail@domain>".
Note: Getter function for property fullName.
bool Person::isEmpty() const
Returns true if the person name and email address are empty.
Note: Getter function for property isEmpty.
[static]
bool Person::isValidEmail(const QString &email)
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)
email is the email address to validate
QString Person::name() const
Returns the person name string.
Note: Getter function for property name.
See also setName().
void Person::setEmail(const QString &email)
Sets the email address for this person to email.
email is the email address for this person.
Note: Setter function for property email.
See also email().
void Person::setName(const QString &name)
Sets the name of the person to name.
name is the name of this person.
Note: Setter function for property name.
See also name().
bool Person::operator!=(const KCalendarCore::Person &person) const
Compares this with person for non-equality.
person is the person to compare.
Returns true of person is not equal to this object, or false if they are equal.
KCalendarCore::Person &Person::operator=(const KCalendarCore::Person &person)
Sets this person equal to person.
person is the person to copy.
bool Person::operator==(const KCalendarCore::Person &person) const
Compares this with person for equality.
person is the person to compare.
Returns true of person is equal to this object, or false if they are different.