summaryrefslogtreecommitdiffstats
path: root/kate/kpybrowser/kpybrowser.h
blob: ae49d3cf82cd8e076b87e5f347197e847dffc0ea (plain)
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
/***************************************************************************
                          kpybrowser.h  -  description
                             -------------------
    begin                : Fri Aug 24 15:11:58 MST 2001
    copyright            : (C) 2001 by Christian Bird
    email                : chrisb@lineo.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KPYBROWSER_H
#define KPYBROWSER_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <kapplication.h>
#include <klistview.h>
#include <qstring.h>
#include <qvaluelist.h>
#include <qtooltip.h>
#include <qdict.h>
#include "pybrowsenode.h"


/** KPyBrowser is the base class of the project */
class KPyBrowser : public KListView
{
  Q_OBJECT
  public:
    /** construtor */
    KPyBrowser(QWidget* parent=0, const char *name=0);
    /** destructor */
    ~KPyBrowser();
    void parseText(QString &pytext);

        //used by KPBToolTip to dynamically create the needed tooltip
        void tip (const QPoint &p, QRect &r, QString &str);

	private:
		PyBrowseNode *class_root, *function_root;

        //create a mapping of names to nodes
        QDict<PyBrowseNode> node_dict;

	public slots:
		void nodeSelected(QListViewItem *node);
	signals:
		void selected(QString, int);
    private:
        class KPBToolTip : public QToolTip
        {
            public:
                KPBToolTip(QWidget *parent);
            protected:
                void maybeTip( const QPoint & );
        };
        KPBToolTip* tooltip;
};

#endif