diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-03-28 13:40:14 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-03-28 13:40:43 (GMT) |
commit | b61486fefe602e0d18fa5279021006f87b965307 (patch) | |
tree | 437585cbef1179e1ec31f79789591d5610200c29 /Swiften/Events | |
parent | dae28dd45e43fc6e6ef2ec4c6c65d5d736ed86f8 (diff) | |
download | swift-contrib-b61486fefe602e0d18fa5279021006f87b965307.zip swift-contrib-b61486fefe602e0d18fa5279021006f87b965307.tar.bz2 |
Moved Swiften to a separate module.
Diffstat (limited to 'Swiften/Events')
m--------- | Swiften | 0 | ||||
-rw-r--r-- | Swiften/Events/MessageEvent.h | 33 | ||||
-rw-r--r-- | Swiften/Events/StanzaEvent.h | 18 | ||||
-rw-r--r-- | Swiften/Events/SubscriptionRequestEvent.h | 36 |
4 files changed, 0 insertions, 87 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Events/MessageEvent.h b/Swiften/Events/MessageEvent.h deleted file mode 100644 index 43174a1..0000000 --- a/Swiften/Events/MessageEvent.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef SWIFTEN_MessageEvent_H -#define SWIFTEN_MessageEvent_H - -#include <cassert> - -#include <boost/signals.hpp> -#include <boost/shared_ptr.hpp> - -#include "Swiften/Events/StanzaEvent.h" -#include "Swiften/Elements/Message.h" - -namespace Swift { - class MessageEvent : public StanzaEvent { - public: - MessageEvent(boost::shared_ptr<Message> stanza) : stanza_(stanza){}; - virtual ~MessageEvent(){}; - boost::shared_ptr<Message> getStanza() {return stanza_;} - - bool isReadable() { - return getStanza()->isError() || !getStanza()->getBody().isEmpty(); - } - - void read() { - assert (isReadable()); - conclude(); - } - - private: - boost::shared_ptr<Message> stanza_; - }; -} - -#endif diff --git a/Swiften/Events/StanzaEvent.h b/Swiften/Events/StanzaEvent.h deleted file mode 100644 index b1dc537..0000000 --- a/Swiften/Events/StanzaEvent.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include <boost/signals.hpp> -#include <boost/shared_ptr.hpp> - -namespace Swift { - class StanzaEvent { - public: - StanzaEvent(){concluded_ = false;}; - virtual ~StanzaEvent() {}; - void conclude() {concluded_ = true; onConclusion();}; - /** Do not call this directly from outside the class */ - boost::signal<void()> onConclusion; - bool getConcluded() {return concluded_;}; - private: - bool concluded_; - }; -} diff --git a/Swiften/Events/SubscriptionRequestEvent.h b/Swiften/Events/SubscriptionRequestEvent.h deleted file mode 100644 index ed063d7..0000000 --- a/Swiften/Events/SubscriptionRequestEvent.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include <cassert> - -#include <boost/signals.hpp> -#include <boost/shared_ptr.hpp> - -#include "Swiften/Events/StanzaEvent.h" -#include "Swiften/Base/String.h" -#include "Swiften/JID/JID.h" - -namespace Swift { - class SubscriptionRequestEvent : public StanzaEvent { - public: - SubscriptionRequestEvent(const JID& jid, const String& reason) : jid_(jid), reason_(reason){}; - virtual ~SubscriptionRequestEvent(){}; - const JID& getJID() const {return jid_;}; - const String& getReason() const {return reason_;}; - boost::signal<void()> onAccept; - boost::signal<void()> onDecline; - void accept() { - onAccept(); - conclude(); - }; - - void decline() { - onDecline(); - conclude(); - }; - - private: - JID jid_; - String reason_; - }; -} - |