1
/***************************************************************************
2
begin : Tue May 13 2003
3
copyright : (C) 2003 by John Birch
4
email : jbb@kdevelop.org
5
***************************************************************************/
7
/***************************************************************************
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
***************************************************************************/
16
#ifndef _GDBBreakpointWidget_H_
17
#define _GDBBreakpointWidget_H_
20
#include <qpopupmenu.h>
22
#include <qguardedptr.h>
23
#include <qvaluevector.h>
26
#include "gdbcontroller.h"
33
/***************************************************************************/
34
/***************************************************************************/
35
/***************************************************************************/
40
class BreakpointTableRow;
44
class GDBBreakpointWidget : public QHBox
49
GDBBreakpointWidget( GDBController* controller,
50
QWidget* parent=0, const char* name=0 );
51
virtual ~GDBBreakpointWidget();
55
void savePartialProjectSession(QDomElement* el);
56
void restorePartialProjectSession(const QDomElement* el);
58
bool hasWatchpointForAddress(unsigned long long address) const;
62
// Connected to from the editor widget:
63
void slotToggleBreakpoint(const QString &filename, int lineNum);
64
void slotToggleBreakpointEnabled(const QString &fileName, int lineNum);
66
// Connected to from the variable widget:
67
void slotToggleWatchpoint(const QString &varName);
69
void slotBreakpointSet(Breakpoint*);
71
void slotRefreshBP(const KURL &filename);
73
void slotBreakpointHit(int id);
77
virtual void focusInEvent(QFocusEvent *e);
80
friend class BreakpointActionCell; // for access to slotNewValue
82
void slotRemoveBreakpoint();
83
void slotRemoveAllBreakpoints();
84
void slotEditBreakpoint(const QString &fileName, int lineNum);
85
void slotEditBreakpoint();
86
void slotAddBlankBreakpoint(int idx);
87
void slotRowDoubleClicked(int row, int col, int button, const QPoint & mousePos);
88
void slotContextMenuShow( int row, int col, const QPoint &mousePos );
89
void slotContextMenuSelect( int item );
90
void slotEditRow(int row, int col, const QPoint & mousePos);
91
void slotNewValue(int row, int col);
92
void editTracing(QTableItem* item);
93
void slotBreakpointModified(Breakpoint*);
95
void slotEvent(GDBController::event_t);
96
void slotWatchpointHit(int id,
97
const QString& oldValue,
98
const QString& newValue);
101
void publishBPState(const Breakpoint& brkpt);
102
void refreshBPState(const Breakpoint& brkpt);
103
void gotoSourcePosition(const QString &fileName, int lineNum);
104
// Emitted when output from yet another passed tracepoint is available.
105
void tracingOutput(const char*);
108
BreakpointTableRow* find(Breakpoint *bp);
109
BreakpointTableRow* findId(int id);
110
BreakpointTableRow* findKey(int BPKey);
113
BreakpointTableRow* addBreakpoint(Breakpoint *bp);
114
void removeBreakpoint(BreakpointTableRow* btr);
116
void sendToGdb(Breakpoint &);
118
void handleBreakpointList(const GDBMI::ResultRecord&);
119
void handleTracingPrintf(const QValueVector<QString>& s);
122
GDBController* controller_;
125
QPopupMenu* m_ctxMenu;
128
class BreakpointTableRow;
130
/** Custom table cell class for cells that require complex editing.
131
When current, the cell shows a "..." on the right. When clicked,
132
the 'edit' signal is emitted that can be be used to pop-up
135
When editing is done, the receiver of 'edit' should change the
136
value in the table, and then call the 'updateValue' method.
138
class ComplexEditCell : public QObject, public QTableItem
143
ComplexEditCell(QTable* table);
145
/** Called by Qt when the current cell should become editable.
146
In our case, when the item becomes current. Creates a widget
147
that will be shown in the cell and should be able to edit cell
148
content. In our case -- text plus "..." button that invokes
151
QWidget* createEditor() const;
157
/** Called when the "..." button is clicked. */
161
void edit(QTableItem*);
164
mutable QGuardedPtr<QLabel> label_;
168
/***************************************************************************/
169
/***************************************************************************/
170
/***************************************************************************/