00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <Swiften/Base/boost_bsignals.h>
00010 #include <boost/shared_ptr.hpp>
00011 #include <Swiften/Base/API.h>
00012
00013 #include <Swiften/Elements/Message.h>
00014 #include <Swiften/Elements/Presence.h>
00015 #include <Swiften/Elements/ChatState.h>
00016
00017 namespace Swift {
00018 class SWIFTEN_API ChatStateTracker {
00019 public:
00020 ChatStateTracker();
00021 void handleMessageReceived(boost::shared_ptr<Message> message);
00022 void handlePresenceChange(boost::shared_ptr<Presence> newPresence);
00023 boost::signal<void (ChatState::ChatStateType)> onChatStateChange;
00024 private:
00025 void changeState(ChatState::ChatStateType state);
00026 ChatState::ChatStateType currentState_;
00027 };
00028 }