Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class 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 (c) 2000-2005 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 
00039 -------------------
00040 begin                : Nov 19 2002
00041 copyright            : (C) 2002 by Kenny Sabir
00042 email                : kenny@sparksuit.com
00043 ***************************************************************************/
00044 
00045 #ifndef __MouseListener_H__
00046 #define __MouseListener_H__
00047 
00048 #include "OgrePrerequisites.h"
00049 #include "OgreMouseEvent.h"
00050 
00051 namespace Ogre {
00052 
00053     class _OgreExport EventListener 
00054     {
00055     public:
00056         virtual ~EventListener() {}
00057     };
00058     
00064     class _OgreExport MouseListener : public EventListener
00065     {
00066     public :
00070         virtual void mouseClicked(MouseEvent* e) = 0;
00074         virtual void mouseEntered(MouseEvent* e) = 0;
00078         virtual void mouseExited(MouseEvent* e) = 0;
00079 
00083         virtual void mousePressed(MouseEvent* e) = 0;
00087         virtual void mouseReleased(MouseEvent* e) = 0;
00088 
00089         virtual void mouseDragEntered(MouseEvent* e) {};
00090         virtual void mouseDragExited(MouseEvent* e) {};
00091         virtual void mouseDragDropped(MouseEvent* e) {};
00092 
00093     };
00094 
00095 
00096     class _OgreExport KeyListener : public EventListener
00097     {
00098     protected:
00099 
00100     public :
00104         virtual void keyClicked(KeyEvent* e) = 0;
00108         virtual void keyPressed(KeyEvent* e) = 0;
00112         virtual void keyReleased(KeyEvent* e) = 0;
00116         virtual void keyFocusIn(KeyEvent* e) {}
00120         virtual void keyFocusOut(KeyEvent* e) {}
00121 
00122     };
00123 
00125     class _OgreExport MouseMotionListener : public EventListener
00126     {
00127     protected:
00128 
00129     public :
00133         virtual void mouseMoved(MouseEvent* e) = 0;
00137         virtual void mouseDragged(MouseEvent* e) = 0;
00141         virtual void mouseDragMoved(MouseEvent* e) {};
00142     };
00143 
00144 
00145 
00146 }
00147 
00148 
00149 #endif  // __MouseListener_H__

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:40 2006