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

MsnSwitchboardConnection Class Reference
[network]

#include <msnswitchboardconnection.h>

Inheritance diagram for MsnSwitchboardConnection:

MsnConnection

List of all members.


Detailed Description

A connection to a switchboard server, over which chats are conducted.

Author:
Mike K. Bennett

Definition at line 49 of file msnswitchboardconnection.h.


Public Types

enum  ApplicationType { FILETRANSFER }
enum  WarningType {
  WARNING_UNSUPPORTED_VOICECLIP, WARNING_UNSUPPORTED_ACTIONMESSAGE, WARNING_UNSUPPORTED_UNKNOWN, WARNING_CONNECTION_DROP,
  WARNING_TOO_MANY_EMOTICONS
}
 Types of emittable warnings. More...

Public Slots

void sendKeepAlive ()

Signals

void chatMessage (const ChatMessage &message)
void contactJoinedChat (ContactBase *contact)
void contactLeftChat (ContactBase *contact, bool isChatIdle)
void contactTyping (ContactBase *contact)
void deleteMe (MsnSwitchboardConnection *object)
void disconnected ()
void gotInkMessage (const QString &inkData, const QString &handle)
void gotMessage (const P2PMessage &message, const QString &handle)
void gotMessage (const MimeMessage &message, const QString &handle)
void gotMsnObject (const QString &msnObjectData, const QString &handle)
void pingSent ()
void readySend ()
void receivedNudge (ContactBase *contact)
void requestChatWindow (MsnSwitchboardConnection *switchboard)
void requestNewSwitchboard (QString contactHandle)
void sendingFailed (const QString &handle, const MimeMessage &message)
void showWarning (MsnSwitchboardConnection::WarningType type, ContactBase *contact)
void statusMessage (QString message, bool isError)

Public Member Functions

virtual void closeConnection ()
 Close the connection.
void closeConnectionLater (bool autoDelete=false)
const QStringList getContactsInChat () const
const QString & getFirstContact () const
const QString & getLastContact () const
bool getUserStartedChat () const
bool initialize (QString handle=QString())
void inviteContact (const QString &handle)
bool isBusy () const
bool isConnected () const
 Return whether or the socket is connected.
bool isContactInChat (const QString &handle) const
bool isEmpty () const
bool isExclusiveChatWithContact (const QString &handle) const
bool isExpired () const
bool isInactive () const
bool isWaiting () const
 MsnSwitchboardConnection (const MsnSwitchboardConnection &other)
void sendApplicationMessage (const MimeMessage &message)
void sendChatMessage (const QString &text)
void sendInk (const QByteArray &ink)
void sendNudge ()
void sendTypingMessage ()
void sendWink (const MsnObject &msnobject)
void setUserStartedChat (bool startedByUser)
void start (const ChatInformation &chatInfo)

Protected Types

enum  AckType { ACK_NONE, ACK_NAK_ONLY, ACK_ALWAYS, ACK_ALWAYS_P2P }
 Ack type parameter for sendMimeMessage(). More...

Protected Slots

virtual void slotConnected ()
 Called when the connection attempt is successful.
void slotError (QString error, MsnSocketBase::ErrorType type)
 Shows error dialog boxes.

Protected Member Functions

void addSoapClient (HttpSoapConnection *client)
 Internal function to track SOAP clients.
void connectToServer (const QString &server=QString(), const quint16 port=0)
 Connect to the given server via the socket.
void deleteSoapClient (HttpSoapConnection *client)
 Disconnect and delete a SOAP clients.
void deleteSoapClients ()
 Disconnect and delete all SOAP clients.
void disconnectFromServer (bool isTransfer=false)
 Disconnect from the server.
const QString getLocalIp () const
 Return the local IP address of the socket.
bool initialize ()
 Initialize the object.
bool isErrorCommand (const QString &command) const
 Return whether the given command is an error command.
virtual bool isPayloadCommand (const QString &command) const
 Return whether the given command is a payload command.
void parseMultiPacketMimeMessage (const QStringList &command, const MimeMessage &mimeMessage)
int sendCommand (const QString &prefix, const QString &text="\r\n")
 Send a command to the server.
int sendMimeMessage (AckType ackType, const MimeMessage &message)
 Send a MIME message command to the server.
int sendPayloadMessage (const QString &prefix, const QString &arguments, const QByteArray &payload)
int sendPayloadMessage (const QString &prefix, const QString &arguments, const QString &payload)
void setAcceptedPayloadCommands (QStringList commandList)
void setSendPings (bool sendPings)
bool switchToHttpSocket ()
 If it is possible, switch to the HTTP connection.
bool switchToTcpSocket ()
 Switch back to the TCP connection.
void writeBinaryData (const QByteArray &data)
void writeData (const QString &data)

Private Types

enum  ConnectionState {
  SB_DISCONNECTED, SB_CONNECTING, SB_AUTHORIZING, SB_INVITING_CONTACTS,
  SB_CHAT_STARTED, SB_CONTACTS_LEFT, SB_REQUESTING_CHAT, SB_DISCONNECTING
}

Private Slots

void slotApplicationsAborted (const QString &contact)

Private Member Functions

void activity ()
void cleanUnackedMessages ()
void contactJoined (const QString &handle, const QString &friendlyName, const uint capabilities)
void contactLeft (const QString &handle)
const QString convertHtmlColorToMsnColor (const QString &color) const
const QString convertMsnColorToHtmlColor (QString &color) const
void gotAck (const QStringList &command)
void gotBye (const QStringList &command)
void gotIro (const QStringList &command)
void gotJoi (const QStringList &command)
void gotNak (const QStringList &command)
void gotOut (const QStringList &command)
void gotUsr (const QStringList &command)
void parseChatMessage (const QString &contactHandle, const QString &friendlyName, const QString &contactPicture, const MimeMessage &message)
void parseClientCapsMessage (const QString &contactHandle, const MimeMessage &message)
void parseCommand (const QStringList &command)
 Process a received command.
void parseDatacastMessage (const QString &contactHandle, const MimeMessage &message)
void parseEmoticonMessage (const QString &contactHandle, const QString &messageBody)
void parseError (const QStringList &command, const QByteArray &payloadData)
 Process a received error command.
void parseMimeMessage (const QStringList &command, const MimeMessage &message)
 Process a received MIME message.
void parseP2PMessage (const QString &contactHandle, const MimeMessage &message)
virtual void parsePayloadMessage (const QStringList &command, const QByteArray &payload)
 Process a received payload message.
void parseTypingMessage (const QString &contactHandle, const MimeMessage &message)
void sendClientCaps ()
void sendMimeMessageWhenReady (AckType ackType, MultiPacketMessage &message)
void sendMimeMessageWhenReady (AckType ackType, const MimeMessage &message)
void sendPendingMessages ()
void storeMessageForAcknowledgement (int ack, AckType ackType, const MimeMessage &message)

Private Attributes

bool abortingApplications_
int acksPending_
QString authorization_
bool autoDeleteLater_
bool backgroundConnection_
QString chatId_
bool closingConnection_
ConnectionState connectionState_
QStringList contactsInChat_
CurrentAccountcurrentAccount_
QString firstContact_
bool initialized_
int keepAlivesRemaining_
QTimer * keepAliveTimer_
QString lastContact_
OfflineImServiceofflineImService_
QStringList pendingInvitations_
QList< QPair< AckType,
MimeMessage > * > 
pendingMessages_
QHash< int, UnAckedMessage * > unAckedMessages_
bool userStartedChat_

Friends

class KMessTest

Classes

struct  UnAckedMessage

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

Generated by  Doxygen 1.6.0   Back to index