summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/backtracelistview.h
blob: 01c34c458b02519980815b9430cb5d969d5e1ebc (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/***************************************************************************
                           Backtracelistview.h
                         ------------------------
    begin                : 2005-07-31
    copyright            : (C) 2005 Linus McCabe

 ***************************************************************************/

/****************************************************************************
 *                                                                          *
 *   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 BACKTRACELISTVIEW_H
#define BACKTRACELISTVIEW_H

#include <tdelistview.h>
#include <tdepopupmenu.h>
#include <tqptrlist.h>

class BacktraceListview;


enum BacktraceType
{
  File = 0,
  Eval
};


class BacktraceListviewItem : public TDEListViewItem
{
  private:
    BacktraceType m_type;
    TQString m_filename;
    TQString m_func;
    long m_line;
    long m_level;

  public:
    BacktraceListviewItem();
    BacktraceListviewItem(BacktraceListview* view);

    // Type
    BacktraceType type() const { return m_type; }
    void setType(BacktraceType type) { m_type = type; }

    // Filename
    TQString filename() const { return m_filename; }
    void setFilename(const TQString &filename) { m_filename = filename; }
    
    // Function
    TQString func() const { return m_func; }
    void setFunc(const TQString &func) { m_func = func; }
    
    // Line
    long line() const { return m_line; }
    void setLine(long line) { m_line= line; }
    
    // Level
    long level() const { return m_level; }
    void setLevel(long level) { m_level = level; }

};

class BacktraceListview : public TDEListView
{
  Q_OBJECT
  

  public:

    BacktraceListview(TQWidget *parent = 0, const char *name = 0);
    ~BacktraceListview();

    void backtraceShow(int level, BacktraceType type, const TQString& filename, long line, const TQString& func);

    void clear();

  public slots:
    void slotBacktraceDoubleClick(TQListViewItem *item, const TQPoint &point, int column);

  private:
    void keyPressEvent(TQKeyEvent *e);
    void jumpHistory(TQListViewItem *item);

};

#endif