本文整理汇总了C++中kabc::Address::label方法的典型用法代码示例。如果您正苦于以下问题:C++ Address::label方法的具体用法?C++ Address::label怎么用?C++ Address::label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kabc::Address
的用法示例。
在下文中一共展示了Address::label方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateAddressEdits
void AddressEditDialog::updateAddressEdits()
{
if ( mPreviousAddress )
saveAddress( *mPreviousAddress );
KABC::Address::List::Iterator it = mTypeCombo->selectedElement();
KABC::Address a = *it;
mPreviousAddress = &(*it);
bool tmp = mChanged;
mStreetTextEdit->setText( a.street() );
mRegionEdit->setText( a.region() );
mLocalityEdit->setText( a.locality() );
mPostalCodeEdit->setText( a.postalCode() );
mPOBoxEdit->setText( a.postOfficeBox() );
mCountryCombo->setCurrentText( a.country() );
mLabel = a.label();
mPreferredCheckBox->setChecked( a.type() & KABC::Address::Pref );
if ( a.isEmpty() )
mCountryCombo->setCurrentText( KGlobal::locale()->twoAlphaToCountryName( KGlobal::locale()->country() ) );
mStreetTextEdit->setFocus();
mChanged = tmp;
}
示例2: 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() ) );
}
示例3: getValue
QString KWMailMergeKABC::getValue( const QString &name, int record ) const
{
kdDebug() << "KWMailMergeKABC::getValue(" << name << ", " << record << ")" << endl;
if ( record < 0 )
return name;
// This doesn't ever happen, right? So why is it there? Dirk Schmidt
if ( record == -1 && _iterator == _addressBook->end() )
return "";
//
// Set the iterator to the asked Addressee.
//
bool uidAvailable = false;
if ( record != -1 )
{
int counter = 0;
for ( _UIDIterator = _exclusiveUIDs.begin(); _UIDIterator != _exclusiveUIDs.end()
&& counter < record; _UIDIterator++ )
{
counter++;
}
for ( _iterator = _addressBook->begin(); _iterator != _addressBook->end(); ++_iterator )
{
if( _iterator->uid() == *_UIDIterator )
{
uidAvailable = true;
break;
}
}
}
if( !uidAvailable )
{
return ( i18n ( "KAddressbook entry '%1' not available." ).arg( *_UIDIterator ) );
}
KABC::Addressee addr = *_iterator;
_iterator++; // Don't know why. Could be removed? Dirk Schmidt
//
// Return the asked variable.
//
if ( name == "KAddressbook identifier" )
return addr.uid();
if ( name == "Name" )
return addr.name();
if ( name == "Formatted name" )
return addr.formattedName();
if ( name == "Family names" )
return addr.familyName();
if ( name == "Given name" )
return addr.givenName();
if ( name == "Additional names" )
return addr.additionalName();
if ( name == "Honorific prefixes" )
return addr.prefix();
if ( name == "Honorific suffixes" )
return addr.suffix();
if ( name == "Nick name" )
return addr.nickName();
if ( name == "Birthday" )
return KGlobal::locale()->formatDate( addr.birthday().date() );
if ( name == "Home address: Street" )
{
KABC::Address a = addr.address( KABC::Address::Home );
return a.street();
}
if ( name == "Home address: Locality" )
{
KABC::Address a = addr.address( KABC::Address::Home );
return a.locality();
}
if ( name == "Home address: Region" )
{
KABC::Address a = addr.address( KABC::Address::Home );
return a.region();
}
if ( name == "Home address: Postal code" )
{
KABC::Address a = addr.address( KABC::Address::Home );
return a.postalCode();
}
if ( name == "Home address: Country" )
{
KABC::Address a = addr.address( KABC::Address::Home );
return a.country();
}
if ( name == "Home address: Label" )
{
KABC::Address a = addr.address( KABC::Address::Home );
return a.label();
}
//.........这里部分代码省略.........