summaryrefslogtreecommitdiff
path: root/src/dic-options/PacksListModel.h
blob: 3523912881e441443cb192d69c19b1b7a9b5a828 (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
#ifndef PACKSLISTMODEL_H
#define PACKSLISTMODEL_H

#include <QAbstractListModel>

#include "DictionaryOptionsDialog.h"
#include "DraggableListModel.h"
#include "../dictionary/Dictionary.h"

class PacksListModel : public DraggableListModel
{
    Q_OBJECT

public:
    PacksListModel( DictionaryOptionsDialog* aParent ):
        DraggableListModel( aParent )
        {}

    int rowCount( const QModelIndex& /*parent*/ = QModelIndex() ) const
        { return m_parent->m_dict.cardPacksNum(); }

    QVariant data( const QModelIndex &index, int role ) const;
    bool setData(const QModelIndex& index, const QVariant& aValue, int role = Qt::EditRole );
    Qt::ItemFlags flags(const QModelIndex &index) const;
    bool insertRows(int position, int rows, const QModelIndex &);
    bool removeRows(int position, int rows, const QModelIndex &);
    const void* dataPtr( const QModelIndex& aIndex ) const;
    void insertPointer( int aPos, void* aData );
    void removePack( int aPos );
};

#endif