本文整理汇总了C++中kabc::Addressee::setAdditionalName方法的典型用法代码示例。如果您正苦于以下问题:C++ Addressee::setAdditionalName方法的具体用法?C++ Addressee::setAdditionalName怎么用?C++ Addressee::setAdditionalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kabc::Addressee
的用法示例。
在下文中一共展示了Addressee::setAdditionalName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: storeContact
void NameEditWidget::storeContact( KABC::Addressee &contact ) const
{
contact.setPrefix( mContact.prefix() );
contact.setGivenName( mContact.givenName() );
contact.setAdditionalName( mContact.additionalName() );
contact.setFamilyName( mContact.familyName() );
contact.setSuffix( mContact.suffix() );
}
示例2: toKABC
KABC::Addressee toKABC(const Kolab::Contact &contact)
{
KABC::Addressee addressee;
addressee.setUid(fromStdString(contact.uid()));
addressee.setCategories(toStringList(contact.categories()));
//addressee.setName(fromStdString(contact.name()));//This one is only for compatiblity (and results in a non-existing name property)
addressee.setFormattedName(fromStdString(contact.name())); //This on corresponds to fn
const Kolab::NameComponents &nc = contact.nameComponents();
if (!nc.surnames().empty()) {
addressee.setFamilyName(fromStdString(nc.surnames().front()));
}
if (!nc.given().empty()) {
addressee.setGivenName(fromStdString(nc.given().front()));
}
if (!nc.additional().empty()) {
addressee.setAdditionalName(fromStdString(nc.additional().front()));
}
if (!nc.prefixes().empty()) {
addressee.setPrefix(fromStdString(nc.prefixes().front()));
}
if (!nc.suffixes().empty()) {
addressee.setSuffix(fromStdString(nc.suffixes().front()));
}
addressee.setNote(fromStdString(contact.note()));
addressee.setSecrecy(KABC::Secrecy::Public); //We don't have any privacy setting in xCard
QString preferredEmail;
if (!contact.emailAddresses().empty()) {
QStringList emails;
foreach( const Kolab::Email &email, contact.emailAddresses()) {
emails << fromStdString(email.address());
const QString types = emailTypesToStringList(email.types());
if (!types.isEmpty()) {
addressee.insertCustom(QLatin1String("KOLAB"), QString::fromLatin1("EmailTypes%1").arg(fromStdString(email.address())), types);
}
}
addressee.setEmails(emails);
if ((contact.emailAddressPreferredIndex() >= 0) && (contact.emailAddressPreferredIndex() < static_cast<int>(contact.emailAddresses().size()))) {
preferredEmail = fromStdString(contact.emailAddresses().at(contact.emailAddressPreferredIndex()).address());
} else {
preferredEmail = fromStdString(contact.emailAddresses().at(0).address());
}
addressee.insertEmail(preferredEmail, true);
}
示例3: formattedNameTypeChanged
void NameEditDialog::formattedNameTypeChanged()
{
QString name;
if ( formattedNameType() == CustomName )
name = mCustomFormattedName;
else {
KABC::Addressee addr;
addr.setPrefix( prefix() );
addr.setFamilyName( familyName() );
addr.setAdditionalName( additionalName() );
addr.setGivenName( givenName() );
addr.setSuffix( suffix() );
addr.setOrganization( mAddressee.organization() );
name = formattedName( addr, formattedNameType() );
}
mFormattedNameEdit->setText( name );
}
示例4: tmpZone
KABC::Addressee VCard21Parser::readFromString(const QString &data)
{
KABC::Addressee addressee;
VCard21ParserImpl *vCard = VCard21ParserImpl::parseVCard(data);
QString tmpStr;
// Check if parsing failed
if(vCard == 0)
{
kdDebug() << "Parsing failed" << endl;
return addressee;
}
// set the addressees name and formated name
QStringList tmpList = vCard->getValues(VCARD_N);
QString formattedName = "";
if(tmpList.count() > 0)
addressee.setFamilyName(tmpList[0]);
if(tmpList.count() > 1)
addressee.setGivenName(tmpList[1]);
if(tmpList.count() > 2)
addressee.setAdditionalName(tmpList[2]);
if(tmpList.count() > 3)
addressee.setPrefix(tmpList[3]);
if(tmpList.count() > 4)
addressee.setSuffix(tmpList[4]);
tmpStr = (vCard->getValue(VCARD_FN));
if(!tmpStr.isEmpty())
addressee.setFormattedName(tmpStr);
// set the addressee's nick name
tmpStr = vCard->getValue(VCARD_NICKNAME);
addressee.setNickName(tmpStr);
// set the addressee's organization
tmpStr = vCard->getValue(VCARD_ORG);
addressee.setOrganization(tmpStr);
// set the addressee's title
tmpStr = vCard->getValue(VCARD_TITLE);
addressee.setTitle(tmpStr);
// set the addressee's email - we can only deal with two. The preferenced one and one other.
tmpStr = vCard->getValue(VCARD_EMAIL, VCARD_EMAIL_INTERNET);
addressee.insertEmail(tmpStr, false);
tmpStr = vCard->getValue(VCARD_EMAIL, VCARD_EMAIL_PREF);
addressee.insertEmail(tmpStr, true);
// set the addressee's url
tmpStr = vCard->getValue(VCARD_URL);
if(tmpStr.isEmpty())
tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_WORK);
if(tmpStr.isEmpty())
tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_HOME);
if(!tmpStr.isEmpty())
{
addressee.setUrl(KURL(tmpStr));
}
// set the addressee's birthday
tmpStr = vCard->getValue(VCARD_BDAY);
addressee.setBirthday(VCardStringToDate(tmpStr));
// set the addressee's phone numbers
for(QValueListIterator< VCardLineX > i = vCard->_vcdata->begin(); i != vCard->_vcdata->end(); ++i)
{
if((*i).name == VCARD_TEL)
{
int type = 0;
if((*i).qualified)
{
if((*i).qualifiers.contains(VCARD_TEL_HOME))
type |= PhoneNumber::Home;
if((*i).qualifiers.contains(VCARD_TEL_WORK))
type |= PhoneNumber::Work;
if((*i).qualifiers.contains(VCARD_TEL_PREF))
type |= PhoneNumber::Pref;
// if ( (*i).qualifiers.contains( VCARD_TEL_VOICE ) )
// type |= PhoneNumber::Voice;
if((*i).qualifiers.contains(VCARD_TEL_FAX))
type |= PhoneNumber::Fax;
if((*i).qualifiers.contains(VCARD_TEL_MSG))
type |= PhoneNumber::Msg;
if((*i).qualifiers.contains(VCARD_TEL_CELL))
type |= PhoneNumber::Cell;
if((*i).qualifiers.contains(VCARD_TEL_PAGER))
type |= PhoneNumber::Pager;
if((*i).qualifiers.contains(VCARD_TEL_BBS))
type |= PhoneNumber::Bbs;
if((*i).qualifiers.contains(VCARD_TEL_MODEM))
type |= PhoneNumber::Modem;
if((*i).qualifiers.contains(VCARD_TEL_CAR))
type |= PhoneNumber::Car;
if((*i).qualifiers.contains(VCARD_TEL_ISDN))
type |= PhoneNumber::Isdn;
if((*i).qualifiers.contains(VCARD_TEL_VIDEO))
type |= PhoneNumber::Video;
if((*i).qualifiers.contains(VCARD_TEL_PCS))
type |= PhoneNumber::Pcs;
}
addressee.insertPhoneNumber(PhoneNumber((*i).parameters[0], type));
}
}
//.........这里部分代码省略.........
示例5: fromXml
KABC::Addressee Contact::fromXml(const QString &xml)
{
QDomDocument document;
QString errorMsg;
int errorLine, errorColumn;
if(!document.setContent(xml, true, &errorMsg, &errorLine, &errorColumn))
{
qDebug("Error parsing XML in Scalix::Contact::fromXml: %s (%d,%d)", errorMsg.latin1(), errorLine, errorColumn);
return KABC::Addressee();
}
QDomElement contactElement = document.documentElement();
if(contactElement.tagName() != "contact")
{
if(contactElement.tagName() == "distlist")
{
const QDomNodeList names = contactElement.elementsByTagName("display_name");
const QString listName = (names.count() == 1 ? names.item(0).toElement().text() : "Scalix Dummy List");
/**
* As we can't provide distribution list functionality we store the entry
* here and return it on save.
*/
KPIM::DistributionList list;
list.setName(listName);
if(!s_distListMap)
sd.setObject(s_distListMap, new QMap<QString, QString>());
s_distListMap->insert(list.uid(), xml);
return list;
}
else
{
qDebug("Error interpreting XML in Scalix::Contact::fromXml: no 'contact' or 'distlist' tag found");
return KABC::Addressee();
}
}
QString emails[ 3 ];
KABC::Address homeAddress(KABC::Address::Home);
KABC::Address workAddress(KABC::Address::Work);
KABC::Address otherAddress(KABC::Address::Dom);
KABC::Addressee addr;
setCustom("comes_from_scalix", "true", addr);
QDomNode node = contactElement.firstChild();
while(!node.isNull())
{
QDomElement element = node.toElement();
if(!element.isNull())
{
if(element.tagName() == "direct_ref")
addr.setUid(element.text());
else if(element.tagName() == "sensitivity")
setCustom("sensitivity", element.text(), addr);
else if(element.tagName() == "is_recurring")
setCustom("is_recurring", element.text(), addr);
else if(element.tagName() == "reminder_set")
setCustom("reminder_set", element.text(), addr);
else if(element.tagName() == "send_rich_info")
setCustom("send_rich_info", element.text(), addr);
else if(element.tagName() == "last_modification_time")
addr.setRevision(QDateTime::fromString(element.text(), Qt::ISODate));
// name
else if(element.tagName() == "display_name_prefix")
addr.setPrefix(element.text());
else if(element.tagName() == "first_name")
addr.setGivenName(element.text());
else if(element.tagName() == "middle_name")
addr.setAdditionalName(element.text());
else if(element.tagName() == "last_name")
addr.setFamilyName(element.text());
else if(element.tagName() == "suffix")
addr.setSuffix(element.text());
else if(element.tagName() == "file_as")
addr.setFormattedName(element.text());
else if(element.tagName() == "nickname")
addr.setNickName(element.text());
// job
else if(element.tagName() == "web_page_address")
addr.setUrl(element.text());
else if(element.tagName() == "company_name")
addr.setOrganization(element.text());
else if(element.tagName() == "job_title")
addr.setTitle(element.text());
// emails
else if(element.tagName().startsWith("email"))
{
if(element.tagName() == "email1_address")
emails[ 0 ] = element.text();
else if(element.tagName() == "email2_address")
emails[ 1 ] = element.text();
else if(element.tagName() == "email3_address")
//.........这里部分代码省略.........
示例6: setFieldText
void CSVTemplate::setFieldText(int column, KABC::Addressee& addressee, const QString& text) const
{
if (column < 0 || text.isEmpty()) return;
if (m_columnToField.isEmpty()) return;
QMap<int, int>::const_iterator it = m_columnToField.find(column);
if (it == m_columnToField.end()) return;
Address address;
PhoneNumber phone;
switch (it.value())
{
case 0: // "Formatted Name"
addressee.setFormattedName(text);
break;
case 1: // "Family Name"
addressee.setFamilyName(text);
break;
case 2: // "Given Name"
addressee.setGivenName(text);
break;
case 3: // "Additional Names"
addressee.setAdditionalName(text);
break;
case 4: // "Honorific Prefixes"
addressee.setPrefix(text);
break;
case 5: // "Honorific Suffixes"
addressee.setSuffix(text);
break;
case 6: // "Nick Name"
addressee.setNickName(text);
break;
case 7: // "Birthday"
addressee.setBirthday(parseDate(text));
break;
case 8: // "Home Address Street"
address = addressee.address(Address::Home);
address.setStreet(text);
addressee.insertAddress(address);
break;
case 9: // "Home Address Locality"
address = addressee.address(Address::Home);
address.setLocality(text);
addressee.insertAddress(address);
break;
case 10: // "Home Address Region"
address = addressee.address(Address::Home);
address.setRegion(text);
addressee.insertAddress(address);
break;
case 11: // "Home Address Postal Code"
address = addressee.address(Address::Home);
address.setPostalCode(text);
addressee.insertAddress(address);
break;
case 12: // "Home Address Country"
address = addressee.address(Address::Home);
address.setCountry(text);
addressee.insertAddress(address);
break;
case 13: // "Home Address Label"
address = addressee.address(Address::Home);
address.setLabel(text);
addressee.insertAddress(address);
break;
case 14: // "Business Address Street"
address = addressee.address(Address::Work);
address.setStreet(text);
addressee.insertAddress(address);
break;
case 15: // "Business Address Locality"
address = addressee.address(Address::Work);
address.setLocality(text);
addressee.insertAddress(address);
break;
case 16: // "Business Address Region"
address = addressee.address(Address::Work);
address.setRegion(text);
addressee.insertAddress(address);
break;
case 17: // "Business Address Postal Code"
address = addressee.address(Address::Work);
address.setPostalCode(text);
addressee.insertAddress(address);
break;
case 18: // "Business Address Country"
address = addressee.address(Address::Work);
address.setCountry(text);
addressee.insertAddress(address);
break;
case 19: // "Business Address Label"
address = addressee.address(Address::Work);
address.setLabel(text);
addressee.insertAddress(address);
break;
case 20: // "Home Phone"
phone = PhoneNumber(text, PhoneNumber::Home);
addressee.insertPhoneNumber(phone);
//.........这里部分代码省略.........
示例7: msTNEFToVPart
//.........这里部分代码省略.........
// we finished composing a vCal
} else if ( bCompatClassNote || "IPM.CONTACT" == msgClass ) {
addressee.setUid( stringProp( tnefMsg, attMSGID ) );
addressee.setFormattedName( stringProp( tnefMsg, MAPI_TAG_PR_DISPLAY_NAME ) );
addressee.insertEmail( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_EMAIL1EMAILADDRESS ), true );
addressee.insertEmail( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_EMAIL2EMAILADDRESS ), false );
addressee.insertEmail( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_EMAIL3EMAILADDRESS ), false );
addressee.insertCustom( "KADDRESSBOOK", "X-IMAddress",
sNamedProp( tnefMsg, MAPI_TAG_CONTACT_IMADDRESS ) );
addressee.insertCustom( "KADDRESSBOOK", "X-SpousesName",
stringProp( tnefMsg, MAPI_TAG_PR_SPOUSE_NAME ) );
addressee.insertCustom( "KADDRESSBOOK", "X-ManagersName",
stringProp( tnefMsg, MAPI_TAG_PR_MANAGER_NAME ) );
addressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName",
stringProp( tnefMsg, MAPI_TAG_PR_ASSISTANT ) );
addressee.insertCustom( "KADDRESSBOOK", "X-Department",
stringProp( tnefMsg, MAPI_TAG_PR_DEPARTMENT_NAME ) );
addressee.insertCustom( "KADDRESSBOOK", "X-Office",
stringProp( tnefMsg, MAPI_TAG_PR_OFFICE_LOCATION ) );
addressee.insertCustom( "KADDRESSBOOK", "X-Profession",
stringProp( tnefMsg, MAPI_TAG_PR_PROFESSION ) );
QString s = tnefMsg->findProp( MAPI_TAG_PR_WEDDING_ANNIVERSARY ).
remove( QChar( '-' ) ).remove( QChar( ':' ) );
if ( !s.isEmpty() ) {
addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", s );
}
addressee.setUrl( KUrl( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_WEBPAGE ) ) );
// collect parts of Name entry
addressee.setFamilyName( stringProp( tnefMsg, MAPI_TAG_PR_SURNAME ) );
addressee.setGivenName( stringProp( tnefMsg, MAPI_TAG_PR_GIVEN_NAME ) );
addressee.setAdditionalName( stringProp( tnefMsg, MAPI_TAG_PR_MIDDLE_NAME ) );
addressee.setPrefix( stringProp( tnefMsg, MAPI_TAG_PR_DISPLAY_NAME_PREFIX ) );
addressee.setSuffix( stringProp( tnefMsg, MAPI_TAG_PR_GENERATION ) );
addressee.setNickName( stringProp( tnefMsg, MAPI_TAG_PR_NICKNAME ) );
addressee.setRole( stringProp( tnefMsg, MAPI_TAG_PR_TITLE ) );
addressee.setOrganization( stringProp( tnefMsg, MAPI_TAG_PR_COMPANY_NAME ) );
/*
the MAPI property ID of this (multiline) )field is unknown:
vPart += stringProp(tnefMsg, "\n","NOTE", ... , "" );
*/
KABC::Address adr;
adr.setPostOfficeBox( stringProp( tnefMsg, MAPI_TAG_PR_HOME_ADDRESS_PO_BOX ) );
adr.setStreet( stringProp( tnefMsg, MAPI_TAG_PR_HOME_ADDRESS_STREET ) );
adr.setLocality( stringProp( tnefMsg, MAPI_TAG_PR_HOME_ADDRESS_CITY ) );
adr.setRegion( stringProp( tnefMsg, MAPI_TAG_PR_HOME_ADDRESS_STATE_OR_PROVINCE ) );
adr.setPostalCode( stringProp( tnefMsg, MAPI_TAG_PR_HOME_ADDRESS_POSTAL_CODE ) );
adr.setCountry( stringProp( tnefMsg, MAPI_TAG_PR_HOME_ADDRESS_COUNTRY ) );
adr.setType( KABC::Address::Home );
addressee.insertAddress( adr );
adr.setPostOfficeBox( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_BUSINESSADDRESSPOBOX ) );
adr.setStreet( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_BUSINESSADDRESSSTREET ) );
adr.setLocality( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_BUSINESSADDRESSCITY ) );
adr.setRegion( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_BUSINESSADDRESSSTATE ) );
adr.setPostalCode( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_BUSINESSADDRESSPOSTALCODE ) );
adr.setCountry( sNamedProp( tnefMsg, MAPI_TAG_CONTACT_BUSINESSADDRESSCOUNTRY ) );
adr.setType( KABC::Address::Work );
addressee.insertAddress( adr );
adr.setPostOfficeBox( stringProp( tnefMsg, MAPI_TAG_PR_OTHER_ADDRESS_PO_BOX ) );
adr.setStreet( stringProp( tnefMsg, MAPI_TAG_PR_OTHER_ADDRESS_STREET ) );
示例8: filterContacts
KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addrList )
{
KABC::AddresseeList list;
if ( addrList.isEmpty() )
return addrList;
VCardExportSelectionDialog dlg( parentWidget() );
if ( !dlg.exec() )
return list;
KABC::AddresseeList::ConstIterator it;
for ( it = addrList.begin(); it != addrList.end(); ++it ) {
KABC::Addressee addr;
addr.setUid( (*it).uid() );
addr.setFormattedName( (*it).formattedName() );
addr.setPrefix( (*it).prefix() );
addr.setGivenName( (*it).givenName() );
addr.setAdditionalName( (*it).additionalName() );
addr.setFamilyName( (*it).familyName() );
addr.setSuffix( (*it).suffix() );
addr.setNickName( (*it).nickName() );
addr.setMailer( (*it).mailer() );
addr.setTimeZone( (*it).timeZone() );
addr.setGeo( (*it).geo() );
addr.setProductId( (*it).productId() );
addr.setSortString( (*it).sortString() );
addr.setUrl( (*it).url() );
addr.setSecrecy( (*it).secrecy() );
addr.setSound( (*it).sound() );
addr.setEmails( (*it).emails() );
addr.setCategories( (*it).categories() );
if ( dlg.exportPrivateFields() ) {
addr.setBirthday( (*it).birthday() );
addr.setNote( (*it).note() );
addr.setPhoto( (*it).photo() );
}
if ( dlg.exportBusinessFields() ) {
addr.setTitle( (*it).title() );
addr.setRole( (*it).role() );
addr.setOrganization( (*it).organization() );
addr.setLogo( (*it).logo() );
KABC::PhoneNumber::List phones = (*it).phoneNumbers( KABC::PhoneNumber::Work );
KABC::PhoneNumber::List::Iterator phoneIt;
for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt )
addr.insertPhoneNumber( *phoneIt );
KABC::Address::List addresses = (*it).addresses( KABC::Address::Work );
KABC::Address::List::Iterator addrIt;
for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt )
addr.insertAddress( *addrIt );
}
KABC::PhoneNumber::List phones = (*it).phoneNumbers();
KABC::PhoneNumber::List::Iterator phoneIt;
for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
int type = (*phoneIt).type();
if ( type & KABC::PhoneNumber::Home && dlg.exportPrivateFields() )
addr.insertPhoneNumber( *phoneIt );
else if ( type & KABC::PhoneNumber::Work && dlg.exportBusinessFields() )
addr.insertPhoneNumber( *phoneIt );
else if ( dlg.exportOtherFields() )
addr.insertPhoneNumber( *phoneIt );
}
KABC::Address::List addresses = (*it).addresses();
KABC::Address::List::Iterator addrIt;
for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) {
int type = (*addrIt).type();
if ( type & KABC::Address::Home && dlg.exportPrivateFields() )
addr.insertAddress( *addrIt );
else if ( type & KABC::Address::Work && dlg.exportBusinessFields() )
addr.insertAddress( *addrIt );
else if ( dlg.exportOtherFields() )
addr.insertAddress( *addrIt );
}
if ( dlg.exportOtherFields() )
addr.setCustoms( (*it).customs() );
if ( dlg.exportEncryptionKeys() ) {
addKey( addr, KABC::Key::PGP );
addKey( addr, KABC::Key::X509 );
}
list.append( addr );
}
return list;
}