1 #ifndef FILEZILLA_INTERFACE_OPTION_CHANGE_EVENT_HANDLER_HEADER 2 #define FILEZILLA_INTERFACE_OPTION_CHANGE_EVENT_HANDLER_HEADER 3 4 #include "../include/optionsbase.h" 5 6 #include <wx/event.h> 7 8 class COptionChangeEventHandler 9 { 10 public: 11 COptionChangeEventHandler(COptionChangeEventHandler const&) = delete; 12 COptionChangeEventHandler(wxEvtHandler * handler)13 explicit COptionChangeEventHandler(wxEvtHandler* handler) 14 : handler_(*handler) 15 { 16 } 17 ~COptionChangeEventHandler()18 virtual ~COptionChangeEventHandler() {}; 19 20 void notify(watched_options && options); 21 22 protected: 23 virtual void OnOptionsChanged(watched_options const& options) = 0; 24 25 private: 26 wxEvtHandler& handler_; 27 }; 28 29 std::tuple<void*, watcher_notifier> get_option_watcher_notifier(COptionChangeEventHandler *); 30 31 #endif 32