~nobuto/ubuntu/natty/synergy/merge-from-experimental

« back to all changes in this revision

Viewing changes to cmd/synergyc/CClientTaskBarReceiver.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Lutz
  • Date: 2003-10-31 19:36:30 UTC
  • Revision ID: james.westby@ubuntu.com-20031031193630-knbv79x5az7qh49y
Tags: upstream-1.0.14
ImportĀ upstreamĀ versionĀ 1.0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "CMutex.h"
 
19
#include "CString.h"
 
20
#include "IArchTaskBarReceiver.h"
 
21
 
 
22
class CClient;
 
23
class IJob;
 
24
 
 
25
//! Implementation of IArchTaskBarReceiver for the synergy server
 
26
class CClientTaskBarReceiver : public IArchTaskBarReceiver {
 
27
public:
 
28
        enum EState {
 
29
                kNotRunning,
 
30
                kNotWorking,
 
31
                kNotConnected,
 
32
                kConnected,
 
33
                kMaxState
 
34
        };
 
35
 
 
36
        CClientTaskBarReceiver();
 
37
        virtual ~CClientTaskBarReceiver();
 
38
 
 
39
        //! @name manipulators
 
40
        //@{
 
41
 
 
42
        //! Set server
 
43
        /*!
 
44
        Sets the server.  The receiver will query state from this server.
 
45
        */
 
46
        void                            setClient(CClient*);
 
47
 
 
48
        //! Set state
 
49
        /*!
 
50
        Sets the current server state.
 
51
        */
 
52
        void                            setState(EState);
 
53
 
 
54
        //! Set the quit job that causes the server to quit
 
55
        /*!
 
56
        Set the job that causes the server to quit.
 
57
        */
 
58
        void                            setQuitJob(IJob* adopted);
 
59
 
 
60
        //@}
 
61
        //! @name accessors
 
62
        //@{
 
63
 
 
64
        //! Get state
 
65
        /*!
 
66
        Returns the current server state.  The receiver is not locked
 
67
        by this call;  the caller must do the locking.
 
68
        */
 
69
        EState                          getState() const;
 
70
 
 
71
        //! Get server
 
72
        /*!
 
73
        Returns the server set by \c setClient().
 
74
        */
 
75
        CClient*                        getClient() const;
 
76
 
 
77
        //@}
 
78
 
 
79
        // IArchTaskBarReceiver overrides
 
80
        virtual void            showStatus() = 0;
 
81
        virtual void            runMenu(int x, int y) = 0;
 
82
        virtual void            primaryAction() = 0;
 
83
        virtual void            lock() const;
 
84
        virtual void            unlock() const;
 
85
        virtual const Icon      getIcon() const = 0;
 
86
        virtual std::string     getToolTip() const;
 
87
 
 
88
protected:
 
89
        void                            quit();
 
90
 
 
91
        //! Status change notification
 
92
        /*!
 
93
        Called when status changes.  The default implementation does
 
94
        nothing.
 
95
        */
 
96
        virtual void            onStatusChanged();
 
97
 
 
98
private:
 
99
        void                            statusChanged(void*);
 
100
 
 
101
private:
 
102
        CMutex                          m_mutex;
 
103
        IJob*                           m_quit;
 
104
        EState                          m_state;
 
105
        CClient*                        m_client;
 
106
        IJob*                           m_job;
 
107
        CString                         m_errorMessage;
 
108
};
 
109
 
 
110
#endif