• Main Page
  • Classes
  • Files
  • File List

CClientProxyUnknown.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2012 Bolton Software Ltd.
00004  * Copyright (C) 2004 Chris Schoeneman
00005  * 
00006  * This package is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * found in the file COPYING that should have accompanied this file.
00009  * 
00010  * This package is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #ifndef CCLIENTPROXYUNKNOWN_H
00020 #define CCLIENTPROXYUNKNOWN_H
00021 
00022 #include "CEvent.h"
00023 
00024 class CClientProxy;
00025 class CEventQueueTimer;
00026 namespace synergy { class IStream; }
00027 class CServer;
00028 
00029 class CClientProxyUnknown {
00030 public:
00031     CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server);
00032     ~CClientProxyUnknown();
00033 
00035 
00036 
00038 
00043     CClientProxy*       orphanClientProxy();
00044 
00046 
00047 
00048 
00050 
00054     static CEvent::Type getSuccessEvent();
00055 
00057 
00061     static CEvent::Type getFailureEvent();
00062 
00064 
00065 private:
00066     void                sendSuccess();
00067     void                sendFailure();
00068     void                addStreamHandlers();
00069     void                addProxyHandlers();
00070     void                removeHandlers();
00071     void                removeTimer();
00072     void                handleData(const CEvent&, void*);
00073     void                handleWriteError(const CEvent&, void*);
00074     void                handleTimeout(const CEvent&, void*);
00075     void                handleDisconnect(const CEvent&, void*);
00076     void                handleReady(const CEvent&, void*);
00077 
00078 private:
00079     synergy::IStream*   m_stream;
00080     CEventQueueTimer*   m_timer;
00081     CClientProxy*       m_proxy;
00082     bool                m_ready;
00083 
00084     static CEvent::Type s_successEvent;
00085     static CEvent::Type s_failureEvent;
00086     CServer*            m_server;
00087 };
00088 
00089 #endif

Generated on Sat May 18 2013 00:00:03 for Synergy by  doxygen 1.7.1