00001 // Class QEvent 00002 // Filename QEvent.h 00003 // FaPra 2003-2004, A5, Alexander Kramer 00004 00005 #ifndef QEvent_h 00006 #define QEvent_h 00007 00008 00009 //! Pre-declaration of QEvent 00010 class QEvent; 00011 00012 00013 00014 //! enumeration of events 00015 enum QEventType {etDraw, etMouseDown, etMouseUp, etMouseMotion, etMouseClick, etKeyboard, etKeyboardUp, etSpecialKey }; 00016 00017 //! enumeration of mouse buttons 00018 enum QMouseButton {mbLeft, mbCenter, mbRight}; 00019 00020 00021 //! Event class, which holds the events 00022 class QEvent 00023 { 00024 protected: 00025 //! type of event 00026 QEventType Type; 00027 00028 //! mouse button 00029 QMouseButton Button; 00030 00031 //! mouse button x coordinate 00032 int X; 00033 00034 //! mouse button y coordinate 00035 int Y; 00036 00037 //! keyboard key 00038 int Key; 00039 00040 public: 00041 //! getter method for Type 00042 virtual QEventType getType(); 00043 00044 //! setter method for Type 00045 virtual void setType( QEventType newValue ); 00046 00047 //! getter method for Button 00048 virtual QMouseButton getButton(); 00049 00050 //! setter method for Button 00051 virtual void setButton( QMouseButton newValue ); 00052 00053 //! getter method for X 00054 virtual int getX(); 00055 00056 //! setter method for X 00057 virtual void setX( int newValue ); 00058 00059 //! getter method for Y 00060 virtual int getY(); 00061 00062 //! setter method for Y 00063 virtual void setY( int newValue ); 00064 00065 //! getter method for Key 00066 virtual int getKey(); 00067 00068 //! setter method for Key 00069 virtual void setKey( int newValue ); 00070 00071 //! copy itself from another instance 00072 void copyFrom( QEvent* from ); 00073 00074 //! prints itself to the cout 00075 void print(); 00076 00077 //! Constructor 00078 QEvent( ); 00079 00080 //! Destructor 00081 virtual ~QEvent(); 00082 00083 00084 }; 00085 #endif 00086
1.2.18