本文整理汇总了C++中kabc::Addressee::setTimeZone方法的典型用法代码示例。如果您正苦于以下问题:C++ Addressee::setTimeZone方法的具体用法?C++ Addressee::setTimeZone怎么用?C++ Addressee::setTimeZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kabc::Addressee
的用法示例。
在下文中一共展示了Addressee::setTimeZone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tmpZone
//.........这里部分代码省略.........
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));
}
}
// set the addressee's addresses
for(QValueListIterator< VCardLineX > i = vCard->_vcdata->begin(); i != vCard->_vcdata->end(); ++i)
{
if((*i).name == VCARD_ADR)
{
int type = 0;
if((*i).qualified)
{
if((*i).qualifiers.contains(VCARD_ADR_DOM))
type |= Address::Dom;
if((*i).qualifiers.contains(VCARD_ADR_INTL))
type |= Address::Intl;
if((*i).qualifiers.contains(VCARD_ADR_POSTAL))
type |= Address::Postal;
if((*i).qualifiers.contains(VCARD_ADR_PARCEL))
type |= Address::Parcel;
if((*i).qualifiers.contains(VCARD_ADR_HOME))
type |= Address::Home;
if((*i).qualifiers.contains(VCARD_ADR_WORK))
type |= Address::Work;
if((*i).qualifiers.contains(VCARD_ADR_PREF))
type |= Address::Pref;
}
addressee.insertAddress(readAddressFromQStringList((*i).parameters, type));
}
}
// set the addressee's delivery label
tmpStr = vCard->getValue(VCARD_LABEL);
if(!tmpStr.isEmpty())
{
tmpStr.replace("\r\n", "\n");
Address tmpAddress;
tmpAddress.setLabel(tmpStr);
addressee.insertAddress(tmpAddress);
}
// set the addressee's notes
tmpStr = vCard->getValue(VCARD_NOTE);
tmpStr.replace("\r\n", "\n");
addressee.setNote(tmpStr);
// set the addressee's timezone
tmpStr = vCard->getValue(VCARD_TZ);
TimeZone tmpZone(tmpStr.toInt());
addressee.setTimeZone(tmpZone);
// set the addressee's geographical position
tmpList = vCard->getValues(VCARD_GEO);
if(tmpList.count() == 2)
{
tmpStr = tmpList[0];
float glat = tmpStr.toFloat();
tmpStr = tmpList[1];
float glong = tmpStr.toFloat();
Geo tmpGeo(glat, glong);
addressee.setGeo(tmpGeo);
}
// set the last revision date
tmpStr = vCard->getValue(VCARD_REV);
addressee.setRevision(VCardStringToDate(tmpStr));
// set the role of the addressee
tmpStr = vCard->getValue(VCARD_ROLE);
addressee.setRole(tmpStr);
delete vCard;
return addressee;
}
示例2: 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;
}