00001 /* 00002 * synergy -- mouse and keyboard sharing utility 00003 * Copyright (C) 2003 Chris Schoeneman 00004 * 00005 * This package is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * found in the file COPYING that should have accompanied this file. 00008 * 00009 * This package is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 */ 00014 00015 #ifndef CSERVERTASKBARRECEIVER_H 00016 #define CSERVERTASKBARRECEIVER_H 00017 00018 #include "CString.h" 00019 #include "IArchTaskBarReceiver.h" 00020 #include "stdvector.h" 00021 00022 class CServer; 00023 00025 class CServerTaskBarReceiver : public IArchTaskBarReceiver { 00026 public: 00027 CServerTaskBarReceiver(); 00028 virtual ~CServerTaskBarReceiver(); 00029 00031 00032 00034 00037 void updateStatus(CServer*, const CString& errorMsg); 00038 00040 00041 // IArchTaskBarReceiver overrides 00042 virtual void showStatus() = 0; 00043 virtual void runMenu(int x, int y) = 0; 00044 virtual void primaryAction() = 0; 00045 virtual void lock() const; 00046 virtual void unlock() const; 00047 virtual const Icon getIcon() const = 0; 00048 virtual std::string getToolTip() const; 00049 00050 protected: 00051 typedef std::vector<CString> CClients; 00052 enum EState { 00053 kNotRunning, 00054 kNotWorking, 00055 kNotConnected, 00056 kConnected, 00057 kMaxState 00058 }; 00059 00061 EState getStatus() const; 00062 00064 const CString& getErrorMessage() const; 00065 00067 const CClients& getClients() const; 00068 00070 00073 void quit(); 00074 00076 00080 virtual void onStatusChanged(CServer* server); 00081 00082 private: 00083 EState m_state; 00084 CString m_errorMessage; 00085 CClients m_clients; 00086 }; 00087 00088 #endif