summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/debuggermanager.h
blob: de0329378c654aced7eb1150be14fe4ca4db393d (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/***************************************************************************
                          phpdebuggerinterface.h
                             -------------------
    begin                : 2004-03-12
    copyright            : (C) 2004 Linus McCabe <linus@mccabe.nu>
    Based on work by Mathieu Kooiman
 ***************************************************************************/

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

#include <tqobject.h>
#include <tqstring.h>

class DebuggerClient;
class QuantaDebuggerInterface;
class DebuggerBreakpointList;
class DebuggerUI;
class DebuggerVariable;
class DebuggerBreakpoint;
class PathMapper;
class Document;

class DebuggerManager : public TQObject
{
    Q_OBJECT
  TQ_OBJECT
  private:
    // client
    DebuggerClient *m_client;
    QuantaDebuggerInterface * m_interface;
    DebuggerBreakpointList *m_breakpointList;
    DebuggerUI * m_debuggerui;
    PathMapper * m_pathmapper;

    // Internal help functions
    void initActions();
    void initClientActions();
    void saveProperties();
    
    void connectBreakpointSignals(Document*);
    void disconnectBreakpointSignals(Document*);

    TQString m_currentFile;
    long m_currentLine;

  public:
    DebuggerManager(TQObject *myparent);
    ~DebuggerManager();

    // Access to memebers
    DebuggerUI * UI() { return m_debuggerui; };
    DebuggerClient * client() { return m_client; };
    PathMapper * Mapper() { return m_pathmapper; };

    // Breakpoints
    void haveBreakpoint (const TQString& file, int line);
    void havenoBreakpoint (const TQString& file, int line);
    void refreshBreakpoints();
//     DebuggerBreakpoint *newDebuggerBreakpoint();
    DebuggerBreakpoint * findDebuggerBreakpoint(const TQString& key);
    void updateBreakpointKey(const DebuggerBreakpoint &bp, const TQString& newkey);

    // Public help functions
    bool showStatus(const TQString& message, bool log);
    bool setActiveLine (const TQString& file, int line);
    void setMark(const TQString& filename, long line, bool set, int mark);

    void enableAction(const TQString& action, bool enable);
    void fileOpened(const TQString& file);

    bool hasClient() { return m_client != 0; };

  public slots:

    // Execution control slots
    void slotDebugRequest();
    void slotDebugRun();
    void slotDebugTrace();
    void slotDebugSkip();
    void slotDebugStepOver();
    void slotDebugStepInto();
    void slotDebugStepOut();
    void slotDebugPause();
    void slotDebugKill();

    // Breakpoint
    void toggleBreakpoint();
    void clearBreakpoints();
    void slotConditionalBreakpoint();
    void slotRemoveBreakpoint(DebuggerBreakpoint* bp);

    // Watches
    void slotAddWatch();
    void slotRemoveVariable(DebuggerVariable* var);
    void slotVariableSet();

    // Connection related slots
    void slotDebugStartSession();
    void slotDebugEndSession();

    // Profiler
    void slotProfilerOpen();

    // Initiation
    void slotNewProjectLoaded(const TQString &, const KURL &, const KURL &);

    // Event handling
    void slotHandleEvent(const TQString &, const TQString &, const TQString &);
        
  private slots:
    void slotBreakpointMarked(Document*, int);
    void slotBreakpointUnmarked(Document*, int);

  signals:
    void hideSplash();
};

#endif