xref: /haiku/src/apps/debugger/user_interface/gui/utility_windows/WatchPromptWindow.h (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1 /*
2  * Copyright 2012-2014, Rene Gollent, rene@gollent.com.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef WATCH_PROMPT_WINDOW_H
6 #define WATCH_PROMPT_WINDOW_H
7 
8 
9 #include <Window.h>
10 
11 #include "ExpressionInfo.h"
12 #include "types/Types.h"
13 
14 
15 class Architecture;
16 class BMenuField;
17 class BTextControl;
18 class SourceLanguage;
19 class Watchpoint;
20 class UserInterfaceListener;
21 
22 
23 class WatchPromptWindow : public BWindow, private ExpressionInfo::Listener
24 {
25 public:
26 								WatchPromptWindow(Architecture* architecture,
27 									target_addr_t address, uint32 type,
28 									int32 length,
29 									UserInterfaceListener* listener);
30 
31 								~WatchPromptWindow();
32 
33 	static	WatchPromptWindow*	Create(Architecture* architecture,
34 									target_addr_t address, uint32 type,
35 									int32 length,
36 									UserInterfaceListener* listener);
37 									// throws
38 
39 
40 	virtual	void				MessageReceived(BMessage* message);
41 
42 	virtual	void				Show();
43 
44 	// ExpressionInfo::Listener
45 	virtual	void				ExpressionEvaluated(ExpressionInfo* info,
46 									status_t result, ExpressionResult* value);
47 
48 private:
49 			void	 			_Init();
50 
51 
52 private:
53 			target_addr_t		fInitialAddress;
54 			uint32				fInitialType;
55 			int32				fInitialLength;
56 			Architecture*		fArchitecture;
57 			target_addr_t		fRequestedAddress;
58 			int32				fRequestedLength;
59 			BTextControl*		fAddressInput;
60 			BTextControl*		fLengthInput;
61 			ExpressionInfo*		fAddressExpressionInfo;
62 			ExpressionInfo*		fLengthExpressionInfo;
63 			BMenuField*			fTypeField;
64 			UserInterfaceListener* fListener;
65 			BButton*			fWatchButton;
66 			BButton*			fCancelButton;
67 			SourceLanguage*		fLanguage;
68 };
69 
70 #endif // WATCH_PROMPT_WINDOW_H
71