From 9d4250e10ada4e2410722951dbd406263b61041c Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 9 Apr 2008 20:12:43 +0000 Subject: Provide tooltips. Per default tooltips are turned off because the information sidebar is turned on already. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks a lot to Konstantin Heil and Fredrik Höglund for the code :-) CCMAIL: konst.heil@stud.uni-heidelberg.de CCMAIL: fredrik@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=795324 --- src/ktooltip_p.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/ktooltip_p.h (limited to 'src/ktooltip_p.h') diff --git a/src/ktooltip_p.h b/src/ktooltip_p.h new file mode 100644 index 000000000..16ca85293 --- /dev/null +++ b/src/ktooltip_p.h @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2008 by Fredrik Höglund * + * * + * 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 * + ***************************************************************************/ + +#ifndef KTOOLTIP_P_H +#define KTOOLTIP_P_H + +class KAbstractToolTipLabel; +class KStyleOptionToolTip; +class KToolTipDelegate; + +class KToolTipManager +{ +public: + ~KToolTipManager(); + + static KToolTipManager *instance() { + if (!s_instance) + s_instance = new KToolTipManager(); + + return s_instance; + } + + void showTip(const QPoint &pos, KToolTipItem *item); + void hideTip(); + + void initStyleOption(KStyleOptionToolTip *option) const; + bool haveAlphaChannel() const; + + void setDelegate(KToolTipDelegate *delegate); + KToolTipDelegate *delegate() const; + +private: + KToolTipManager(); + + KAbstractToolTipLabel *label; + KToolTipItem *currentItem; + KToolTipDelegate *m_delegate; + +#ifdef Q_WS_X11 + bool haveArgbVisual; + Atom net_wm_cm_s0; +#endif + + static KToolTipManager *s_instance; +}; + +#endif -- cgit v1.3