| 1 | /*
|
|---|
| 2 | * synergy -- mouse and keyboard sharing utility
|
|---|
| 3 | * Copyright (C) 2003 Chris Schoeneman
|
|---|
| 4 | *
|
|---|
| 5 | * This package is free software; you can redistribute it and/or
|
|---|
| 6 | * modify it under the terms of the GNU General Public License
|
|---|
| 7 | * found in the file COPYING that should have accompanied this file.
|
|---|
| 8 | *
|
|---|
| 9 | * This package is distributed in the hope that it will be useful,
|
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | * GNU General Public License for more details.
|
|---|
| 13 | */
|
|---|
| 14 |
|
|---|
| 15 | #ifndef CCLIENTTASKBARRECEIVER_H
|
|---|
| 16 | #define CCLIENTTASKBARRECEIVER_H
|
|---|
| 17 |
|
|---|
| 18 | #include "CString.h"
|
|---|
| 19 | #include "IArchTaskBarReceiver.h"
|
|---|
| 20 |
|
|---|
| 21 | class CClient;
|
|---|
| 22 |
|
|---|
| 23 | //! Implementation of IArchTaskBarReceiver for the synergy server
|
|---|
| 24 | class CClientTaskBarReceiver : public IArchTaskBarReceiver {
|
|---|
| 25 | public:
|
|---|
| 26 | CClientTaskBarReceiver();
|
|---|
| 27 | virtual ~CClientTaskBarReceiver();
|
|---|
| 28 |
|
|---|
| 29 | //! @name manipulators
|
|---|
| 30 | //@{
|
|---|
| 31 |
|
|---|
| 32 | //! Update status
|
|---|
| 33 | /*!
|
|---|
| 34 | Determine the status and query required information from the client.
|
|---|
| 35 | */
|
|---|
| 36 | void updateStatus(CClient*, const CString& errorMsg);
|
|---|
| 37 |
|
|---|
| 38 | //@}
|
|---|
| 39 |
|
|---|
| 40 | // IArchTaskBarReceiver overrides
|
|---|
| 41 | virtual void showStatus() = 0;
|
|---|
| 42 | virtual void runMenu(int x, int y) = 0;
|
|---|
| 43 | virtual void primaryAction() = 0;
|
|---|
| 44 | virtual void lock() const;
|
|---|
| 45 | virtual void unlock() const;
|
|---|
| 46 | virtual const Icon getIcon() const = 0;
|
|---|
| 47 | virtual std::string getToolTip() const;
|
|---|
| 48 |
|
|---|
| 49 | protected:
|
|---|
| 50 | enum EState {
|
|---|
| 51 | kNotRunning,
|
|---|
| 52 | kNotWorking,
|
|---|
| 53 | kNotConnected,
|
|---|
| 54 | kConnecting,
|
|---|
| 55 | kConnected,
|
|---|
| 56 | kMaxState
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 | //! Get status
|
|---|
| 60 | EState getStatus() const;
|
|---|
| 61 |
|
|---|
| 62 | //! Get error message
|
|---|
| 63 | const CString& getErrorMessage() const;
|
|---|
| 64 |
|
|---|
| 65 | //! Quit app
|
|---|
| 66 | /*!
|
|---|
| 67 | Causes the application to quit gracefully
|
|---|
| 68 | */
|
|---|
| 69 | void quit();
|
|---|
| 70 |
|
|---|
| 71 | //! Status change notification
|
|---|
| 72 | /*!
|
|---|
| 73 | Called when status changes. The default implementation does nothing.
|
|---|
| 74 | */
|
|---|
| 75 | virtual void onStatusChanged(CClient* client);
|
|---|
| 76 |
|
|---|
| 77 | private:
|
|---|
| 78 | EState m_state;
|
|---|
| 79 | CString m_errorMessage;
|
|---|
| 80 | CString m_server;
|
|---|
| 81 | };
|
|---|
| 82 |
|
|---|
| 83 | #endif
|
|---|