本文整理汇总了C++中kabc::Address::extended方法的典型用法代码示例。如果您正苦于以下问题:C++ Address::extended方法的具体用法?C++ Address::extended怎么用?C++ Address::extended使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kabc::Address
的用法示例。
在下文中一共展示了Address::extended方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contactToTemplate
void ReportGenerator::contactToTemplate( TextTemplate *tmpl, const QString& prefix, const KABC::Addressee& contact )
{
if( contact.isEmpty() ) return;
tmpl->setValue( ADDRESS_TAG( prefix, "NAME" ), escapeTrml2pdfXML( contact.realName() ) );
QString co = contact.organization();
if( co.isEmpty() ) {
co = contact.realName();
}
tmpl->setValue( ADDRESS_TAG( prefix, "ORGANISATION" ), escapeTrml2pdfXML( co ) );
tmpl->setValue( ADDRESS_TAG( prefix, "URL" ), escapeTrml2pdfXML( contact.url().prettyUrl() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "EMAIL" ), escapeTrml2pdfXML( contact.preferredEmail() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "PHONE" ), escapeTrml2pdfXML( contact.phoneNumber( KABC::PhoneNumber::Work ).number() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "FAX" ), escapeTrml2pdfXML( contact.phoneNumber( KABC::PhoneNumber::Fax ).number() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "CELL" ), escapeTrml2pdfXML( contact.phoneNumber( KABC::PhoneNumber::Cell ).number() ) );
KABC::Address address;
address = contact.address( KABC::Address::Pref );
if( address.isEmpty() )
address = contact.address(KABC::Address::Work );
if( address.isEmpty() )
address = contact.address(KABC::Address::Home );
if( address.isEmpty() )
address = contact.address(KABC::Address::Postal );
tmpl->setValue( ADDRESS_TAG( prefix, "POSTBOX" ),
escapeTrml2pdfXML( address.postOfficeBox() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "EXTENDED" ),
escapeTrml2pdfXML( address.extended() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "STREET" ),
escapeTrml2pdfXML( address.street() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "LOCALITY" ),
escapeTrml2pdfXML( address.locality() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "REGION" ),
escapeTrml2pdfXML( address.region() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "POSTCODE" ),
escapeTrml2pdfXML( address.postalCode() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "COUNTRY" ),
escapeTrml2pdfXML( address.country() ) );
tmpl->setValue( ADDRESS_TAG( prefix, "REGION" ),
escapeTrml2pdfXML( address.region() ) );
tmpl->setValue( ADDRESS_TAG( prefix,"LABEL" ),
escapeTrml2pdfXML( address.label() ) );
}
示例2: updateAddressEdit
void AddressEditWidget::updateAddressEdit()
{
KABC::Address::List::Iterator it = mTypeCombo->selectedElement();
bool block = signalsBlocked();
blockSignals( true );
mAddressField->setText( "" );
if ( it != mAddressList.end() ) {
KABC::Address a = *it;
if ( !a.isEmpty() ) {
#if KDE_VERSION >= 319
if ( a.type() & KABC::Address::Work && mAddressee.realName() != mAddressee.organization() ) {
mAddressField->setText( a.formattedAddress( mAddressee.realName(),
mAddressee.organization() ) );
} else {
mAddressField->setText( a.formattedAddress( mAddressee.realName() ) );
}
#else
QString text;
if ( !a.street().isEmpty() )
text += a.street() + "\n";
if ( !a.postOfficeBox().isEmpty() )
text += a.postOfficeBox() + "\n";
text += a.locality() + QString(" ") + a.region();
if ( !a.postalCode().isEmpty() )
text += QString(", ") + a.postalCode();
text += "\n";
if ( !a.country().isEmpty() )
text += a.country() + "\n";
text += a.extended();
mAddressField->setText( text );
#endif
}
}
blockSignals( block );
}