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 <QtCore/QList>
00027 #include <QtGui/QPixmap>
00028 #include <QtGui/QIcon>
00029
00030 #include <plasma/plasma_export.h>
00031
00032 class QTextDocument;
00033
00041 namespace Plasma
00042 {
00043
00044 class ToolTipContentPrivate;
00045
00046 class PLASMA_EXPORT ToolTipContent
00047 {
00048 public:
00049 enum ResourceType { ImageResource = 0, HtmlResource, CssResource };
00050
00052 ToolTipContent();
00053
00054 ~ToolTipContent();
00055
00057 ToolTipContent(const ToolTipContent &other);
00058
00060 ToolTipContent(const QString &mainText,
00061 const QString &subText,
00062 const QPixmap &image = QPixmap());
00063
00065 ToolTipContent(const QString &mainText,
00066 const QString &subText,
00067 const QIcon &icon);
00068
00069 ToolTipContent &operator=(const ToolTipContent &other);
00070
00072 bool isEmpty() const;
00073
00075 void setMainText(const QString &text);
00076
00078 QString mainText() const;
00079
00081 void setSubText(const QString &text) ;
00082
00084 QString subText() const;
00085
00087 void setImage(const QPixmap &image);
00088
00090 void setImage(const QIcon &icon);
00091
00093 QPixmap image() const;
00094
00095
00097 void setWindowToPreview(WId id);
00098
00099
00101 WId windowToPreview() const;
00102
00105 void setWindowsToPreview(const QList<WId> &ids);
00106
00109 QList<WId> windowsToPreview() const;
00110
00112 void setAutohide(bool autohide);
00113
00115 bool autohide() const;
00116
00119 void addResource(ResourceType type, const QUrl &path, const QVariant &resource);
00120
00122 void registerResources(QTextDocument *document) const;
00123
00124 private:
00125 ToolTipContentPrivate * const d;
00126 };
00127
00128 }
00129
00130 #endif
00131