2 Copyright (c) 2005 by Olivier Goffart <ogoffart@kde.org>
4 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
6 *************************************************************************
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
13 *************************************************************************
26 #include <QTimerEvent>
31 namespace KNetwork
{ class KServerSocket
; class KBufferedSocket
; }
35 class MSNWebcamDialog
;
41 class Webcam
: public TransferContext
44 enum Who
{ wProducer
, wViewer
};
46 Webcam( Who who
, const QString
& to
, Dispatcher
*parent
, quint32 sessionID
);
49 virtual void processMessage(const Message
& message
);
52 void askIncommingInvitation();
53 virtual void acknowledged();
54 void sendBYEMessage();
57 void makeSIPMessage(const QString
&message
, quint8 XX
=0, quint8 YY
=9 , quint8 ZZ
=0);
58 void sendBigP2PMessage( const QByteArray
& dataMessage
);
59 void closeAllOtherSockets();
62 QString
xml(uint session
, uint rid
);
63 int getAvailablePort();
66 KNetwork::KServerSocket
*m_listener
;
67 KNetwork::KBufferedSocket
*m_webcamSocket
;
69 enum { wsNegotiating
, wsConnecting
, wsConnected
, wsTransfer
} m_webcamState
;
76 MimicWrapper
*m_mimic
;
77 MSNWebcamDialog
*m_widget
;
79 QList
<KNetwork::KBufferedSocket
* > m_allSockets
;
85 void slotListenError(int errorCode
);
87 void slotSocketRead();
88 void slotSocketClosed();
89 void slotSocketError(int errorCode
);
90 void slotSocketConnected();
91 // void slotReadyWrite();
93 virtual void timerEvent( QTimerEvent
* );