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     };
00056     
00062     class _OgreExport MouseListener : public EventListener
00063     {
00064     public :
00068         virtual void mouseClicked(MouseEvent* e) = 0;
00072         virtual void mouseEntered(MouseEvent* e) = 0;
00076         virtual void mouseExited(MouseEvent* e) = 0;
00077 
00081         virtual void mousePressed(MouseEvent* e) = 0;
00085         virtual void mouseReleased(MouseEvent* e) = 0;
00086 
00087         virtual void mouseDragEntered(MouseEvent* e) {};
00088         virtual void mouseDragExited(MouseEvent* e) {};
00089         virtual void mouseDragDropped(MouseEvent* e) {};
00090 
00091     };
00092 
00093 
00094     class _OgreExport KeyListener : public EventListener
00095     {
00096     protected:
00097 
00098     public :
00102         virtual void keyClicked(KeyEvent* e) = 0;
00106         virtual void keyPressed(KeyEvent* e) = 0;
00110         virtual void keyReleased(KeyEvent* e) = 0;
00114         virtual void keyFocusIn(KeyEvent* e) {}
00118         virtual void keyFocusOut(KeyEvent* e) {}
00119 
00120     };
00121 
00123     class _OgreExport MouseMotionListener : public EventListener
00124     {
00125     protected:
00126 
00127     public :
00131         virtual void mouseMoved(MouseEvent* e) = 0;
00135         virtual void mouseDragged(MouseEvent* e) = 0;
00139         virtual void mouseDragMoved(MouseEvent* e) {};
00140     };
00141 
00142 
00143 
00144 }
00145 
00146 
00147 #endif  // __MouseListener_H__

Copyright © 2000-2005 by The OGRE Team
Last modified Sun Apr 10 23:21:14 2005