~ubuntu-branches/debian/lenny/italc/lenny

« back to all changes in this revision

Viewing changes to ica/src/isd_server.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-06-17 13:46:54 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080617134654-cl0gi4u524cv1ici
Tags: 1:1.0.9~rc3-1
* Package new upstream version
  - upstream ported the code to qt4.4 (Closes: #481974)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * isd_server.h - ISD Server
 
3
 *
 
4
 * Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
 
5
 *  
 
6
 * This file is part of iTALC - http://italc.sourceforge.net
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU General Public
 
10
 * License as published by the Free Software Foundation; either
 
11
 * version 2 of the License, or (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
 * General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public
 
19
 * License along with this program (see COPYING); if not, write to the
 
20
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
21
 * Boston, MA 02111-1307, USA.
 
22
 *
 
23
 */
 
24
 
 
25
#ifndef _ISD_SERVER_H
 
26
#define _ISD_SERVER_H
 
27
 
 
28
#include <QtCore/QList>
 
29
#include <QtCore/QMutex>
 
30
#include <QtCore/QPair>
 
31
#include <QtCore/QSignalMapper>
 
32
#include <QtCore/QStringList>
 
33
#include <QtNetwork/QTcpServer>
 
34
 
 
35
#include "isd_base.h"
 
36
 
 
37
 
 
38
class IVS;
 
39
class demoClient;
 
40
class demoServer;
 
41
class lockWidget;
 
42
 
 
43
 
 
44
class isdServer : public QTcpServer
 
45
{
 
46
        Q_OBJECT
 
47
public:
 
48
        enum accessDialogResult
 
49
        {
 
50
                Yes,
 
51
                No,
 
52
                Always,
 
53
                Never
 
54
        } ;
 
55
 
 
56
        isdServer( const quint16 _ivs_port, int _argc, char * * _argv );
 
57
        virtual ~isdServer();
 
58
 
 
59
        int processClient( socketDispatcher _sd, void * _user );
 
60
 
 
61
        static bool protocolInitialization( socketDevice & _sd,
 
62
                                                italcAuthTypes _auth_type,
 
63
                                                bool _demo_server = FALSE );
 
64
        static bool authSecTypeItalc( socketDispatcher _sd, void * _user,
 
65
                                italcAuthTypes _auth_type = ItalcAuthDSA );
 
66
 
 
67
        static quint16 isdPort( void );
 
68
 
 
69
        static accessDialogResult showAccessDialog( const QString & _host );
 
70
 
 
71
 
 
72
private slots:
 
73
        void acceptNewConnection( void );
 
74
        void processClient( QObject * _sock );
 
75
 
 
76
        void checkForPendingActions( void );
 
77
 
 
78
        void demoWindowClosed( QObject * );
 
79
 
 
80
        // client-functions
 
81
        void startDemo( const QString & _master_host, bool _fullscreen );
 
82
        void stopDemo( void );
 
83
 
 
84
        void lockDisplay( void );
 
85
        void unlockDisplay( void );
 
86
 
 
87
        void displayTextMessage( const QString & _msg );
 
88
 
 
89
 
 
90
private:
 
91
        void allowDemoClient( const QString & _host );
 
92
        void denyDemoClient( const QString & _host );
 
93
 
 
94
        static void errorMsgAuth( const QString & _ip );
 
95
 
 
96
 
 
97
        static QStringList s_allowedDemoClients;
 
98
 
 
99
        QMutex m_actionMutex;
 
100
        QList<QPair<ISD::commands, QString> > m_pendingActions;
 
101
 
 
102
        QSignalMapper m_readyReadMapper;
 
103
 
 
104
        IVS * m_ivs;
 
105
        demoClient * m_demoClient;
 
106
        lockWidget * m_lockWidget;
 
107
 
 
108
} ;
 
109
 
 
110
 
 
111
 
 
112
int processItalcClient( socketDispatcher _sd, void * user );
 
113
 
 
114
 
 
115
#endif
 
116