blogcomment.h

00001 /*
00002   This file is part of the kblog library.
00003 
00004   Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
00005   Copyright (c) 2007 Mike Arthur <mike@mikearthur.co.uk>
00006 
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Library General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   Library General Public License for more details.
00016 
00017   You should have received a copy of the GNU Library General Public License
00018   along with this library; see the file COPYING.LIB.  If not, write to
00019   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020   Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef KBLOG_BLOGCOMMENT_H
00024 #define KBLOG_BLOGCOMMENT_H
00025 
00026 #include <kblog/kblog_export.h>
00027 
00028 #include <QtCore/QString>
00029 #include <QtCore/QtAlgorithms>
00030 
00031 class KDateTime;
00032 class KUrl;
00033 
00034 namespace KBlog {
00035 
00036     class BlogCommentPrivate;
00050 class KBLOG_EXPORT BlogComment
00051 {
00052   public:
00057   BlogComment( const BlogComment &comment );
00058 
00063   explicit BlogComment( const QString &commentId = QString() );
00064 
00068   virtual ~BlogComment();
00069 
00076   QString title() const;
00077 
00084   void setTitle( const QString &title );
00085 
00092   QString content() const;
00093 
00100   void setContent( const QString &content );
00101 
00108   QString commentId() const;
00109 
00116   void setCommentId( const QString &id );
00117 
00124   QString email() const;
00125 
00132   void setEmail( const QString &email );
00133 
00140   QString name() const;
00141 
00148   void setName( const QString &name );
00149 
00156   KUrl url() const;
00157 
00164   void setUrl( const KUrl &url );
00165 
00172   KDateTime modificationDateTime() const;
00173 
00180   void setModificationDateTime( const KDateTime &datetime );
00181 
00188   KDateTime creationDateTime() const;
00189 
00196   void setCreationDateTime( const KDateTime &datetime );
00197 
00202   enum Status {
00204     New,
00206     Fetched,
00209     Created,
00212     Removed,
00215     Error
00216   };
00217 
00224   Status status() const;
00225 
00232   void setStatus( Status status );
00233 
00240   QString error() const;
00241 
00248   void setError( const QString &error );
00249 
00253   BlogComment &operator=( const BlogComment &comment );
00254 
00258   void swap( BlogComment &other ) { qSwap( this->d_ptr, other.d_ptr ); }
00259 
00260   private:
00261     BlogCommentPrivate *d_ptr; //krazy:exclude=dpointer can't constify due to bic and swap being declared inline
00262 };
00263 
00264 } //namespace KBlog
00265 
00266 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys