TVInfo API
Since: 2.4
Table of Contents
- 1. Type Definitions
- 1.1. CaptionInfoKey
- 1.2. CaptionState
- 1.3. CaptionMode
- 1.4. CaptionFontSize
- 1.5. CaptionFontStyle
- 1.6. CaptionColor
- 1.7. CaptionOpacity
- 1.8. CaptionEdge
- 1.9. CaptionValue
- 2. Interfaces
- 2.1. TVInfoManagerObject
- 2.2. TVInfoManager
- 2.3. CaptionValueChangeCallback
- 3. Related Feature
- 4. Full WebIDL
Summary of Interfaces and Methods
Interface | Method |
---|---|
TVInfoManagerObject | |
TVInfoManager |
void removeCaptionValueChangeListener (long watchId)
|
CaptionValueChangeCallback |
1. Type Definitions
1.1. CaptionInfoKey
enum CaptionInfoKey { "CAPTION_ONOFF_KEY", "CAPTION_MODE_KEY", "CAPTION_FONT_SIZE_KEY", "CAPTION_FONT_STYLE_KEY", "CAPTION_FONT_COLOR_KEY", "CAPTION_FONT_OPACITY_KEY", "CAPTION_BG_COLOR_KEY", "CAPTION_BG_OPACITY_KEY", "CAPTION_EDGE_TYPE_KEY", "CAPTION_EDGE_COLOR_KEY", "CAPTION_WINDOW_COLOR_KEY", "CAPTION_WINDOW_OPACITY_KEY" };
Since: 2.4
- CAPTION_ONOFF_KEY - caption state
- CAPTION_MODE_KEY - caption mode
- CAPTION_FONT_SIZE_KEY - caption font size
- CAPTION_FONT_STYLE_KEY - caption font style
- CAPTION_FONT_COLOR_KEY - caption font color
- CAPTION_FONT_OPACITY_KEY - caption font opacity mode
- CAPTION_BG_COLOR_KEY - caption background color
- CAPTION_BG_OPACITY_KEY - caption background opacity mode
- CAPTION_EDGE_TYPE_KEY - caption text edge type
- CAPTION_EDGE_COLOR_KEY - caption edge color
- CAPTION_WINDOW_COLOR_KEY - caption window color (only US)
- CAPTION_WINDOW_OPACITY_KEY - caption window opacity mode (only US)
1.2. CaptionState
enum CaptionState { "CAPTION_OFF", "CAPTION_ON" };
Since: 2.4
These values may be returned for key CAPTION_ONOFF_KEY.
- CAPTION_OFF - caption menu is turned off
- CAPTION_ON - caption menu is turned on
1.3. CaptionMode
enum CaptionMode { "CAPTION_MODE_DEFAULT", "CAPTION_MODE_SERVICE1", "CAPTION_MODE_SERVICE2", "CAPTION_MODE_SERVICE3", "CAPTION_MODE_SERVICE4", "CAPTION_MODE_SERVICE5", "CAPTION_MODE_SERVICE6", "CAPTION_MODE_CC1", "CAPTION_MODE_CC2", "CAPTION_MODE_CC3", "CAPTION_MODE_CC4", "CAPTION_MODE_TEXT1", "CAPTION_MODE_TEXT2", "CAPTION_MODE_TEXT3", "CAPTION_MODE_TEXT4" };
Since: 2.4
These values may be returned for key CAPTION_MODE_KEY.
- CAPTION_MODE_DEFAULT - default mode
- CAPTION_MODE_SERVICE1 - standard service 1 (Primary Caption Service)
- CAPTION_MODE_SERVICE2 - standard service 2 (Secondary Language Service)
- CAPTION_MODE_SERVICE3 - standard service 3
- CAPTION_MODE_SERVICE4 - standard service 4
- CAPTION_MODE_SERVICE5 - standard service 5
- CAPTION_MODE_SERVICE6 - standard service 6
- CAPTION_MODE_CC1 - Primary Synchronous Caption Service
- CAPTION_MODE_CC2 - Special Non-Synchronous Service
- CAPTION_MODE_CC3 - Secondary Synchronous Caption Service
- CAPTION_MODE_CC4 - Special Non-Synchronous Service
- CAPTION_MODE_TEXT1 - Text Service 1
- CAPTION_MODE_TEXT2 - Text Service 2
- CAPTION_MODE_TEXT3 - Text Service 3
- CAPTION_MODE_TEXT4 - Text Service 4
1.4. CaptionFontSize
enum CaptionFontSize { "CAPTION_SIZE_DEFAULT", "CAPTION_SIZE_SMALL", "CAPTION_SIZE_STANDARD", "CAPTION_SIZE_LARGE", "CAPTION_SIZE_EXTRA_LARGE" };
Since: 2.4
These values may be returned for key CAPTION_FONT_SIZE_KEY.
- CAPTION_SIZE_DEFAULT - default font size
- CAPTION_SIZE_SMALL - small font size
- CAPTION_SIZE_STANDARD - standard font size
- CAPTION_SIZE_LARGE - large font size
- CAPTION_SIZE_EXTRA_LARGE - extra large font size
1.5. CaptionFontStyle
enum CaptionFontStyle { "CAPTION_FONT_DEFAULT", "CAPTION_FONT_STYLE0", "CAPTION_FONT_STYLE1", "CAPTION_FONT_STYLE2", "CAPTION_FONT_STYLE3", "CAPTION_FONT_STYLE4", "CAPTION_FONT_STYLE5", "CAPTION_FONT_STYLE6", "CAPTION_FONT_STYLE7" };
Since: 2.4
These values may be returned for key CAPTION_FONT_STYLE_KEY.
- CAPTION_FONT_DEFAULT - default font style
- CAPTION_FONT_STYLE1 - Monospaced with serifs (similar to Courier)
- CAPTION_FONT_STYLE2 - Proportionally spaced with serifs (similar to Times New Roman)
- CAPTION_FONT_STYLE3 - Monospaced without serifs (similar to Helvetica Monospaced)
- CAPTION_FONT_STYLE4 - Proportionally spaced without serifs (similar to Arial and Swiss)
- CAPTION_FONT_STYLE5 - Casual font type (similar to Dom and Impress)
- CAPTION_FONT_STYLE6 - Cursive font type (similar to Coronet and Marigold)
- CAPTION_FONT_STYLE7 - Small capitals (similar to Engravers Gothic)
1.6. CaptionColor
enum CaptionColor { "CAPTION_COLOR_DEFAULT", "CAPTION_COLOR_WHITE", "CAPTION_COLOR_BLACK", "CAPTION_COLOR_RED", "CAPTION_COLOR_GREEN", "CAPTION_COLOR_BLUE", "CAPTION_COLOR_YELLOW", "CAPTION_COLOR_MAGENTA", "CAPTION_COLOR_CYAN" };
Since: 2.4
These values may be returned for keys CAPTION_FONT_COLOR_KEY, CAPTION_BG_COLOR_KEY, CAPTION_EDGE_COLOR_KEY and CAPTION_WINDOW_COLOR_KEY.
1.7. CaptionOpacity
enum CaptionOpacity { "CAPTION_OPACITY_SOLID", "CAPTION_OPACITY_FLASHING", "CAPTION_OPACITY_TRANSLUCENT", "CAPTION_OPACITY_TRANSPARENT", "CAPTION_OPACITY_DEFAULT" };
Since: 2.4
These values may be returned for keys CAPTION_FONT_OPACITY_KEY, CAPTION_BG_OPACITY_KEY and CAPTION_WINDOW_OPACITY_KEY.
1.8. CaptionEdge
enum CaptionEdge { "CAPTION_EDGE_NONE", "CAPTION_EDGE_RAISED", "CAPTION_EDGE_DEPRESSED", "CAPTION_EDGE_UNIFORM", "CAPTION_EDGE_DROP_SHADOWED" };
Since: 2.4
These values may be returned for key CAPTION_EDGE_TYPE_KEY.
- CAPTION_EDGE_NONE - no edge
- CAPTION_EDGE_RAISED - raised edge
- CAPTION_EDGE_DEPRESSED - depressed edge
- CAPTION_EDGE_UNIFORM - uniform edge
- CAPTION_EDGE_DROP_SHADOWED - drop shadowed edge
1.9. CaptionValue
typedef (CaptionState or CaptionMode or CaptionFontSize or CaptionFontStyle or CaptionColor or CaptionOpacity or CaptionEdge) CaptionValue;
Since: 2.4
2. Interfaces
2.1. TVInfoManagerObject
[NoInterfaceObject] interface TVInfoManagerObject { readonly attribute TVInfoManager tvinfo; };
Tizen implements TVInfoManagerObject;
Since: 2.4
There is a tizen.tvinfo object that allows accessing the functionality of the TVInfo API.
2.2. TVInfoManager
[NoInterfaceObject] interface TVInfoManager { CaptionValue getCaptionValue(CaptionInfoKey key) raises(WebAPIException); long addCaptionValueChangeListener(CaptionInfoKey key, CaptionValueChangeCallback callback) raises(WebAPIException); void removeCaptionValueChangeListener(long watchId) raises(WebAPIException); };
Since: 2.4
Methods
-
getCaptionValue
-
Method returns the value for corresponding caption menu key.
CaptionValue getCaptionValue(CaptionInfoKey key);
Since: 2.4
Return value:
-
CaptionValue:
CaptionValue value for given caption menu key
Exceptions:
- WebAPIException
with error type TypeMismatchError, if the input parameter is not compatible with the expected type.
with error type UnknownError in any other error case.
Code example:
console.log("Caption menu turned on: " + (tizen.tvinfo.getCaptionValue("CAPTION_ONOFF_KEY") === "CAPTION_ON"));
- WebAPIException
-
addCaptionValueChangeListener
-
Adds a listener to be called when given caption menu key value changes.
long addCaptionValueChangeListener(CaptionInfoKey key, CaptionValueChangeCallback callback);
Since: 2.4
Parameters:
- key: Caption menu key which changes will be observed by this listener
- callback: Callback method to be invoked when the value changes
Return value:
-
long:
long Subscription identifier
Exceptions:
- WebAPIException
with error type TypeMismatchError, if the input parameter is not compatible with the expected type.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type UnknownError in any other error case.
Code example:
var id = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", function(value) { console.log("Caption menu state changed: " + value); });
-
removeCaptionValueChangeListener
-
Removes a listener.
void removeCaptionValueChangeListener(long watchId);
Since: 2.4
Calling this function has no effect if there is no listener with given id.
Parameters:
- watchId: Identifier of the subscription returned by addCaptionValueChangeListener()
Exceptions:
- WebAPIException
with error type UnknownError, in any other error case.
Code example:
var id = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", function() {}); tizen.tvinfo.removeCaptionValueChangeListener(id);
2.3. CaptionValueChangeCallback
[Callback=FunctionOnly, NoInterfaceObject] interface CaptionValueChangeCallback { void onchanged(CaptionInfoKey key, CaptionValue value); };
Since: 2.4
Methods
-
onchanged
-
Called when the caption menu value changes.
void onchanged(CaptionInfoKey key, CaptionValue value);
Since: 2.4
Parameters:
- key: Watched key.
- value: New value of watched key.
3. Related Feature
To guarantee the running of this application on a device with a caption and so on, define the following requirements in the config file:
4. Full WebIDL
module TVInfo { typedef (CaptionState or CaptionMode or CaptionFontSize or CaptionFontStyle or CaptionColor or CaptionOpacity or CaptionEdge) CaptionValue; enum CaptionInfoKey { "CAPTION_ONOFF_KEY", "CAPTION_MODE_KEY", "CAPTION_FONT_SIZE_KEY", "CAPTION_FONT_STYLE_KEY", "CAPTION_FONT_COLOR_KEY", "CAPTION_FONT_OPACITY_KEY", "CAPTION_BG_COLOR_KEY", "CAPTION_BG_OPACITY_KEY", "CAPTION_EDGE_TYPE_KEY", "CAPTION_EDGE_COLOR_KEY", "CAPTION_WINDOW_COLOR_KEY", "CAPTION_WINDOW_OPACITY_KEY" }; enum CaptionState { "CAPTION_OFF", "CAPTION_ON" }; enum CaptionMode { "CAPTION_MODE_DEFAULT", "CAPTION_MODE_SERVICE1", "CAPTION_MODE_SERVICE2", "CAPTION_MODE_SERVICE3", "CAPTION_MODE_SERVICE4", "CAPTION_MODE_SERVICE5", "CAPTION_MODE_SERVICE6", "CAPTION_MODE_CC1", "CAPTION_MODE_CC2", "CAPTION_MODE_CC3", "CAPTION_MODE_CC4", "CAPTION_MODE_TEXT1", "CAPTION_MODE_TEXT2", "CAPTION_MODE_TEXT3", "CAPTION_MODE_TEXT4" }; enum CaptionFontSize { "CAPTION_SIZE_DEFAULT", "CAPTION_SIZE_SMALL", "CAPTION_SIZE_STANDARD", "CAPTION_SIZE_LARGE", "CAPTION_SIZE_EXTRA_LARGE" }; enum CaptionFontStyle { "CAPTION_FONT_DEFAULT", "CAPTION_FONT_STYLE0", "CAPTION_FONT_STYLE1", "CAPTION_FONT_STYLE2", "CAPTION_FONT_STYLE3", "CAPTION_FONT_STYLE4", "CAPTION_FONT_STYLE5", "CAPTION_FONT_STYLE6", "CAPTION_FONT_STYLE7" }; enum CaptionColor { "CAPTION_COLOR_DEFAULT", "CAPTION_COLOR_WHITE", "CAPTION_COLOR_BLACK", "CAPTION_COLOR_RED", "CAPTION_COLOR_GREEN", "CAPTION_COLOR_BLUE", "CAPTION_COLOR_YELLOW", "CAPTION_COLOR_MAGENTA", "CAPTION_COLOR_CYAN" }; enum CaptionOpacity { "CAPTION_OPACITY_SOLID", "CAPTION_OPACITY_FLASHING", "CAPTION_OPACITY_TRANSLUCENT", "CAPTION_OPACITY_TRANSPARENT", "CAPTION_OPACITY_DEFAULT" }; enum CaptionEdge { "CAPTION_EDGE_NONE", "CAPTION_EDGE_RAISED", "CAPTION_EDGE_DEPRESSED", "CAPTION_EDGE_UNIFORM", "CAPTION_EDGE_DROP_SHADOWED" }; Tizen implements TVInfoManagerObject; [NoInterfaceObject] interface TVInfoManagerObject { readonly attribute TVInfoManager tvinfo; }; [NoInterfaceObject] interface TVInfoManager { CaptionValue getCaptionValue(CaptionInfoKey key) raises(WebAPIException); long addCaptionValueChangeListener(CaptionInfoKey key, CaptionValueChangeCallback callback) raises(WebAPIException); void removeCaptionValueChangeListener(long watchId) raises(WebAPIException); }; [Callback=FunctionOnly, NoInterfaceObject] interface CaptionValueChangeCallback { void onchanged(CaptionInfoKey key, CaptionValue value); }; };