2012-06-10 16:50:54 +00:00
|
|
|
/*
|
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
2016-09-07 14:24:00 +00:00
|
|
|
* Copyright (C) 2012-2016 Symless Ltd.
|
2012-09-04 02:09:56 +00:00
|
|
|
* Copyright (C) 2002 Chris Schoeneman
|
2024-07-02 19:07:06 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2015-05-03 02:33:52 +00:00
|
|
|
* found in the file LICENSE that should have accompanied this file.
|
2024-07-02 19:07:06 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-02-28 12:36:45 +00:00
|
|
|
#pragma once
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2014-02-28 12:36:45 +00:00
|
|
|
#include "base/Event.h"
|
|
|
|
|
#include "base/EventTypes.h"
|
2024-07-02 19:07:06 +00:00
|
|
|
#include "base/String.h"
|
|
|
|
|
#include "server/BaseClientProxy.h"
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
namespace synergy {
|
|
|
|
|
class IStream;
|
|
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
//! Generic proxy for client
|
2014-11-11 13:51:47 +00:00
|
|
|
class ClientProxy : public BaseClientProxy {
|
2012-06-10 16:50:54 +00:00
|
|
|
public:
|
2024-07-02 19:07:06 +00:00
|
|
|
/*!
|
|
|
|
|
\c name is the name of the client.
|
|
|
|
|
*/
|
|
|
|
|
ClientProxy(const String &name, synergy::IStream *adoptedStream);
|
|
|
|
|
ClientProxy(ClientProxy const &) = delete;
|
|
|
|
|
ClientProxy(ClientProxy &&) = delete;
|
|
|
|
|
~ClientProxy();
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
ClientProxy &operator=(ClientProxy const &) = delete;
|
|
|
|
|
ClientProxy &operator=(ClientProxy &&) = delete;
|
2020-11-03 10:52:56 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! @name manipulators
|
|
|
|
|
//@{
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Disconnect
|
|
|
|
|
/*!
|
|
|
|
|
Ask the client to disconnect, using \p msg as the reason.
|
|
|
|
|
*/
|
|
|
|
|
void close(const char *msg);
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//@}
|
|
|
|
|
//! @name accessors
|
|
|
|
|
//@{
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Get stream
|
|
|
|
|
/*!
|
|
|
|
|
Returns the original stream passed to the c'tor.
|
|
|
|
|
*/
|
|
|
|
|
synergy::IStream *getStream() const override;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//@}
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
// IScreen
|
|
|
|
|
void *getEventTarget() const override;
|
|
|
|
|
bool getClipboard(ClipboardID id, IClipboard *) const override = 0;
|
2024-07-16 13:36:44 +00:00
|
|
|
void getShape(
|
|
|
|
|
SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const override = 0;
|
2024-07-02 19:07:06 +00:00
|
|
|
void getCursorPos(SInt32 &x, SInt32 &y) const override = 0;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
// IClient overrides
|
2024-07-16 13:36:44 +00:00
|
|
|
void enter(
|
|
|
|
|
SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask,
|
|
|
|
|
bool forScreensaver) override = 0;
|
2024-07-02 19:07:06 +00:00
|
|
|
bool leave() override = 0;
|
|
|
|
|
void setClipboard(ClipboardID, const IClipboard *) override = 0;
|
|
|
|
|
void grabClipboard(ClipboardID) override = 0;
|
|
|
|
|
void setClipboardDirty(ClipboardID, bool) override = 0;
|
|
|
|
|
void keyDown(KeyID, KeyModifierMask, KeyButton, const String &) override = 0;
|
2024-07-16 13:36:44 +00:00
|
|
|
void keyRepeat(
|
|
|
|
|
KeyID, KeyModifierMask, SInt32 count, KeyButton,
|
|
|
|
|
const String &lang) override = 0;
|
2024-07-02 19:07:06 +00:00
|
|
|
void keyUp(KeyID, KeyModifierMask, KeyButton) override = 0;
|
|
|
|
|
void mouseDown(ButtonID) override = 0;
|
|
|
|
|
void mouseUp(ButtonID) override = 0;
|
|
|
|
|
void mouseMove(SInt32 xAbs, SInt32 yAbs) override = 0;
|
|
|
|
|
void mouseRelativeMove(SInt32 xRel, SInt32 yRel) override = 0;
|
|
|
|
|
void mouseWheel(SInt32 xDelta, SInt32 yDelta) override = 0;
|
|
|
|
|
void screensaver(bool activate) override = 0;
|
|
|
|
|
void resetOptions() override = 0;
|
|
|
|
|
void setOptions(const OptionsList &options) override = 0;
|
2024-07-16 13:36:44 +00:00
|
|
|
void
|
|
|
|
|
sendDragInfo(UInt32 fileCount, const char *info, size_t size) override = 0;
|
2024-07-02 19:07:06 +00:00
|
|
|
void fileChunkSending(UInt8 mark, char *data, size_t dataSize) override = 0;
|
|
|
|
|
void secureInputNotification(const String &app) const override = 0;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
private:
|
2024-07-02 19:07:06 +00:00
|
|
|
synergy::IStream *m_stream;
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|