summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-02-10 15:29:44 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-02-10 15:29:44 (GMT)
commit1d20eabbc32274b491b4c2bedf73d19933d97bfd (patch)
treeb5a2760b4e72a88f24041f7821e788d34a184522 /Swiften/Chat/ChatStateNotifier.h
parent4d0c1d3b8a40cb74cfb30ed27a294afaa6ced56f (diff)
downloadswift-1d20eabbc32274b491b4c2bedf73d19933d97bfd.zip
swift-1d20eabbc32274b491b4c2bedf73d19933d97bfd.tar.bz2
ChatStateNotifier and tests, ready for XEP-85 support.
Diffstat (limited to 'Swiften/Chat/ChatStateNotifier.h')
-rw-r--r--Swiften/Chat/ChatStateNotifier.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/Swiften/Chat/ChatStateNotifier.h b/Swiften/Chat/ChatStateNotifier.h
new file mode 100644
index 0000000..90228b7
--- /dev/null
+++ b/Swiften/Chat/ChatStateNotifier.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <boost/signals.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace Swift {
+ class ChatStateNotifier {
+ public:
+ enum ChatState {Active, Composing, Paused, Inactive, Gone};
+ ChatStateNotifier();
+ void setContactHas85Caps(bool hasCaps);
+ void setUserIsTyping();
+ void userSentMessage();
+ void userCancelledNewMessage();
+ void receivedMessageFromContact(bool hasActiveElement);
+ bool contactShouldReceiveStates();
+
+ boost::signal<void (ChatState)> onChatStateChanged;
+ private:
+ bool contactHas85Caps_;
+ bool isInConversation_;
+ bool contactHasSentActive_;
+ bool userIsTyping_;
+ };
+}