xref: /haiku/src/apps/debugger/user_interface/gui/team_window/BreakpointsView.h (revision 6eafb4b041ad79cb936b2041fdb9c56b1209cc10)
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 class BCheckBox;
16 
17 
18 class BreakpointsView : public BGroupView,
19 	private BreakpointListView::Listener {
20 public:
21 	class Listener;
22 
23 public:
24 								BreakpointsView(Team* team, Listener* listener);
25 								~BreakpointsView();
26 
27 	static	BreakpointsView*	Create(Team* team, Listener* listener);
28 									// throws
29 
30 			void				UnsetListener();
31 
32 			void				UserBreakpointChanged(
33 									UserBreakpoint* breakpoint);
34 			void				WatchpointChanged(
35 									Watchpoint* watchpoint);
36 
37 	virtual	void				MessageReceived(BMessage* message);
38 	virtual	void				AttachedToWindow();
39 
40 			void				LoadSettings(const BMessage& settings);
41 			status_t			SaveSettings(BMessage& settings);
42 
43 private:
44 	// BreakpointListView::Listener
45 	virtual	void				BreakpointSelectionChanged(
46 									BreakpointProxyList& proxies);
47 
48 			void				_Init();
49 
50 			void				_UpdateButtons();
51 
52 			void				_SetSelection(BreakpointProxyList& proxies);
53 			void				_HandleBreakpointAction(uint32 action);
54 private:
55 			Team*				fTeam;
56 			BreakpointListView*	fListView;
57 			BreakpointProxyList	fSelectedBreakpoints;
58 			BButton*			fConfigureExceptionsButton;
59 			BButton*			fToggleBreakpointButton;
60 			BButton*			fEditBreakpointButton;
61 			BButton*			fRemoveBreakpointButton;
62 			Listener*			fListener;
63 };
64 
65 
66 
67 class BreakpointsView::Listener {
68 public:
69 	virtual						~Listener();
70 
71 	virtual	void				BreakpointSelectionChanged(
72 									BreakpointProxyList& proxies) = 0;
73 	virtual	void				SetBreakpointEnabledRequested(
74 									UserBreakpoint* breakpoint,
75 									bool enabled) = 0;
76 	virtual	void				ClearBreakpointRequested(
77 									UserBreakpoint* breakpoint) = 0;
78 
79 	virtual	void				SetWatchpointEnabledRequested(
80 									Watchpoint* breakpoint,
81 									bool enabled) = 0;
82 	virtual	void				ClearWatchpointRequested(
83 									Watchpoint* watchpoint) = 0;
84 };
85 
86 
87 #endif	// BREAKPOINT_LIST_VIEW_H
88