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

Public Types | Signals | Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes

MimeApplication Class Reference
[network/applications]

#include <mimeapplication.h>

Inheritance diagram for MimeApplication:
Inheritance graph
[legend]
Collaboration diagram for MimeApplication:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ApplicationMode { APP_MODE_NORMAL, APP_MODE_ERROR_HANDLER, APP_MODE_DATACAST }

Signals

void applicationMessage (const ChatMessage &message)
void deleteMe (Application *object)
void putMsg (const MimeApplication *source, const MimeMessage &message)
void updateApplicationMessage (const QString &messageId, const QString &newMessage)

Public Member Functions

virtual void contactAborted (const QString &message=QString())
 The contact aborted the session.
ChatgetChat () const
 Return the chat the application was originally created for (may be null).
const QString & getContactHandle () const
 Return the handle of the other contact.
const QString & getCookie () const
 Return the application's identifying cookie.
int getMode () const
 Return the current mode of the application.
void gotCommand (QString command)
 A command for the application was received (i.e. "Accept" or "Reject")
void gotMessage (const MimeMessage &message)
bool isClosing () const
 Indicate whether the application is closing or not.
virtual bool isPrivateChatRequired () const
 Returns whether the application can operate in a multi-chat session, or requires a private chat.
 MimeApplication (const QString &contactHandle)
void setChat (Chat *chat)
 Set the chat the application was originally created for.
void setMode (ApplicationMode mode)
 Change the current mode.
void start ()
 Start the application.
virtual void userAborted ()
 Called when the user aborted the application.

Protected Types

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

Protected Member Functions

void contactRejected (const QString &message=QString::null)
 The contact declined the invitation.
virtual void contactStarted1_ContactInvitesUser (const MimeMessage &message)
 Step 1 of a contact-started chat: the contact invites the user.
virtual void contactStarted2_UserAccepts ()
 Step 2 of a contact-started chat: the user accepts.
virtual void contactStarted3_ContactConfirmsAccept (const MimeMessage &message)
void delayDeletion (bool doDelay)
void endApplication ()
 Request to delete this application.
QString generateCookie () const
 Generate a random cookie value.
virtual QString getContactAbortMessage () const
 Return an abort message to display.
virtual QString getContactRejectMessage () const
 Return a reject message to display.
const QString & getExternalIp () const
 Return the external IP address.
const QString & getLocalIp () const
const QString & getSessionId ()
virtual QString getUserAbortMessage () const
 Return an abort message to display.
virtual QString getUserRejectMessage () const
 Return a reject message to display.
bool isUserStartedApp () const
 Return the "user started this app" state.
bool isWaitingForUser () const
 Return true if we're waiting for the user to accept.
void modifyOfferMessage (const QString &newMessage=QString())
 Replace an application's accept/reject/cancel links with another text.
void offerAcceptOrReject (const QString &appHtml)
 Let the user accept or reject the application.
void offerCancel (const QString &appHtml)
 Let the user cancel the application.
void sendCancelMessage (const ApplicationCancelReason cancelReason)
 Send a cancel message and terminate the application.
void sendMessage (const MimeMessage &message)
void setApplicationType (ChatMessage::MessageType type)
 Set the type of application we're starting.
void setClosing (bool closing)
 Indicate the application is closing or not.
virtual void showEventMessage (const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming=true)
 Show a message to notify the user of an event.
virtual void showSystemMessage (const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming=true)
 Show a message to notify about a system error.
virtual void showTransferComplete ()
 Called when the transfer is complete.
virtual void showTransferMessage (const QString &message)
 Show a message to inform about a transfer event.
virtual void showTransferProgress (const ulong bytesTransferred)
 Show the progress made during a transfer.
void startByInvite (const QString &invitationCookie)
 Start the application internally (from an invite message)
virtual void userRejected ()
 Called when the user rejected (declined) the application.
virtual void userStarted1_UserInvitesContact ()
 Step 1 of a user-started chat: the user invites the contact.
virtual void userStarted2_ContactAccepts (const MimeMessage &message)
 Step 2 of a user-started chat: the contact accepts.
virtual void userStarted3_UserPrepares ()
 Step 3 of a user-started chat: the user prepares for the session.

Private Member Functions

QString generateSessionId () const

Private Attributes

QString sessionId_

Detailed Description

The base class for all old-style (pre-msn6) invitations. These invitations use plain text MIME messages to exchange the invitation data. The incoming messages are passed to the gotMessage() method. This method automatically calls the correct contactStarted* and userStarted* methods. These methods are implemented in each one of the derived classes.

Author:
Mike K. Bennett, Diederik van der Boor

Definition at line 37 of file mimeapplication.h.


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

Generated by  Doxygen 1.6.0   Back to index