Logo Search packages:      
Sourcecode: kmess version File versions

inktransferp2p.h

/***************************************************************************
                          inktransferp2p.h -  description
                             -------------------
    begin                : Sun Mar 23 2008
    copyright            : (C) 2008 by Diederik van der Boor
    email                : "vdboor" --at-- "codingdomain.com"
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms 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 INKTRANSFERP2P_H
#define INKTRANSFERP2P_H

#include "p2papplication.h"

#include <QBuffer>



/**
 * Ink transfer class.
 *
 * The official client transfers ink messages as normal MIME messages in group chats (image/gif type),
 * but uses P2P transport for private chats. This is likely done for backwards compatibility reasons.
 * This application type does not start a full session.
 * It only uses/abuses the P2P protocol layer to transmit the message in multiple fragments.
 * MSN Messenger 7 introduced the "datacast" MIME message to end this madness.
 *
 * @author Antonio Nastasi, Diederik van der Boor
 * @ingroup Applications
 */
00039 class InkTransferP2P : public P2PApplication
{
  Q_OBJECT

  public:
    // The fixed session ID used by all ink transfer sessions.
    static const unsigned long SESSION_ID = 64;

    // The constructor
                           InkTransferP2P( ApplicationList *applicationList );

    // The destructor
    virtual               ~InkTransferP2P();

    // Read the buffer, send the inkReceived() signal.
    void                   showTransferComplete();

  protected:
    // Called when data is received
    void                   gotData( const P2PMessage &message );

  signals:
    // Signal that an ink image was received.
    void                   inkReceived( const QString &base64ImageData, const QString& contact );

  private:
    QBuffer                inkBuffer_;
};

#endif

Generated by  Doxygen 1.6.0   Back to index