contactengine/contactsengine.h
author John Kern <johnk@symbian.org>
Thu, 05 Aug 2010 16:40:47 -0700
changeset 19 e4b6ee329501
child 23 51fcdd1558d8
permissions -rwxr-xr-x
WIP: first draft of contact engine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
#ifndef CONTACTSENGINE_H
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
#define CONTACTSENGINE_H
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
#include <QAbstractListModel>
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
#include <QContactManager>
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     8
#include "contactsengine.h"
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
using namespace QtMobility;
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
class ContactsEngine : public QAbstractListModel
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
{
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
    Q_OBJECT
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
public:
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
    explicit ContactsEngine(QObject *parent = 0);
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
    ~ContactsEngine();
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
    // required by list model interface.
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    20
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    21
    QVariant data(const QModelIndex &index, int role) const;
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    23
    QStringList dataSources();
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    24
    void setManager(QString aMgr);
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
public:
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
    void populateAddresses();
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
signals:
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
    void managerChanged(QStringList containNames);
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    31
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
public slots:
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    33
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
private:
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
    QContactManager *m_manager;
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
    QMap<QString, QString> m_availableManagers;
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
    QMap<QString, QContactManager*> m_initialisedManagers;
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
};
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    39
e4b6ee329501 WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff changeset
    40
#endif // CONTACTSENGINE_H