/* * Copyright (c) 2012 Mateusz Piękos * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include #include namespace Swift { WhiteboardManager::WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, StanzaChannel* stanzaChannel) : whiteboardWindowFactory_(whiteboardWindowFactory), uiEventStream_(uiEventStream), stanzaChannel_(stanzaChannel) { uiEventConnection_ = uiEventStream_->onUIEvent.connect(boost::bind(&WhiteboardManager::handleUIEvent, this, _1)); } WhiteboardManager::~WhiteboardManager() { } void WhiteboardManager::handleUIEvent(boost::shared_ptr event) { boost::shared_ptr whiteboardEvent = boost::dynamic_pointer_cast(event); if(whiteboardEvent) { WhiteboardWindow* window = whiteboardWindowFactory_->createWhiteboardWindow(stanzaChannel_, whiteboardEvent->getContact()); window->show(); } } }