/* * Copyright (c) 2012 Yoann Blein * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #pragma once #include #include #include namespace Swift { class ScreenSharing; class ScreenSharingManager; class IncomingScreenSharing; class Timer; class TimerFactory; class DesktopScreenGrabber; class RemoteScreenWindowFactory; class RemoteScreenWindow; class ChatWindow; class ScreenSharingController { public: ScreenSharingController(ScreenSharingManager* screenSharingManager, TimerFactory* timerFactory, DesktopScreenGrabber* desktopScreenGrabber, const JID& to); ScreenSharingController(boost::shared_ptr screenSharing, RemoteScreenWindowFactory* remoteScreenWindowFactory); ~ScreenSharingController(); const JID& getOtherParty() const; std::string setChatWindow(ChatWindow *wnd, std::string nickname); void accept(); void cancel(); void stop(); private: void handleGrabTimerTick(); void handleReady(); void handleFinished(); void handleStateChange(ScreenSharing::SCState state); void handleWindowStopRequest(); private: DesktopScreenGrabber* screenGrabber; boost::shared_ptr grabTimer; RemoteScreenWindowFactory* remoteScreenWindowFactory; RemoteScreenWindow* remoteScreenWindow; boost::shared_ptr screenSharing; JID otherParty; bool incoming; std::string uiID; ChatWindow* chatWindow; }; }