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 RINGTONEMODEL_H
19
#define RINGTONEMODEL_H
23
#include <QtCore/QString>
24
#include <QtCore/QAbstractTableModel>
30
///CredentialModel: A model for account credentials
31
class LIB_EXPORT RingToneModel : public QAbstractTableModel {
40
explicit RingToneModel(Account* a);
41
virtual ~RingToneModel();
44
QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const;
45
int rowCount ( const QModelIndex& parent = QModelIndex() ) const;
46
int columnCount ( const QModelIndex& parent = QModelIndex() ) const;
47
Qt::ItemFlags flags ( const QModelIndex& index ) const;
48
virtual bool setData ( const QModelIndex& index, const QVariant &value, int role) ;
51
QString currentRingTone() const;
52
QModelIndex currentIndex () const;
55
void setCurrentIndex(const QModelIndex& idx);
58
void play(const QModelIndex& index);
62
explicit RingToneInfo() : isPlaying(false),isCurrent(false){}
68
QList<RingToneInfo*> m_lRingTone;
71
RingToneInfo* m_pCurrent;
77
#endif //RINGTONEMODEL_H