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

KNewStuff

  • sources
  • kde-4.12
  • kdelibs
  • knewstuff
  • knewstuff3
  • ui
knewstuff3/ui/itemsmodel.h
Go to the documentation of this file.
1 /*
2  knewstuff3/ui/itemsmodel.h.
3  Copyright (C) 2008 Jeremy Whiting <jpwhiting@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef KNEWSTUFF3_UI_ITEMSMODEL_H
20 #define KNEWSTUFF3_UI_ITEMSMODEL_H
21 
22 #include <QAbstractListModel>
23 #include <QtGui/QImage>
24 
25 #include "core/entryinternal.h"
26 
27 class KJob;
28 
29 namespace KNS3
30 {
31  class Engine;
32 
33 class ItemsModel: public QAbstractListModel
34 {
35  Q_OBJECT
36 public:
37  explicit ItemsModel(Engine* engine, QObject * parent = 0);
38  ~ItemsModel();
39 
40  int rowCount(const QModelIndex & parent = QModelIndex()) const;
41  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
42 
43  void addEntry(const EntryInternal& entry);
44  void removeEntry(const EntryInternal& entry);
45 
46  bool hasPreviewImages() const;
47  bool hasWebService() const;
48 
49 Q_SIGNALS:
50  void jobStarted(KJob*, const QString& label);
51 
52 public Q_SLOTS:
53  void slotEntryChanged(const KNS3::EntryInternal& entry);
54  void slotEntriesLoaded(KNS3::EntryInternal::List entries);
55  void clearEntries();
56  void slotEntryPreviewLoaded(const KNS3::EntryInternal& entry, KNS3::EntryInternal::PreviewType type);
57 
58 private:
59  Engine* m_engine;
60  // the list of entries
61  QList<EntryInternal> m_entries;
62  bool m_hasPreviewImages;
63 };
64 
65 } // end KNS namespace
66 
67 Q_DECLARE_METATYPE(KNS3::EntryInternal)
68 
69 #endif
QVariant
KNS3::ItemsModel::clearEntries
void clearEntries()
Definition: knewstuff3/ui/itemsmodel.cpp:100
KNS3::ItemsModel::ItemsModel
ItemsModel(Engine *engine, QObject *parent=0)
Definition: knewstuff3/ui/itemsmodel.cpp:30
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:54
KNS3::Engine
KNewStuff engine.
Definition: knewstuff3/core/engine.h:52
label
QString label(StandardShortcut id)
KNS3::ItemsModel::hasPreviewImages
bool hasPreviewImages() const
Definition: knewstuff3/ui/itemsmodel.cpp:142
QAbstractListModel
QString
QObject
KNS3::ItemsModel::hasWebService
bool hasWebService() const
KNS3::ItemsModel::slotEntryChanged
void slotEntryChanged(const KNS3::EntryInternal &entry)
Definition: knewstuff3/ui/itemsmodel.cpp:93
KNS3::ItemsModel
Definition: knewstuff3/ui/itemsmodel.h:33
KNS3::ItemsModel::slotEntriesLoaded
void slotEntriesLoaded(KNS3::EntryInternal::List entries)
Definition: knewstuff3/ui/itemsmodel.cpp:55
KNS3::EntryInternal::PreviewType
PreviewType
Definition: entryinternal.h:70
KNS3::ItemsModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: knewstuff3/ui/itemsmodel.cpp:46
KNS3::ItemsModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: knewstuff3/ui/itemsmodel.cpp:41
KNS3::ItemsModel::slotEntryPreviewLoaded
void slotEntryPreviewLoaded(const KNS3::EntryInternal &entry, KNS3::EntryInternal::PreviewType type)
Definition: knewstuff3/ui/itemsmodel.cpp:106
entryinternal.h
KNS3::ItemsModel::jobStarted
void jobStarted(KJob *, const QString &label)
KNS3::ItemsModel::~ItemsModel
~ItemsModel()
Definition: knewstuff3/ui/itemsmodel.cpp:37
KNS3::ItemsModel::addEntry
void addEntry(const EntryInternal &entry)
Definition: knewstuff3/ui/itemsmodel.cpp:62
KNS3::ItemsModel::removeEntry
void removeEntry(const EntryInternal &entry)
Definition: knewstuff3/ui/itemsmodel.cpp:82
KJob
QList< EntryInternal >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:48 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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