diff options
Diffstat (limited to 'Swiften/Chat/ChatStateTracker.h')
-rw-r--r-- | Swiften/Chat/ChatStateTracker.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Swiften/Chat/ChatStateTracker.h b/Swiften/Chat/ChatStateTracker.h new file mode 100644 index 0000000..e66bbae --- /dev/null +++ b/Swiften/Chat/ChatStateTracker.h @@ -0,0 +1,21 @@ +#pragma once + +#include <boost/signal.hpp> +#include <boost/shared_ptr.hpp> + +#include "Swiften/Elements/Message.h" +#include "Swiften/Elements/Presence.h" +#include "Swiften/Elements/ChatState.h" + +namespace Swift { + class ChatStateTracker { + public: + ChatStateTracker(); + void handleMessageReceived(boost::shared_ptr<Message> message); + void handlePresenceChange(boost::shared_ptr<Presence> newPresence, boost::shared_ptr<Presence> oldPresence); + boost::signal<void (ChatState::ChatStateType)> onChatStateChange; + private: + void changeState(ChatState::ChatStateType state); + ChatState::ChatStateType currentState_; + }; +} |