KNSCore

KNSCore Namespace Reference

Classes

class  Author
 
class  CommentsModel
 
class  DownloadManager
 
class  Engine
 
class  EntryInternal
 
class  EntryWrapper
 
class  Installation
 
class  KPackageJob
 
class  Provider
 
class  ProvidersModel
 
class  Question
 
class  QuestionListener
 
class  QuestionManager
 
class  Security
 
class  TagsFilterChecker
 
class  XmlLoader
 

Typedefs

typedef QFlags< JobFlag > JobFlags
 
typedef QHash< const Provider *, ProviderPrivate * > ProviderPrivateHash
 

Enumerations

enum  ErrorCode {
  UnknownError, NetworkError, OcsError, ConfigFileError,
  ProviderError, InstallationError, ImageError, AdoptionError,
  TryAgainLaterError
}
 
enum  JobFlag {
  None = 0, HideProgressInfo = 1, Resume = 2, Overwrite = 4,
  DefaultFlags = None
}
 
enum  LoadType { Reload, NoReload }
 

Functions

QDomElement addElement (QDomDocument &doc, QDomElement &parent, const QString &tag, const QString &value)
 
static ProviderPrivate * d (const Provider *provider)
 
static void delete_d (const Provider *provider)
 
QList< std::shared_ptr< KNSCore::Comment > > getCommentsList (const Attica::Comment::List &comments, std::shared_ptr< KNSCore::Comment > parent)
 
void handleData (XmlLoader *q, const QByteArray &data)
 
QDebug operator<< (QDebug dbg, const Provider::SearchRequest &search)
 
uint qHash (const KNSCore::EntryInternal &entry)
 
KNEWSTUFFCORE_EXPORT QString replaceBBCode (const QString &unformattedText)
 

Variables

static const QLatin1String ATTR_CURRENCY_CODE {"currencycode"}
 
static const QLatin1String FEED_COMPLETE {"fh:complete"}
 
static const QLatin1String HTML_MT {"text/html"}
 
static const QLatin1String KEY_LANGUAGE {"data##language="}
 
static const QLatin1String KEY_MIME_TYPE {"data##mimetype="}
 
static const QLatin1String KEY_URL {"data##url="}
 
static const QLatin1String OPDS_ATOM_MT {"application/atom+xml"}
 
static const QLatin1String OPDS_ATTR_ACTIVE_FACET {"opds:activeFacet"}
 
static const QLatin1String OPDS_ATTR_FACET_GROUP {"opds:facetGroup"}
 
static const QLatin1String OPDS_EL_INDIRECT {"opds:indirectAcquisition"}
 
static const QLatin1String OPDS_EL_PRICE {"opds:price"}
 
static const QLatin1String OPDS_KIND_ACQUISITION {"kind=acquisition"}
 
static const QLatin1String OPDS_KIND_NAVIGATION {"kind=navigation"}
 
static const QLatin1String OPDS_PROFILE {"profile=opds-catalog"}
 
static const QLatin1String OPDS_REL_AC_BORROW {"http://opds-spec.org/acquisition/borrow"}
 
static const QLatin1String OPDS_REL_AC_BUY {"http://opds-spec.org/acquisition/buy"}
 
static const QLatin1String OPDS_REL_AC_OPEN_ACCESS {"http://opds-spec.org/acquisition/open-access"}
 
static const QLatin1String OPDS_REL_AC_SAMPLE {"http://opds-spec.org/acquisition/sample"}
 
static const QLatin1String OPDS_REL_AC_SUBSCRIBE {"http://opds-spec.org/acquisition/subscribe"}
 
static const QLatin1String OPDS_REL_ACQUISITION {"http://opds-spec.org/acquisition"}
 
static const QLatin1String OPDS_REL_CRAWL {"http://opds-spec.org/crawlable"}
 
static const QLatin1String OPDS_REL_FACET {"http://opds-spec.org/facet"}
 
static const QLatin1String OPDS_REL_FEATURED {"http://opds-spec.org/featured"}
 
static const QLatin1String OPDS_REL_IMAGE {"http://opds-spec.org/image"}
 
static const QLatin1String OPDS_REL_RECOMMENDED {"http://opds-spec.org/recommended"}
 
static const QLatin1String OPDS_REL_SHELF {"http://opds-spec.org/shelf"}
 
static const QLatin1String OPDS_REL_SORT_NEW {"http://opds-spec.org/sort/new"}
 
static const QLatin1String OPDS_REL_SORT_POPULAR {"http://opds-spec.org/sort/popular"}
 
