/usr/share/idl/thunderbird/nsITVService.idl is in thunderbird-dev 1:38.6.0+build1-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | /* 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 "nsISupports.idl"
interface nsIArray;
%{C++
#define TV_TUNER_DATA_CID \
{ 0x1f36be28, 0xf9fe, 0x2dc3, { 0xbf, 0x2a, 0x17, 0x97, 0x93, 0x40, 0xff, 0xe1 } }
#define TV_TUNER_DATA_CONTRACTID \
"@mozilla.org/tv/tvtunerdata;1"
%}
/**
* XPCOM component which acts as the container for tuner data.
*
* NOTE: Use do_CreateInstance() to create the Gecko provided implementation,
* and then uses the setter functions to adjust the properties of the object
* before passing it.
*/
[scriptable, builtinclass, uuid(608d3f7e-f9f1-4b3c-82c2-3eb60b1d3de8)]
interface nsITVTunerData : nsISupports
{
attribute DOMString id;
/**
* Get the supported source types of the tuner. Please refer to
* http://seanyhlin.github.io/TV-Manager-API/ for available values.
*
* @param count The number of supported source types.
* @param sourceTypes An array of supported source types.
*/
void getSupportedSourceTypes([optional] out unsigned long count,
[retval, array, size_is(count)] out string sourceTypes);
/**
* Set the supported source types of the tuner. Please refer to
* http://seanyhlin.github.io/TV-Manager-API/ for available values.
*
* @param count The number of supported source types.
* @param sourceTypes An array of supported source types.
*/
void setSupportedSourceTypes(in unsigned long count,
[array, size_is(count)] in string sourceTypes);
};
%{C++
#define TV_CHANNEL_DATA_CID \
{ 0xdafe6881, 0x0964, 0xdb5b, { 0x59, 0xc6, 0x20, 0x0b, 0xa6, 0x59, 0xe6, 0x68 } }
#define TV_CHANNEL_DATA_CONTRACTID \
"@mozilla.org/tv/tvchanneldata;1"
%}
/**
* XPCOM component which acts as the container for channel data.
*
* NOTE: Use do_CreateInstance() to create the Gecko provided implementation,
* and then uses the setter functions to adjust the properties of the object
* before passing it.
*/
[scriptable, builtinclass, uuid(5d01ea74-2db6-11e4-9dba-74d02b97e723)]
interface nsITVChannelData : nsISupports
{
attribute DOMString networkId;
attribute DOMString transportStreamId;
attribute DOMString serviceId;
attribute DOMString type;
attribute DOMString number;
attribute DOMString name;
[infallible] attribute boolean isEmergency;
[infallible] attribute boolean isFree;
};
%{C++
#define TV_PROGRAM_DATA_CID \
{ 0x11415eeb, 0x27a6, 0x1c04, { 0x91, 0x33, 0x3e, 0x0a, 0xdd, 0x48, 0x5d, 0xb3 } }
#define TV_PROGRAM_DATA_CONTRACTID \
"@mozilla.org/tv/tvprogramdata;1"
%}
/**
* XPCOM component which acts as the container for program data.
*
* NOTE: Use do_CreateInstance() to create the Gecko provided implementation,
* and then uses the setter functions to adjust the properties of the object
* before passing it.
*/
[scriptable, builtinclass, uuid(ed65422e-2d97-11e4-89d6-74d02b97e723)]
interface nsITVProgramData : nsISupports
{
attribute DOMString eventId;
attribute DOMString title;
[infallible] attribute unsigned long long startTime;
[infallible] attribute unsigned long long duration;
attribute DOMString description;
attribute DOMString rating;
/**
* Get the audio languages of the program. Please refer to
* http://seanyhlin.github.io/TV-Manager-API/ for available values.
*
* @param count The number of languages.
* @param languages An array of languages.
*/
void getAudioLanguages([optional] out unsigned long count,
[retval, array, size_is(count)] out string languages);
/**
* Set the audio languages of the program. Please refer to
* http://seanyhlin.github.io/TV-Manager-API/ for available values.
*
* @param count The number of languages.
* @param languages An array of languages.
*/
void setAudioLanguages(in unsigned long count,
[array, size_is(count)] in string languages);
/**
* Get the subtitle languages of the program. Please refer to
* http://seanyhlin.github.io/TV-Manager-API/ for available values.
*
* @param count The number of languages.
* @param languages An array of languages.
*/
void getSubtitleLanguages([optional] out unsigned long count,
[retval, array, size_is(count)] out string languages);
/**
* Set the subtitle languages of the program. Please refer to
* http://seanyhlin.github.io/TV-Manager-API/ for available values.
*
* @param count The number of languages.
* @param languages An array of languages.
*/
void setSubtitleLanguages(in unsigned long count,
[array, size_is(count)] in string languages);
};
[builtinclass, uuid(c3fd7a8c-21e4-11e4-97e8-74d02b97e723)]
interface nsITVSourceListener : nsISupports
{
/**
* Called when a channel is detected through scanning (after
* |nsITVService::startScanningChannels()| is invoked and probably before
* |nsITVService::stopScanningChannels()|, if any, is invoked).
*
* @param tunerId The ID of the tuner which the source belongs to.
* @param sourceType The type of the source which the channel belongs to.
* Please refer to http://seanyhlin.github.io/TV-Manager-API/
* for available values.
* @param channelData The data of the added channel.
*/
void notifyChannelScanned(in DOMString tunerId,
in DOMString sourceType,
in nsITVChannelData channelData);
/**
* Called when the operation of channel scanning is complete (after
* |nsITVService::startScanningChannels()| is invoked).
*
* @param tunerId The ID of the tuner which the source belongs to.
* @param sourceType The type of the source which the channel belongs to.
* Please refer to http://seanyhlin.github.io/TV-Manager-API/
* for available values.
*/
void notifyChannelScanComplete(in DOMString tunerId,
in DOMString sourceType);
/**
* Called when the operation of channel scanning is forced to stop due to
* something wrong during scanning.
*
* @param tunerId The ID of the tuner which the source belongs to.
* @param sourceType The type of the source which the channel belongs to.
* Please refer to http://seanyhlin.github.io/TV-Manager-API/
* for available values.
*/
void notifyChannelScanStopped(in DOMString tunerId,
in DOMString sourceType);
/**
* Called when a new EIT is broadcasted.
*
* @param tunerId The ID of the tuner which the source belongs to.
* @param sourceType The type of the source which the channel belongs to.
* Please refer to http://seanyhlin.github.io/TV-Manager-API/
* for available values.
* @param channelData The channel data which the programs belong to.
* @param programDataList An array of correspondent program data.
* @param count The number of programs.
*/
void notifyEITBroadcasted(in DOMString tunerId,
in DOMString sourceType,
in nsITVChannelData channelData,
[array, size_is(count)] in nsITVProgramData programDataList,
in unsigned long count);
};
[builtinclass, uuid(a19e6e7e-2293-11e4-b335-74d02b97e723)]
interface nsITVServiceCallback : nsISupports
{
const unsigned short TV_ERROR_OK = 0;
const unsigned short TV_ERROR_FAILURE = 1;
const unsigned short TV_ERROR_INVALID_ARG = 2;
const unsigned short TV_ERROR_NO_SIGNAL = 3;
const unsigned short TV_ERROR_NOT_SUPPORTED = 4;
/**
* Called when something wrong happens.
*
* @param errorCode Error code listed above from the underlying layer.
*/
void notifyError(in unsigned short errorCode);
/**
* Called when the operation succeeds.
*
* @param dataList A list of data.
* An array of |nsITVTunerData| when used for |getTuners()|.
* An array of |nsITVChannelData| ordered by the LCN (Logical
* Channel Number) when used for |getChannels()|.
* An array of |nsITVProgramData| ordered by the start time
* for |getPrograms()|.
* An array of |nsITVChannelData| with only one element for
* |setChannel()|.
* An array of |nsISupportsString| with only one element for
* |getOverlayId()|.
*
* NOTE: |nsIArray| is adopted to prevent this interface from being split into
* multiple interfaces with different |notifySuccess|. Though the
* implementation of TV service may need |nsIMutableArray| to fill in the
* array, it doesn't seem necessary for other places to use the mutable one.
*/
void notifySuccess([optional] in nsIArray dataList);
};
%{C++
#define TV_SERVICE_CONTRACTID \
"@mozilla.org/tv/tvservice;1"
%}
/**
* XPCOM component which interacts with the underlying TV components.
*
* NOTE: The implementation is expected to be done by TV vendors to cooperate
* with their own TV stack. The methods should not be called on any thread
* except for the XPCOM main thread.
*
* NOTE: The callbacks passing in the methods must be called asynchronously. In
* the implementation, actual runnable objects may need to be created and call
* the callback off of the runnables, after the function returns.
* TVServiceRunnables.h provides some ready-made runnables and could be used in
* the following way.
*
* nsCOMPtr<nsIRunnable> runnable =
* new TVServiceNotifyRunnable(callback, dataList, optional errorCode);
* return NS_DispatchToCurrentThread(runnable);
*/
[uuid(1b17e3cc-1c84-11e4-a4d4-74d02b97e723)]
interface nsITVService : nsISupports
{
attribute nsITVSourceListener sourceListener;
/**
* Get all tuners.
*
* @param callback The callback object where either |notifyError| or
* |notifySuccess|, which takes an array of
* |nsITVTunerData|, is expected.
*/
void getTuners(in nsITVServiceCallback callback);
/**
* Set the source type to be used by the given tuner.
*
* @param tunerId The ID of the tuner.
* @param sourceType The source type to be used.
* @param callback The callback object where either |notifyError| or
* |notifySuccess| is expected.
*/
void setSource(in DOMString tunerId,
in DOMString sourceType,
in nsITVServiceCallback callback);
/**
* Start scanning channels on the given tuner.
*
* Once the operation successfully starts, a series of |notifyChannelScanned|
* from |nsITVSourceListener| are expected, and followed by one of either
* |notifyChannelScanComplete| or |notifyChannelScanStopped|.
*
* @param tunerId The ID of the tuner.
* @param sourceType The source type to be used.
* @param callback The callback object where either |notifyError| or
* |notifySuccess| is expected.
*/
void startScanningChannels(in DOMString tunerId,
in DOMString sourceType,
in nsITVServiceCallback callback);
/**
* Stop scanning channels on the given tuner.
*
* Once the operation succeeds, a call of |notifyChannelScanStopped| from
* |nsITVSourceListener| should be expected.
*
* @param tunerId The ID of the tuner.
* @param sourceType The source type to be used.
* @param callback The callback object where either |notifyError| or
* |notifySuccess| is expected.
*/
void stopScanningChannels(in DOMString tunerId,
in DOMString sourceType,
in nsITVServiceCallback callback);
/**
* Clear the cache for scanned channels, if any, from the underlying layer.
*/
void clearScannedChannelsCache();
/**
* Set the channel to be used by the tuner.
*
* @param tunerId The ID of the tuner.
* @param sourceType The source type to be used.
* @param channelNumber The LCN (Logical Channel Number) of the channel.
* @param callback The callback object where either |notifyError| or
* |notifySuccess| is expected.
*/
void setChannel(in DOMString tunerId,
in DOMString sourceType,
in DOMString channelNumber,
in nsITVServiceCallback callback);
/**
* Get the channels, ordered by the LCN (Logical Channel Number), of a given
* source type.
*
* @param tunerId The ID of the tuner.
* @param sourceType The source type to be used.
* @param callback The callback object where either |notifyError| or
* |notifySuccess|, which takes an array of
* |nsITVChannelData| ordered by the LCN (Logical Channel
* Number), is expected.
*/
void getChannels(in DOMString tunerId,
in DOMString sourceType,
in nsITVServiceCallback callback);
/**
* Get the programs, ordered by the start time, of a given channel.
*
* @param tunerId The ID of the tuner.
* @param sourceType The source type to be used.
* @param channelNumber The LCN (Logical Channel Number) of the channel.
* @param startTime The begining of the searching time frame for programs.
* @param endTime The end of the searching time frame for programs.
* @param callback The callback object where either |notifyError| or
* |notifySuccess|, which takes an array of
* |nsITVProgramData| ordered by the start time, is
* expected.
*/
void getPrograms(in DOMString tunerId,
in DOMString sourceType,
in DOMString channelNumber,
in unsigned long long startTime,
in unsigned long long endTime,
in nsITVServiceCallback callback);
/**
* Get the overlay ID of a given tuner.
*
* @param tunerId The ID of the tuner.
* @param callback The callback object where either |notifyError| or
* |notifySuccess|, which takes an array of
* |nsISupportsString| with only one element, is expected.
*/
void getOverlayId(in DOMString tunerId,
in nsITVServiceCallback callback);
};
|