1/*
2 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
3 Copyright (c) 2003 - 2007 Josef Spillner <spillner@kde.org>
4 Copyright (c) 2009 Jeremy Whiting <jpwhiting@kde.org>
5 Copyright (C) 2009 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
21#ifndef KNEWSTUFF3_KNEWSTUFFENTRY_H
22#define KNEWSTUFF3_KNEWSTUFFENTRY_H
23
24#include <QtCore/QStringList>
25#include <QtCore/QSharedDataPointer>
26#include <kurl.h>
27
28#include <knewstuff3/knewstuff_export.h>
29
30
31namespace KNS3
32{
33
34/**
35 * @short KNewStuff information about changed entries
36 *
37 * This class provides information about the entries that
38 * have been installed while the new stuff dialog was shown.
39 * It is a minimal version that only gives applications what they need
40 * to know.
41 *
42 * @since 4.4
43 */
44class KNEWSTUFF_EXPORT Entry
45{
46public:
47 typedef QList<Entry> List;
48
49 /**
50 * Status of the entry. An entry will be downloadable from the provider's
51 * site prior to the download. Once downloaded and installed, it will
52 * be either installed or updateable, implying an out-of-date
53 * installation. Finally, the entry can be deleted and hence show up as
54 * downloadable again.
55 * Entries not taking part in this cycle, for example those in upload,
56 * have an invalid status.
57 */
58 enum Status {
59 Invalid,
60 Downloadable,
61 Installed,
62 Updateable,
63 Deleted,
64 Installing,
65 Updating
66 };
67
68 ~Entry();
69 Entry(const Entry& other);
70 Entry& operator=(const Entry& other);
71
72 /**
73 * Retrieve the name of the data object.
74 *
75 * @return object name
76 */
77 QString name() const;
78
79 /**
80 * Retrieve the category of the data object.
81 *
82 * @return object category
83 */
84 QString category() const;
85
86 /**
87 * Retrieve the locally installed files.
88 * @return file names
89 */
90 QStringList installedFiles() const;
91
92 /**
93 * Retrieve the locally uninstalled files.
94 * @return file names
95 */
96 QStringList uninstalledFiles() const;
97
98 /**
99 * Retrieves the entry's status.
100 *
101 * @return Current status of the entry
102 */
103 Status status() const;
104
105 /**
106 * Retrieve the license name of the object.
107 *
108 * @return object license
109 */
110 QString license() const;
111
112 /**
113 * Retrieve a short description about the object.
114 *
115 * @return object description
116 */
117 QString summary() const;
118
119 /**
120 * Retrieve the version string of the object.
121 *
122 * @return object version
123 */
124 QString version() const;
125
126 /**
127 * Id of this Entry. It is guaranteed to be unique for one provider.
128 * Id and ProviderId together identifiy this entry.
129 * @return the id
130 * @since 4.5
131 */
132 QString id() const;
133
134 /**
135 * The Provider which is the source of the Entry.
136 * @return the Id of the Provider
137 * @since 4.5
138 */
139 QString providerId() const;
140
141private:
142 Entry();
143
144 class Private;
145 QExplicitlySharedDataPointer<Private> d;
146
147 friend class EntryInternal;
148};
149
150}
151
152#endif
153