xref: /haiku/src/apps/debugger/user_interface/gui/value/value_handlers/IntegerValueHandler.h (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
1 /*
2  * Copyright 2015, Rene Gollent, rene@gollent.com.
3  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef INTEGER_VALUE_HANDLER_H
7 #define INTEGER_VALUE_HANDLER_H
8 
9 
10 #include "IntegerValueFormatter.h"
11 #include "ValueHandler.h"
12 
13 
14 class IntegerValue;
15 class IntegerValueFormatter;
16 class OptionsSettingImpl;
17 class SettingsDescription;
18 
19 
20 class IntegerValueHandler : public ValueHandler {
21 public:
22 								IntegerValueHandler();
23 								~IntegerValueHandler();
24 
25 			status_t			Init();
26 
27 	virtual	float				SupportsValue(Value* value);
28 	virtual	status_t			GetValueFormatter(Value* value,
29 									ValueFormatter*& _formatter);
30 	virtual	status_t			GetTableCellValueRenderer(Value* value,
31 									TableCellValueRenderer*& _renderer);
32 	virtual	status_t			GetTableCellValueEditor(Value* value,
33 									Settings* settings,
34 									TableCellValueEditor*& _editor);
35 	virtual	status_t			CreateTableCellValueSettingsMenu(Value* value,
36 									Settings* settings, SettingsMenu*& _menu);
37 
38 protected:
39 	virtual	integer_format		DefaultIntegerFormat(IntegerValue* value);
40 	virtual	status_t			AddIntegerFormatSettingOptions(
41 									IntegerValue* value,
42 									OptionsSettingImpl* setting);
43 	virtual	status_t			CreateValueFormatter(
44 									IntegerValueFormatter::Config* config,
45 									ValueFormatter*& _formatter);
46 	virtual	status_t			CreateTableCellValueRenderer(
47 									IntegerValue* value,
48 									IntegerValueFormatter::Config* config,
49 									TableCellValueRenderer*& _renderer);
50 	virtual	status_t			CreateIntegerFormatterConfig(
51 									IntegerValue* value,
52 									IntegerValueFormatter::Config*& _config);
53 
54 			status_t			AddIntegerFormatOption(
55 									OptionsSettingImpl* setting, const char* id,
56 									const char* name, integer_format format);
57 
58 private:
59 			class FormatOption;
60 			class IntegerFormatterConfig;
61 
62 private:
63 			SettingsDescription* _CreateTableCellSettingsDescription(
64 									IntegerValue* value);
65 };
66 
67 
68 #endif	// INTEGER_VALUE_HANDLER_H
69