~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/services/input/IInputAdapter.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-07-23 07:46:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090723074640-wh0ukzis0kda36qv
Tags: upstream-0.5.6
ImportĀ upstreamĀ versionĀ 0.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// C++ Interface: IInputAdapter
 
3
//
 
4
// Description: 
 
5
//
 
6
//
 
7
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2005
 
8
//
 
9
// This program is free software; you can redistribute it and/or modify
 
10
// it under the terms of the GNU General Public License as published by
 
11
// the Free Software Foundation; either version 2 of the License, or
 
12
// (at your option) any later version.
 
13
// 
 
14
// This program is distributed in the hope that it will be useful,
 
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
// GNU General Public License for more details.
 
18
// 
 
19
// You should have received a copy of the GNU General Public License
 
20
// along with this program; if not, write to the Free Software
 
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
 
22
//
 
23
#ifndef EMBEROGREIINPUTADAPTOR_H
 
24
#define EMBEROGREIINPUTADAPTOR_H
 
25
 
 
26
#include "Input.h"
 
27
 
 
28
#include <SDL.h>
 
29
 
 
30
 
 
31
namespace Ember {
 
32
 
 
33
 
 
34
/**
 
35
        @brief An adapter class which is used to listen to events from the Input class, when the system is in gui input mode.
 
36
        Use instances of this if you want to hook into the input system and override the default gui handling.
 
37
        @author Erik Hjortsberg <erik.hjortsberg@gmail.com>
 
38
*/
 
39
class IInputAdapter
 
40
{
 
41
public:
 
42
 
 
43
        virtual ~IInputAdapter() {}
 
44
        /**
 
45
         *    Injects a mouse move. Returns false if the event shouldn't be processed any more.
 
46
         * @param x 
 
47
         * @param y 
 
48
         * @return true if other IInputAdapters should continue handle the event, false if no more handling should happen
 
49
         */
 
50
        virtual bool injectMouseMove(const MouseMotion& motion, bool& freezeMouse) = 0;
 
51
        /**
 
52
         *    Injects a mouse button up event. Returns false if the event shouldn't be processed any more.
 
53
         * @param button 
 
54
         * @return true if other IInputAdapters should continue handle the event, false if no more handling should happen
 
55
         */
 
56
        virtual bool injectMouseButtonUp(const Input::MouseButton& button) = 0;
 
57
        /**
 
58
         *    Injects a mouse button down event. Returns false if the event shouldn't be processed any more.
 
59
         * @param button 
 
60
         * @return true if other IInputAdapters should continue handle the event, false if no more handling should happen
 
61
         */
 
62
        virtual bool injectMouseButtonDown(const Input::MouseButton& button) = 0;
 
63
        /**
 
64
         *    Injects a character. Returns false if the event shouldn't be processed any more.
 
65
         * @param character 
 
66
         * @return true if other IInputAdapters should continue handle the event, false if no more handling should happen
 
67
         */
 
68
        virtual bool injectChar(char character) = 0;
 
69
        /**
 
70
         *    Injects a key down event. Returns false if the event shouldn't be processed any more.
 
71
         * @param key 
 
72
         * @return true if other IInputAdapters should continue handle the event, false if no more handling should happen
 
73
         */
 
74
        virtual bool injectKeyDown(const SDLKey& key) = 0;
 
75
        /**
 
76
         *    Injects a key up event. Returns false if the event shouldn't be processed any more.
 
77
         * @param key 
 
78
         * @return true if other IInputAdapters should continue handle the event, false if no more handling should happen
 
79
         */
 
80
        virtual bool injectKeyUp(const SDLKey& key) = 0;
 
81
};
 
82
 
 
83
}
 
84
 
 
85
#endif