• Main Page
  • Classes
  • Files
  • File List

CClientApp.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2012 Bolton Software Ltd.
00004  * Copyright (C) 2002 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 #pragma once
00020 
00021 #include "CApp.h"
00022 #include "CArgsBase.h"
00023 
00024 class CScreen;
00025 class CEvent;
00026 class CClient;
00027 class CNetworkAddress;
00028 class CThread;
00029 
00030 class CClientApp : public CApp {
00031 public:
00032     class CArgs : public CArgsBase {
00033     public:
00034         CArgs();
00035         ~CArgs();
00036 
00037     public:
00038         int m_yscroll;
00039         CNetworkAddress* m_serverAddress;
00040     };
00041 
00042     CClientApp(CreateTaskBarReceiverFunc createTaskBarReceiver);
00043     virtual ~CClientApp();
00044 
00045     // Parse client specific command line arguments.
00046     void parseArgs(int argc, const char* const* argv);
00047 
00048     // Prints help specific to client.
00049     void help();
00050 
00051     // Returns arguments that are common and for client.
00052     CArgs& args() const { return (CArgs&)argsBase(); }
00053 
00054     const char* daemonName() const;
00055     const char* daemonInfo() const;
00056 
00057     // TODO: move to server only (not supported on client)
00058     void loadConfig() { }
00059     bool loadConfig(const CString& pathname) { return false; }
00060 
00061     int foregroundStartup(int argc, char** argv);
00062     int standardStartup(int argc, char** argv);
00063     int runInner(int argc, char** argv, ILogOutputter* outputter, StartupFunc startup);
00064     CScreen* createScreen();
00065     void updateStatus();
00066     void updateStatus(const CString& msg);
00067     void resetRestartTimeout();
00068     double nextRestartTimeout();
00069     void handleScreenError(const CEvent&, void*);
00070     CScreen* openClientScreen();
00071     void closeClientScreen(CScreen* screen);
00072     void handleClientRestart(const CEvent&, void* vtimer);
00073     void scheduleClientRestart(double retryTime);
00074     void handleClientConnected(const CEvent&, void*);
00075     void handleClientFailed(const CEvent& e, void*);
00076     void handleClientDisconnected(const CEvent&, void*);
00077     CClient* openClient(const CString& name, const CNetworkAddress& address, CScreen* screen, const CCryptoOptions& crypto);
00078     void closeClient(CClient* client);
00079     bool startClient();
00080     void stopClient();
00081     int mainLoop();
00082     void startNode();
00083 
00084     static CClientApp& instance() { return (CClientApp&)CApp::instance(); }
00085 
00086 private:
00087     virtual bool parseArg(const int& argc, const char* const* argv, int& i);
00088     void vncThread(void*);
00089 
00090 private:
00091     CClient* s_client;
00092     CScreen* s_clientScreen;
00093     CThread* m_vncThread;
00094 };

Generated on Tue May 21 2013 00:00:05 for Synergy by  doxygen 1.7.1