2011-04-28 00:33:29 +02:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright 2011 Marco Martin <mart@kde.org> *
|
|
|
|
* Copyright 2011 Artur Duque de Souza <asouza@kde.org> *
|
2013-04-04 05:02:51 +02:00
|
|
|
* Copyright 2013 Sebastian Kügler <sebas@kde.org> *
|
2011-04-28 00:33:29 +02:00
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program 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 General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2013-04-04 22:14:56 +02:00
|
|
|
#ifndef TOOLTIPOBJECT_H
|
|
|
|
#define TOOLTIPOBJECT_H
|
2011-04-28 00:33:29 +02:00
|
|
|
|
2013-04-09 03:52:59 +02:00
|
|
|
#include <QQuickItem>
|
2011-04-28 00:33:29 +02:00
|
|
|
#include <QWeakPointer>
|
2012-10-23 18:55:36 +02:00
|
|
|
#include <QtCore/QVariant>
|
2011-04-28 00:33:29 +02:00
|
|
|
|
2013-04-03 00:50:00 +02:00
|
|
|
class QQuickItem;
|
2011-04-28 00:33:29 +02:00
|
|
|
class QGraphicsWidget;
|
|
|
|
|
2012-12-14 16:14:31 +01:00
|
|
|
/**
|
2013-04-09 03:50:43 +02:00
|
|
|
* Exposed as `ToolTipProxy` in QML. This is used only internally for WIndow handling
|
|
|
|
*
|
|
|
|
* DO NOT USE THIS API, PlasmaCore.ToolTip is what you should use.
|
2012-12-14 16:14:31 +01:00
|
|
|
*/
|
2013-04-04 22:14:56 +02:00
|
|
|
class ToolTip : public QObject
|
2011-04-28 00:33:29 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2012-01-10 12:06:59 +01:00
|
|
|
/**
|
2013-04-09 03:50:43 +02:00
|
|
|
* The item shown inside the tooltip.
|
2013-04-03 02:23:22 +02:00
|
|
|
*/
|
|
|
|
Q_PROPERTY(QQuickItem *mainItem READ mainItem WRITE setMainItem NOTIFY mainItemChanged)
|
2013-04-09 03:42:54 +02:00
|
|
|
|
2013-04-03 02:23:22 +02:00
|
|
|
/**
|
|
|
|
* The main QML item that will be displayed in the Dialog
|
|
|
|
*/
|
|
|
|
Q_PROPERTY(QQuickItem *visualParent READ visualParent WRITE setVisualParent NOTIFY visualParentChanged)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Visibility of the Dialog window. Doesn't have anything to do with the visibility of the mainItem.
|
|
|
|
*/
|
|
|
|
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
|
|
|
|
|
|
|
|
|
2011-04-28 00:33:29 +02:00
|
|
|
public:
|
2013-04-04 22:14:56 +02:00
|
|
|
ToolTip(QObject *parent = 0);
|
|
|
|
~ToolTip();
|
2011-04-28 00:33:29 +02:00
|
|
|
|
2013-04-03 02:23:22 +02:00
|
|
|
QQuickItem *mainItem() const;
|
|
|
|
void setMainItem(QQuickItem *mainItem);
|
|
|
|
|
|
|
|
QQuickItem *visualParent() const;
|
|
|
|
void setVisualParent(QQuickItem *visualParent);
|
|
|
|
|
|
|
|
bool isVisible() const;
|
|
|
|
void setVisible(const bool visible);
|
|
|
|
|
2011-04-28 00:33:29 +02:00
|
|
|
Q_SIGNALS:
|
2013-04-03 02:23:22 +02:00
|
|
|
void mainItemChanged();
|
|
|
|
void visualParentChanged();
|
|
|
|
void visibleChanged();
|
2011-04-28 00:33:29 +02:00
|
|
|
|
|
|
|
private:
|
2013-04-03 02:23:22 +02:00
|
|
|
QWeakPointer<QQuickItem> m_mainItem;
|
|
|
|
QWeakPointer<QQuickItem> m_visualParent;
|
2011-04-28 00:33:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|