00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: YSimpleEventHandler.h 00014 00015 Author: Stefan Hundhammer <sh@suse.de> 00016 00017 /-*/ 00018 00019 #ifndef YSimpleEventHandler_h 00020 #define YSimpleEventHandler_h 00021 00022 00023 class YEvent; 00024 class YWidget; 00025 00026 00032 class YSimpleEventHandler 00033 { 00034 public: 00035 00039 YSimpleEventHandler(); 00040 00046 virtual ~YSimpleEventHandler(); 00047 00061 void sendEvent( YEvent * event ); 00062 00066 bool eventPendingFor( YWidget * widget ) const; 00067 00073 YEvent * pendingEvent() const { return _pending_event; } 00074 00085 YEvent * consumePendingEvent(); 00086 00090 void clear(); 00091 00097 void blockEvents( bool block = true ); 00098 00103 void unblockEvents() { blockEvents( false ); } 00104 00108 bool eventsBlocked() const { return _events_blocked; } 00109 00110 00111 protected: 00112 00113 // Data members 00114 00115 YEvent * _pending_event; 00116 bool _events_blocked; 00117 }; 00118 00119 00120 00121 00122 #endif // YSimpleEventHandler_h