/* * Copyright (c) 2011 Vlad Voicu * Licensed under the Simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include #include #include #include #include namespace Swift { ViewHistoryController::ViewHistoryController(RosterController* rosterController, ViewHistoryWindowFactory* viewHistoryWindowFactory, UIEventStream* uiEventStream): rosterController(rosterController), viewHistoryWindowFactory(viewHistoryWindowFactory), uiEventStream(uiEventStream), viewHistoryWindow(NULL) { uiEventStream->onUIEvent.connect(boost::bind(&ViewHistoryController::handleUIEvent, this, _1)); } ViewHistoryController::~ViewHistoryController() { } void ViewHistoryController::handleUIEvent(UIEvent::ref event) { RequestViewHistoryUIEvent::ref viewHistoryEvent = boost::dynamic_pointer_cast(event); if (!viewHistoryWindow) { viewHistoryWindow = viewHistoryWindowFactory->createViewHistoryWindow(); } } void ViewHistoryController::setAvailable(bool b) { if (viewHistoryWindow) { viewHistoryWindow->setEnabled(b); } } }