• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kopete/protocols/messenger/libpapillon

Papillon::MessengerCoreProtocol

Papillon::MessengerCoreProtocol Class Reference

#include <Papillon/MessengerCoreProtocol>

Inheritance diagram for Papillon::MessengerCoreProtocol:

Inheritance graph
[legend]

List of all members.


Detailed Description

Translate raw data into NetworkMessage The sole purpose of this class is to parse in a low-level way the Messenger protocol.

it create NetworkMessage that Task will be able to use.

Author:
Michaƫl Larouche <larouche@kde.org>

SuSE Linux AG

Justin Karneges

Definition at line 44 of file messengercoreprotocol.h.


Public Types

enum  State { NeedMore, Available, NoData, WaitForPayload }

Signals

void outgoingData (const QByteArray &data)
void incomingData ()

Public Member Functions

 MessengerCoreProtocol ()
virtual ~MessengerCoreProtocol ()
void reset ()
void addIncomingData (const QByteArray &incomingBytes)
NetworkMessage * incomingNetworkMessage ()
void outgoingNetworkMessage (NetworkMessage *outgoing)
int state ()

Protected Member Functions

bool okToProceed (const QDataStream &din)
int rawToNetworkMessage (const QByteArray &raw)
bool isPayloadCommand (const QString &command)

Member Enumeration Documentation

enum Papillon::MessengerCoreProtocol::State

State is used internally to tell where we are in the parsing.

Enumerator:
NeedMore  Need more data to proceed.
Available  NetworkMessage is ready.
NoData  No data is currently in for proceeding.
WaitForPayload  We parsed a payload command and we are waiting for payload data.

Definition at line 51 of file messengercoreprotocol.h.


Constructor & Destructor Documentation

Papillon::MessengerCoreProtocol::MessengerCoreProtocol (  ) 

Create an new parser instance.

Definition at line 55 of file messengercoreprotocol.cpp.

Papillon::MessengerCoreProtocol::~MessengerCoreProtocol (  )  [virtual]

d-tor

Definition at line 58 of file messengercoreprotocol.cpp.


Member Function Documentation

void Papillon::MessengerCoreProtocol::reset (  ) 

Reset the protocol, clear buffers.

Definition at line 225 of file messengercoreprotocol.cpp.

void Papillon::MessengerCoreProtocol::addIncomingData ( const QByteArray &  incomingBytes  ) 

Add data to be proceeded by this class.

Accept data from the network, and buffer it into a useful message This requires parsing out each packet from the incoming data

Parameters:
incomingBytes Raw data

Definition at line 69 of file messengercoreprotocol.cpp.

NetworkMessage * Papillon::MessengerCoreProtocol::incomingNetworkMessage (  ) 

Get the current NetworkMessage available.

Use incomingData() to tell when get the incoming NetworkMessage.

Returns:
the incoming NetworkMessage or 0 if none is available.

Definition at line 94 of file messengercoreprotocol.cpp.

void Papillon::MessengerCoreProtocol::outgoingNetworkMessage ( NetworkMessage *  outgoing  ) 

Convert a request into an outgoing networkMessage Emit outgoingData() with the raw networkMessage.

Parameters:
outgoing NetworkMessage

Definition at line 107 of file messengercoreprotocol.cpp.

int Papillon::MessengerCoreProtocol::state (  ) 

Get the state of the protocol.

Returns:
Current state
See also:
State

Definition at line 64 of file messengercoreprotocol.cpp.

void Papillon::MessengerCoreProtocol::outgoingData ( const QByteArray &  data  )  [signal]

Emitted as the core protocol converts fields to wire ready data.

Parameters:
data Outgoing raw data

void Papillon::MessengerCoreProtocol::incomingData (  )  [signal]

Emitted when there is incoming data, parsed into a NetworkMessage.

bool Papillon::MessengerCoreProtocol::okToProceed ( const QDataStream &  din  )  [protected]

Check that there is data to read, and set the protocol's state if there isn't any.

Parameters:
din Currently used QDataStream

Definition at line 230 of file messengercoreprotocol.cpp.

int Papillon::MessengerCoreProtocol::rawToNetworkMessage ( const QByteArray &  raw  )  [protected]

Convert incoming raw data into a NetworkMessage object and queue it.

Parameters:
raw raw data
Returns:
number of bytes from the input that were parsed into a NetworkMessage

Definition at line 114 of file messengercoreprotocol.cpp.

bool Papillon::MessengerCoreProtocol::isPayloadCommand ( const QString &  command  )  [protected]

Check if the command is a payload command.

Parameters:
command command to check.

Definition at line 241 of file messengercoreprotocol.cpp.


The documentation for this class was generated from the following files:
  • messengercoreprotocol.h
  • messengercoreprotocol.cpp

kopete/protocols/messenger/libpapillon

Skip menu "kopete/protocols/messenger/libpapillon"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal