xref: /haiku/src/apps/debugger/user_interface/gui/value/TableCellTextControlEditor.h (revision d0ac609964842f8cdb6d54b3c539c6c15293e172)
1 /*
2  * Copyright 2015, Rene Gollent, rene@gollent.com.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef TABLE_CELL_TEXT_CONTROL_EDITOR_H
6 #define TABLE_CELL_TEXT_CONTROL_EDITOR_H
7 
8 #include <TextControl.h>
9 
10 #include "TableCellFormattedValueEditor.h"
11 
12 
13 // common base class for editors that input a value via a text field
14 class TableCellTextControlEditor : public TableCellFormattedValueEditor,
15 	public BTextControl {
16 public:
17 								TableCellTextControlEditor(
18 									::Value* initialValue,
19 									ValueFormatter* formatter);
20 	virtual						~TableCellTextControlEditor();
21 
22 	status_t					Init();
23 
24 	virtual	BView*				GetView();
25 
26 	virtual	bool				ValidateInput() const = 0;
27 
28 	virtual status_t			GetValueForInput(::Value*& _output) const = 0;
29 									// returns reference
30 
31 	virtual	void				AttachedToWindow();
32 	virtual	void				MessageReceived(BMessage* message);
33 };
34 
35 #endif	// TABLE_CELL_TEXT_CONTROL_EDITOR_H
36