2002-08-02 19:57:46 +00:00
|
|
|
/*
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
|
|
|
* Copyright (C) 2002 Chris Schoeneman
|
|
|
|
*
|
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* found in the file COPYING that should have accompanied this file.
|
|
|
|
*
|
|
|
|
* This package is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2002-07-13 22:00:38 +00:00
|
|
|
#ifndef ISCREENEVENTHANDLER_H
|
|
|
|
#define ISCREENEVENTHANDLER_H
|
|
|
|
|
|
|
|
#include "IInterface.h"
|
|
|
|
|
|
|
|
// the platform screen should define this
|
|
|
|
class CEvent;
|
|
|
|
|
|
|
|
class IScreen;
|
|
|
|
|
2002-07-29 16:07:26 +00:00
|
|
|
//! Screen event handler interface
|
|
|
|
/*!
|
|
|
|
This is the interface through which IScreen sends notification of events.
|
|
|
|
Each platform will derive two types from IScreenEventHandler, one
|
|
|
|
for handling events on the primary screen and one for the
|
|
|
|
secondary screen. The header file with the IScreen subclass for
|
|
|
|
each platform should define the CEvent type, which depends on the
|
|
|
|
type of native events for that platform.
|
|
|
|
*/
|
2002-07-13 22:00:38 +00:00
|
|
|
class IScreenEventHandler : public IInterface {
|
|
|
|
public:
|
2002-07-29 16:07:26 +00:00
|
|
|
//! @name manipulators
|
|
|
|
//@{
|
2002-07-13 22:00:38 +00:00
|
|
|
|
2002-07-29 16:07:26 +00:00
|
|
|
//! Notify of screen saver change
|
|
|
|
/*!
|
|
|
|
Called when the screensaver is activated or deactivated.
|
|
|
|
*/
|
2002-07-13 22:00:38 +00:00
|
|
|
virtual void onScreensaver(bool activated) = 0;
|
|
|
|
|
2002-07-29 16:07:26 +00:00
|
|
|
//! Event filtering
|
|
|
|
/*!
|
|
|
|
Called for each event before event translation and dispatch. Return
|
|
|
|
true to skip translation and dispatch. Subclasses should call the
|
|
|
|
superclass's version first and return true if it returns true.
|
|
|
|
*/
|
2002-07-13 22:00:38 +00:00
|
|
|
virtual bool onPreDispatch(const CEvent* event) = 0;
|
|
|
|
|
2002-07-29 16:07:26 +00:00
|
|
|
//! Event handling
|
|
|
|
/*!
|
|
|
|
Called to handle an event. Iff the event was handled return true and
|
|
|
|
store the result, if any, in event->m_result, which defaults to zero.
|
|
|
|
*/
|
2002-07-13 22:00:38 +00:00
|
|
|
virtual bool onEvent(CEvent* event) = 0;
|
2002-07-15 15:01:36 +00:00
|
|
|
|
2003-02-22 21:53:25 +00:00
|
|
|
//! Notify of one-shot timer expiration
|
|
|
|
/*!
|
|
|
|
Called when a one-shot timer expires.
|
|
|
|
*/
|
|
|
|
virtual void onOneShotTimerExpired(UInt32 id) = 0;
|
|
|
|
|
2002-07-29 16:07:26 +00:00
|
|
|
//@}
|
|
|
|
//! @name accessors
|
|
|
|
//@{
|
2002-07-15 15:01:36 +00:00
|
|
|
|
2002-07-29 16:07:26 +00:00
|
|
|
//! Get jump zone size
|
|
|
|
/*!
|
|
|
|
Called to get the jump zone size.
|
|
|
|
*/
|
2002-07-15 15:01:36 +00:00
|
|
|
virtual SInt32 getJumpZoneSize() const = 0;
|
2002-07-29 16:07:26 +00:00
|
|
|
|
|
|
|
//@}
|
2002-07-13 22:00:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|