summaryrefslogtreecommitdiffstats
path: root/hyperui/src/contactresource.h
blob: 5fff87eb06d1500dbefa8258b2cfbd65b72a772e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: qt-info@nokia.com
**
** This software, including documentation, is protected by copyright
** controlled by Nokia Corporation.  You may use this software in
** accordance with the terms and conditions contained in the Qt Phone
** Demo License Agreement.
**
****************************************************************************/

#ifndef CONTACTRESOURCE_H
#define CONTACTRESOURCE_H

#include <QHash>
#include <QString>

class ContactResource
{
public:
    enum PhotoSize { SmallPhoto, LargePhoto };

    static int count();

    static QString name(int index);
    static QString phone(int index);
    static QString photo(int index, PhotoSize type = SmallPhoto);

    static int indexFromPhone(const QString &phone);

private:
    ContactResource();
    ~ContactResource();
    static ContactResource *instance();

    QString data(int index, int role) const;

    QList<QHash<int, QString> > m_values;
};

#endif