summaryrefslogtreecommitdiff
path: root/gui/Updater/PkAddRm_Delegate.h
blob: 4d2b84af6ddf58e5c5f115cf699e80d6e4d5169b (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 *   Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
 *   Copyright (C) 2008 Daniel Nicoletti <mirttex85-pk@yahoo.com.br>
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Library/Lesser General Public License
 *   version 2, or (at your option) any later version, as published by the
 *   Free Software Foundation
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details
 *
 *   You should have received a copy of the GNU Library/Lesser General Public
 *   License along with this program; if not, write to the
 *   Free Software Foundation, Inc.,
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef PKADDRMDELEGATE_H
#define PKADDRMDELEGATE_H

#include <QtCore/QtCore>
#include <QtGui/QtGui>

#include <KIcon>

/**
 * Delegate for displaying the items
 */
class PkAddRmDelegate: public QItemDelegate
{
    Q_OBJECT

public:
    PkAddRmDelegate(QObject *parent = 0);

    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
    int columnWidth (int column, int viewWidth) const;

//     bool editorEvent(QEvent *event,
//                      QAbstractItemModel *model,
//                      const QStyleOptionViewItem &option,
//                      const QModelIndex &index);

Q_SIGNALS:
    void destroyApplets(const QString name);
private:

//     KCategorizedItemsView * m_parent;
    KIcon m_favoriteIcon;
    KIcon m_favoriteAddIcon;
    KIcon m_removeIcon;

//     mutable KCategorizedItemsViewModels::AbstractItem * m_onFavoriteIconItem;

    void paintColMain(QPainter *painter,
            const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void paintColFav(QPainter *painter,
            const QStyleOptionViewItem &option, const QModelIndex &index) const;
//     void paintColRemove(QPainter *painter,
//             const QStyleOptionViewItem &option, const QModelIndex &index) const;
};

#endif /*KCATEGORIZEDITEMSVIEWDELEGATE_H_*/