add more spacing
[personal-kdebase.git] / runtime / kuiserver / progresslistdelegate.h
blob6c2a89ba387875b48dd4f9ed7cbb118e7b627bd3
1 /**
2 * This file is part of the KDE project
3 * Copyright (C) 2006-2008 Rafael Fernández López <ereslibre@kde.org>
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.
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.
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.
20 #ifndef PROGRESSLISTDELEGATE_H
21 #define PROGRESSLISTDELEGATE_H
23 #include <QModelIndex>
25 #include <kwidgetitemdelegate.h>
27 class QListView;
29 class ProgressListDelegate
30 : public KWidgetItemDelegate
32 Q_OBJECT
33 Q_ENUMS(ProgressItemRole)
35 public:
36 explicit ProgressListDelegate(QObject *parent = 0, QListView *listView = 0);
37 ~ProgressListDelegate();
39 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
40 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
42 void setSeparatorPixels(int separatorPixels);
43 void setLeftMargin(int leftMargin);
44 void setRightMargin(int rightMargin);
45 void setMinimumItemHeight(int minimumItemHeight);
46 void setMinimumContentWidth(int minimumContentWidth);
47 void setEditorHeight(int editorHeight);
49 protected:
50 virtual QList<QWidget*> createItemWidgets() const;
51 virtual void updateItemWidgets(const QList<QWidget*> widgets,
52 const QStyleOptionViewItem &option,
53 const QPersistentModelIndex &index) const;
55 private Q_SLOTS:
56 void slotPauseResumeClicked();
57 void slotCancelClicked();
59 private:
60 class Private;
61 Private *d;
64 #endif // PROGRESSLISTDELEGATE_H