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

KNewStuff

  • 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
27class KJob;
28
29namespace KNS3
30{
31 class Engine;
32
33class ItemsModel: public QAbstractListModel
34{
35 Q_OBJECT
36public:
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
49Q_SIGNALS:
50 void jobStarted(KJob*, const QString& label);
51
52public 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
58private:
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
67Q_DECLARE_METATYPE(KNS3::EntryInternal)
68
69#endif
KJob
KNS3::Engine
KNewStuff engine.
Definition: knewstuff3/core/engine.h:53
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:55
KNS3::EntryInternal::PreviewType
PreviewType
Definition: entryinternal.h:70
KNS3::ItemsModel
Definition: knewstuff3/ui/itemsmodel.h:34
KNS3::ItemsModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: knewstuff3/ui/itemsmodel.cpp:41
KNS3::ItemsModel::slotEntryChanged
void slotEntryChanged(const KNS3::EntryInternal &entry)
Definition: knewstuff3/ui/itemsmodel.cpp:93
KNS3::ItemsModel::clearEntries
void clearEntries()
Definition: knewstuff3/ui/itemsmodel.cpp:100
KNS3::ItemsModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: knewstuff3/ui/itemsmodel.cpp:46
KNS3::ItemsModel::hasPreviewImages
bool hasPreviewImages() const
Definition: knewstuff3/ui/itemsmodel.cpp:142
KNS3::ItemsModel::removeEntry
void removeEntry(const EntryInternal &entry)
Definition: knewstuff3/ui/itemsmodel.cpp:82
KNS3::ItemsModel::addEntry
void addEntry(const EntryInternal &entry)
Definition: knewstuff3/ui/itemsmodel.cpp:62
KNS3::ItemsModel::hasWebService
bool hasWebService() const
KNS3::ItemsModel::slotEntriesLoaded
void slotEntriesLoaded(KNS3::EntryInternal::List entries)
Definition: knewstuff3/ui/itemsmodel.cpp:55
KNS3::ItemsModel::jobStarted
void jobStarted(KJob *, const QString &label)
KNS3::ItemsModel::slotEntryPreviewLoaded
void slotEntryPreviewLoaded(const KNS3::EntryInternal &entry, KNS3::EntryInternal::PreviewType type)
Definition: knewstuff3/ui/itemsmodel.cpp:106
KNS3::ItemsModel::~ItemsModel
~ItemsModel()
Definition: knewstuff3/ui/itemsmodel.cpp:37
QAbstractListModel
QList< EntryInternal >
QObject
entryinternal.h
KNS3
Definition: atticaprovider.cpp:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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.14.38 API Reference

Skip menu "kdelibs-4.14.38 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