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#include "ArgumentCoders.h"
28#include "Connection.h"
29#include <WebCore/PageIdentifier.h>
30#include <wtf/Forward.h>
31#include <wtf/ThreadSafeRefCounted.h>
32#include <wtf/text/WTFString.h>
33
34
35namespace Messages {
36namespace WebInspectorUI {
37
38static inline IPC::StringReference messageReceiverName()
39{
40 return IPC::StringReference("WebInspectorUI");
41}
42
43class EstablishConnection {
44public:
45 typedef std::tuple<const WebCore::PageIdentifier&, bool, const unsigned&> Arguments;
46
47 static IPC::StringReference receiverName() { return messageReceiverName(); }
48 static IPC::StringReference name() { return IPC::StringReference("EstablishConnection"); }
49 static const bool isSync = false;
50
51 EstablishConnection(const WebCore::PageIdentifier& inspectedPageIdentifier, bool underTest, const unsigned& inspectionLevel)
52 : m_arguments(inspectedPageIdentifier, underTest, inspectionLevel)
53 {
54 }
55
56 const Arguments& arguments() const
57 {
58 return m_arguments;
59 }
60
61private:
62 Arguments m_arguments;
63};
64
65class UpdateConnection {
66public:
67 typedef std::tuple<> Arguments;
68
69 static IPC::StringReference receiverName() { return messageReceiverName(); }
70 static IPC::StringReference name() { return IPC::StringReference("UpdateConnection"); }
71 static const bool isSync = false;
72
73 const Arguments& arguments() const
74 {
75 return m_arguments;
76 }
77
78private:
79 Arguments m_arguments;
80};
81
82class AttachedBottom {
83public:
84 typedef std::tuple<> Arguments;
85
86 static IPC::StringReference receiverName() { return messageReceiverName(); }
87 static IPC::StringReference name() { return IPC::StringReference("AttachedBottom"); }
88 static const bool isSync = false;
89
90 const Arguments& arguments() const
91 {
92 return m_arguments;
93 }
94
95private:
96 Arguments m_arguments;
97};
98
99class AttachedRight {
100public:
101 typedef std::tuple<> Arguments;
102
103 static IPC::StringReference receiverName() { return messageReceiverName(); }
104 static IPC::StringReference name() { return IPC::StringReference("AttachedRight"); }
105 static const bool isSync = false;
106
107 const Arguments& arguments() const
108 {
109 return m_arguments;
110 }
111
112private:
113 Arguments m_arguments;
114};
115
116class AttachedLeft {
117public:
118 typedef std::tuple<> Arguments;
119
120 static IPC::StringReference receiverName() { return messageReceiverName(); }
121 static IPC::StringReference name() { return IPC::StringReference("AttachedLeft"); }
122 static const bool isSync = false;
123
124 const Arguments& arguments() const
125 {
126 return m_arguments;
127 }
128
129private:
130 Arguments m_arguments;
131};
132
133class Detached {
134public:
135 typedef std::tuple<> Arguments;
136
137 static IPC::StringReference receiverName() { return messageReceiverName(); }
138 static IPC::StringReference name() { return IPC::StringReference("Detached"); }
139 static const bool isSync = false;
140
141 const Arguments& arguments() const
142 {
143 return m_arguments;
144 }
145
146private:
147 Arguments m_arguments;
148};
149
150class SetDockingUnavailable {
151public:
152 typedef std::tuple<bool> Arguments;
153
154 static IPC::StringReference receiverName() { return messageReceiverName(); }
155 static IPC::StringReference name() { return IPC::StringReference("SetDockingUnavailable"); }
156 static const bool isSync = false;
157
158 explicit SetDockingUnavailable(bool unavailable)
159 : m_arguments(unavailable)
160 {
161 }
162
163 const Arguments& arguments() const
164 {
165 return m_arguments;
166 }
167
168private:
169 Arguments m_arguments;
170};
171
172class SetIsVisible {
173public:
174 typedef std::tuple<bool> Arguments;
175
176 static IPC::StringReference receiverName() { return messageReceiverName(); }
177 static IPC::StringReference name() { return IPC::StringReference("SetIsVisible"); }
178 static const bool isSync = false;
179
180 explicit SetIsVisible(bool visible)
181 : m_arguments(visible)
182 {
183 }
184
185 const Arguments& arguments() const
186 {
187 return m_arguments;
188 }
189
190private:
191 Arguments m_arguments;
192};
193
194class ShowConsole {
195public:
196 typedef std::tuple<> Arguments;
197
198 static IPC::StringReference receiverName() { return messageReceiverName(); }
199 static IPC::StringReference name() { return IPC::StringReference("ShowConsole"); }
200 static const bool isSync = false;
201
202 const Arguments& arguments() const
203 {
204 return m_arguments;
205 }
206
207private:
208 Arguments m_arguments;
209};
210
211class ShowResources {
212public:
213 typedef std::tuple<> Arguments;
214
215 static IPC::StringReference receiverName() { return messageReceiverName(); }
216 static IPC::StringReference name() { return IPC::StringReference("ShowResources"); }
217 static const bool isSync = false;
218
219 const Arguments& arguments() const
220 {
221 return m_arguments;
222 }
223
224private:
225 Arguments m_arguments;
226};
227
228class ShowTimelines {
229public:
230 typedef std::tuple<> Arguments;
231
232 static IPC::StringReference receiverName() { return messageReceiverName(); }
233 static IPC::StringReference name() { return IPC::StringReference("ShowTimelines"); }
234 static const bool isSync = false;
235
236 const Arguments& arguments() const
237 {
238 return m_arguments;
239 }
240
241private:
242 Arguments m_arguments;
243};
244
245class ShowMainResourceForFrame {
246public:
247 typedef std::tuple<const String&> Arguments;
248
249 static IPC::StringReference receiverName() { return messageReceiverName(); }
250 static IPC::StringReference name() { return IPC::StringReference("ShowMainResourceForFrame"); }
251 static const bool isSync = false;
252
253 explicit ShowMainResourceForFrame(const String& frameIdentifier)
254 : m_arguments(frameIdentifier)
255 {
256 }
257
258 const Arguments& arguments() const
259 {
260 return m_arguments;
261 }
262
263private:
264 Arguments m_arguments;
265};
266
267class StartPageProfiling {
268public:
269 typedef std::tuple<> Arguments;
270
271 static IPC::StringReference receiverName() { return messageReceiverName(); }
272 static IPC::StringReference name() { return IPC::StringReference("StartPageProfiling"); }
273 static const bool isSync = false;
274
275 const Arguments& arguments() const
276 {
277 return m_arguments;
278 }
279
280private:
281 Arguments m_arguments;
282};
283
284class StopPageProfiling {
285public:
286 typedef std::tuple<> Arguments;
287
288 static IPC::StringReference receiverName() { return messageReceiverName(); }
289 static IPC::StringReference name() { return IPC::StringReference("StopPageProfiling"); }
290 static const bool isSync = false;
291
292 const Arguments& arguments() const
293 {
294 return m_arguments;
295 }
296
297private:
298 Arguments m_arguments;
299};
300
301class StartElementSelection {
302public:
303 typedef std::tuple<> Arguments;
304
305 static IPC::StringReference receiverName() { return messageReceiverName(); }
306 static IPC::StringReference name() { return IPC::StringReference("StartElementSelection"); }
307 static const bool isSync = false;
308
309 const Arguments& arguments() const
310 {
311 return m_arguments;
312 }
313
314private:
315 Arguments m_arguments;
316};
317
318class StopElementSelection {
319public:
320 typedef std::tuple<> Arguments;
321
322 static IPC::StringReference receiverName() { return messageReceiverName(); }
323 static IPC::StringReference name() { return IPC::StringReference("StopElementSelection"); }
324 static const bool isSync = false;
325
326 const Arguments& arguments() const
327 {
328 return m_arguments;
329 }
330
331private:
332 Arguments m_arguments;
333};
334
335class DidSave {
336public:
337 typedef std::tuple<const String&> Arguments;
338
339 static IPC::StringReference receiverName() { return messageReceiverName(); }
340 static IPC::StringReference name() { return IPC::StringReference("DidSave"); }
341 static const bool isSync = false;
342
343 explicit DidSave(const String& url)
344 : m_arguments(url)
345 {
346 }
347
348 const Arguments& arguments() const
349 {
350 return m_arguments;
351 }
352
353private:
354 Arguments m_arguments;
355};
356
357class DidAppend {
358public:
359 typedef std::tuple<const String&> Arguments;
360
361 static IPC::StringReference receiverName() { return messageReceiverName(); }
362 static IPC::StringReference name() { return IPC::StringReference("DidAppend"); }
363 static const bool isSync = false;
364
365 explicit DidAppend(const String& url)
366 : m_arguments(url)
367 {
368 }
369
370 const Arguments& arguments() const
371 {
372 return m_arguments;
373 }
374
375private:
376 Arguments m_arguments;
377};
378
379class SendMessageToFrontend {
380public:
381 typedef std::tuple<const String&> Arguments;
382
383 static IPC::StringReference receiverName() { return messageReceiverName(); }
384 static IPC::StringReference name() { return IPC::StringReference("SendMessageToFrontend"); }
385 static const bool isSync = false;
386
387 explicit SendMessageToFrontend(const String& message)
388 : m_arguments(message)
389 {
390 }
391
392 const Arguments& arguments() const
393 {
394 return m_arguments;
395 }
396
397private:
398 Arguments m_arguments;
399};
400
401} // namespace WebInspectorUI
402} // namespace Messages
403