1b66f61afSRene Gollent /* 2b66f61afSRene Gollent * Copyright 2013-2015, Rene Gollent, rene@gollent.com. 3b66f61afSRene Gollent * Distributed under the terms of the MIT License. 4b66f61afSRene Gollent */ 5b66f61afSRene Gollent #ifndef SIGNALS_CONFIG_VIEW_H 6b66f61afSRene Gollent #define SIGNALS_CONFIG_VIEW_H 7b66f61afSRene Gollent 8b66f61afSRene Gollent 9b66f61afSRene Gollent #include <GroupView.h> 10b66f61afSRene Gollent 11b66f61afSRene Gollent #include "table/Table.h" 12b66f61afSRene Gollent 13b66f61afSRene Gollent #include "Team.h" 14b66f61afSRene Gollent 15b66f61afSRene Gollent #include "types/Types.h" 16b66f61afSRene Gollent 17b66f61afSRene Gollent 18b66f61afSRene Gollent class BButton; 19b66f61afSRene Gollent class BMenuField; 20*b3f2ebf0SRene Gollent class SignalDispositionEditWindow; 21b66f61afSRene Gollent class UserInterfaceListener; 22b66f61afSRene Gollent 23b66f61afSRene Gollent 24b66f61afSRene Gollent class SignalsConfigView : public BGroupView, private Team::Listener, 25b66f61afSRene Gollent private TableListener { 26b66f61afSRene Gollent public: 27b66f61afSRene Gollent SignalsConfigView(::Team* team, 28b66f61afSRene Gollent UserInterfaceListener* listener); 29b66f61afSRene Gollent 30b66f61afSRene Gollent ~SignalsConfigView(); 31b66f61afSRene Gollent 32b66f61afSRene Gollent static SignalsConfigView* Create(::Team* team, 33b66f61afSRene Gollent UserInterfaceListener* listener); 34b66f61afSRene Gollent // throws 35b66f61afSRene Gollent 36b66f61afSRene Gollent virtual void AttachedToWindow(); 37b66f61afSRene Gollent virtual void MessageReceived(BMessage* message); 38b66f61afSRene Gollent 39b66f61afSRene Gollent private: 40b66f61afSRene Gollent class SignalDispositionModel; 41b66f61afSRene Gollent 42b66f61afSRene Gollent private: 43*b3f2ebf0SRene Gollent // Team::Listener 44*b3f2ebf0SRene Gollent virtual void CustomSignalDispositionChanged( 45*b3f2ebf0SRene Gollent const Team::CustomSignalDispositionEvent& 46*b3f2ebf0SRene Gollent event); 47*b3f2ebf0SRene Gollent virtual void CustomSignalDispositionRemoved( 48*b3f2ebf0SRene Gollent const Team::CustomSignalDispositionEvent& 49*b3f2ebf0SRene Gollent event); 50*b3f2ebf0SRene Gollent 51*b3f2ebf0SRene Gollent // TableListener 52*b3f2ebf0SRene Gollent virtual void TableSelectionChanged(Table* table); 53*b3f2ebf0SRene Gollent 54b66f61afSRene Gollent void _Init(); 55b66f61afSRene Gollent 56b66f61afSRene Gollent void _UpdateSignalConfigState(); 57b66f61afSRene Gollent // must be called with team lock held 58b66f61afSRene Gollent 59b66f61afSRene Gollent private: 60b66f61afSRene Gollent ::Team* fTeam; 61b66f61afSRene Gollent UserInterfaceListener* fListener; 62b66f61afSRene Gollent BMenuField* fDefaultSignalDisposition; 63b66f61afSRene Gollent Table* fDispositionExceptions; 64b66f61afSRene Gollent BButton* fAddDispositionButton; 65b66f61afSRene Gollent BButton* fEditDispositionButton; 66b66f61afSRene Gollent BButton* fRemoveDispositionButton; 67b66f61afSRene Gollent SignalDispositionModel* fDispositionModel; 68*b3f2ebf0SRene Gollent SignalDispositionEditWindow* fEditWindow; 69b66f61afSRene Gollent }; 70b66f61afSRene Gollent 71b66f61afSRene Gollent 72b66f61afSRene Gollent #endif // SIGNALS_CONFIG_VIEW_H 73