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 --- kopete/libkopete/kopetemessageevent.h | 129 ++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 kopete/libkopete/kopetemessageevent.h (limited to 'kopete/libkopete/kopetemessageevent.h') diff --git a/kopete/libkopete/kopetemessageevent.h b/kopete/libkopete/kopetemessageevent.h new file mode 100644 index 00000000..7beb1aa2 --- /dev/null +++ b/kopete/libkopete/kopetemessageevent.h @@ -0,0 +1,129 @@ +/* + kopetemessageevent.h - Kopete Message Event + + Copyright (c) 2003 by Olivier Goffart + Copyright (c) 2002 by Duncan Mac-Vicar Prett + Copyright (c) 2002 by Hendrik vom Lehn + Copyright (c) 2004 by Richard Smith + + Kopete (c) 2002 by the Kopete developers + + ************************************************************************* + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + ************************************************************************* +*/ + +#ifndef KOPETEMESSAGEEVENT_H +#define KOPETEMESSAGEEVENT_H + +#include + +#include "kopetemessage.h" + +#include "kopete_export.h" + +namespace Kopete +{ + +/** + * @author Olivier Goffart + * @author Richard Smith + * + * Kopete::MessageEvent is used when a new messages arrives, it is + * caught by the UI. It contains just informations about + * the message, and a signal when it is terminated (i.e. + * the message is read + **/ +class KOPETE_EXPORT MessageEvent : public QObject +{ + Q_OBJECT + +public: + MessageEvent(const Kopete::Message& , QObject* parent=0L, const char *name=0L); + ~MessageEvent(); + + /** + * @return A copy of the message + */ + Kopete::Message message(); + + /** + * Sets the message contained in this event. + * @param message The new value for the message + */ + void setMessage( const Kopete::Message &message ); + + /** + * The state of the event. + * - @c Nothing means that the event has not been accepted or ignored + * - @c Applied if the event has been applied + * - @c Ignored if the event has been ignored + */ + enum EventState { Nothing , Applied , Ignored }; + + EventState state(); + +public slots: + /** + * @deprecated Use accept() instead to continue the processing of this event once the caller has moved to using MessageHandlers + * + * execute the event + */ + void apply(); + + /** + * @deprecated Use discard() instead to destroy this event once the caller has moved to using MessageHandlers + * + * ignore the event + */ + void ignore(); + + /** + * @brief Passes the event to the next handler + * + * Call this when you've finished processing this event + */ + void accept(); + + /** + * @brief Discards the event + * + * If this event should not be processed any further, this function + * should be called to discard it. + */ + void discard(); + +signals: + /** + * The event has been processed + */ + void done(Kopete::MessageEvent *); + + /** + * The event has been discarded. + * @param event The event sending the signal. + */ + void discarded(Kopete::MessageEvent *event); + + /** + * The event has been accepted by its current handler. + * @param event The event sending the signal. + */ + void accepted(Kopete::MessageEvent *event); + +private: + class Private; + Private *d; +}; + +} + +#endif + +// vim: set noet ts=4 sts=4 sw=4: + -- cgit v1.2.1