~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to src/widgets/psitooltip.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <QWidget>
25
25
 
26
 
class PsiToolTip
27
 
{
 
26
class PsiTipLabel;
 
27
 
 
28
class ToolTipPosition : public QObject
 
29
{
 
30
public:
 
31
        ToolTipPosition(const QPoint& cursorPos, const QWidget* parentWidget);
 
32
        virtual ~ToolTipPosition() {}
 
33
 
 
34
        int getScreenNumber() const;
 
35
        QRect screenRect() const;
 
36
 
 
37
        virtual QPoint calculateTipPosition(const QWidget* label) const;
 
38
 
 
39
protected:
 
40
        QPoint pos;
 
41
        const QWidget* w;
 
42
};
 
43
 
 
44
class PsiToolTip : public QObject
 
45
{
 
46
public:
 
47
        static void showText(const QPoint &pos, const QString &text, const QWidget *w = 0) { instance()->doShowText(pos, text, w); }
 
48
        static void install(QWidget *w) { instance()->doInstall(w); }
 
49
 
 
50
        static PsiToolTip* instance();
 
51
 
 
52
protected:
28
53
        PsiToolTip();
29
 
public:
30
 
        static void showText(const QPoint &pos, const QString &text, QWidget *w = 0);
31
 
        static void install(QWidget *w);
 
54
        void doShowText(const QPoint &pos, const QString &text, const QWidget *w = 0);
 
55
        void doInstall(QWidget *w);
 
56
        virtual ToolTipPosition* createTipPosition(const QPoint& cursorPos, const QWidget* parentWidget);
 
57
        virtual PsiTipLabel* createTipLabel(const QString& text, QWidget* parent);
 
58
        virtual bool moveAndUpdateTipLabel(PsiTipLabel* label, const QString& text);
 
59
        virtual void updateTipLabel(PsiTipLabel* label, const QString& text);
 
60
 
 
61
        static PsiToolTip* instance_;
32
62
};
33
63
 
34
64
#endif