00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef COMMENTSVIEW_H
00021 #define COMMENTSVIEW_H
00022
00023 #include "abstractitemview.h"
00024
00025 #include <QMultiHash>
00026 #include <QPersistentModelIndex>
00027
00028 class QGraphicsLinearLayout;
00029 class CommentsViewItem;
00030
00031 namespace Plasma
00032 {
00033 class ItemBackground;
00034 class Frame;
00035 }
00036
00037 class CommentsView : public AbstractItemView
00038 {
00039 Q_OBJECT
00040 public:
00041 CommentsView( QGraphicsItem* parent = 0, Qt::WindowFlags wFlags = 0 );
00042 virtual void setModel( QAbstractItemModel* model );
00043
00044 protected slots:
00045 void showReply();
00046 void removeComments();
00047 void loadComments();
00048 void reloadComments();
00049 void addNewUserComment( QModelIndex parentIndex, QString title, QString body );
00050 void cancelNewComment();
00051 void hideComments();
00052 void showComments();
00053
00054 protected:
00055 bool eventFilter( QObject* obj, QEvent* event );
00056 CommentsViewItem* addComment( const QModelIndex& index, QGraphicsWidget* parent, int depth );
00057
00058 Plasma::ItemBackground* m_itemBackground;
00059
00060 private:
00061 QGraphicsWidget* m_rootWidget;
00062 Plasma::Frame* m_commentsFrame;
00063 QGraphicsLinearLayout* m_commentsLayout;
00064 bool m_isOnline;
00065 };
00066
00067 #endif // COMMENTSVIEW_H