From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksirc/messageReceiver.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 ksirc/messageReceiver.h (limited to 'ksirc/messageReceiver.h') diff --git a/ksirc/messageReceiver.h b/ksirc/messageReceiver.h new file mode 100644 index 00000000..a86817b0 --- /dev/null +++ b/ksirc/messageReceiver.h @@ -0,0 +1,62 @@ + +#ifndef KMESSAGERECEIVER_H +#define KMESSAGERECEIVER_H + +#include +#include + +class KSircProcess; +class QTextCodec; + +struct filterRule { + const char *desc; + const char *search; + const char *from; + const char *to; +}; + +typedef QPtrList filterRuleList; + +class KSircMessageReceiver +{ +public: + KSircMessageReceiver(KSircProcess *_proc); + virtual ~KSircMessageReceiver(); + + virtual void sirc_receive(QCString str, bool broadcast = false) = 0; + + virtual void control_message(int, QString) = 0; + + bool getBroadcast(); + void setBroadcast(bool bd); + + virtual filterRuleList *defaultRules(); + + KSircProcess *ksircProcess() const { return proc; } + +private: + KSircProcess *proc; + bool broadcast; + +}; + +class UnicodeMessageReceiver : public KSircMessageReceiver +{ +public: + UnicodeMessageReceiver( KSircProcess *process ); + + virtual void sirc_receive(QCString str, bool broadcast = false); + virtual void sirc_receive(QString str, bool broadcast = false) = 0; + +protected: + void setEncoding( const QString &encoding ); + QString encoding() const; + + QTextCodec *encoder() const; + +private: + QString m_encoding; + QTextCodec *m_encoder; +}; + +#endif -- cgit v1.2.1