static const QLatin1String OPDS_REL_SUBSCRIPTIONS {"http://opds-spec.org/subscriptions"}
 
static const QLatin1String OPDS_REL_THUMBNAIL {"http://opds-spec.org/image/thumbnail"}
 
static const QLatin1String OPDS_TYPE_ENTRY {"type=entry"}
 
static const QLatin1String OPENSEARCH_ATTR_TEMPLATE {"template"}
 
static const QLatin1String OPENSEARCH_ATTR_TYPE {"type"}
 
static const QLatin1String OPENSEARCH_COUNT {"count"}
 
static const QLatin1String OPENSEARCH_EL_URL {"Url"}
 
static const QLatin1String OPENSEARCH_MT {"application/opensearchdescription+xml"}
 
static const QLatin1String OPENSEARCH_NS {"http://a9.com/-/spec/opensearch/1.1/"}
 
static const QLatin1String OPENSEARCH_SEARCH_TERMS {"searchTerms"}
 
static const QLatin1String OPENSEARCH_START_INDEX {"startIndex"}
 
static const QLatin1String OPENSEARCH_START_PAGE {"startPage"}
 
static const int PreviewHeight = 72
 
static const int PreviewWidth = 96
 
static const QLatin1String REL_ALTERNATE {"alternate"}
 
static const QLatin1String REL_COLLECTION {"collection"}
 
static const QLatin1String REL_FIRST {"first"}
 
static const QLatin1String REL_LAST {"last"}
 
static const QLatin1String REL_NEXT {"next"}
 
static const QLatin1String REL_PREVIEW {"preview"}
 
static const QLatin1String REL_PREVIOUS {"previous"}
 
static const QLatin1String REL_RELATED {"related"}
 
static const QLatin1String REL_REPLIES {"replies"}
 
static const QLatin1String REL_SEARCH {"search"}
 
static const QLatin1String REL_SELF {"self"}
 
static const QLatin1String REL_START {"start"}
 
static const QLatin1String REL_SUBSECTION {"subsection"}
 
static const QLatin1String REL_UP {"up"}
 
static const QLatin1String THREAD_COUNT {"count"}
 

Detailed Description

Contains the core functionality for handling interaction with NewStuff providers.

The entrypoint for most things will be the creation of an instance of KNSCore::Engine which will other classes then either use or get instantiated from directly.

NOTE: When implementing anything on top of KNSCore, without using either KNS3 or the Qt Quick components, you will need to implement a custom QuestionListener (see that class for instructions)

See also
KNSCore::Engine
KNSCore::ItemsModel
KNSCore::QuestionListener

Enumeration Type Documentation

An enumeration of specific error conditions which might occur and which users of KNewStuff would want to react to.

It is used by both the Engine and Provider classes.

Since
5.53 TODO: KF6 do not repeat entry properties in the QVariantList
Enumerator
UnknownError 

An unknown error (this should not be used, an error report of this nature should be considered a bug)

NetworkError 

A network error. In signalErrorCode, this will be accompanied by the QtNetwork error code in the metadata.

OcsError 

An error reported by the OCS API server. In signalErrorCode, this will be accompanied by the OCS error code in the metadata.

ConfigFileError 

The configuration file is missing or somehow incorrect. The configuration file filename will be held in the metadata.

ProviderError 

A provider has failed to load or initialize. The provider file URL or provider URL will be held in the metadata.

InstallationError 

Installation of a content item has failed. If known, the entry's unique ID will be the metadata.

ImageError 

Loading an image has failed. The entry name and preview type which failed will be held in the metadata as a QVariantList.

AdoptionError 

Adopting one entry has failed. The adoption command will be in the metadata as a QVariantList.

TryAgainLaterError 

Specific error condition for failed network calls which explicitly request an amount of time to wait before retrying (generally interpreted as maintenance).

The retry will be scheduled automatically, and this code can be used to show the user how long they have to wait. The time after which the user can try again can be read as a QDateTime in the metadata.

Since
5.84

Definition at line 24 of file errorcode.h.

Function Documentation

QList<std::shared_ptr<KNSCore::Comment> > KNSCore::getCommentsList ( const Attica::Comment::List &  comments,
std::shared_ptr< KNSCore::Comment parent 
)

TODO KF6 QList is discouraged, and we'll probably want to switch this (and the rest of the KNS library) to QVector instead.

Definition at line 361 of file atticaprovider.cpp.

QString KNSCore::replaceBBCode ( const QString unformattedText)

function to remove bb code formatting that opendesktop sends

Definition at line 750 of file entryinternal.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Sep 23 2021 22:42:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.