KDEUI
ktitlewidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KTITLEWIDGET_H
00020 #define KTITLEWIDGET_H
00021
00022 #include <kdeui_export.h>
00023
00024 #include <QtGui/QWidget>
00025
00061 class KDEUI_EXPORT KTitleWidget : public QWidget
00062 {
00063 Q_OBJECT
00064 Q_ENUMS(ImageAlignment)
00065 Q_PROPERTY(QString text READ text WRITE setText)
00066 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
00067 Q_PROPERTY(int autoHideTimeout READ autoHideTimeout WRITE setAutoHideTimeout)
00068
00069 public:
00076 enum ImageAlignment {
00077 ImageLeft,
00078 ImageRight
00079 };
00080
00084 enum MessageType {
00085 PlainMessage,
00086 InfoMessage,
00087 WarningMessage,
00088 ErrorMessage
00089 };
00090
00094 explicit KTitleWidget(QWidget *parent = 0);
00095
00096 virtual ~KTitleWidget();
00097
00101 void setWidget(QWidget *widget);
00102
00107 QString text() const;
00108
00113 QString comment() const;
00114
00119 const QPixmap *pixmap() const;
00120
00128 void setBuddy(QWidget *buddy);
00129
00134 int autoHideTimeout() const;
00135
00136 public Q_SLOTS:
00143 void setText(const QString &text, Qt::Alignment alignment = Qt::AlignLeft | Qt::AlignVCenter);
00150 void setText(const QString &text, MessageType type);
00151
00158 void setComment(const QString &comment, MessageType type = PlainMessage);
00159
00165 void setPixmap(const QPixmap &pixmap, ImageAlignment alignment = ImageRight);
00166
00172 void setPixmap(const QString &icon, ImageAlignment alignment = ImageRight);
00173
00179 void setPixmap(const QIcon& icon, ImageAlignment alignment = ImageRight);
00180
00186 void setPixmap(MessageType type, ImageAlignment alignment = ImageRight);
00187
00193 void setAutoHideTimeout(int msecs);
00194
00195 protected:
00196 void changeEvent(QEvent *e);
00197 void showEvent(QShowEvent *event);
00198 bool eventFilter(QObject *object, QEvent *event);
00199
00200 private:
00201 class Private;
00202 Private* const d;
00203
00204 Q_PRIVATE_SLOT(d, void _k_timeoutFinished())
00205 Q_DISABLE_COPY(KTitleWidget)
00206 };
00207
00208 #endif