00001 #ifndef QCOMMENTWIDGET_H
00002 #define QCOMMENTWIDGET_H
00003
00004 #include <QWidget>
00005 #include <QPicture>
00006 #include <QDateTime>
00007 #include <QHBoxLayout>
00008 #include <QLabel>
00009 #include <QTextBrowser>
00010 #include <QIcon>
00011
00012 #include "datatypes/photocomments.h"
00013 #include "datatypes/friend.h"
00014
00015 #define ICON_SIZE 60
00016
00017 class QCommentWidget : public QWidget
00018 {
00019 Q_OBJECT
00020
00021 public:
00022 explicit QCommentWidget(QFont textFont, QWidget *parent = 0);
00023 ~QCommentWidget();
00024
00025 void setPhotoComment(PhotoComment comment);
00026 void setSenderProfile(Friend fr);
00027 PhotoComment photoComment();
00028
00029 QDateTime dateTime();
00030
00031 virtual int heightForWidth(int width) const;
00032 virtual QSize sizeHint() const;
00033 void setWidth(int width);
00034
00035 private:
00036 void setupUi(QFont textFont);
00037 void updateIcon();
00038 void setName();
00039
00040
00041 QLabel *icon;
00042 QLabel *name;
00043 QLabel *date;
00044 QTextBrowser *text;
00045
00046 PhotoComment pComment;
00047 Friend senderProfile;
00048 };
00049
00050 #endif // QCOMMENTWIDGET_H