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