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#include "blogcomment.h"
24#include "blogcomment_p.h"
25
26#include <KDateTime>
27#include <KUrl>
28
29#include <QStringList>
30
31namespace KBlog {
32
33BlogComment::BlogComment( const BlogComment &c )
34 : d_ptr( new BlogCommentPrivate )
35{
36 d_ptr->q_ptr = this;
37 d_ptr->mTitle = c.title();
38 d_ptr->mContent = c.content();
39 d_ptr->mEmail = c.email();
40 d_ptr->mName = c.name();
41 d_ptr->mCommentId = c.commentId();
42 d_ptr->mUrl = c.url();
43 d_ptr->mError = c.error();
44 d_ptr->mStatus = c.status();
45 d_ptr->mModificationDateTime = c.modificationDateTime();
46 d_ptr->mCreationDateTime = c.creationDateTime();
47}
48
49BlogComment::BlogComment( const QString &commentId )
50 : d_ptr( new BlogCommentPrivate )
51{
52 d_ptr->q_ptr = this;
53 d_ptr->mStatus = New;
54 d_ptr->mCommentId = commentId;
55}
56
57BlogComment::~BlogComment()
58{
59 delete d_ptr;
60}
61
62QString BlogComment::title() const
63{
64 return d_ptr->mTitle;
65}
66
67void BlogComment::setTitle( const QString &title )
68{
69 d_ptr->mTitle = title;
70}
71
72QString BlogComment::content() const
73{
74 return d_ptr->mContent;
75}
76
77void BlogComment::setContent( const QString &content )
78{
79 d_ptr->mContent = content;
80}
81
82QString BlogComment::commentId() const
83{
84 return d_ptr->mCommentId;
85}
86
87void BlogComment::setCommentId( const QString &commentId )
88{
89 d_ptr->mCommentId = commentId;
90}
91
92QString BlogComment::email() const
93{
94 return d_ptr->mEmail;
95}
96
97void BlogComment::setEmail( const QString &email )
98{
99 d_ptr->mEmail = email;
100}
101
102QString BlogComment::name() const
103{
104 return d_ptr->mName;
105}
106
107void BlogComment::setName( const QString &name )
108{
109 d_ptr->mName = name;
110}
111KUrl BlogComment::url() const
112{
113 return d_ptr->mUrl;
114}
115
116void BlogComment::setUrl( const KUrl &url )
117{
118 d_ptr->mUrl = url;
119}
120
121KDateTime BlogComment::modificationDateTime() const
122{
123 return d_ptr->mModificationDateTime;
124}
125
126void BlogComment::setModificationDateTime( const KDateTime &datetime )
127{
128 d_ptr->mModificationDateTime=datetime;
129}
130
131KDateTime BlogComment::creationDateTime() const
132{
133 return d_ptr->mCreationDateTime;
134}
135
136void BlogComment::setCreationDateTime( const KDateTime &datetime )
137{
138 d_ptr->mCreationDateTime= datetime;
139}
140
141BlogComment::Status BlogComment::status() const
142{
143 return d_ptr->mStatus;
144}
145
146void BlogComment::setStatus( BlogComment::Status status )
147{
148 d_ptr->mStatus = status;
149}
150
151QString BlogComment::error() const
152{
153 return d_ptr->mError;
154}
155
156void BlogComment::setError( const QString &error )
157{
158 d_ptr->mError = error;
159}
160
161BlogComment &BlogComment::operator=( const BlogComment &c )
162{
163 BlogComment copy( c );
164 swap( copy );
165 return *this;
166}
167
168} // namespace KBlog
169