/ * Msnp2p.h - MSN P2P Protocol
Copyright (c) 2003 by olivier goffart
*********************************************************** *********************** * * * this program is free software; you can redistribute it and / or modify * * it under the terminal of the gnu general Public License As Published by * * The Free Software Foundation; Either Version 2 of the license, or * * (at Your option) Any Later Version. * * * *************** *********************************************************** ******** /
#ifndef msnp2p_h # define msnp2p_h
#include
Class Kopetransfer; Struct KopetefileTransferinfo;
Class KtempFile; Class Qfile;
/ ** * @Author olivier goffart * * this class help the msnswithboardsocket to handle the msn-p2p message * / class msnp2p: public Qobject {q_object
Public: MSNP2P (QObject * parent = 0L, const char * name = 0L); ~ MSNP2P ();
Public slots: / ** * Parse An Incoming Message * / Void SlotreadMessage (Const QByteaRray & MSG);
signals: / ** * should be connected to the MSNSwitchBoardSocket's sendCommand function * / void sendCommand (const QString & cmd, const QString & args = QString :: null, bool addId = true, const QByteArray & body = QByteArray (), bool binary = false) ;
Void FileReceived (KtempFile *, Const QString & MsnObject);
Private:
ENUM MessageType {BYE, OK, DECLINE, ERROR, INVITE}
/ ** * send the MSNSLP command in a msn p2p message * dataMessage cen be a QCString in case of text message * / void sendP2PMessage (const QByteArray & dataMessage); / ** * make and send a P2P message * @ref sendP2PMessage is. Used to send the message. * * @Param Content Is The Content of the Message. It Must Be Terminated by TWO / R / N / R / N * / Void MakeysnSlpMessage (MessageType Type, QString Content); / ** * Send THE ACK * / VOID Sendp2Pack (const char * origina);
private slots: void slotSendData (); void slotTransferAccepted (KopeteTransfer *, const QString &); void slotFileTransferRefused (const KopeteFileTransferInfo &); void slotKopeteTransferDestroyed ();
Public slots: / ** * load the dysplayImage (const qstring & myhandle, const qstring & msghandle, qstring msnobject);
/ ** * Abort the current transfer. * / Void AbortcurrentTransfer ();
private: // for the display image KTempFile * m_file; QFile * m_Sfile; QFile * m_Rfile; QString m_obj; unsigned long int m_msgIdentifier; unsigned long int m_sessionId; unsigned long int m_totalDataSize; unsigned long int m_offset; QString m_CallID; QString m_branch;
Qstring m_myhandle; qstring m_msghandle; kopetetransfer * m_kopetetransfer;
}
#ENDIF