Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / protocols / msn / webcam.h
blob6ed96f548958071c7d0b190358a7f1a74fab68d9
1 /*
2 Copyright (c) 2005 by Olivier Goffart <ogoffart@kde.org>
4 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
6 *************************************************************************
7 * *
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. *
12 * *
13 *************************************************************************
16 #ifndef P2PWEBCAM_H
17 #define P2PWEBCAM_H
19 //#if MSN_WEBCAM
20 #if 0
22 #include "p2p.h"
24 //Added by qt3to4:
25 #include <QLabel>
26 #include <QTimerEvent>
27 #include <QList>
31 namespace KNetwork{ class KServerSocket; class KBufferedSocket; }
33 class MimicWrapper;
34 class QLabel;
35 class MSNWebcamDialog;
36 class QTimerEvent;
38 namespace P2P {
41 class Webcam : public TransferContext
42 { Q_OBJECT
43 public:
44 enum Who { wProducer , wViewer };
46 Webcam( Who who , const QString& to, Dispatcher *parent, quint32 sessionID);
47 virtual ~Webcam();
49 virtual void processMessage(const Message& message);
51 public slots:
52 void askIncommingInvitation();
53 virtual void acknowledged();
54 void sendBYEMessage();
56 private:
57 void makeSIPMessage(const QString &message, quint8 XX=0, quint8 YY=9 , quint8 ZZ=0);
58 void sendBigP2PMessage( const QByteArray& dataMessage );
59 void closeAllOtherSockets();
60 QString m_content;
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;
71 Who m_who;
73 QString m_myAuth;
74 QString m_peerAuth;
76 MimicWrapper *m_mimic;
77 MSNWebcamDialog *m_widget;
79 QList<KNetwork::KBufferedSocket* > m_allSockets;
81 int m_timerId;
82 int m_timerFps;
84 private slots:
85 void slotListenError(int errorCode);
86 void slotAccept();
87 void slotSocketRead();
88 void slotSocketClosed();
89 void slotSocketError(int errorCode);
90 void slotSocketConnected();
91 // void slotReadyWrite();
92 protected:
93 virtual void timerEvent( QTimerEvent * );
98 #endif
100 #endif