1 // Copyright 2012 Google Inc. All Rights Reserved.
4 * @fileoverview Defines a result type interface.
5 * @author peterxiao@google.com (Peter Xiao)
8 goog.provide('cvox.AbstractResult');
10 goog.require('cvox.SearchUtil');
15 cvox.AbstractResult = function() { };
18 * Checks the result if it is an unknown result.
19 * @param {Element} result Result to be checked.
20 * @return {boolean} Whether or not the element is an unknown result.
22 cvox.AbstractResult.prototype.isType = function(result) {
27 * Speak a generic search result.
28 * @param {Element} result Generic result to be spoken.
29 * @return {boolean} Whether or not the result was spoken.
31 cvox.AbstractResult.prototype.speak = function(result) {
36 * Extracts the wikipedia URL from knowledge panel.
37 * @param {Element} result Result to extract from.
38 * @return {?string} URL.
40 cvox.AbstractResult.prototype.getURL = cvox.SearchUtil.extractURL;
43 * Returns the node to sync to.
44 * @param {Element} result Result.
45 * @return {?Node} Node to sync to.
47 cvox.AbstractResult.prototype.getSyncNode = function(result) {