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


C++ ContactRef::GetPropDisplayname方法代码示例

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


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

示例1: OnChange

void MyContactGroup::OnChange(const ContactRef& contact)
{
  ContactGroup::TYPE groupType;
  this->GetPropType(groupType);

  if (groupType == ContactGroup::SKYPE_BUDDIES)
  {
    SEString contactName;
    contact->GetPropDisplayname(contactName);

    if (!contactList.contains(contact))
    {
      contactList.append(contact);
      contact.fetch();
      printf("%s was added.\n", (const char*)contactName);
    }
    else
    {
      contactList.remove_val(contact);
      printf("%s was removed.\n", (const char*)contactName);
    };
  };
};
开发者ID:goodinges,项目名称:Ciao-Chat,代码行数:23,代码来源:tutorial_4.cpp

示例2: OnChange

//MYCONTACTGROUP
void MyContactGroup::OnChange(const ContactRef& contact){

  ContactGroup::TYPE groupType;
  if (!GetPropType(groupType)) throw SkypeException("Can't obtain group type.\n");

  if (groupType == ContactGroup::SKYPE_BUDDIES)
  {
    SEString contactName;
    if (!contact->GetPropDisplayname(contactName)) throw SkypeException("Can't obtain contact name.\n");

    if (!contactList.contains(contact))
    {
      contactList.append(contact);
      contact.fetch();
      printf("[SKYPE]: %s was added.\n", (const char*)contactName);
    }
    else
    {
      contactList.remove_val(contact);
      printf("[SKYPE]: %s was removed.\n", (const char*)contactName);
    };
  };
}
开发者ID:jizecn,项目名称:srs_ui_pro,代码行数:24,代码来源:SkypeFunctions.cpp

示例3: switch

Poco::SharedPtr<ContactData>
    Util::dataFromContact(const ContactRef &contact)
{
    /* As we are only interested in some data about the Contact, let's fill
     * a small structure with everything we need and then return.
     */
    Poco::SharedPtr<ContactData> newData =
        Poco::SharedPtr<ContactData>(new ContactData);
    newData->canSMS = false;

    SEString value;

    // Get the Skype Name from the Contact.
    Contact::TYPE type;
    contact->GetPropType(type);

    switch (type) {
        case Contact::SKYPE:
            contact->GetPropSkypename(value);
            break;
        case Contact::PSTN:
            contact->GetPropPstnnumber(value);
            newData->canSMS = true;
            break;
        default:
            value = "Unrecognized";
    }

    newData->skypeName = value;

    // Get the Display Name from the Contact.
    contact->GetPropDisplayname(value);
    newData->displayName = value;

    if (!newData->canSMS) {
        // See if the contact has a mobile number set.
        contact->GetPropPhoneMobile(value);
        if (value.length() > 0)
            newData->canSMS = true;
    }

    /* Get the availability from the Contact and translate it to a readable
     * string.
     */
    Contact::AVAILABILITY availability;
    contact->GetPropAvailability(availability);
    std::pair<ContactAvailability, std::string> ret =
        convertAvailability(availability);
    newData->status = ret.first;
    newData->availability = ret.second;

    //Get the contact Avatar.
    bool hasAvatar = false;
    SEBinary rawData;

    contact->GetAvatar(hasAvatar, rawData);

    // Check if the contact has an avatar and then extract the data from it.
    if (hasAvatar)
        newData->avatar.assignRaw(rawData.data(), rawData.size());

    // Get the contact capabilities.
    contact->HasCapability(Contact::CAPABILITY_TEXT, newData->canIM);
    newData->canCall = (newData->status != Offline);
    newData->canFT = (newData->status != Offline && type == Contact::SKYPE);

    return newData;
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:68,代码来源:util.cpp


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