/usr/include/plasma/tooltipcontent.h is in kdelibs5-dev 4:4.14.2-5+deb8u2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | /*
* Copyright 2008 by Aaron Seigo <aseigo@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef PLASMA_TOOLTIPCONTENT_H
#define PLASMA_TOOLTIPCONTENT_H
#include <QtCore/QString>
#include <QtCore/QUrl>
#include <QtCore/QVariant>
#include <QtCore/QList>
#include <QtGui/QPixmap>
#include <QtGui/QIcon>
#include <plasma/plasma_export.h>
class QTextDocument;
class QGraphicsWidget;
/**
* This provides the content for a tooltip.
*
* Normally you will want to set at least the @p mainText and
* @p subText.
*/
namespace Plasma
{
class ToolTipContentPrivate;
class PLASMA_EXPORT ToolTipContent
{
public:
enum ResourceType { ImageResource = 0, HtmlResource, CssResource };
/**
* Creates an empty Content
*/
ToolTipContent();
~ToolTipContent();
/**
* Copy constructor
*/
ToolTipContent(const ToolTipContent &other);
/**
* Constructor that sets the common fields
*/
ToolTipContent(const QString &mainText,
const QString &subText,
const QPixmap &image = QPixmap());
/**
* Constructor that sets the common fields
*/
ToolTipContent(const QString &mainText,
const QString &subText,
const QIcon &icon);
ToolTipContent &operator=(const ToolTipContent &other);
/**
* @return true if all the fields are empty
*/
bool isEmpty() const;
/**
* Sets the main text which containts important information, e.g. the title
*/
void setMainText(const QString &text);
/**
* Important information, e.g. the title
*/
QString mainText() const;
/**
* Sets text which elaborates on the @p mainText
*/
void setSubText(const QString &text) ;
/**
* Elaborates on the @p mainText
*/
QString subText() const;
/**
* Sets the icon to show
*/
void setImage(const QPixmap &image);
/**
* Sets the icon to show
*/
void setImage(const QIcon &icon);
/**
* An icon to display
*/
QPixmap image() const;
/**
* Sets the ID of the window to show a preview for.
* @deprecated
* @see setWindowsToPreview
*/
KDE_DEPRECATED void setWindowToPreview(WId id);
/**
* Id of a window if you want to show a preview
* @deprecated
* @see windowsToPreview
*/
KDE_DEPRECATED WId windowToPreview() const;
/**
* Sets the IDS of the windows to show a preview for
* @since 4.3
*/
void setWindowsToPreview(const QList<WId> &ids);
/**
* Ids of a windows if you want to show a preview
* @since 4.3
*/
QList<WId> windowsToPreview() const;
/**
* sets if when the mouse will be over a thumbnail the corresponding window
* will be highlighted by reducing opacity of all the other windows
* @since 4.4
*/
void setHighlightWindows(bool highlight);
/**
* true if when the mouse will be over a thumbnail the corresponding window
* will be highlighted by reducing opacity of all the other windows
* @since 4.4
*/
bool highlightWindows() const;
/** Sets whether or not to autohide the tooltip, defaults to true
*/
void setAutohide(bool autohide);
/**
* Whether or not to autohide the tooltip, defaults to true
*/
bool autohide() const;
/**
* Sets whether or not the tooltip should popup instantly when
* the widget is hovered, defaults to false.
*
* @since 4.7
*/
void setInstantPopup(bool enabled);
/**
* Whether or not the tooltip should popup instantly when
* the widget is hovered, defaults to false.
*
* @since 4.7
*/
bool isInstantPopup() const;
/**
* Adds a resource that can then be referenced from the text elements
* using rich text
*/
void addResource(ResourceType type, const QUrl &path, const QVariant &resource);
/**
* Registers all resources with a given document
*/
void registerResources(QTextDocument *document) const;
/**
* Sets whether or not the tooltip contains clickable content, such as
* window previews. Defaults to false, or not clickable.
*
* @since 4.3
*/
void setClickable(bool clickable);
/**
* @return true if the tooltip is clickabel
*
* @since 4.3
*/
bool isClickable() const;
/**
* Sets an optional graphicsWidget that will be used for positioning the tooltip
* @since 4.6
*/
void setGraphicsWidget(QGraphicsWidget *widget);
/**
* the graphicsWidget used for positioning the tooltip, if any
* @since 4.6
*/
QGraphicsWidget *graphicsWidget() const;
private:
ToolTipContentPrivate * const d;
};
} // namespace Plasma
#endif
|