qtmobility/examples/qml-contacts/qmlcontact.h
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 5 453da2cfceef
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
     1 #ifndef QMLCONTACT_H
       
     2 #define QMLCONTACT_H
       
     3 
       
     4 #include <QObject>
       
     5 #include <QContact>
       
     6 #include <qml.h>
       
     7 
       
     8 
       
     9 QTM_BEGIN_NAMESPACE
       
    10 class QmlContact : public QObject {
       
    11 Q_OBJECT
       
    12 Q_PROPERTY(QContact contact READ contact WRITE setContact NOTIFY contactChanged)
       
    13 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
       
    14 Q_PROPERTY(QString test READ test)
       
    15 Q_PROPERTY(QStringList availableActions READ availableActions)
       
    16 Q_PROPERTY(QStringList details READ details)
       
    17 Q_PROPERTY(QStringList contexts READ contexts)
       
    18 public:
       
    19     QmlContact(QContact& contact, QObject *parent = 0);
       
    20     QmlContact();
       
    21     ~QmlContact();
       
    22 
       
    23     QContact& contact();
       
    24     void setContact(QContact& contact);
       
    25 
       
    26     QString name();
       
    27     void setName(QString name);
       
    28 
       
    29     QStringList availableActions();
       
    30     QStringList details();
       
    31 
       
    32     QStringList contexts();
       
    33 
       
    34     Q_INVOKABLE QVariantMap values(QString definitionId);
       
    35 
       
    36     QString test() { return "test string"; }
       
    37 
       
    38 signals:
       
    39     void contactChanged(QmlContact* qmlcontact);
       
    40     void nameChanged(QmlContact* qmlcontact);
       
    41 
       
    42 private:
       
    43     QContact m_contact;
       
    44 };
       
    45 
       
    46 QML_DECLARE_TYPE(QmlContact);
       
    47 
       
    48 QTM_END_NAMESPACE
       
    49 
       
    50 #endif // QMLCONTACT_H