1*20df96b0SRene Gollent /* 2*20df96b0SRene Gollent * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3*20df96b0SRene Gollent * Distributed under the terms of the MIT License. 4*20df96b0SRene Gollent */ 5*20df96b0SRene Gollent #ifndef VALUE_HANDLER_ROSTER_H 6*20df96b0SRene Gollent #define VALUE_HANDLER_ROSTER_H 7*20df96b0SRene Gollent 8*20df96b0SRene Gollent 9*20df96b0SRene Gollent #include <Locker.h> 10*20df96b0SRene Gollent #include <ObjectList.h> 11*20df96b0SRene Gollent 12*20df96b0SRene Gollent 13*20df96b0SRene Gollent class TableCellValueRenderer; 14*20df96b0SRene Gollent class Value; 15*20df96b0SRene Gollent class ValueFormatter; 16*20df96b0SRene Gollent class ValueHandler; 17*20df96b0SRene Gollent 18*20df96b0SRene Gollent 19*20df96b0SRene Gollent typedef BObjectList<ValueHandler> ValueHandlerList; 20*20df96b0SRene Gollent 21*20df96b0SRene Gollent 22*20df96b0SRene Gollent class ValueHandlerRoster { 23*20df96b0SRene Gollent public: 24*20df96b0SRene Gollent ValueHandlerRoster(); 25*20df96b0SRene Gollent ~ValueHandlerRoster(); 26*20df96b0SRene Gollent 27*20df96b0SRene Gollent static ValueHandlerRoster* Default(); 28*20df96b0SRene Gollent static status_t CreateDefault(); 29*20df96b0SRene Gollent static void DeleteDefault(); 30*20df96b0SRene Gollent 31*20df96b0SRene Gollent status_t Init(); 32*20df96b0SRene Gollent status_t RegisterDefaultHandlers(); 33*20df96b0SRene Gollent 34*20df96b0SRene Gollent status_t FindValueHandler(Value* value, 35*20df96b0SRene Gollent ValueHandler*& _handler); 36*20df96b0SRene Gollent // returns a reference 37*20df96b0SRene Gollent status_t GetValueFormatter(Value* value, 38*20df96b0SRene Gollent ValueFormatter*& _formatter); 39*20df96b0SRene Gollent // returns a reference 40*20df96b0SRene Gollent status_t GetTableCellValueRenderer(Value* value, 41*20df96b0SRene Gollent TableCellValueRenderer*& _renderer); 42*20df96b0SRene Gollent // returns a reference 43*20df96b0SRene Gollent 44*20df96b0SRene Gollent bool RegisterHandler(ValueHandler* handler); 45*20df96b0SRene Gollent void UnregisterHandler(ValueHandler* handler); 46*20df96b0SRene Gollent 47*20df96b0SRene Gollent private: 48*20df96b0SRene Gollent BLocker fLock; 49*20df96b0SRene Gollent ValueHandlerList fValueHandlers; 50*20df96b0SRene Gollent static ValueHandlerRoster* sDefaultInstance; 51*20df96b0SRene Gollent }; 52*20df96b0SRene Gollent 53*20df96b0SRene Gollent 54*20df96b0SRene Gollent #endif // VALUE_HANDLER_ROSTER_H 55