summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp')
-rw-r--r--Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp
new file mode 100644
index 0000000..1f5cdec
--- /dev/null
+++ b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012 Yoann Blein
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include "ScreenSharingOverviewImpl.h"
+
+#include "Swift/QtUI/ScreenSharing/QtDesktopScreenGrabber.h"
+#include "Swift/Controllers/ScreenSharing/ScreenSharingController.h"
+#include <Swiften/ScreenSharing/ScreenSharingManager.h>
+
+#include <boost/bind.hpp>
+
+namespace Swift {
+
+ScreenSharingOverviewImpl::ScreenSharingOverviewImpl(ScreenSharingManager *screenSharingManager, RemoteScreenWindowFactory* remoteScreenViewerFactory, TimerFactory* timerFactory)
+ : ScreenSharingOverview(),
+ screenSharingManager(screenSharingManager), remoteScreenWindowFactory(remoteScreenViewerFactory), timerFactory(timerFactory),
+ screenGrabber(new QtDesktopScreenGrabber)
+{
+ screenSharingManager->onIncomingScreenSharing.connect(boost::bind(&ScreenSharingOverviewImpl::handleIncomingScreenSharing, this, _1));
+}
+
+ScreenSharingOverviewImpl::~ScreenSharingOverviewImpl()
+{
+ screenSharingManager->onIncomingScreenSharing.disconnect(boost::bind(&ScreenSharingOverviewImpl::handleIncomingScreenSharing, this, _1));
+}
+
+void ScreenSharingOverviewImpl::createOugoingScreenSharing(const JID& to)
+{
+ ScreenSharingController* ssc = new ScreenSharingController(screenSharingManager, timerFactory, screenGrabber, to);
+ controllers.push_back(ssc);
+ onNewScreenSharingController(ssc);
+}
+
+void ScreenSharingOverviewImpl::handleIncomingScreenSharing(boost::shared_ptr<IncomingScreenSharing> incomingScreenSharing)
+{
+ ScreenSharingController* ssc = new ScreenSharingController(incomingScreenSharing, remoteScreenWindowFactory);
+ controllers.push_back(ssc);
+ onNewScreenSharingController(ssc);
+}
+
+}