Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreEventListeners.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 /***************************************************************************
00027 OgreEventListeners.h  -  
00028     This file contains definatitions of all the different EventListeners.
00029     They are all included in 1 file, due to their small size.
00030 
00031     They all inherit from an abstract base listener called EventListener.
00032 
00033     So far we have the following listeners:
00034         MouseListener - handles mouse buttons clicked, pressed released,
00035                         and mouse entered,exited, 
00036         MouseMotionListener - handles mouse move and mouse drag
00037         ActionListener - Used for buttons, when pressed and released.
00038         ListSelectionListener - Used when a list item is selected.
00039 
00040 -------------------
00041 begin                : Nov 19 2002
00042 copyright            : (C) 2002 by Kenny Sabir
00043 email                : kenny@sparksuit.com
00044 ***************************************************************************/
00045 
00046 #ifndef __MouseListener_H__
00047 #define __MouseListener_H__
00048 
00049 #include "OgrePrerequisites.h"
00050 #include "OgreMouseEvent.h"
00051 #include "OgreActionEvent.h"
00052 #include "OgreScrollEvent.h"
00053 
00054 namespace Ogre {
00055 
00059     class _OgreExport EventListener 
00060     {
00064     public:
00065         virtual bool isMulticaster() const
00066         { return false; }
00067 
00068     };
00069     
00075     class _OgreExport MouseListener : public EventListener
00076     {
00077     protected:
00078 
00079     public :
00083         virtual void mouseClicked(MouseEvent* e) = 0;
00087         virtual void mouseEntered(MouseEvent* e) = 0;
00091         virtual void mouseExited(MouseEvent* e) = 0;
00092 
00096         virtual void mousePressed(MouseEvent* e) = 0;
00100         virtual void mouseReleased(MouseEvent* e) = 0;
00101 
00102         virtual void mouseDragEntered(MouseEvent* e) {};
00103         virtual void mouseDragExited(MouseEvent* e) {};
00104         virtual void mouseDragDropped(MouseEvent* e) {};
00105 
00106     };
00107 
00108 
00109     class _OgreExport KeyListener : public EventListener
00110     {
00111     protected:
00112 
00113     public :
00117         virtual void keyClicked(KeyEvent* e) = 0;
00121         virtual void keyPressed(KeyEvent* e) = 0;
00125         virtual void keyReleased(KeyEvent* e) = 0;
00129         virtual void keyFocusIn(KeyEvent* e) {}
00133         virtual void keyFocusOut(KeyEvent* e) {}
00134 
00135     };
00136 
00138     class _OgreExport MouseMotionListener : public EventListener
00139     {
00140     protected:
00141 
00142     public :
00146         virtual void mouseMoved(MouseEvent* e) = 0;
00150         virtual void mouseDragged(MouseEvent* e) = 0;
00154         virtual void mouseDragMoved(MouseEvent* e) {};
00155     };
00156 
00158     class _OgreExport ActionListener : public EventListener
00159     {
00160     protected:
00161 
00162     public :
00163 
00167         virtual void actionPerformed(ActionEvent* e) = 0;
00168     };
00169 
00171     class _OgreExport ListSelectionListener : public EventListener
00172     {
00173     protected:
00174 
00175     public :
00176 
00180         virtual void listSelected(ListSelectionEvent* e) = 0;
00181     };
00182 
00183     class _OgreExport ScrollListener : public EventListener
00184     {
00185     protected:
00186 
00187     public :
00188 
00192         virtual void scrollPerformed(ScrollEvent* e) = 0;
00193     };
00194 
00195 
00196 }
00197 
00198 
00199 #endif  // __MouseListener_H__

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:10 2004