xref: /haiku/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h (revision c90684742e7361651849be4116d0e5de3a817194)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef BREAKPOINTS_VIEW_H
6 #define BREAKPOINTS_VIEW_H
7 
8 
9 #include <GroupView.h>
10 
11 #include "BreakpointListView.h"
12 
13 
14 class BButton;
15 
16 
17 class BreakpointsView : public BGroupView,
18 	private BreakpointListView::Listener {
19 public:
20 	class Listener;
21 
22 public:
23 								BreakpointsView(Team* team, Listener* listener);
24 								~BreakpointsView();
25 
26 	static	BreakpointsView*	Create(Team* team, Listener* listener);
27 									// throws
28 
29 			void				UnsetListener();
30 
31 			void				SetBreakpoint(UserBreakpoint* breakpoint);
32 			void				UserBreakpointChanged(
33 									UserBreakpoint* breakpoint);
34 
35 	virtual	void				MessageReceived(BMessage* message);
36 	virtual	void				AttachedToWindow();
37 
38 private:
39 	// BreakpointListView::Listener
40 	virtual	void				BreakpointSelectionChanged(
41 									UserBreakpoint* breakpoint);
42 
43 			void				_Init();
44 
45 			void				_UpdateButtons();
46 
47 private:
48 			Team*				fTeam;
49 			UserBreakpoint*		fBreakpoint;
50 			BreakpointListView*	fListView;
51 			BButton*			fToggleBreakpointButton;
52 			BButton*			fRemoveBreakpointButton;
53 			Listener*			fListener;
54 };
55 
56 
57 class BreakpointsView::Listener {
58 public:
59 	virtual						~Listener();
60 
61 	virtual	void				BreakpointSelectionChanged(
62 									UserBreakpoint* breakpoint) = 0;
63 	virtual	void				SetBreakpointEnabledRequested(
64 									UserBreakpoint* breakpoint,
65 									bool enabled) = 0;
66 	virtual	void				ClearBreakpointRequested(
67 									UserBreakpoint* breakpoint) = 0;
68 };
69 
70 
71 #endif	// BREAKPOINT_LIST_VIEW_H
72