26 #include <tdelocale.h> 28 #include <libemailfunctions/email.h> 34 Person::Person( const TQString &fullName ) 37 KPIM::getNameAndMail( fullName, name, email ); 42 Person::Person( const TQString &name, const TQString &email ) 49 bool KCal::operator==( const Person& p1, const Person& p2 ) 51 return ( p1.name() == p2.name() && 52 p1.email() == p2.email() ); 56 TQString Person::fullName() const 58 if( mName.isEmpty() ) { 61 if( mEmail.isEmpty() ) 65 TQString name = mName; 66 TQRegExp needQuotes( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ); 67 bool weNeedToQuote = name.find( needQuotes ) != -1; 68 if ( weNeedToQuote ) { 71 if ( name[ name.length()-1 ] != '"' ) 74 return name + " <" + mEmail + ">"; 79 bool Person::isEmpty() const 81 return mEmail.isEmpty() && mName.isEmpty(); 84 void Person::setName( const TQString &name) 89 void Person::setEmail( const TQString &email) 91 if ( email.startsWith( "mailto:", false ) ) { 92 mEmail = email.mid(7); This class represents a person.
Namespace KCal is for global classes, objects and/or functions in libkcal.
|