GHOST_IEvent.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version 2
  5. * of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software Foundation,
  14. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  15. *
  16. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  17. * All rights reserved.
  18. */
  19. /** \file
  20. * \ingroup GHOST
  21. * Declaration of GHOST_IEvent interface class.
  22. */
  23. #ifndef __GHOST_IEVENT_H__
  24. #define __GHOST_IEVENT_H__
  25. #include <stddef.h>
  26. #include "GHOST_Types.h"
  27. class GHOST_IWindow;
  28. /**
  29. * Interface class for events received from GHOST.
  30. * You should not need to inherit this class. The system will pass these events
  31. * to the GHOST_IEventConsumer::processEvent() method of event consumers.<br>
  32. * Use the getType() method to retrieve the type of event and the getData()
  33. * method to get the event data out. Using the event type you can cast the
  34. * event data to the correct event dat structure.
  35. * \see GHOST_IEventConsumer#processEvent
  36. * \see GHOST_TEventType
  37. */
  38. class GHOST_IEvent {
  39. public:
  40. /**
  41. * Destructor.
  42. */
  43. virtual ~GHOST_IEvent()
  44. {
  45. }
  46. /**
  47. * Returns the event type.
  48. * \return The event type.
  49. */
  50. virtual GHOST_TEventType getType() = 0;
  51. /**
  52. * Returns the time this event was generated.
  53. * \return The event generation time.
  54. */
  55. virtual GHOST_TUns64 getTime() = 0;
  56. /**
  57. * Returns the window this event was generated on,
  58. * or NULL if it is a 'system' event.
  59. * \return The generating window.
  60. */
  61. virtual GHOST_IWindow *getWindow() = 0;
  62. /**
  63. * Returns the event data.
  64. * \return The event data.
  65. */
  66. virtual GHOST_TEventDataPtr getData() = 0;
  67. #ifdef WITH_CXX_GUARDEDALLOC
  68. MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_IEvent")
  69. #endif
  70. };
  71. #endif // __GHOST_IEVENT_H__