• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff3
  • ui
itemsviewbasedelegate.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 Jeremy Whiting <jpwhiting@kde.org>
3  Copyright (C) 2010 Reza Fatahilah Shah <rshah0385@kireihana.com>
4  Copyright (C) 2010 Frederik Gladhorn <gladhorn@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef KNEWSTUFF3_UI_ITEMSVIEWBASEDELEGATE_H
21 #define KNEWSTUFF3_UI_ITEMSVIEWBASEDELEGATE_H
22 
23 #include <QList>
24 #include <QtCore/QMap>
25 #include <QtCore/QModelIndex>
26 #include <QtCore/QObject>
27 #include <QtGui/QImage>
28 
29 #include "core/engine.h"
30 #include "core/entryinternal.h"
31 
32 #include <kicon.h>
33 #include <kwidgetitemdelegate.h>
34 
35 namespace KNS3
36 {
37  class ItemsModel;
38  class Engine;
39 
40 class ItemsViewBaseDelegate: public KWidgetItemDelegate
41 {
42  Q_OBJECT
43 public:
44  explicit ItemsViewBaseDelegate(QAbstractItemView* itemView, Engine* engine, QObject* parent = 0);
45  virtual ~ItemsViewBaseDelegate();
46  // paint the item at index with all its attributes shown
47  virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const = 0;
48 
49  // get the list of widgets
50  virtual QList<QWidget*> createItemWidgets() const = 0;
51 
52  // update the widgets
53  virtual void updateItemWidgets(const QList<QWidget*> widgets,
54  const QStyleOptionViewItem &option,
55  const QPersistentModelIndex &index) const =0;
56 
57  virtual QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const = 0;
58 
59 Q_SIGNALS:
60  void signalShowDetails(const KNS3::EntryInternal& entry);
61 
62 protected slots:
63  bool eventFilter(QObject *watched, QEvent *event);
64  void slotInstallClicked();
65  void slotInstallActionTriggered(QAction* action);
66  void slotLinkClicked(const QString & url);
67  void slotDetailsClicked(const QModelIndex& index);
68  void slotDetailsClicked();
69 
70 protected:
71  Engine* m_engine;
72  QAbstractItemView *m_itemView;
73  KIcon m_iconInvalid;
74  KIcon m_iconDownloadable;
75  KIcon m_iconInstall;
76  KIcon m_iconUpdate;
77  KIcon m_iconDelete;
78  QPixmap m_frameImage;
79  QPixmap m_noImage;
80  QSize m_buttonSize;
81 };
82 }
83 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 17:51:51 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal