summaryrefslogtreecommitdiffstats
blob: 6bae1322eeb46a7d6fec841bd8855066cc145908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Copyright (c) 2012 Yoann Blein
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#pragma once

#include <Swiften/Base/boost_bsignals.h>

#include <boost/shared_ptr.hpp>

namespace Swift {
	class ScreenSharingManager;
	class IncomingScreenSharing;
	class OutgoingScreenSharing;
	class Timer;
	class TimerFactory;
	class DesktopScreenGrabber;
	class RemoteScreenWindowFactory;
	class RemoteScreenWindow;
	class JID;

	class ScreenSharingController {
		public:
			ScreenSharingController(ScreenSharingManager* screenSharingManager, RemoteScreenWindowFactory* remoteScreenWindowFactory, TimerFactory* timerFactory);
			~ScreenSharingController();

			boost::shared_ptr<OutgoingScreenSharing> createOugoingScreenSharing(const JID& to);

		public:
			boost::signal<void (boost::shared_ptr<IncomingScreenSharing>)> onNewIncomingScreenSharing;

		private:
			void handleIncomingScreenSharing(boost::shared_ptr<IncomingScreenSharing> incomingScreenSharing);
			void handleGrabTimerTick();
			void handleOssReady();
			void handleIncomingFinished();
			void handleOutgoingFinished();

		private:
			ScreenSharingManager* screenSharingManager;
			RemoteScreenWindowFactory* remoteScreenWindowFactory;

			RemoteScreenWindow* remoteScreenWindow;
			boost::shared_ptr<Timer> grabTimer;
			DesktopScreenGrabber* screenGrabber;
			boost::shared_ptr<IncomingScreenSharing> iss;
			boost::shared_ptr<OutgoingScreenSharing> oss;
	};
}