当前位置: 首页>>代码示例>>C++>>正文


C++ Addressee::emails方法代码示例

本文整理汇总了C++中kabc::Addressee::emails方法的典型用法代码示例。如果您正苦于以下问题:C++ Addressee::emails方法的具体用法?C++ Addressee::emails怎么用?C++ Addressee::emails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kabc::Addressee的用法示例。


在下文中一共展示了Addressee::emails方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: selectedEmails

QString KAddressBookView::selectedEmails()
{
    bool first = true;
    QString emailAddrs;
    const QStringList uidList = selectedUids();
    KABC::Addressee addr;
    QString email;

    QStringList::ConstIterator it;
    for(it = uidList.begin(); it != uidList.end(); ++it)
    {
        addr = mCore->addressBook()->findByUid(*it);

        if(!addr.isEmpty())
        {
            QString m = QString::null;

            if(addr.emails().count() > 1)
                m = KABC::EmailSelector::getEmail(addr.emails(), addr.preferredEmail(), this);

            email = addr.fullEmail(m);

            if(!first)
                emailAddrs += ", ";
            else
                first = false;

            emailAddrs += email;
        }
    }

    return emailAddrs;
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:33,代码来源:kaddressbookview.cpp

示例2: loadContact

void EmailEditWidget::loadContact( const KABC::Addressee &contact )
{
  mEmailList = contact.emails();

  if ( !mEmailList.isEmpty() ) {
    mEmailEdit->setText( mEmailList.first() );
  } else {
    mEmailEdit->setText( QString() );
  }
}
开发者ID:lenggi,项目名称:kcalcore,代码行数:10,代码来源:emaileditwidget.cpp

示例3: QString

static QString getEmail2(const KABC::Addressee &addressee)
{
    // preferred might not be the first one, so remove it and take the first of
    // the remaining instead of always taking the second one
    QStringList emails = addressee.emails();
    emails.removeAll(addressee.preferredEmail());
    if (emails.count() >= 1) {
        return emails[ 0 ];
    }

    return QString();
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:12,代码来源:contactshandler.cpp

示例4: entityData

QVariant ContactsTreeModel::entityData( const Item &item, int column, int role ) const
{
  if ( item.mimeType() == KABC::Addressee::mimeType() ) {
    if ( !item.hasPayload<KABC::Addressee>() ) {

      // Pass modeltest
      if ( role == Qt::DisplayRole )
        return item.remoteId();

      return QVariant();
    }

    const KABC::Addressee contact = item.payload<KABC::Addressee>();

    if ( role == Qt::DecorationRole ) {
      if ( column == 0 ) {
        const KABC::Picture picture = contact.photo();
        if ( picture.isIntern() ) {
          return picture.data().scaled( QSize( 16, 16 ), Qt::KeepAspectRatio );
        } else {
          return KIcon( QLatin1String( "x-office-contact" ) );
        }
      }
      return QVariant();
    } else if ( (role == Qt::DisplayRole) || (role == Qt::EditRole) ) {
      switch ( mColumns.at( column ) ) {
        case FullName:
          return contact.realName();
          break;
        case Birthday:
          if ( contact.birthday().isValid() )
            return KGlobal::locale()->formatDate( contact.birthday().date() );
          break;
        case HomeAddress:
          {
            const KABC::Address address = contact.address( KABC::Address::Home );
            if ( !address.isEmpty() )
              return address.formattedAddress();
          }
          break;
        case BusinessAddress:
          {
            const KABC::Address address = contact.address( KABC::Address::Work );
            if ( !address.isEmpty() )
              return address.formattedAddress();
          }
          break;
        case PhoneNumbers:
          {
            QStringList values;

            const KABC::PhoneNumber::List numbers = contact.phoneNumbers();
            foreach ( const KABC::PhoneNumber &number, numbers )
              values += number.number();

            return values.join( "\n" );
          }
          break;
        case PreferredEmail:
          return contact.preferredEmail();
          break;
        case AllEmails:
          return contact.emails().join( "\n" );
          break;
        case Organization:
          return contact.organization();
          break;
        case Homepage:
          return contact.url().url();
          break;
        case Note:
          return contact.note();
          break;
      }
    }
  } else if ( item.mimeType() == KABC::ContactGroup::mimeType() ) {
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:76,代码来源:contactstreemodel.cpp

示例5: toXml

QString Contact::toXml(const KABC::Addressee &addr)
{
    /**
     * Handle distribution lists.
     */
    if(KPIM::DistributionList::isDistributionList(addr))
    {
        if(s_distListMap)
            return (*s_distListMap)[ addr.uid() ];
        else
            return QString();
    }

    /**
     * Handle normal contacts.
     */
    QString xml;
    xml += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    xml += "<contact>\n";

    xml += "<direct_ref>" + addr.uid() + "</direct_ref>\n";
    xml += "<sensitivity>" + custom("sensitivity", addr, "0") + "</sensitivity>\n";

    xml += "<message_class>IPM.Contact</message_class>\n";
    xml += "<is_recurring>" + custom("is_recurring", addr, "false") + "</is_recurring>\n";
    xml += "<reminder_set>" + custom("reminder_set", addr, "false") + "</reminder_set>\n";
    xml += "<send_rich_info>" + custom("send_rich_info", addr, "false") + "</send_rich_info>\n";
    xml += "<subject>" + addr.formattedName() + "</subject>\n";
    xml += "<last_modification_time>" + addr.revision().toString(Qt::ISODate) + "</last_modification_time>\n";

    xml += "<display_name_prefix>" + addr.prefix() + "</display_name_prefix>\n";
    xml += "<first_name>" + addr.givenName() + "</first_name>\n";
    xml += "<middle_name>" + addr.additionalName() + "</middle_name>\n";
    xml += "<last_name>" + addr.familyName() + "</last_name>\n";
    xml += "<suffix>" + addr.suffix() + "</suffix>\n";
    xml += "<display_name>" + addr.assembledName() + "</display_name>\n";
    xml += "<file_as>" + addr.formattedName() + "</file_as>\n";
    xml += "<nickname>" + addr.nickName() + "</nickname>\n";

    xml += "<web_page_address>" + addr.url().url() + "</web_page_address>\n";
    xml += "<company_name>" + addr.organization() + "</company_name>\n";
    xml += "<job_title>" + addr.title() + "</job_title>\n";

    QStringList emails = addr.emails();
    for(uint i = 0; i < 3; ++i)
    {
        QString type, address, comment, display;

        if(i < emails.count())
        {
            type = "SMTP";
            address = emails[ i ];

            /**
             * If the contact was created by kontact use the email address as
             * display name and the formatted name as comment, otherwise we use
             * the values from the server.
             */
            if(custom("comes_from_scalix", addr) != "true")
            {
                comment = addr.formattedName();
                display = emails[ i ];
            }
            else
            {
                comment = custom(QString("email%1_address_with_comment").arg(i + 1), addr);
                display = custom(QString("email%1_display_name").arg(i + 1), addr);
            }
        }

        xml += QString("<email%1_address_type>").arg(i + 1) + type +
               QString("</email%1_address_type>").arg(i + 1) + "\n";
        xml += QString("<email%1_address>").arg(i + 1) + address +
               QString("</email%1_address>").arg(i + 1) + "\n";
        xml += QString("<email%1_address_with_comment>").arg(i + 1) + comment +
               QString("</email%1_address_with_comment>").arg(i + 1) + "\n";
        xml += QString("<email%1_display_name>").arg(i + 1) + display +
               QString("</email%1_display_name>").arg(i + 1) + "\n";
    }

    KABC::PhoneNumber phone = addr.phoneNumber(KABC::PhoneNumber::Home);
    xml += "<home_phone_number>" + phone.number() + "</home_phone_number>\n";

    phone = addr.phoneNumber(KABC::PhoneNumber::Work);
    xml += "<work_phone_number>" + phone.number() + "</work_phone_number>\n";

    phone = addr.phoneNumber(KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax);
    xml += "<work_fax_number>" + phone.number() + "</work_fax_number>\n";

    phone = addr.phoneNumber(KABC::PhoneNumber::Cell);
    xml += "<mobile_phone_number>" + phone.number() + "</mobile_phone_number>\n";

    const KABC::Address workAddress = addr.address(KABC::Address::Work);
    xml += "<work_address_street>" + workAddress.street() + "</work_address_street>\n";
    xml += "<work_address_zip>" + workAddress.postalCode() + "</work_address_zip>\n";
    xml += "<work_address_city>" + workAddress.locality() + "</work_address_city>\n";
    xml += "<work_address_state>" + workAddress.region() + "</work_address_state>\n";
    xml += "<work_address_country>" + workAddress.country() + "</work_address_country>\n";

    const KABC::Address homeAddress = addr.address(KABC::Address::Home);
//.........这里部分代码省略.........
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:101,代码来源:contact.cpp

示例6: email

QString AddresseeEmailSelection::email( const KABC::Addressee &addressee, uint index ) const
{
  return addressee.emails()[ index ];
}
开发者ID:,项目名称:,代码行数:4,代码来源:

示例7: itemEquals

bool AddresseeEmailSelection::itemEquals( const KABC::Addressee &addressee, uint index, const QString &pattern ) const
{
  return (pattern == addressee.formattedName() + " " + email( addressee, index )) ||
         (addressee.emails().contains( pattern ));
}
开发者ID:,项目名称:,代码行数:5,代码来源:

示例8: itemEnabled

bool AddresseeEmailSelection::itemEnabled( const KABC::Addressee &addressee, uint ) const
{
  return addressee.emails().count() != 0;
}
开发者ID:,项目名称:,代码行数:4,代码来源:

示例9: itemCount

uint AddresseeEmailSelection::itemCount( const KABC::Addressee &addressee ) const
{
  return addressee.emails().count();
}
开发者ID:,项目名称:,代码行数:4,代码来源:


注:本文中的kabc::Addressee::emails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。