summaryrefslogtreecommitdiffstats
path: root/kalzium/src/kalziumtip.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch)
treed3bb9f5d25a2dc09ca81adecf39621d871534297 /kalzium/src/kalziumtip.h
downloadtdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz
tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalzium/src/kalziumtip.h')
-rw-r--r--kalzium/src/kalziumtip.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/kalzium/src/kalziumtip.h b/kalzium/src/kalziumtip.h
new file mode 100644
index 00000000..425e2a7e
--- /dev/null
+++ b/kalzium/src/kalziumtip.h
@@ -0,0 +1,88 @@
+#ifndef KALZIUMTIP_H
+#define KALZIUMTIP_H
+/***************************************************************************
+
+ The header for the tooltip class of Kalzium
+ -------------------
+ begin : June 2003
+ copyright : (C) 2003, 2004, 2005 by Zack Rusin <zrusin@kde.org>
+ Sami Kyostil <skyostil@kempele.fi>
+                    Aaron J. Seigo <aseigo@kde.org>
+ Martin Pfeiffer <hubipete@gmx.net>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+
+#include <qwidget.h>
+#include <qbitmap.h>
+#include <qtimer.h>
+
+class QPaintEvent;
+class QSimpleRichText;
+class QPixmap;
+class Element;
+class QTimer;
+
+
+/**
+ * @short tooltip for kalzium
+ * @author Martin Pfeiffer
+ */
+class KalziumTip : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ enum MaskEffect { Plain, Dissolve };
+
+ KalziumTip( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
+
+ void showTip( QPoint, Element* element, int visibleWidth, int visibleHeight ); //show the tip
+ void hide(); // hide it
+
+ protected:
+ void paintEvent(QPaintEvent * e);
+
+ void plainMask();
+ void dissolveMask();
+ // if the mouse pointer hovers us, send the event to the parent
+ // so we are some-what 'mouse transparent'
+ void mouseMoveEvent(QMouseEvent * e);
+ void displayInternal();
+ void display();
+
+ void loadIcon(); //loads the elements icon
+
+ protected slots:
+ void internalUpdate();
+
+ private:
+ QBitmap m_mask;
+ QPoint m_mousePointer;
+ QPixmap m_pixmap;
+ QPixmap m_icon; //icon shown on the tip
+ QPixmap m_noElemIcon; //icon for element wich have no image
+
+ MaskEffect m_maskEffect; //inidicates to show mask effect or plain
+ QSimpleRichText* m_richText;
+
+ int m_dissolveSize;
+ int m_dissolveDelta;
+
+ QTimer m_frameTimer; //timer for the dissolve effect
+ bool m_dirty; //indicates repainting the tooltip internal
+
+ const Element* m_tippedElement; //the element the tip is about
+};
+
+#endif
+