gecko/dom/fmradio/ipc/PFMRadio.ipdl

138 lines
2.7 KiB
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
include protocol PContent;
include protocol PFMRadioRequest;
using mozilla::hal::FMRadioSeekDirection from "mozilla/HalTypes.h";
namespace mozilla {
namespace dom {
struct EnableRequestArgs
{
double frequency;
};
struct DisableRequestArgs
{
};
struct SetFrequencyRequestArgs
{
double frequency;
};
struct SeekRequestArgs
{
FMRadioSeekDirection direction;
};
struct CancelSeekRequestArgs
{
};
struct EnableRDSArgs
{
};
struct DisableRDSArgs
{
};
union FMRadioRequestArgs
{
EnableRequestArgs;
DisableRequestArgs;
SetFrequencyRequestArgs;
SeekRequestArgs;
CancelSeekRequestArgs;
EnableRDSArgs;
DisableRDSArgs;
};
struct StatusInfo
{
bool enabled;
double frequency;
double upperBound;
double lowerBound;
double channelWidth;
};
sync protocol PFMRadio
{
manager PContent;
manages PFMRadioRequest;
child:
/**
* Sent when the frequency is changed.
*/
NotifyFrequencyChanged(double frequency);
/**
* Sent when the power state of FM radio HW is changed.
*/
NotifyEnabledChanged(bool enabled, double frequency);
/**
* Sent when RDS is enabled or disabled.
*/
NotifyRDSEnabledChanged(bool enabled);
/**
* Sent when we have a new PI code.
*/
NotifyPIChanged(bool valid, uint16_t code);
/**
* Sent when we have a new PTY
*/
NotifyPTYChanged(bool valid, uint8_t pty);
/**
* Sent when we have a new PS name.
*/
NotifyPSChanged(nsString psname);
/**
* Sent when we have new radiotext.
*/
NotifyRadiotextChanged(nsString radiotext);
/**
* Sent when a full RDS group is received.
*/
NotifyNewRDSGroup(uint64_t data);
__delete__();
parent:
/**
* Get the current status infomation of FM radio HW synchronously.
* Sent when the singleton object of FMRadioChild is initialized.
*/
sync GetStatusInfo() returns (StatusInfo info);
/**
* Send request to parent process to operate the FM radio HW.
*
* We don't have separate Enable/SetFrequency/etc. methods instead here,
* because we can leverage the IPC messaging mechanism to manage the mapping
* of the asynchronous request and the DOMRequest we returned to the caller
* on web content, otherwise, we have to do the mapping stuff manually which
* is more error prone.
*/
PFMRadioRequest(FMRadioRequestArgs requestType);
/**
* Enable/Disable audio
*/
EnableAudio(bool audioEnabled);
/**
* Set RDS group mask
*/
SetRDSGroupMask(uint32_t groupMask);
};
} // namespace dom
} // namespace mozilla