1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 include protocol PContent;
7 include protocol PFMRadioRequest;
9 using mozilla::hal::FMRadioSeekDirection from "mozilla/HalTypes.h";
14 struct EnableRequestArgs
19 struct DisableRequestArgs
23 struct SetFrequencyRequestArgs
28 struct SeekRequestArgs
30 FMRadioSeekDirection direction;
33 struct CancelSeekRequestArgs
37 union FMRadioRequestArgs
41 SetFrequencyRequestArgs;
43 CancelSeekRequestArgs;
55 sync protocol PFMRadio
58 manages PFMRadioRequest;
62 * Sent when the frequency is changed.
64 NotifyFrequencyChanged(double frequency);
66 * Sent when the power state of FM radio HW is changed.
68 NotifyEnabledChanged(bool enabled, double frequency);
74 * Get the current status infomation of FM radio HW synchronously.
75 * Sent when the singleton object of FMRadioChild is initialized.
77 sync GetStatusInfo() returns (StatusInfo info);
80 * Send request to parent process to operate the FM radio HW.
82 * We don't have separate Enable/SetFrequency/etc. methods instead here,
83 * because we can leverage the IPC messaging mechanism to manage the mapping
84 * of the asynchronous request and the DOMRequest we returned to the caller
85 * on web content, otherwise, we have to do the mapping stuff manually which
86 * is more error prone.
88 PFMRadioRequest(FMRadioRequestArgs requestType);
91 * Enable/Disable audio
93 EnableAudio(bool audioEnabled);
97 } // namespace mozilla