00001 #ifndef ATITLEWIDGET_H 00002 #define ATITLEWIDGET_H 00003 00004 #include <QWidget> 00005 00041 class ATitleWidget : public QWidget 00042 { 00043 Q_OBJECT 00044 Q_ENUMS(ImageAlignment) 00045 Q_PROPERTY(QString text READ text WRITE setText) 00046 Q_PROPERTY(QString comment READ comment WRITE setComment) 00047 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) 00048 00049 public: 00056 enum ImageAlignment 00057 { 00058 ImageLeft, 00059 ImageRight 00060 }; 00061 00065 enum MessageType { 00066 PlainMessage, 00067 InfoMessage, 00068 WarningMessage, 00069 ErrorMessage 00070 }; 00071 00075 explicit ATitleWidget(QWidget *parent = 0); 00076 00077 virtual ~ATitleWidget(); 00078 00082 void setWidget(QWidget *widget); 00083 00088 QString text() const; 00089 00094 QString comment() const; 00095 00100 const QPixmap *pixmap() const; 00101 00109 void setBuddy(QWidget *buddy); 00110 00115 int autoHideTimeout() const; 00116 00117 public Q_SLOTS: 00124 void setText(const QString &text, Qt::Alignment alignment = Qt::AlignLeft | Qt::AlignVCenter); 00131 void setText(const QString &text, MessageType type); 00132 00139 void setComment(const QString &comment, MessageType type = PlainMessage); 00140 00146 void setPixmap(const QPixmap &pixmap, ImageAlignment alignment = ImageRight); 00147 00153 void setPixmap(const QString &icon, ImageAlignment alignment = ImageRight); 00154 00160 void setPixmap(const QIcon& icon, ImageAlignment alignment = ImageRight); 00161 00167 void setPixmap(MessageType type, ImageAlignment alignment = ImageRight); 00168 00169 protected: 00170 void changeEvent(QEvent *e); 00171 00172 private: 00173 class Private; 00174 Private* const d; 00175 00176 Q_DISABLE_COPY(ATitleWidget) 00177 }; 00178 00179 #endif