1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef ipc_MediaControlIPC_h
8 #define ipc_MediaControlIPC_h
10 #include "ipc/EnumSerializer.h"
12 #include "mozilla/dom/MediaControllerBinding.h"
13 #include "mozilla/dom/MediaControlKeySource.h"
14 #include "mozilla/dom/MediaPlaybackStatus.h"
18 struct ParamTraits
<mozilla::dom::MediaControlKey
>
19 : public ContiguousEnumSerializerInclusive
<
20 mozilla::dom::MediaControlKey
, mozilla::dom::MediaControlKey::Focus
,
21 mozilla::dom::MediaControlKey::Stop
> {};
24 struct ParamTraits
<mozilla::dom::MediaPlaybackState
>
25 : public ContiguousEnumSerializerInclusive
<
26 mozilla::dom::MediaPlaybackState
,
27 mozilla::dom::MediaPlaybackState::eStarted
,
28 mozilla::dom::MediaPlaybackState::eStopped
> {};
31 struct ParamTraits
<mozilla::dom::MediaAudibleState
>
32 : public ContiguousEnumSerializerInclusive
<
33 mozilla::dom::MediaAudibleState
,
34 mozilla::dom::MediaAudibleState::eInaudible
,
35 mozilla::dom::MediaAudibleState::eAudible
> {};
38 struct ParamTraits
<mozilla::dom::AbsoluteSeek
> {
39 typedef mozilla::dom::AbsoluteSeek paramType
;
41 static void Write(MessageWriter
* aWriter
, const paramType
& aParam
) {
42 WriteParam(aWriter
, aParam
.mSeekTime
);
43 WriteParam(aWriter
, aParam
.mFastSeek
);
46 static bool Read(MessageReader
* aReader
, paramType
* aResult
) {
47 if (!ReadParam(aReader
, &aResult
->mSeekTime
) ||
48 !ReadParam(aReader
, &aResult
->mFastSeek
)) {
56 struct ParamTraits
<mozilla::dom::SeekDetails
> {
57 typedef mozilla::dom::SeekDetails paramType
;
59 static void Write(MessageWriter
* aWriter
, const paramType
& aParam
) {
60 WriteParam(aWriter
, aParam
.mAbsolute
);
61 WriteParam(aWriter
, aParam
.mRelativeSeekOffset
);
64 static bool Read(MessageReader
* aReader
, paramType
* aResult
) {
65 if (!ReadParam(aReader
, &aResult
->mAbsolute
) ||
66 !ReadParam(aReader
, &aResult
->mRelativeSeekOffset
)) {
74 struct ParamTraits
<mozilla::dom::MediaControlAction
> {
75 typedef mozilla::dom::MediaControlAction paramType
;
77 static void Write(MessageWriter
* aWriter
, const paramType
& aParam
) {
78 WriteParam(aWriter
, aParam
.mKey
);
79 WriteParam(aWriter
, aParam
.mDetails
);
82 static bool Read(MessageReader
* aReader
, paramType
* aResult
) {
83 if (!ReadParam(aReader
, &aResult
->mKey
) ||
84 !ReadParam(aReader
, &aResult
->mDetails
)) {
93 #endif // mozilla_MediaControlIPC_hh