• 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
  • staticxml
staticxmlprovider.h
Go to the documentation of this file.
1 /*
2  knewstuff3/provider.h
3  This file is part of KNewStuff2.
4  Copyright (c) 2009 Jeremy Whiting <jpwhiting@kde.org>
5  Copyright (C) 2009-2010 Frederik Gladhorn <gladhorn@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #ifndef KNEWSTUFF3_STATICXML_PROVIDER_H
21 #define KNEWSTUFF3_STATICXML_PROVIDER_H
22 
23 #include "core/provider.h"
24 
25 namespace KNS3
26 {
27  class XmlLoader;
28 
41  class StaticXmlProvider: public Provider
42  {
43  Q_OBJECT
44  public:
45  typedef QList<Provider*> List;
49  StaticXmlProvider();
50 
51  virtual QString id() const;
52 
56  virtual bool setProviderXML(const QDomElement & xmldata);
57 
58  virtual bool isInitialized() const;
59 
60  virtual void setCachedEntries(const KNS3::EntryInternal::List& cachedEntries);
61 
62  virtual void loadEntries(const KNS3::Provider::SearchRequest& request);
63  virtual void loadPayloadLink(const KNS3::EntryInternal& entry, int);
64 
65  private Q_SLOTS:
66  void slotEmitProviderInitialized();
67  void slotFeedFileLoaded(const QDomDocument&);
68  void slotFeedFailed();
69 
70  private:
71  bool searchIncludesEntry(const EntryInternal& entry) const;
72  KUrl downloadUrl(SortMode mode) const;
73  EntryInternal::List installedEntries() const;
74 
75  // map of download urls to their feed name
76  QMap<QString, KUrl> mDownloadUrls;
77  KUrl mUploadUrl;
78  KUrl mNoUploadUrl;
79 
80  // cache of all entries known from this provider so far, mapped by their id
81  EntryInternal::List mCachedEntries;
82  QMap<Provider::SortMode, XmlLoader*> mFeedLoaders;
83  Provider::SearchRequest mCurrentRequest;
84  QString mId;
85  bool mInitialized;
86 
87  Q_DISABLE_COPY(StaticXmlProvider)
88  };
89 
90 }
91 
92 #endif
KNS3::Provider
KNewStuff Base Provider class.
Definition: knewstuff3/core/provider.h:46
KNS3::StaticXmlProvider::loadPayloadLink
virtual void loadPayloadLink(const KNS3::EntryInternal &entry, int)
Definition: staticxmlprovider.cpp:261
KNS3::StaticXmlProvider::setCachedEntries
virtual void setCachedEntries(const KNS3::EntryInternal::List &cachedEntries)
Definition: staticxmlprovider.cpp:124
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:54
KNS3::StaticXmlProvider::loadEntries
virtual void loadEntries(const KNS3::Provider::SearchRequest &request)
load the given search and return given page
Definition: staticxmlprovider.cpp:130
KNS3::StaticXmlProvider
KNewStuff Base Provider class.
Definition: staticxmlprovider.h:41
QString
KNS3::Provider::SortMode
SortMode
Definition: knewstuff3/core/provider.h:52
KUrl
KNS3::Provider::SearchRequest
used to keep track of a search
Definition: knewstuff3/core/provider.h:64
KNS3::StaticXmlProvider::List
QList< Provider * > List
Definition: staticxmlprovider.h:45
KNS3::StaticXmlProvider::StaticXmlProvider
StaticXmlProvider()
Constructor.
Definition: staticxmlprovider.cpp:34
KNS3::StaticXmlProvider::isInitialized
virtual bool isInitialized() const
Definition: staticxmlprovider.cpp:119
KNS3::StaticXmlProvider::id
virtual QString id() const
A unique Id for this provider (the url in most cases)
Definition: staticxmlprovider.cpp:39
KNS3::StaticXmlProvider::setProviderXML
virtual bool setProviderXML(const QDomElement &xmldata)
set the provider data xml, to initialize the provider
Definition: staticxmlprovider.cpp:44
QMap< QString, KUrl >
QList< Provider * >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:49 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