Logo Search packages:      
Sourcecode: kmess version File versions


                          webcamtransferp2p.h -  description
    begin                : Wed Dec 27 2006
    copyright            : (C) 2006 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.                                   *
 *                                                                         *


#include "p2papplication.h"

#include <QBuffer>

class MsnWebcamConnection;
class DirectConnectionPool;

 * This class handles the invitations for webcam video transfer.
 * This is currently a STUB class. It rejects the invitation,
 * but displays a better error message instead of "some MSN6 invitation is not supported".
 * @author Diederik van der Boor
 * @ingroup Applications
00039 class WebcamTransferP2P : public P2PApplication

    // The constructor without application parameters (sufficient for incoming sessions)
                           WebcamTransferP2P(ApplicationList *applicationList);
    // The constructor with application parameters to start a session
//                           WebcamTransferP2P(const QString &contactHandle, ...);

    // The destructor
    virtual               ~WebcamTransferP2P();

    // Return the application's GUID for "video conference" invitations.
    static QString         getConferenceAppId();

    // Return the application's GUID (for the "user push" invitation)
    static QString         getPushAppId();

    // Return the application's GUID (for the "contact pull" invitation)
    static QString         getPullAppId();

    // Step one of a contact-started chat: the contact invites the user
    void                   contactStarted1_ContactInvitesUser(const MimeMessage& message);
    // Step two of a contact-started chat: the user accepts
    void                   contactStarted2_UserAccepts();
    // Step three of a contact-started chat: the contact confirms the accept
    void                   contactStarted3_ContactConfirmsAccept(const MimeMessage& message);
    // Create the producer or viewer XML tag
    QString                createSipXml(uint recipientId, uint sessionId);
    // Called when data is received
    void                   gotData(const P2PMessage &message);
    // Called when all data is received.
    void                   gotDataComplete(const P2PMessage &lastMessage);
    // Called when an ack is received, which is not handled by the normal class.
    bool                   gotUnhandledAck( const P2PMessage &message, P2PMessageType ackedMessageType );
    // Send a webcam negotiation message.
    void                   sendSipMessage( const QString &contents, quint8 flag1, quint8 flag2, quint8 flag3, P2PMessageType messageType );
    // Step one of a user-started chat: the user invites the contact
    void                   userStarted1_UserInvitesContact();
    // Step two of a user-started chat: the contact accepts
    void                   userStarted2_ContactAccepts(const MimeMessage &message);
    // Step three of a user-started chat: the user prepares for the session
    void                   userStarted3_UserPrepares();

  private slots:
    // The active webcam connection is authorized.
    void                   slotActiveConnectionAuthorized();
    // The active webcam connection is closed
    void                   slotActiveConnectionClosed();
    // All connection attempts failed.
    void                   slotAllConnectionsFailed();
    // The active webcam connection is closed
    void                   slotConnectionEstablished();

    // The authentication string for the webcam connection
    QString                authentication_;
    // The negotiation message buffer
    QBuffer                buffer_;
    // Whether the contact requests the webcam from us, or it wants to share it's webcam.
    bool                   isUserSender_;
    // The active connection to receive webcam frames.
    MsnWebcamConnection   *webcamConnection_;
    // The pool of connection attempts to get a webcam connection.
    DirectConnectionPool  *webcamConnectionPool_;
    // The GUID received in the invitation
    QString                webcamGuid_;


Generated by  Doxygen 1.6.0   Back to index