diff options
Diffstat (limited to 'Swift/Controllers/HistoryViewController.h')
-rw-r--r-- | Swift/Controllers/HistoryViewController.h | 102 |
1 files changed, 55 insertions, 47 deletions
diff --git a/Swift/Controllers/HistoryViewController.h b/Swift/Controllers/HistoryViewController.h index f44c968..75fc460 100644 --- a/Swift/Controllers/HistoryViewController.h +++ b/Swift/Controllers/HistoryViewController.h @@ -4,64 +4,72 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include <Swiften/Base/boost_bsignals.h> +#include <memory> +#include <set> + #include <boost/bind.hpp> -#include <boost/shared_ptr.hpp> +#include <boost/signals2.hpp> -#include <Swift/Controllers/UIEvents/UIEventStream.h> +#include <Swiften/History/HistoryStorage.h> #include <Swiften/JID/JID.h> #include <Swiften/Presence/PresenceOracle.h> -#include <Swiften/History/HistoryStorage.h> -#include <set> + +#include <Swift/Controllers/UIEvents/UIEventStream.h> namespace Swift { - class HistoryWindowFactory; - class HistoryWindow; - class Roster; - class RosterItem; - class ContactRosterItem; - class HistoryController; - class NickResolver; - class AvatarManager; + 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(); + 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); + private: + void handleUIEvent(std::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); + 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_; + 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_; - }; + std::map<HistoryMessage::Type, ContactsMap> contacts_; + ContactRosterItem* selectedItem_; + HistoryMessage::Type selectedItemType_ = HistoryMessage::Chat; + boost::gregorian::date currentResultDate_; + }; } |