libyui
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends

YEvent Class Reference

#include <YEvent.h>

Inheritance diagram for YEvent:
YCancelEvent YDebugEvent YKeyEvent YMenuEvent YTimeoutEvent YWidgetEvent

List of all members.

Public Types

enum  EventType {
  NoEvent = 0, UnknownEvent, WidgetEvent, MenuEvent,
  KeyEvent, CancelEvent, TimeoutEvent, DebugEvent,
  InvalidEvent = 0x4242
}
enum  EventReason {
  UnknownReason = 0, Activated, SelectionChanged, ValueChanged,
  ContextMenuActivated
}

Public Member Functions

 YEvent (EventType eventType=UnknownEvent)
EventType eventType () const
unsigned long serial () const
virtual YWidgetwidget () const
virtual YItemitem () const
YDialogdialog () const
bool isValid () const

Static Public Member Functions

static const char * toString (EventType eventType)
static const char * toString (EventReason reason)

Protected Member Functions

void setDialog (YDialog *dia)
virtual ~YEvent ()
void invalidate ()

Friends

void YDialog::deleteEvent (YEvent *event)
void YSimpleEventHandler::deleteEvent (YEvent *event)

Detailed Description

Abstract base class for events to be returned upon UI::UserInput() and related functions.


Constructor & Destructor Documentation

YEvent::YEvent ( EventType  eventType = UnknownEvent)

Constructor.

YEvent::~YEvent ( ) [protected, virtual]

Protected destructor - events can only be deleted via YDialog::deleteEvent(). The associated dialog will take care of this event and delete it when appropriate.

This desctructor is virtual to force a polymorph object so dynamic_cast<> can be used.


Member Function Documentation

YDialog* YEvent::dialog ( ) const [inline]

Return the dialog this event belongs to or 0 if no dialog was set yet.

EventType YEvent::eventType ( ) const [inline]

Returns the event type.

void YEvent::invalidate ( ) [protected]

Mark this event as invalid. This cannot be undone.

bool YEvent::isValid ( ) const

Check if this event is valid. Events become invalid in the destructor.

virtual YItem* YEvent::item ( ) const [inline, virtual]

Return the YItem that corresponds to this event or 0 if there is none.

This default implementation always returns 0. Subclasses that actually return items should overwrite this method.

Reimplemented in YMenuEvent.

unsigned long YEvent::serial ( ) const [inline]

Returns the unique serial no. of this event. This is mainly useful for debugging.

void YEvent::setDialog ( YDialog dia) [inline, protected]

Set the dialog this event belongs to.

const char * YEvent::toString ( EventType  eventType) [static]

Returns the character representation of an event type.

const char * YEvent::toString ( EventReason  reason) [static]

Returns the character representation of an event reason.

virtual YWidget* YEvent::widget ( ) const [inline, virtual]

Returns the widget that caused this event or 0 if there is none.

This default implementation always returns 0. Subclasses that actually return widgets should overwrite this method.

Reimplemented in YWidgetEvent.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Friends