KNewStuff

entry.h
1 /*
2  SPDX-FileCopyrightText: 2002 Cornelius Schumacher <[email protected]>
3  SPDX-FileCopyrightText: 2003-2007 Josef Spillner <[email protected]>
4  SPDX-FileCopyrightText: 2009 Jeremy Whiting <[email protected]>
5  SPDX-FileCopyrightText: 2009 Frederik Gladhorn <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.1-or-later
8 */
9 
10 #ifndef KNEWSTUFF3_KNEWSTUFFENTRY_H
11 #define KNEWSTUFF3_KNEWSTUFFENTRY_H
12 
13 #include <QLoggingCategory>
14 #include <QSharedDataPointer>
15 #include <QStringList>
16 
17 #include "knewstuff_export.h"
18 namespace KNSCore
19 {
20 class EntryInternal;
21 }
22 namespace KNS3
23 {
24 class EntryPrivate;
25 /**
26  * @short KNewStuff information about changed entries
27  *
28  * This class provides information about the entries that
29  * have been installed while the new stuff dialog was shown.
30  * It is a minimal version that only gives applications what they need
31  * to know.
32  *
33  * @since 4.4
34  */
35 class KNEWSTUFF_EXPORT Entry
36 {
37 public:
38  typedef QList<Entry> List;
39 
40  /**
41  * Status of the entry. An entry will be downloadable from the provider's
42  * site prior to the download. Once downloaded and installed, it will
43  * be either installed or updateable, implying an out-of-date
44  * installation. Finally, the entry can be deleted and hence show up as
45  * downloadable again.
46  * Entries not taking part in this cycle, for example those in upload,
47  * have an invalid status.
48  */
49  enum Status {
50  Invalid,
51  Downloadable,
52  Installed,
53  Updateable,
54  Deleted,
55  Installing,
56  Updating,
57  };
58 
59  ~Entry();
60  Entry(const Entry &other);
61  Entry &operator=(const Entry &other);
62 
63  /**
64  * Retrieve the name of the data object.
65  *
66  * @return object name
67  */
68  QString name() const;
69 
70  /**
71  * Retrieve the category of the data object.
72  *
73  * @return object category
74  */
75  QString category() const;
76 
77  /**
78  * Retrieve the locally installed files.
79  * @return file names
80  */
81  QStringList installedFiles() const;
82 
83  /**
84  * Retrieve the locally uninstalled files.
85  * @return file names
86  */
87  QStringList uninstalledFiles() const;
88 
89  /**
90  * Retrieves the entry's status.
91  *
92  * @return Current status of the entry
93  */
94  Status status() const;
95 
96  /**
97  * Retrieve the license name of the object.
98  *
99  * @return object license
100  */
101  QString license() const;
102 
103  /**
104  * Retrieve a short description about the object.
105  *
106  * @return object description
107  */
108  QString summary() const;
109 
110  /**
111  * Retrieve the version string of the object.
112  *
113  * @return object version
114  *
115  * @sa installedVersion()
116  */
117  QString version() const;
118 
119  /**
120  * Id of this Entry. It is guaranteed to be unique for one provider.
121  * Id and ProviderId together identify this entry.
122  * @return the id
123  * @since 4.5
124  */
125  QString id() const;
126 
127  /**
128  * The Provider which is the source of the Entry.
129  * @return the Id of the Provider
130  * @since 4.5
131  */
132  QString providerId() const;
133 
134  /**
135  * @returns if available an url identifying the asset
136  * @since 5.23
137  */
138  QUrl url() const;
139 
140  /**
141  * @returns a list of urls to small previews to be displayed as thumbnails
142  * @since 5.23
143  */
144  QList<QUrl> previewThumbnails() const;
145 
146  /**
147  * @returns a list of full previews of the asset
148  * @since 5.23
149  */
150  QList<QUrl> previewImages() const;
151 
152  /**
153  * @returns the advertised disk size of the asset
154  * @since 5.23
155  */
156  quint64 size() const;
157 
158  /**
159  * @returns the number of comments in the asset
160  * @since 5.23
161  */
162  uint numberOfComments() const;
163 
164  /**
165  * @returns the rating of the asset, between 0 and 100
166  * @since 5.23
167  */
168  uint rating() const;
169 
170  /**
171  * @returns the asset's change log
172  * @since 5.23
173  */
174  QString changelog() const;
175 
176  /**
177  * @returns a short one-line summary of the asset
178  * @since 5.23
179  */
180  QString shortSummary() const;
181 
182  /**
183  * @returns the available version
184  *
185  * If the entry is not updateable, it will be the same as version.
186  *
187  * @sa version()
188  *
189  * @since 5.23
190  */
191  QString updateVersion() const;
192 
193 private:
194  Entry();
195 
197 
198  friend class KNSCore::EntryInternal;
199  friend class EntryPrivate;
200 };
201 
202 }
203 
204 #endif
Contains the core functionality for handling interaction with NewStuff providers. ...
KNewStuff information about changed entries.
Definition: entry.h:35
Status
Status of the entry.
Definition: entry.h:49
KNewStuff data entry container.
Definition: entryinternal.h:49
The namespace for the KNewStuff classes.
Definition: button.cpp:19
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:43:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.