• Main Page
  • Classes
  • Files
  • File List

CServerTaskBarReceiver.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2012 Bolton Software Ltd.
00004  * Copyright (C) 2003 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 CSERVERTASKBARRECEIVER_H
00020 #define CSERVERTASKBARRECEIVER_H
00021 
00022 #include "CString.h"
00023 #include "IArchTaskBarReceiver.h"
00024 #include "stdvector.h"
00025 #include "CEvent.h"
00026 #include "CServerApp.h"
00027 #include "CServer.h"
00028 
00030 class CServerTaskBarReceiver : public IArchTaskBarReceiver {
00031 public:
00032     CServerTaskBarReceiver();
00033     virtual ~CServerTaskBarReceiver();
00034 
00036 
00037 
00039 
00042     void                updateStatus(CServer*, const CString& errorMsg);
00043 
00044     void updateStatus(INode* n, const CString& errorMsg) { updateStatus((CServer*)n, errorMsg); }
00045 
00047 
00048     // IArchTaskBarReceiver overrides
00049     virtual void        showStatus() = 0;
00050     virtual void        runMenu(int x, int y) = 0;
00051     virtual void        primaryAction() = 0;
00052     virtual void        lock() const;
00053     virtual void        unlock() const;
00054     virtual const Icon  getIcon() const = 0;
00055     virtual std::string getToolTip() const;
00056 
00057 protected:
00058     typedef std::vector<CString> CClients;
00059     enum EState {
00060         kNotRunning,
00061         kNotWorking,
00062         kNotConnected,
00063         kConnected,
00064         kMaxState
00065     };
00066 
00068     EState              getStatus() const;
00069 
00071     const CString&      getErrorMessage() const;
00072 
00074     const CClients&     getClients() const;
00075 
00077 
00080     void                quit();
00081 
00083 
00087     virtual void        onStatusChanged(CServer* server);
00088 
00089 protected:
00090     CEvent::Type getReloadConfigEvent();
00091     CEvent::Type getForceReconnectEvent();
00092     CEvent::Type getResetServerEvent();
00093 
00094 private:
00095     EState              m_state;
00096     CString             m_errorMessage;
00097     CClients            m_clients;
00098 };
00099 
00100 IArchTaskBarReceiver* createTaskBarReceiver(const CBufferedLogOutputter* logBuffer);
00101 
00102 #endif

Generated on Fri May 24 2013 00:00:04 for Synergy by  doxygen 1.7.1