xref: /haiku/src/apps/debugger/user_interface/gui/team_window/StackTraceView.h (revision 93f521060e787cee01f28504dde672951e2c7f5e)
1e3a631c0SIngo Weinhold /*
2e3a631c0SIngo Weinhold  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3e3a631c0SIngo Weinhold  * Distributed under the terms of the MIT License.
4e3a631c0SIngo Weinhold  */
5e3a631c0SIngo Weinhold #ifndef STACK_TRACE_VIEW_H
6e3a631c0SIngo Weinhold #define STACK_TRACE_VIEW_H
7e3a631c0SIngo Weinhold 
8e3a631c0SIngo Weinhold #include <GroupView.h>
9e3a631c0SIngo Weinhold 
10e3a631c0SIngo Weinhold #include "table/Table.h"
11e3a631c0SIngo Weinhold #include "Team.h"
12e3a631c0SIngo Weinhold 
13e3a631c0SIngo Weinhold 
14e3a631c0SIngo Weinhold class StackFrame;
15e3a631c0SIngo Weinhold 
16e3a631c0SIngo Weinhold 
17e3a631c0SIngo Weinhold class StackTraceView : public BGroupView, private TableListener {
18e3a631c0SIngo Weinhold public:
19e3a631c0SIngo Weinhold 	class Listener;
20e3a631c0SIngo Weinhold 
21e3a631c0SIngo Weinhold public:
22e3a631c0SIngo Weinhold 								StackTraceView(Listener* listener);
23e3a631c0SIngo Weinhold 								~StackTraceView();
24e3a631c0SIngo Weinhold 
25e3a631c0SIngo Weinhold 	static	StackTraceView*		Create(Listener* listener);
26e3a631c0SIngo Weinhold 									// throws
27e3a631c0SIngo Weinhold 
28e3a631c0SIngo Weinhold 			void				UnsetListener();
29e3a631c0SIngo Weinhold 
30e3a631c0SIngo Weinhold 			void				SetStackTrace(StackTrace* stackTrace);
31e3a631c0SIngo Weinhold 			void				SetStackFrame(StackFrame* stackFrame);
32e3a631c0SIngo Weinhold 
3311102e38SRene Gollent 			void				LoadSettings(const BMessage& settings);
3411102e38SRene Gollent 			status_t			SaveSettings(BMessage& settings);
3511102e38SRene Gollent 
36*a7376ac1SRene Gollent 			void				SetStackTraceClearPending();
37fcf72bc4SRene Gollent 
38e3a631c0SIngo Weinhold private:
39e3a631c0SIngo Weinhold 			class FramesTableModel;
40e3a631c0SIngo Weinhold 
41e3a631c0SIngo Weinhold private:
42e3a631c0SIngo Weinhold 	// TableListener
43e3a631c0SIngo Weinhold 	virtual	void				TableSelectionChanged(Table* table);
44e3a631c0SIngo Weinhold 
45e3a631c0SIngo Weinhold 			void				_Init();
46e3a631c0SIngo Weinhold 
47e3a631c0SIngo Weinhold private:
48e3a631c0SIngo Weinhold 			StackTrace*			fStackTrace;
49e3a631c0SIngo Weinhold 			Table*				fFramesTable;
50e3a631c0SIngo Weinhold 			FramesTableModel*	fFramesTableModel;
51*a7376ac1SRene Gollent 			bool				fTraceClearPending;
52e3a631c0SIngo Weinhold 			Listener*			fListener;
53e3a631c0SIngo Weinhold };
54e3a631c0SIngo Weinhold 
55e3a631c0SIngo Weinhold 
56e3a631c0SIngo Weinhold class StackTraceView::Listener {
57e3a631c0SIngo Weinhold public:
58e3a631c0SIngo Weinhold 	virtual						~Listener();
59e3a631c0SIngo Weinhold 
60e3a631c0SIngo Weinhold 	virtual	void				StackFrameSelectionChanged(
61e3a631c0SIngo Weinhold 									StackFrame* frame) = 0;
62e3a631c0SIngo Weinhold };
63e3a631c0SIngo Weinhold 
64e3a631c0SIngo Weinhold 
65e3a631c0SIngo Weinhold #endif	// STACK_TRACE_VIEW_H
66