Warning: That file was not part of the compilation database. It may have many parsing errors.

1/*
2 This file is part of the kblog library.
3
4 Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
5 Copyright (c) 2007 Mike McQuaid <mike@mikemcquaid.com>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 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 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef KBLOG_BLOGCOMMENT_H
24#define KBLOG_BLOGCOMMENT_H
25
26#include <kblog/kblog_export.h>
27
28#include <QtCore/QString>
29#include <QtCore/QtAlgorithms>
30
31class KDateTime;
32class KUrl;
33
34namespace KBlog {
35
36 class BlogCommentPrivate;
37/**
38 @brief
39 A class that represents a blog comment on the blog post.
40
41 @code
42 KBlog::BlogComment *comment = new BlogComment();
43 comment->setTitle( "This is the title." );
44 comment->setContent( "Here is some the content..." );
45 @endcode
46
47 @author Mike McQuaid \<mike\@mikemcquaid.com\>
48*/
49
50class KBLOG_EXPORT BlogComment
51{
52 public:
53 /**
54 Copy Constructor for list handling.
55 @param comment The comment to copy.
56 */
57 BlogComment( const BlogComment &comment );
58
59 /**
60 Constructor.
61 @param commentId The ID of the comment on the server.
62 */
63 explicit BlogComment( const QString &commentId = QString() );
64
65 /**
66 Virtual default destructor.
67 */
68 virtual ~BlogComment();
69
70 /**
71 Returns the title.
72 @return The title.
73
74 @see setTitle( const QString& )
75 */
76 QString title() const;
77
78 /**
79 Sets the title.
80 @param title This is the title.
81
82 @see title()
83 */
84 void setTitle( const QString &title );
85
86 /**
87 Returns the content.
88 @return The content.
89
90 @see setContent( const QString& )
91 */
92 QString content() const;
93
94 /**
95 Sets the content.
96 @param content This is the content.
97
98 @see content()
99 */
100 void setContent( const QString &content );
101
102 /**
103 Returns the comment's id.
104 @return The comment's id
105
106 @see setCommentId( const QString& )
107 */
108 QString commentId() const;
109
110 /**
111 Sets the comment's id.
112 @param id The comment's id.
113
114 @see commentId()
115 */
116 void setCommentId( const QString &id );
117
118 /**
119 Returns the E-Mail address of the commentator.
120 @return The E-Mail.
121
122 @see setEmail( const QString& )
123 */
124 QString email() const;
125
126 /**
127 Sets the E-Mail.
128 @param email This is the E-Mail address of the commentator.
129
130 @see email()
131 */
132 void setEmail( const QString &email );
133
134 /**
135 Returns the commentator's name.
136 @return The name.
137
138 @see setName()
139 */
140 QString name() const;
141
142 /**
143 Sets the name of the commentator.
144 @param name This is the commenator's name.
145
146 @see name()
147 */
148 void setName( const QString &name );
149
150 /**
151 Returns the commentator's homepage URL.
152 @return The url of the commentator's homepage
153
154 @see setUrl( const KUrl& )
155 */
156 KUrl url() const;
157
158 /**
159 Sets the commentator's homepage URL.
160 @param url The commentator's homepage url.
161
162 @see url()
163 */
164 void setUrl( const KUrl &url );
165
166 /**
167 Returns the modification date-time.
168 @return The modification date-time.
169
170 @see setModificationDateTime( const KDateTime& )
171 */
172 KDateTime modificationDateTime() const;
173
174 /**
175 Sets the modification date-time.
176 @param datetime The date-time the comment has been modified.
177
178 @see modificationDateTime( const KDateTime& )
179 */
180 void setModificationDateTime( const KDateTime &datetime );
181
182 /**
183 Returns the creation date-time.
184 @return The creation date-time.
185
186 @see setCreationDateTime( const KDateTime& )
187 */
188 KDateTime creationDateTime() const;
189
190 /**
191 Sets the creation date-time.
192 @param datetime The date-time the comment has been created.
193
194 @see creationDateTime()
195 */
196 void setCreationDateTime( const KDateTime &datetime );
197
198 /**
199 The enumartion of the different post status, reflecting the status changes
200 on the server.
201 */
202 enum Status {
203 /** Status of a freshly constructed comment on the client. */
204 New,
205 /** Status of a successfully fetched comment. */
206 Fetched,
207 /** Status of a successfully created comment.
208 @see GData::createComment( BlogPost*, BlogComment* ) */
209 Created,
210 /** Status of a successfully removed comment.
211 @see GData::removeComment( BlogPost*, BlogComment* ) */
212 Removed,
213 /** Status when an error has occurred on the server side.
214 @see error() */
215 Error
216 };
217
218 /**
219 Returns the status on the server.
220 @return The status.
221
222 @see setStatus( Status ), Status
223 */
224 Status status() const;
225
226 /**
227 Sets the status.
228 @param status The status on the server.
229
230 @see status(), Status
231 */
232 void setStatus( Status status );
233
234 /**
235 Returns the last error.
236 @returns The last error string.
237
238 @see setError( const QString& ), Error
239 */
240 QString error() const;
241
242 /**
243 Sets the error.
244 @param error The error string.
245
246 @see error(), Error
247 */
248 void setError( const QString &error );
249
250 /**
251 Overloaded for QList handling.
252 */
253 BlogComment &operator=( const BlogComment &comment );
254
255 /**
256 The swap operator.
257 */
258 void swap( BlogComment &other ) {
259 qSwap( this->d_ptr, other.d_ptr );
260 }
261
262 private:
263 BlogCommentPrivate *d_ptr; //krazy:exclude=dpointer can't constify due to bic and swap being declared inline
264};
265
266} //namespace KBlog
267
268#endif
269

Warning: That file was not part of the compilation database. It may have many parsing errors.