22 #include "vcardtool.h"
30 #include <QtCore/QString>
31 #include <QtCore/QBuffer>
36 static bool needsEncoding(
const QString &value )
38 uint length = value.
length();
39 for ( uint i = 0; i < length; ++i ) {
41 if ( ( c < 33 || c > 126 ) && c !=
' ' && c !=
'=' ) {
49 VCardTool::VCardTool()
75 VCardTool::~VCardTool()
81 return createVCards( list, version,
true );
86 return createVCards( list, version,
false );
89 void VCardTool::addParameter(VCardLine &line, VCard::Version version,
const QString &key,
const QStringList &valueStringList)
const
91 if (version == VCard::v2_1) {
92 Q_FOREACH(
const QString &valueStr, valueStringList) {
93 line.addParameter( valueStr,
QString() );
101 VCard::Version version,
bool exportVcard )
const
107 for ( addrIt = list.
constBegin(); addrIt != listEnd; ++addrIt ) {
116 const bool isEmpty = ( ( *it ).postOfficeBox().isEmpty() &&
117 ( *it ).extended().isEmpty() &&
118 ( *it ).street().isEmpty() &&
119 ( *it ).locality().isEmpty() &&
120 ( *it ).region().isEmpty() &&
121 ( *it ).postalCode().isEmpty() &&
122 ( *it ).country().isEmpty() );
146 if ( version == VCard::v2_1 && needsEncoding( address.
join(
QLatin1String(
";" ) ) ) ) {
151 VCardLine labelLine(
QLatin1String(
"LABEL" ), ( *it ).label() );
152 if ( version == VCard::v2_1 && needsEncoding( ( *it ).label() ) ) {
157 const bool hasLabel = !( *it ).label().isEmpty();
160 typeIt != mAddressTypeMap.
constEnd(); ++typeIt ) {
161 if ( typeIt.
value() & ( *it ).type() ) {
170 card.addLine( adrLine );
173 card.addLine( labelLine );
178 card.addLine( VCardLine(
QLatin1String(
"BDAY" ), createDateTime( ( *addrIt ).birthday() ) ) );
184 if ( version != VCard::v2_1 ) {
188 for ( catIt = categories.
begin(); catIt != catEnd; ++catIt ) {
193 card.addLine( catLine );
198 if ( version == VCard::v4_0) {
200 if (( *addrIt ).kind().toLower() ==
QLatin1String(
"group")) {
201 Q_FOREACH (
const QString &member, ( *addrIt ).members() ) {
203 card.addLine( line );
209 Q_FOREACH (
const KUrl &url, ( *addrIt ).sourcesUrlList()) {
210 VCardLine line = VCardLine(
QLatin1String(
"SOURCE" ), url.url() );
211 card.addLine( line );
215 if (version == VCard::v4_0) {
216 Q_FOREACH (
const QString &relation, ( *addrIt ).relationShips() ) {
218 card.addLine( line );
222 if ( version == VCard::v3_0 ) {
223 card.addLine( createSecrecy( ( *addrIt ).secrecy() ) );
227 if ( version == VCard::v4_0 ) {
228 const Lang::List langList = ( *addrIt ).langs();
231 for ( langIt = langList.
begin(); langIt != langEnd; ++langIt ) {
232 VCardLine line(
QLatin1String(
"LANG" ), (*langIt).language() );
234 while (i.hasNext()) {
236 line.addParameter( i.key(), i.value().join(
QLatin1String(
",")) );
238 card.addLine( line );
242 const Email::List emailList = ( *addrIt ).emailList();
247 for ( emailIt = emailList.
begin(); emailIt != emailEnd; ++emailIt ) {
248 bool needToAddPref =
false;
249 VCardLine line(
QLatin1String(
"EMAIL" ), (*emailIt).mail() );
250 if ( pref ==
true && emailList.
count() > 1 ) {
251 needToAddPref =
true;
255 bool foundType =
false;
256 while (i.hasNext()) {
264 needToAddPref =
false;
267 if (!needToAddPref) {
273 if (!valueStringList.
isEmpty()) {
275 addParameter(line, version, i.key(), valueStringList);
281 if (!foundType && needToAddPref) {
282 if (version == VCard::v2_1) {
288 card.addLine( line );
292 VCardLine fnLine(
QLatin1String(
"FN" ), ( *addrIt ).formattedName() );
293 if ( version == VCard::v2_1 && needsEncoding( ( *addrIt ).formattedName() ) ) {
297 card.addLine( fnLine );
300 const Geo geo = ( *addrIt ).geo();
303 if (version == VCard::v4_0 ) {
312 const Key::List keys = ( *addrIt ).keys();
315 for ( keyIt = keys.
begin(); keyIt != keyEnd; ++keyIt ) {
316 card.addLine( createKey( *keyIt, version ) );
320 card.addLine( createPicture(
QLatin1String(
"LOGO" ), ( *addrIt ).logo(), version ) );
321 Q_FOREACH (
const KABC::Picture &logo, ( *addrIt ).extraLogoList()) {
322 card.addLine( createPicture(
QLatin1String(
"LOGO" ), logo, version ) );
326 if ( version != VCard::v4_0 ) {
327 VCardLine mailerLine(
QLatin1String(
"MAILER" ), ( *addrIt ).mailer() );
328 if ( version == VCard::v2_1 && needsEncoding( ( *addrIt ).mailer() ) ) {
332 card.addLine( mailerLine );
353 if ( version == VCard::v2_1 && needsEncoding( name.
join(
QLatin1String(
";" ) ) ) ) {
357 if ( version == VCard::v4_0 && !( *addrIt ).sortString().isEmpty() ) {
358 nLine.addParameter(
QLatin1String(
"SORT-AS" ), ( *addrIt ).sortString() );
361 card.addLine( nLine );
364 if ( version != VCard::v4_0 ) {
365 VCardLine nameLine(
QLatin1String(
"NAME" ), ( *addrIt ).name() );
366 if ( version == VCard::v2_1 && needsEncoding( ( *addrIt ).name() ) ) {
370 card.addLine( nameLine );
374 if ( version != VCard::v2_1 ) {
375 card.addLine( VCardLine(
QLatin1String(
"NICKNAME" ), ( *addrIt ).nickName() ) );
379 VCardLine noteLine(
QLatin1String(
"NOTE" ), ( *addrIt ).note() );
380 if ( version == VCard::v2_1 && needsEncoding( ( *addrIt ).note() ) ) {
384 card.addLine( noteLine );
390 if ( !( *addrIt ).department().isEmpty() ) {
395 if ( version == VCard::v2_1 && needsEncoding( organization.
join(
QLatin1String(
";" ) ) ) ) {
399 card.addLine( orgLine );
402 card.addLine( createPicture(
QLatin1String(
"PHOTO" ), ( *addrIt ).photo(), version ) );
403 Q_FOREACH (
const KABC::Picture &photo, ( *addrIt ).extraPhotoList()) {
404 card.addLine( createPicture(
QLatin1String(
"PHOTO" ), photo, version ) );
408 if ( version != VCard::v2_1 ) {
409 card.addLine( VCardLine(
QLatin1String(
"PRODID" ), ( *addrIt ).productId() ) );
413 card.addLine( VCardLine(
QLatin1String(
"REV" ), createDateTime( ( *addrIt ).revision() ) ) );
416 VCardLine roleLine(
QLatin1String(
"ROLE" ), ( *addrIt ).role() );
417 if ( version == VCard::v2_1 && needsEncoding( ( *addrIt ).role() ) ) {
421 card.addLine( roleLine );
424 if ( version == VCard::v3_0 ) {
425 card.addLine( VCardLine(
QLatin1String(
"SORT-STRING" ), ( *addrIt ).sortString() ) );
429 card.addLine( createSound( ( *addrIt ).sound(), version ) );
430 Q_FOREACH (
const KABC::Sound &sound, ( *addrIt ).extraSoundList()) {
431 card.addLine( createSound( sound, version ) );
438 for ( phoneIt = phoneNumbers.
begin(); phoneIt != phoneEnd; ++phoneIt ) {
439 VCardLine line(
QLatin1String(
"TEL" ), ( *phoneIt ).number() );
443 for ( typeIt = mPhoneTypeMap.constBegin(); typeIt != typeEnd; ++typeIt ) {
444 if ( typeIt.value() & ( *phoneIt ).type() ) {
449 card.addLine( line );
453 VCardLine titleLine(
QLatin1String(
"TITLE" ), ( *addrIt ).title() );
454 if ( version == VCard::v2_1 && needsEncoding( ( *addrIt ).title() ) ) {
458 card.addLine( titleLine );
462 const TimeZone timeZone = ( *addrIt ).timeZone();
467 if ( timeZone.
offset() < 0 ) {
471 str.
sprintf(
"%c%02d:%02d", ( timeZone.
offset() >= 0 ?
'+' :
'-' ),
472 ( timeZone.
offset() / 60 ) * neg,
473 ( timeZone.
offset() % 60 ) * neg );
479 card.addLine( VCardLine(
QLatin1String(
"UID" ), ( *addrIt ).uid() ) );
482 card.addLine( VCardLine(
QLatin1String(
"URL" ), ( *addrIt ).url().url() ) );
483 Q_FOREACH (
const KUrl &url, ( *addrIt ).extraUrlList()) {
484 VCardLine line = VCardLine(
QLatin1String(
"URL" ), url.url() );
485 card.addLine( line );
489 if ( version == VCard::v2_1 ) {
491 }
else if ( version == VCard::v3_0 ) {
493 }
else if ( version == VCard::v4_0 ) {
499 for ( strIt = customs.
begin(); strIt != customs.
end(); ++strIt ) {
501 ( *strIt ).left( ( *strIt ).indexOf(
QLatin1Char(
':' ) ) );
508 if ( identifier ==
QLatin1String(
"X-messaging/aim-All" ) ) {
510 }
else if ( identifier ==
QLatin1String(
"X-messaging/icq-All" ) ) {
512 }
else if ( identifier ==
QLatin1String(
"X-messaging/xmpp-All" ) ) {
514 }
else if ( identifier ==
QLatin1String(
"X-messaging/msn-All" ) ) {
516 }
else if ( identifier ==
QLatin1String(
"X-messaging/yahoo-All" ) ) {
518 }
else if ( identifier ==
QLatin1String(
"X-messaging/gadu-All" ) ) {
520 }
else if ( identifier ==
QLatin1String(
"X-messaging/skype-All" ) ) {
522 }
else if ( identifier ==
QLatin1String(
"X-messaging/groupwise-All" ) ) {
524 }
else if ( identifier ==
QLatin1String(
"X-messaging/sms-All" ) ) {
526 }
else if ( identifier ==
QLatin1String(
"X-messaging/meanwhile-All" ) ) {
528 }
else if ( identifier ==
QLatin1String(
"X-messaging/irc-All" ) ) {
530 }
else if ( identifier ==
QLatin1String(
"X-messaging/googletalk-All" ) ) {
536 if (version == VCard::v4_0) {
538 const Gender gender = ( *addrIt ).gender();
539 if (gender.isValid()) {
541 if (!gender.gender().isEmpty()) {
542 genderStr = gender.gender();
544 if (!gender.comment().isEmpty()) {
548 card.addLine( line );
551 if (!( *addrIt ).kind().isEmpty()) {
552 VCardLine line(
QLatin1String(
"KIND" ), ( *addrIt ).kind() );
556 if (identifier.
toLower() ==
QLatin1String(
"x-kaddressbook-x-anniversary" ) && version == VCard::v4_0) {
562 card.addLine( VCardLine(
QLatin1String(
"ANNIVERSARY" ), createDateTime( dt ) ) );
565 VCardLine line( identifier, value );
566 if ( version == VCard::v2_1 && needsEncoding( value ) ) {
570 card.addLine( line );
577 return VCardParser::createVCards( vCardList );
587 const VCard::List vCardList = VCardParser::parseVCards( vcard );
591 for ( cardIt = vCardList.
begin(); cardIt != listEnd; ++cardIt ) {
594 const QStringList idents = ( *cardIt ).identifiers();
597 for ( identIt = idents.
begin(); identIt != identEnd; ++identIt ) {
602 for ( lineIt = lines.
begin(); lineIt != lines.
end(); ++lineIt ) {
603 identifier = ( *lineIt ).identifier().
toLower();
607 const QStringList addrParts = splitString( semicolonSep, ( *lineIt ).value().toString() );
608 if ( addrParts.
count() > 0 ) {
611 if ( addrParts.
count() > 1 ) {
614 if ( addrParts.
count() > 2 ) {
617 if ( addrParts.
count() > 3 ) {
620 if ( addrParts.
count() > 4 ) {
623 if ( addrParts.
count() > 5 ) {
626 if ( addrParts.
count() > 6 ) {
635 type |= mAddressTypeMap[ ( *it ).toLower() ];
639 if ( !( *lineIt ).parameter(
QLatin1String(
"label" ) ).isEmpty() ) {
647 addr.
setBirthday( parseDateTime( ( *lineIt ).value().toString() ) );
651 const QString t = ( *lineIt ).value().toString();
657 const QStringList categories = splitString( commaSep, ( *lineIt ).value().toString() );
662 CalendarUrl calendarUrl(CalendarUrl::FBUrl);
664 addr.insertCalendarUrl(calendarUrl);
668 CalendarUrl calendarUrl(CalendarUrl::CALADRUri);
670 addr.insertCalendarUrl(calendarUrl);
674 CalendarUrl calendarUrl(CalendarUrl::CALUri);
676 addr.insertCalendarUrl(calendarUrl);
692 QString genderStr = ( *lineIt ).value().toString();
696 gender.setGender(genderStr.
at(0));
697 if (genderStr.
length() > 2) {
698 gender.setComment(genderStr.
right(genderStr.
length()-2));
701 gender.setComment(genderStr.
right(genderStr.
length()-1));
703 addr.setGender(gender);
710 lang.setLanguage(( *lineIt ).value().toString());
711 lang.setParameters((*lineIt).parameterMap());
712 addr.insertLang(lang);
716 addr.setKind( ( *lineIt ).value().toString() );
726 QString lineStr = ( *lineIt ).value().toString();
731 if ( geoParts.
size() >= 2 ) {
739 if ( geoParts.
size() >= 2 ) {
759 type |= mAddressTypeMap[ ( *it ).toLower() ];
762 bool available =
false;
765 it != addressList.
end(); ++it ) {
766 if ( ( *it ).type() == type ) {
767 ( *it ).setLabel( ( *lineIt ).value().toString() );
776 address.
setLabel( ( *lineIt ).value().toString() );
783 Picture picture = parsePicture( *lineIt );
787 addr.insertExtraLogo( picture );
793 addr.
setMailer( ( *lineIt ).value().toString() );
798 const QStringList nameParts = splitString( semicolonSep, ( *lineIt ).value().toString() );
799 const int numberOfParts( nameParts.
count() );
800 if ( numberOfParts > 0 ) {
803 if ( numberOfParts > 1 ) {
806 if ( numberOfParts > 2 ) {
809 if ( numberOfParts > 3 ) {
812 if ( numberOfParts > 4 ) {
815 if ( !( *lineIt ).parameter(
QLatin1String(
"sort-as" ) ).isEmpty() ) {
822 addr.
setName( ( *lineIt ).value().toString() );
827 addr.
setNickName( ( *lineIt ).value().toString() );
832 addr.
setNote( ( *lineIt ).value().toString() );
837 const QStringList orgParts = splitString( semicolonSep, ( *lineIt ).value().toString() );
838 if ( orgParts.
count() > 0 ) {
841 if ( orgParts.
count() > 1 ) {
844 if ( !( *lineIt ).parameter(
QLatin1String(
"sort-as" ) ).isEmpty() ) {
851 Picture picture = parsePicture( *lineIt );
855 addr.insertExtraPhoto( picture );
866 addr.
setRevision( parseDateTime( ( *lineIt ).value().toString() ) );
871 addr.
setRole( ( *lineIt ).value().toString() );
881 Sound sound = parseSound( *lineIt );
885 addr.insertExtraSound(sound);
892 phone.
setNumber( ( *lineIt ).value().toString() );
894 PhoneNumber::Type type;
899 type |= mPhoneTypeMap[( *it ).toUpper()];
909 addr.
setTitle( ( *lineIt ).value().toString() );
918 int hours = date.
mid( 1, 2 ).
toInt();
919 int minutes = date.
mid( 4, 2 ).
toInt();
920 int offset = ( hours * 60 ) + minutes;
921 offset = offset * ( date[ 0 ] ==
QLatin1Char(
'+' ) ? 1 : -1 );
930 addr.
setUid( ( *lineIt ).value().toString() );
935 const KUrl url = KUrl( ( *lineIt ).value().toString() );
936 if (addr.
url().isEmpty()) {
939 addr.insertExtraUrl(url);
944 const KUrl url = KUrl( ( *lineIt ).value().toString() );
945 addr.insertSourceUrl( url );
949 addr.insertMember( ( *lineIt ).value().toString() );
953 addr.insertRelationShip( ( *lineIt ).value().toString() );
958 QString ident = ( *lineIt ).identifier();
963 }
else if ( identifier ==
QLatin1String(
"x-evolution-blog-url" ) ) {
965 }
else if ( identifier ==
QLatin1String(
"x-evolution-assistant" ) ||
968 }
else if ( identifier ==
QLatin1String(
"x-evolution-anniversary" ) ||
971 }
else if ( identifier ==
QLatin1String(
"x-evolution-manager" ) ||
1005 ( *lineIt ).value().toString() );
1030 if ( timeStart >= 0 ) {
1031 int hour = 0, minute = 0, second = 0;
1033 hour = str.
mid( timeStart + 1, 2 ).
toInt();
1036 if ( str.
length() >= ( timeStart + 5 ) ) {
1037 minute = str.
mid( timeStart + 4, 2 ).
toInt();
1038 if ( str.
length() >= ( timeStart + 8 ) ) {
1039 second = str.
mid( timeStart + 7, 2 ).
toInt();
1043 if ( str.
length() >= ( timeStart + 4 ) ) {
1044 minute = str.
mid( timeStart + 3, 2 ).
toInt();
1045 if ( str.
length() >= ( timeStart + 6 ) ) {
1046 second = str.
mid( timeStart + 5, 2 ).
toInt();
1051 time =
QTime( hour, minute, second );
1054 Qt::TimeSpec spec = ( str.
right( 1 ) ==
QLatin1String(
"Z" ) ) ? Qt::UTC : Qt::LocalTime;
1064 dateTime.setTime( time );
1066 dateTime.setTimeSpec( spec );
1083 if ( dateTime.
timeSpec() == Qt::UTC ) {
1092 Picture VCardTool::parsePicture(
const VCardLine &line )
const
1102 pic.
setRawData( line.value().toByteArray(), type );
1105 pic.
setUrl( line.value().toString() );
1112 VCardLine VCardTool::createPicture(
const QString &identifier,
const Picture &pic, VCard::Version version )
const
1114 VCardLine line( identifier );
1121 line.setValue( pic.
rawData() );
1122 if (version == VCard::v2_1) {
1130 line.setValue( pic.
url() );
1137 Sound VCardTool::parseSound(
const VCardLine &line )
const
1143 snd.
setData( line.value().toByteArray() );
1146 snd.
setUrl( line.value().toString() );
1158 VCardLine VCardTool::createSound(
const Sound &snd, VCard::Version version )
const
1164 line.setValue( snd.
data() );
1165 if (version == VCard::v2_1) {
1173 line.setValue( snd.
url() );
1180 Key VCardTool::parseKey(
const VCardLine &line )
const
1205 VCardLine VCardTool::createKey(
const Key &key, VCard::Version version )
const
1213 if (version == VCard::v2_1)
1233 Secrecy VCardTool::parseSecrecy(
const VCardLine &line )
const
1239 secrecy.setType( Secrecy::Public );
1241 secrecy.setType( Secrecy::Private );
1243 secrecy.setType( Secrecy::Confidential );
1249 VCardLine VCardTool::createSecrecy(
const Secrecy &secrecy )
const
1253 int type = secrecy.type();
1255 if ( type == Secrecy::Public ) {
1257 }
else if ( type == Secrecy::Private ) {
1259 }
else if ( type == Secrecy::Confidential ) {
1272 int pos = value.
indexOf( sep, start );
1274 while ( pos != -1 ) {
1275 if ( pos == 0 || value[ pos - 1 ] !=
QLatin1Char(
'\\' ) ) {
1276 if ( pos > start && pos <= (
int)value.
length() ) {
1277 list << value.
mid( start, pos - start );
1283 pos = value.
indexOf( sep, start );
1285 value.
replace( pos - 1, 2, sep );
1286 pos = value.
indexOf( sep, pos );
1290 int l = value.
length() - 1;
1291 if ( value.
mid( start, l - start + 1 ).
length() > 0 ) {
1292 list << value.
mid( start, l - start + 1 );
Class that holds a Sound clip for a contact.
Personal Communication Service.
QString textData() const
Returns the text data.
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
void setType(Type type)
Sets the type of address.
Postal address information.
void setNickName(const QString &nickName)
Set nick name.
Picture photo() const
Return photo.
void setBinaryData(const QByteArray &data)
Sets binary data.
void setData(const QByteArray &data)
Sets the raw data of the sound.
void insertEmail(const QString &email, bool preferred=false)
Insert an email address.
A class to store a picture of an addressee.
void setUrl(const QString &url)
Sets a URL for the location of the sound file.
void setMailer(const QString &mailer)
Set mail client.
void insertPhoneNumber(const PhoneNumber &phoneNumber)
Insert a phone number.
void setLongitude(float longitude)
Sets the longitude.
a QValueList of Addressee, with sorting functionality
QString toString(Qt::DateFormat format) const
void setSuffix(const QString &suffix)
Set honorific suffixes.
void setPhoto(const Picture &photo)
Set photo.
void setFormattedName(const QString &formattedName)
Set formatted name.
void setTextData(const QString &data)
Sets text data.
QByteArray binaryData() const
Returns the binary data.
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
A class to store an encryption key.
void setRole(const QString &role)
Set role.
void setOffset(int offset)
Set time zone offset relative to UTC.
void setLatitude(float latitude)
Sets the latitude.
const_iterator constBegin() const
const T & at(int i) const
void setTime(const QTime &time)
bool contains(const QString &str, Qt::CaseSensitivity cs) const
float longitude() const
Returns the longitude.
void setCategories(const QStringList &)
Set categories to given value.
void setGivenName(const QString &givenName)
Set given name.
bool isBinary() const
Returns whether the key contains binary or text data.
bool isValid() const
Return, if this time zone object is valid.
void setStreet(const QString &street)
Sets the street (including house number).
Sound sound() const
Return sound.
void setSortString(const QString &sortString)
Set sort string.
void setAdditionalName(const QString &additionalName)
Set additional names.
QString join(const QString &separator) const
void setLogo(const Picture &logo)
Set logo.
QByteArray rawData() const
Returns the raw data of this picture.
QString & remove(int position, int n)
void setFamilyName(const QString &familyName)
Set family name.
Address::List addresses() const
Return list of all addresses.
Custom or IANA conform key.
void setPrefix(const QString &prefix)
Set honorific prefixes.
void setRawData(const QByteArray &rawData, const QString &type)
Sets the raw data of the picture.
QDate fromString(const QString &string, Qt::DateFormat format)
QString url() const
Returns the location URL of this picture.
int count(const T &value) const
void append(const T &value)
void setTitle(const QString &title)
Set title.
void setType(Type type)
Sets the type.
void setDepartment(const QString &department)
Set department.
void setNumber(const QString &number)
Sets the phone number.
int toInt(bool *ok, int base) const
int removeAll(const T &value)
const_iterator constEnd() const
float latitude() const
Returns the latitude.
void setPostOfficeBox(const QString &postOfficeBox)
Sets the post office box.
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
void setSound(const Sound &sound)
Set sound.
int offset() const
Return offset in minutes relative to UTC.
void setUid(const QString &uid)
Set unique identifier.
void insertKey(const Key &key)
Insert a key.
QByteArray data() const
Returns the raw data of this sound.
bool isValid() const
Returns, whether this object contains a valid geographical position.
void setOrganization(const QString &organization)
Set organization.
void setGeo(const Geo &geo)
Set geographic position.
void setUrl(const KUrl &url)
Set homepage.
void setRegion(const QString ®ion)
Sets the region, e.g.
void setCustomTypeString(const QString &type)
Sets custom type string.
QString right(int n) const
Qt::TimeSpec timeSpec() const
void setName(const QString &name)
Set name.
void setLabel(const QString &label)
Sets the delivery label.
void setNote(const QString ¬e)
Set note.
void insertAddress(const Address &address)
Insert an address.
const Key key(const T &value) const
QString & replace(int position, int n, QChar after)
bool isEmpty() const
Returns true, if the picture is empty.
void insertCustom(const QString &app, const QString &name, const QString &value)
Insert custom entry.
QString mid(int position, int n) const
void setType(Type type)
Sets the type.
void setCountry(const QString &country)
Sets the country.
void setRevision(const QDateTime &revision)
Set revision date.
QString type() const
Returns the type of this picture.
void setProductId(const QString &productId)
Set product identifier.
QString & sprintf(const char *cformat,...)
const QChar at(int position) const
void setUrl(const QString &url)
Sets a URL for the location of the picture file.
QString customTypeString() const
Returns the custom type string.
Picture logo() const
Return logo.
void setLocality(const QString &locality)
Sets the locality, e.g.
void setPostalCode(const QString &code)
Sets the postal code.
void setExtended(const QString &extended)
Sets the extended address information.
void setBirthday(const QDateTime &birthday)
Set birthday.
QString left(int n) const
bool isIntern() const
Returns whether the sound is described by a URL (extern) or by the raw data (intern).
void setTimeZone(const TimeZone &timeZone)
Set time zone.
Type type() const
Returns the type, see Type.
const_iterator constEnd() const
const_iterator constBegin() const
bool isEmpty() const
Returns true, if the sound object is empty.
bool isIntern() const
Returns whether the picture is described by a URL (extern) or by the raw data (intern).
KUrl url() const
Return homepage.
void setSecrecy(const Secrecy &secrecy)
Set security class.
QString url() const
Returns the location URL of this sound.
const T value(const Key &key) const