Contact.hpp Example File
bbmcontacts/src/Contact.hpp
#ifndef CONTACT_HPP
#define CONTACT_HPP
#include <bb/cascades/Image>
#include <bb/platform/bbm/Contact>
#include <bb/platform/bbm/ImageType>
class Contact: public QObject
{
Q_OBJECT
Q_PROPERTY(QString handle READ handle NOTIFY contactChanged)
Q_PROPERTY(QString ppid READ ppid NOTIFY contactChanged)
Q_PROPERTY(QString appVersion READ appVersion NOTIFY contactChanged)
Q_PROPERTY(QString platformVersion READ platformVersion NOTIFY contactChanged)
Q_PROPERTY(QString displayName READ displayName NOTIFY contactChanged)
Q_PROPERTY(QString personalMessage READ personalMessage NOTIFY contactChanged)
Q_PROPERTY(QString statusMessage READ statusMessage NOTIFY contactChanged)
Q_PROPERTY(bool busy READ busy NOTIFY contactChanged)
Q_PROPERTY(QVariant avatar READ avatar NOTIFY avatarChanged)
public:
Contact() { }
Contact(const bb::platform::bbm::Contact &contact);
~Contact();
QString handle();
QString ppid();
QString appVersion();
QString platformVersion();
QString displayName();
QString personalMessage();
QString statusMessage();
bool busy() const;
QVariant avatar();
Q_SIGNALS:
void contactChanged();
void avatarChanged();
public Q_SLOTS:
void avatarUpdated (const QString &handle, const bb::platform::bbm::ImageType::Type imageType, const QByteArray &displayPicture);
private:
void setAvatar(const QByteArray &imageData);
const bb::platform::bbm::Contact m_bbmspContact;
bb::cascades::Image m_avatar;
};
Q_DECLARE_METATYPE(Contact *);
#endif /* CONTACT_HPP */