Logo Search packages:      
Sourcecode: kmess version File versions  Download package

Application Class Reference

#include <application.h>

Inheritance diagram for Application:

MimeApplication P2PApplication FileTransfer GnomeMeeting MsnRemoteDesktop FileTransferP2P PictureTransferP2P WebApplicationP2P

List of all members.


Detailed Description

The base class of chat applications, such as file transfer and meetings. This class only provide the essentials like accept/cancel notifications.

External users of this class only have to use the start() and gotMessage() methods. The start() method causes KMess to send an invitation, and the messages received after that should be passed to the gotMessage() method. The gotMessage() method also detects whether KMess received an invitation.

The following paragraphs are worth reading if you're a new KMess developer:

To support both MSN4 "Mime-style" and MSN6 "P2P-style" invitations, two classes derive from this base class: The MimeApplication and P2PApplication class. Those two classes implement the missing gotMessage() and sendCancelMessage() methods.

To implement your own application handler (like file transfers, voice and webcam conversations), create a new class which derives from either 'MimeApplication' or 'P2PApplication' and implements the contactStarted* and userStarted* methods.

The contactStarted* methods provide a framework to implement the nessesairy dialogs for sessions started by the other contact ("chat buddy").

The userStarted* methods provide a framework to implement the nessesairy dialogs for sessions started by the user itself ("KMess user")

Also note how each Application subclass implements a "static QString getAppId()" method to return the Application GUID. This GUID is used in the invitation message.

Author:
Mike K. Bennett, Diederik van der Boor (mime/p2p stuff)

Definition at line 60 of file application.h.


Public Types

enum  ApplicationMode { APP_MODE_NORMAL, APP_MODE_BACKGROUND, APP_MODE_ERROR_HANDLER }

Signals

void appInitMessage (QString html)
void appMessage (QString html)
void deleteMe (Application *object)
void fileTransferred (QString filename)
void putMsg (const MimeMessage &message)
void systemMessage (QString message)

Public Member Functions

 Application (const QString &localIp)
const QString & getCookie () const
int getMode () const
void gotCommand (QString command)
virtual void gotMessage (const MimeMessage &message)=0
void setMode (ApplicationMode mode)
void start ()
virtual void userAborted ()

Protected Types

enum  ApplicationCancelReason {
  CANCEL_INVITATION, CANCEL_SESSION, CANCEL_NOT_INSTALLED, CANCEL_TIMEOUT,
  CANCEL_FAILED, CANCEL_INVALID_SLP_CONTENT_TYPE
}

Protected Member Functions

void contactAborted (const QString &message=0)
void contactRejected (const QString &message=0)
virtual void contactStarted1_ContactInvitesUser (const MimeMessage &message)
virtual void contactStarted2_UserAccepts ()
virtual void contactStarted3_ContactConfirmsAccept (const MimeMessage &message)
void endApplication (const QString &reason=0)
QString generateCookie () const
virtual QString getCancelMessage () const
const QString & getExternalIp () const
const QString & getLocalIp () const
bool isUserStartedApp () const
bool isWaitingForUser () const
void offerAcceptOrReject (const QString &appHtml)
void offerCancel (const QString &appHtml)
virtual void sendCancelMessage (const ApplicationCancelReason cancelReason)=0
void startByInvite (const QString &invitationCookie)
void userRejected ()
virtual void userStarted1_UserInvitesContact ()
virtual void userStarted2_ContactAccepts (const MimeMessage &message)
virtual void userStarted3_UserPrepares ()

Static Protected Member Functions

static void freePort (const int &port)

Private Attributes

QString cookie_
QString localIp_
ApplicationMode mode_
bool userAccepted_
bool userStartedApp_
bool waitingForUser_

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index