1/*
2 * This file is part of the KDE project
3 * Copyright (C) 2007, 2006 Rafael Fernández López <ereslibre@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License version 2 as published by the Free Software Foundation.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef PROGRESSLISTDELEGATE_P_H
21#define PROGRESSLISTDELEGATE_P_H
22
23#include "progresslistmodel.h"
24
25#include <QtCore/QList>
26#include <QtCore/QObject>
27
28#include <QListView>
29#include <QPushButton>
30#include <QProgressBar>
31
32class QModelIndex;
33class QString;
34
35class ProgressListDelegate::Private
36{
37public:
38 Private(QListView *listView)
39 : separatorPixels(0),
40 leftMargin(0),
41 rightMargin(0),
42 minimumItemHeight(0),
43 minimumContentWidth(0),
44 editorHeight(0),
45 iconWidth(0),
46 listView(listView),
47 progressBar(new QProgressBar(0))
48 {
49 }
50
51 ~Private() {
52 delete progressBar;
53 }
54
55 QString getIcon(const QModelIndex &index) const;
56 QString getSizeTotal(const QModelIndex &index) const;
57 QString getSizeProcessed(const QModelIndex &index) const;
58 qlonglong getTimeTotal(const QModelIndex &index) const;
59 qlonglong getTimeProcessed(const QModelIndex &index) const;
60 QString getSpeed(const QModelIndex &index) const;
61 int getPercent(const QModelIndex &index) const;
62 QString getInfoMessage(const QModelIndex &index) const;
63 int getCurrentLeftMargin(int fontHeight) const;
64
65public:
66 int separatorPixels;
67 int leftMargin;
68 int rightMargin;
69 int minimumItemHeight;
70 int minimumContentWidth;
71 int editorHeight;
72 int iconWidth;
73 QListView *listView;
74 QProgressBar *progressBar;
75};
76
77#endif // PROGRESSLISTDELEGATE_P_H
78