dom/fmradio/ipc/PFMRadio.ipdl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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";
    11 namespace mozilla {
    12 namespace dom {
    14 struct EnableRequestArgs
    15 {
    16   double frequency;
    17 };
    19 struct DisableRequestArgs
    20 {
    21 };
    23 struct SetFrequencyRequestArgs
    24 {
    25   double frequency;
    26 };
    28 struct SeekRequestArgs
    29 {
    30   FMRadioSeekDirection direction;
    31 };
    33 struct CancelSeekRequestArgs
    34 {
    35 };
    37 union FMRadioRequestArgs
    38 {
    39   EnableRequestArgs;
    40   DisableRequestArgs;
    41   SetFrequencyRequestArgs;
    42   SeekRequestArgs;
    43   CancelSeekRequestArgs;
    44 };
    46 struct StatusInfo
    47 {
    48   bool enabled;
    49   double frequency;
    50   double upperBound;
    51   double lowerBound;
    52   double channelWidth;
    53 };
    55 sync protocol PFMRadio
    56 {
    57   manager PContent;
    58   manages PFMRadioRequest;
    60 child:
    61   /**
    62    * Sent when the frequency is changed.
    63    */
    64   NotifyFrequencyChanged(double frequency);
    65   /**
    66    * Sent when the power state of FM radio HW is changed.
    67    */
    68   NotifyEnabledChanged(bool enabled, double frequency);
    70   __delete__();
    72 parent:
    73   /**
    74    * Get the current status infomation of FM radio HW synchronously.
    75    * Sent when the singleton object of FMRadioChild is initialized.
    76    */
    77   sync GetStatusInfo() returns (StatusInfo info);
    79   /**
    80    * Send request to parent process to operate the FM radio HW.
    81    *
    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.
    87    */
    88   PFMRadioRequest(FMRadioRequestArgs requestType);
    90   /**
    91    * Enable/Disable audio
    92    */
    93   EnableAudio(bool audioEnabled);
    94 };
    96 } // namespace dom
    97 } // namespace mozilla

mercurial