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


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

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


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

示例1: 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);
  }
开发者ID:maxyz,项目名称:libkolab,代码行数:49,代码来源:kabcconversion.cpp

示例2: testContactConversion_data

void KCalConversionTest::testContactConversion_data()
{
    QTest::addColumn<KABC::Addressee>( "kcal" );
    QTest::addColumn<Kolab::Contact>( "kolab" );
    
    Kolab::cDateTime date(2011,2,2,12,11,10,true);
    Kolab::cDateTime date2(2011,2,2,12,12,10,true);
    {
        KABC::Addressee kcal;
        kcal.setUid("uid");
        kcal.setFormattedName("name");

        Kolab::Contact kolab;
        kolab.setUid("uid");
        kolab.setName("name");

        QTest::newRow("basic") << kcal << kolab;
    }
    {
        KABC::Addressee kcal;
        kcal.setUid("uid");
        //The first address is always the preferred
        kcal.setEmails(QStringList() << "[email protected]" << "[email protected]");
        kcal.insertCustom("KOLAB", "[email protected]", "home,work");

        Kolab::Contact kolab;
        kolab.setUid("uid");

        Kolab::Email email1("[email protected]", Kolab::Email::Work|Kolab::Email::Home);
        Kolab::Email email2("[email protected]");

        std::vector<Kolab::Email> emails;
        emails.push_back(email1);
        emails.push_back(email2);
        kolab.setEmailAddresses(emails, 0);

        QTest::newRow("emailTypesAndPreference") << kcal << kolab;
    }
}
开发者ID:maxyz,项目名称:libkolab,代码行数:39,代码来源:kcalconversiontest.cpp

示例3: setDeleted

static void setDeleted(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-Deleted", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例4: setMAcceptStatusFields

static void setMAcceptStatusFields(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-MacceptStatusFields", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例5: setOpportunityRoleFields

static void setOpportunityRoleFields(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-OpportunityRoleFields", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例6: setSalutation

static void setSalutation(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-Salutation", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例7: setCreatedById

static void setCreatedById(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-CreatedById", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例8: msTNEFToVPart


//.........这里部分代码省略.........
          KDateTime highNoonTime =
            pureISOToLocalQDateTime( tnefMsg->findProp( 0x8502 ).
                                     remove( QChar( '-' ) ).remove( QChar( ':' ) ) );
          KDateTime wakeMeUpTime =
            pureISOToLocalQDateTime( tnefMsg->findProp( 0x8560, "" ).
                                     remove( QChar( '-' ) ).remove( QChar( ':' ) ) );
          alarm->setTime( wakeMeUpTime );

          if ( highNoonTime.isValid() && wakeMeUpTime.isValid() ) {
            alarm->setStartOffset( Duration( highNoonTime, wakeMeUpTime ) );
          } else {
            // default: wake them up 15 minutes before the appointment
            alarm->setStartOffset( Duration( 15 * 60 ) );
          }
          alarm->setDisplayAlarm( i18n( "Reminder" ) );

          // Sorry: the different action types are not known (yet)
          //        so we always set 'DISPLAY' (no sounds, no images...)
          event->addAlarm( alarm );
        }
        //ensure we have a uid for this event
        if ( event->uid().isEmpty() ) {
          event->setUid( CalFormat::createUniqueId() );
        }
        cal->addEvent( event );
        bOk = true;
        // 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 ) );
开发者ID:pvuorela,项目名称:kcalcore,代码行数:67,代码来源:formatter.cpp

示例9: setCustom

static void setCustom(const QString &name, const QString &value, KABC::Addressee &addr)
{
    addr.insertCustom("Scalix", name, value);
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:4,代码来源:contact.cpp

示例10: setAssignedUserName

static void setAssignedUserName(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-AssignedUserName", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例11: setCampaignName

static void setCampaignName(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-CampaignName", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例12: setLeadSourceName

static void setLeadSourceName(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-LeadSourceName", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例13: setAssistantPhone

static void setAssistantPhone(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-AssistantsPhone", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例14: setAssistantName

static void setAssistantName(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("KADDRESSBOOK", "X-AssistantsName", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例15: setAccountId

static void setAccountId(const QString &value, KABC::Addressee &addressee)
{
    addressee.insertCustom("FATCRM", "X-AccountId", value);
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp


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