1 | /* |
2 | * Copyright (C) 2010-2018 Apple Inc. All rights reserved. |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions |
6 | * are met: |
7 | * 1. Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. |
9 | * 2. Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. |
12 | * |
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND |
14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 | * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR |
17 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
19 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
20 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
21 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
22 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ |
24 | |
25 | #pragma once |
26 | |
27 | #if ENABLE(FULLSCREEN_API) |
28 | |
29 | #include "ArgumentCoders.h" |
30 | #include "Connection.h" |
31 | #include <WebCore/RectEdges.h> |
32 | #include <wtf/Forward.h> |
33 | #include <wtf/ThreadSafeRefCounted.h> |
34 | |
35 | |
36 | namespace Messages { |
37 | namespace WebFullScreenManager { |
38 | |
39 | static inline IPC::StringReference messageReceiverName() |
40 | { |
41 | return IPC::StringReference("WebFullScreenManager" ); |
42 | } |
43 | |
44 | class RequestExitFullScreen { |
45 | public: |
46 | typedef std::tuple<> Arguments; |
47 | |
48 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
49 | static IPC::StringReference name() { return IPC::StringReference("RequestExitFullScreen" ); } |
50 | static const bool isSync = false; |
51 | |
52 | const Arguments& arguments() const |
53 | { |
54 | return m_arguments; |
55 | } |
56 | |
57 | private: |
58 | Arguments m_arguments; |
59 | }; |
60 | |
61 | class WillEnterFullScreen { |
62 | public: |
63 | typedef std::tuple<> Arguments; |
64 | |
65 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
66 | static IPC::StringReference name() { return IPC::StringReference("WillEnterFullScreen" ); } |
67 | static const bool isSync = false; |
68 | |
69 | const Arguments& arguments() const |
70 | { |
71 | return m_arguments; |
72 | } |
73 | |
74 | private: |
75 | Arguments m_arguments; |
76 | }; |
77 | |
78 | class DidEnterFullScreen { |
79 | public: |
80 | typedef std::tuple<> Arguments; |
81 | |
82 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
83 | static IPC::StringReference name() { return IPC::StringReference("DidEnterFullScreen" ); } |
84 | static const bool isSync = false; |
85 | |
86 | const Arguments& arguments() const |
87 | { |
88 | return m_arguments; |
89 | } |
90 | |
91 | private: |
92 | Arguments m_arguments; |
93 | }; |
94 | |
95 | class WillExitFullScreen { |
96 | public: |
97 | typedef std::tuple<> Arguments; |
98 | |
99 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
100 | static IPC::StringReference name() { return IPC::StringReference("WillExitFullScreen" ); } |
101 | static const bool isSync = false; |
102 | |
103 | const Arguments& arguments() const |
104 | { |
105 | return m_arguments; |
106 | } |
107 | |
108 | private: |
109 | Arguments m_arguments; |
110 | }; |
111 | |
112 | class DidExitFullScreen { |
113 | public: |
114 | typedef std::tuple<> Arguments; |
115 | |
116 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
117 | static IPC::StringReference name() { return IPC::StringReference("DidExitFullScreen" ); } |
118 | static const bool isSync = false; |
119 | |
120 | const Arguments& arguments() const |
121 | { |
122 | return m_arguments; |
123 | } |
124 | |
125 | private: |
126 | Arguments m_arguments; |
127 | }; |
128 | |
129 | class SetAnimatingFullScreen { |
130 | public: |
131 | typedef std::tuple<bool> Arguments; |
132 | |
133 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
134 | static IPC::StringReference name() { return IPC::StringReference("SetAnimatingFullScreen" ); } |
135 | static const bool isSync = false; |
136 | |
137 | explicit SetAnimatingFullScreen(bool animating) |
138 | : m_arguments(animating) |
139 | { |
140 | } |
141 | |
142 | const Arguments& arguments() const |
143 | { |
144 | return m_arguments; |
145 | } |
146 | |
147 | private: |
148 | Arguments m_arguments; |
149 | }; |
150 | |
151 | class SaveScrollPosition { |
152 | public: |
153 | typedef std::tuple<> Arguments; |
154 | |
155 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
156 | static IPC::StringReference name() { return IPC::StringReference("SaveScrollPosition" ); } |
157 | static const bool isSync = false; |
158 | |
159 | const Arguments& arguments() const |
160 | { |
161 | return m_arguments; |
162 | } |
163 | |
164 | private: |
165 | Arguments m_arguments; |
166 | }; |
167 | |
168 | class RestoreScrollPosition { |
169 | public: |
170 | typedef std::tuple<> Arguments; |
171 | |
172 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
173 | static IPC::StringReference name() { return IPC::StringReference("RestoreScrollPosition" ); } |
174 | static const bool isSync = false; |
175 | |
176 | const Arguments& arguments() const |
177 | { |
178 | return m_arguments; |
179 | } |
180 | |
181 | private: |
182 | Arguments m_arguments; |
183 | }; |
184 | |
185 | class SetFullscreenInsets { |
186 | public: |
187 | typedef std::tuple<const WebCore::RectEdges<float>&> Arguments; |
188 | |
189 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
190 | static IPC::StringReference name() { return IPC::StringReference("SetFullscreenInsets" ); } |
191 | static const bool isSync = false; |
192 | |
193 | explicit SetFullscreenInsets(const WebCore::RectEdges<float>& insets) |
194 | : m_arguments(insets) |
195 | { |
196 | } |
197 | |
198 | const Arguments& arguments() const |
199 | { |
200 | return m_arguments; |
201 | } |
202 | |
203 | private: |
204 | Arguments m_arguments; |
205 | }; |
206 | |
207 | class SetFullscreenAutoHideDuration { |
208 | public: |
209 | typedef std::tuple<const Seconds&> Arguments; |
210 | |
211 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
212 | static IPC::StringReference name() { return IPC::StringReference("SetFullscreenAutoHideDuration" ); } |
213 | static const bool isSync = false; |
214 | |
215 | explicit SetFullscreenAutoHideDuration(const Seconds& duration) |
216 | : m_arguments(duration) |
217 | { |
218 | } |
219 | |
220 | const Arguments& arguments() const |
221 | { |
222 | return m_arguments; |
223 | } |
224 | |
225 | private: |
226 | Arguments m_arguments; |
227 | }; |
228 | |
229 | class SetFullscreenControlsHidden { |
230 | public: |
231 | typedef std::tuple<bool> Arguments; |
232 | |
233 | static IPC::StringReference receiverName() { return messageReceiverName(); } |
234 | static IPC::StringReference name() { return IPC::StringReference("SetFullscreenControlsHidden" ); } |
235 | static const bool isSync = false; |
236 | |
237 | explicit SetFullscreenControlsHidden(bool hidden) |
238 | : m_arguments(hidden) |
239 | { |
240 | } |
241 | |
242 | const Arguments& arguments() const |
243 | { |
244 | return m_arguments; |
245 | } |
246 | |
247 | private: |
248 | Arguments m_arguments; |
249 | }; |
250 | |
251 | } // namespace WebFullScreenManager |
252 | } // namespace Messages |
253 | |
254 | #endif // ENABLE(FULLSCREEN_API) |
255 | |