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

kopete/protocols/messenger/libpapillon

messengercoreprotocol.h

Go to the documentation of this file.
00001 /*
00002    messengercoreprotocol.h - Messenger core protocol for Papillon 
00003 
00004    Copyright (c) 2006 by Michaƫl Larouche <larouche@kde.org>
00005 
00006    Based on code copyright (c) 2004 SuSE Linux AG <http://www.suse.com>
00007    Based on Iris, Copyright (C) 2003  Justin Karneges
00008 
00009    *************************************************************************
00010    *                                                                       *
00011    * This library is free software; you can redistribute it and/or         *
00012    * modify it under the terms of the GNU Lesser General Public            *
00013    * License as published by the Free Software Foundation; either          *
00014    * version 2 of the License, or (at your option) any later version.      *
00015    *                                                                       *
00016    *************************************************************************
00017 */
00018 
00019 #ifndef MESSANGERCOREPROTOCOL_H
00020 #define MESSANGERCOREPROTOCOL_H
00021 
00022 #include <QtCore/QObject>
00023 #include <QtCore/QByteArray>
00024 
00025 #include <Papillon/Macros>
00026 
00027 class QDataStream;
00028 
00029 namespace Papillon
00030 {
00031 
00032 class NetworkMessage;
00033 
00044 class PAPILLON_EXPORT MessengerCoreProtocol : public QObject
00045 {
00046     Q_OBJECT
00047 public:
00051     enum State 
00052     {
00056         NeedMore,
00060         Available,
00064         NoData,
00068         WaitForPayload
00069     };
00070 
00074     MessengerCoreProtocol();
00078     virtual ~MessengerCoreProtocol();
00079 
00083     void reset();
00084 
00091     void addIncomingData(const QByteArray &incomingBytes);
00092 
00098     NetworkMessage *incomingNetworkMessage();
00099 
00105     void outgoingNetworkMessage(NetworkMessage *outgoing);
00106 
00112     int state();
00113 
00114 signals:
00119     void outgoingData(const QByteArray &data);
00120 
00124     void incomingData();
00125 
00126 protected:
00131     bool okToProceed(const QDataStream &din);
00137     int rawToNetworkMessage(const QByteArray &raw);
00138 
00143     bool isPayloadCommand(const QString &command);
00144 
00145 private:
00146     class Private;
00147     Private *d;
00148 };
00149 
00150 }
00151 
00152 #endif // MESSANGERCOREPROTOCOL_H

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