1
/****************************************************************************
2
* Copyright (C) 2013-2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
* This library is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU Lesser General Public *
7
* License as published by the Free Software Foundation; either *
8
* version 2.1 of the License, or (at your option) any later version. *
10
* This library is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13
* Lesser General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
***************************************************************************/
18
#ifndef LASTUSEDNUMBERMODEL_H
19
#define LASTUSEDNUMBERMODEL_H
23
#include <QtCore/QAbstractListModel>
25
struct ChainedPhoneNumber;
29
class LIB_EXPORT LastUsedNumberModel : public QAbstractListModel {
34
static LastUsedNumberModel* instance();
37
QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const;
38
int rowCount ( const QModelIndex& parent = QModelIndex() ) const;
39
Qt::ItemFlags flags ( const QModelIndex& index ) const;
40
virtual bool setData ( const QModelIndex& index, const QVariant &value, int role) ;
43
void addCall(Call* call);
46
static const int MAX_ITEM = 15;
49
LastUsedNumberModel();
52
ChainedPhoneNumber* m_pFirstNode;
53
QHash<PhoneNumber*,ChainedPhoneNumber*> m_hNumbers;
55
ChainedPhoneNumber* m_lLastNumbers[MAX_ITEM];
58
static LastUsedNumberModel* m_spInstance;