Plasma
tooltipcontent.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
00020 #ifndef PLASMA_TOOLTIPCONTENT_H
00021 #define PLASMA_TOOLTIPCONTENT_H
00022
00023 #include <QtCore/QString>
00024 #include <QtCore/QUrl>
00025 #include <QtCore/QVariant>
00026 #include <QtGui/QPixmap>
00027 #include <QtGui/QIcon>
00028
00029 #include <plasma/plasma_export.h>
00030
00031 class QTextDocument;
00032
00040 namespace Plasma
00041 {
00042
00043 class ToolTipContentPrivate;
00044
00045 class PLASMA_EXPORT ToolTipContent
00046 {
00047 public:
00048 enum ResourceType { ImageResource = 0, HtmlResource, CssResource };
00049
00051 ToolTipContent();
00052
00053 ~ToolTipContent();
00054
00056 ToolTipContent(const ToolTipContent &other);
00057
00059 ToolTipContent(const QString &mainText,
00060 const QString &subText,
00061 const QPixmap &image = QPixmap());
00062
00064 ToolTipContent(const QString &mainText,
00065 const QString &subText,
00066 const QIcon &icon);
00067
00068 ToolTipContent &operator=(const ToolTipContent &other);
00069
00071 bool isEmpty() const;
00072
00074 void setMainText(const QString &text);
00075
00077 QString mainText() const;
00078
00080 void setSubText(const QString &text) ;
00081
00083 QString subText() const;
00084
00086 void setImage(const QPixmap &image);
00087
00089 void setImage(const QIcon &icon);
00090
00092 QPixmap image() const;
00093
00095 void setWindowToPreview(WId id);
00096
00098 WId windowToPreview() const;
00099
00101 void setAutohide(bool autohide);
00102
00104 bool autohide() const;
00105
00108 void addResource(ResourceType type, const QUrl &path, const QVariant &resource);
00109
00111 void registerResources(QTextDocument *document) const;
00112
00113 private:
00114 ToolTipContentPrivate * const d;
00115 };
00116
00117 }
00118
00119 #endif
00120