1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
/*
This file is part of KOrganizer.
Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KNEWSTUFF_ENTRY_H
#define KNEWSTUFF_ENTRY_H
#include <tqdatetime.h>
#include <tqdom.h>
#include <tqmap.h>
#include <tqstring.h>
#include <tqstringlist.h>
#include <kurl.h>
namespace KNS {
/**
* @short KNewStuff data entry container.
*
* This class provides accessor methods to the data objects
* as used by KNewStuff.
* It should probably not be used directly by the application.
*
* @author Cornelius Schumacher (schumacher@kde.org)
* \par Maintainer:
* Josef Spillner (spillner@kde.org)
*/
class KDE_EXPORT Entry
{
public:
Entry();
/**
* Constructor.
*/
Entry( const TQDomElement & );
/**
* Destructor.
*/
~Entry();
/**
* Sets the (unique) name for this data object.
*/
void setName( const TQString & );
/**
* Retrieve the name of the data object.
*
* @return object name
*/
TQString name() const;
/**
* Sets the application type, e.g. 'kdesktop/wallpaper'.
*/
void setType( const TQString & );
/**
* Retrieve the type of the data object.
*
* @return object type
*/
TQString type() const;
/**
* Sets the full name of the object's author.
*/
void setAuthor( const TQString & );
/**
* Retrieve the author's name of the object.
*
* @return object author
*/
TQString author() const;
/**
* Sets the license (abbreviation) applicable to the object.
*/
void setLicence( const TQString & );
/**
* Retrieve the license name of the object.
*
* @return object license
*/
TQString license() const;
/**
* Sets a short description on what the object is all about.
*/
void setSummary( const TQString &, const TQString &lang = TQString::null );
/**
* Retrieve a short description about the object.
*
* @param lang preferred language, or TQString::null for KDE default
* @return object description
*/
TQString summary( const TQString &lang = TQString::null ) const;
/**
* Sets the version number.
*/
void setVersion( const TQString & );
/**
* Retrieve the version string of the object.
*
* @return object version
*/
TQString version() const;
/**
* Sets the release number, which is increased for feature-equal objects
* with the same version number, but slightly updated contents.
*/
void setRelease( int );
/**
* Retrieve the release number of the object
*
* @return object release
*/
int release() const;
/**
* Sets the release date.
*/
void setReleaseDate( const TQDate & );
/**
* Retrieve the date of the object's publication.
*
* @return object release date
*/
TQDate releaseDate() const;
/**
* Sets the object's file.
*/
void setPayload( const KURL &, const TQString &lang = TQString::null );
/**
* Retrieve the file name of the object.
*
* @param lang preferred language, or TQString::null for KDE default
* @return object filename
*/
KURL payload( const TQString &lang = TQString::null ) const;
/**
* Sets the object's preview file, if available. This should be a
* picture file.
*/
void setPreview( const KURL &, const TQString &lang = TQString::null );
/**
* Retrieve the file name of an image containing a preview of the object.
*
* @param lang preferred language, or TQString::null for KDE default
* @return object preview filename
*/
KURL preview( const TQString &lang = TQString::null ) const;
/**
* Sets the rating between 0 (worst) and 10 (best).
*
* @internal
*/
void setRating( int );
/**
* Retrieve the rating for the object, which has been determined by its
* users and thus might change over time.
*
* @return object rating
*/
int rating();
/**
* Sets the number of downloads.
*
* @internal
*/
void setDownloads( int );
/**
* Retrieve the download count for the object, which has been determined
* by its hosting sites and thus might change over time.
*
* @return object download count
*/
int downloads();
/**
* Return the full name for the meta information. It is constructed as
* name-version-release.
*/
TQString fullName();
/**
* Return the list of languages this object supports.
*/
TQStringList langs();
/**
* @internal
*/
void parseDomElement( const TQDomElement & );
/**
* @internal
*/
TQDomElement createDomElement( TQDomDocument &, TQDomElement &parent );
protected:
TQDomElement addElement( TQDomDocument &doc, TQDomElement &parent,
const TQString &tag, const TQString &value );
private:
TQString mName;
TQString mType;
TQString mAuthor;
TQString mLicence;
TQMap<TQString,TQString> mSummaryMap;
TQString mVersion;
int mRelease;
TQDate mReleaseDate;
TQMap<TQString,KURL> mPayloadMap;
TQMap<TQString,KURL> mPreviewMap;
int mRating;
int mDownloads;
TQStringList mLangs;
};
}
#endif
|