00001
00022 #ifndef MESSAGEHANDLER_H
00023 #define MESSAGEHANDLER_H
00024
00025 #include <sigc++/signal_system.h>
00026
00027 #include <libicq2000/Contact.h>
00028 #include <libicq2000/events.h>
00029
00030 namespace ICQ2000 {
00031
00032 class ContactList;
00033 class UINICQSubType;
00034 class MessageEvent;
00035 class ICQMessageEvent;
00036
00037 class MessageHandler : public SigC::Object {
00038 private:
00039 ContactRef m_self_contact;
00040 ContactList *m_contact_list;
00041
00042 ICQMessageEvent* UINICQSubTypeToEvent(UINICQSubType *st, ContactRef contact);
00043 UINICQSubType* EventToUINICQSubType(MessageEvent *ev);
00044
00045 void SignalLog(LogEvent::LogType type, const std::string& msg);
00046
00047 public:
00048 MessageHandler(ContactRef self, ContactList *cl);
00049
00050
00051 bool handleIncoming(UINICQSubType* icq);
00052
00053
00054 UINICQSubType* handleOutgoing(MessageEvent *ev);
00055
00056
00057 void handleIncomingACK(MessageEvent *ev, UINICQSubType* icq);
00058
00059 SigC::Signal1<void,MessageEvent*> messaged;
00060 SigC::Signal1<void,MessageEvent*> messageack;
00061 SigC::Signal1<void,ICQMessageEvent*> want_auto_resp;
00062 SigC::Signal1<void,LogEvent*> logger;
00063 };
00064 }
00065
00066 #endif