summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCătălin Badea <catalin.badea392@gmail.com>2012-08-21 19:06:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-08-30 20:54:18 (GMT)
commit7d0cd94de71d9e55e573e28206470439ecde3db5 (patch)
treec361caa96dac71d53a74ba76aa3dc1d349a0c59e /Swift/Controllers/HistoryViewController.h
parent6856199274e9c5e581220fccf520b8f011519d17 (diff)
downloadswift-contrib-7d0cd94de71d9e55e573e28206470439ecde3db5.zip
swift-contrib-7d0cd94de71d9e55e573e28206470439ecde3db5.tar.bz2
History dialog
Add history dialog as an experimental feature. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/Controllers/HistoryViewController.h')
-rw-r--r--Swift/Controllers/HistoryViewController.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/Swift/Controllers/HistoryViewController.h b/Swift/Controllers/HistoryViewController.h
new file mode 100644
index 0000000..f44c968
--- /dev/null
+++ b/Swift/Controllers/HistoryViewController.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2012 Catalin Badea
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Base/boost_bsignals.h>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include <Swift/Controllers/UIEvents/UIEventStream.h>
+#include <Swiften/JID/JID.h>
+#include <Swiften/Presence/PresenceOracle.h>
+#include <Swiften/History/HistoryStorage.h>
+#include <set>
+
+namespace Swift {
+ class HistoryWindowFactory;
+ class HistoryWindow;
+ class Roster;
+ class RosterItem;
+ class ContactRosterItem;
+ class HistoryController;
+ class NickResolver;
+ class AvatarManager;
+
+ class HistoryViewController {
+ public:
+ HistoryViewController(const JID& selfJID, UIEventStream* uiEventStream, HistoryController* historyController, NickResolver* nickResolver, AvatarManager* avatarManager, PresenceOracle* presenceOracle, HistoryWindowFactory* historyWindowFactory);
+ ~HistoryViewController();
+
+ private:
+ void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleSelectedContactChanged(RosterItem* item);
+ void handleNewMessage(const HistoryMessage& message);
+ void handleReturnPressed(const std::string& keyword);
+ void handleScrollReachedTop(const boost::gregorian::date& date);
+ void handleScrollReachedBottom(const boost::gregorian::date& date);
+ void handlePreviousButtonClicked();
+ void handleNextButtonClicked();
+ void handleCalendarClicked(const boost::gregorian::date& date);
+ void handlePresenceChanged(Presence::ref presence);
+ void handleAvatarChanged(const JID& jid);
+
+ void addNewMessage(const HistoryMessage& message, bool addAtTheTop);
+ void reset();
+ Presence::ref getPresence(const JID& jid, bool isMUC);
+
+ private:
+ JID selfJID_;
+ UIEventStream* uiEventStream_;
+ HistoryController* historyController_;
+ NickResolver* nickResolver_;
+ AvatarManager* avatarManager_;
+ PresenceOracle* presenceOracle_;
+ HistoryWindowFactory* historyWindowFactory_;
+ HistoryWindow* historyWindow_;
+ Roster* roster_;
+
+ std::map<HistoryMessage::Type, ContactsMap> contacts_;
+ ContactRosterItem* selectedItem_;
+ HistoryMessage::Type selectedItemType_;
+ boost::gregorian::date currentResultDate_;
+ };
+}