YSimpleEventHandler Class Reference

Simple event handler suitable for most UIs. This event handler keeps track of one single event that gets overwritten when a new one arrives. More...

#include <YSimpleEventHandler.h>

List of all members.

Public Member Functions

 YSimpleEventHandler ()
virtual ~YSimpleEventHandler ()
void sendEvent (YEvent *event)
bool eventPendingFor (YWidget *widget) const
YEventpendingEvent () const
YEventconsumePendingEvent ()
void clear ()
void blockEvents (bool block=true)
void unblockEvents ()
bool eventsBlocked () const

Protected Attributes

YEvent_pending_event
bool _events_blocked


Detailed Description

Simple event handler suitable for most UIs. This event handler keeps track of one single event that gets overwritten when a new one arrives.


Constructor & Destructor Documentation

YSimpleEventHandler::YSimpleEventHandler  ) 
 

Constructor.

YSimpleEventHandler::~YSimpleEventHandler  )  [virtual]
 

Destructor.

If there is a pending event, it is deleted here.


Member Function Documentation

void YSimpleEventHandler::blockEvents bool  block = true  ) 
 

Block (or unblock) events. If events are blocked, any event sent with sendEvent() from now on is ignored (and will get lost) until events are unblocked again.

void YSimpleEventHandler::clear  ) 
 

Clears any pending event (deletes the corresponding object).

YEvent * YSimpleEventHandler::consumePendingEvent  ) 
 

Consumes the pending event. Sets the internal pending event to 0. Does NOT delete the internal consuming event.

The caller assumes ownership of the object this pending event points to. In particular, he has to take care to delete that object when he is done processing it.

Returns the pending event or 0 if there is none.

bool YSimpleEventHandler::eventPendingFor YWidget widget  )  const
 

Returns 'true' if there is any event pending for the specified widget.

bool YSimpleEventHandler::eventsBlocked  )  const [inline]
 

Returns 'true' if events are currently blocked.

YEvent* YSimpleEventHandler::pendingEvent  )  const [inline]
 

Returns the last event that isn't processed yet or 0 if there is none.

This event handler keeps track of only one single (the last one) event.

void YSimpleEventHandler::sendEvent YEvent event  ) 
 

Widget event handlers call this when an event occured that should be the answer to a UserInput() / PollInput() (etc.) call.

The UI assumes ownership of the event object that 'event' points to, so the event MUST be created with new(). The UI is to take care to delete the event after it has been processed.

If events are blocked (see blockEvents() ), the event sent with this function will be ignored (but safely deleted - no memory leak).

It is an error to pass 0 for 'event'.

void YSimpleEventHandler::unblockEvents  )  [inline]
 

Unblock events previously blocked. This is just an alias for blockEvents( false) for better readability.


Member Data Documentation

bool YSimpleEventHandler::_events_blocked [protected]
 

YEvent* YSimpleEventHandler::_pending_event [protected]
 


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 18:07:47 2006 for yast2-core by  doxygen 1.4.6