| 1 |
// Copyright 2012 The Closure Library Authors. All Rights Reserved. |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS-IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
/** |
| 16 |
* @fileoverview Options for rendering matches. |
| 17 |
* |
| 18 |
*/ |
| 19 |
|
| 20 |
goog.provide('goog.ui.ac.RenderOptions'); |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
/** |
| 25 |
* A simple class that contains options for rendering a set of autocomplete |
| 26 |
* matches. Used as an optional argument in the callback from the matcher. |
| 27 |
* @constructor |
| 28 |
*/ |
| 29 |
goog.ui.ac.RenderOptions = function() {}; |
| 30 |
|
| 31 |
|
| 32 |
/** |
| 33 |
* Whether the current highlighting is to be preserved when displaying the new |
| 34 |
* set of matches. |
| 35 |
* @type {boolean} |
| 36 |
* @private |
| 37 |
*/ |
| 38 |
goog.ui.ac.RenderOptions.prototype.preserveHilited_ = false; |
| 39 |
|
| 40 |
|
| 41 |
/** |
| 42 |
* Whether the first match is to be highlighted. When undefined the autoHilite |
| 43 |
* flag of the autocomplete is used. |
| 44 |
* @type {boolean|undefined} |
| 45 |
* @private |
| 46 |
*/ |
| 47 |
goog.ui.ac.RenderOptions.prototype.autoHilite_; |
| 48 |
|
| 49 |
|
| 50 |
/** |
| 51 |
* @param {boolean} flag The new value for the preserveHilited_ flag. |
| 52 |
*/ |
| 53 |
goog.ui.ac.RenderOptions.prototype.setPreserveHilited = function(flag) { |
| 54 |
this.preserveHilited_ = flag; |
| 55 |
}; |
| 56 |
|
| 57 |
|
| 58 |
/** |
| 59 |
* @return {boolean} The value of the preserveHilited_ flag. |
| 60 |
*/ |
| 61 |
goog.ui.ac.RenderOptions.prototype.getPreserveHilited = function() { |
| 62 |
return this.preserveHilited_; |
| 63 |
}; |
| 64 |
|
| 65 |
|
| 66 |
/** |
| 67 |
* @param {boolean} flag The new value for the autoHilite_ flag. |
| 68 |
*/ |
| 69 |
goog.ui.ac.RenderOptions.prototype.setAutoHilite = function(flag) { |
| 70 |
this.autoHilite_ = flag; |
| 71 |
}; |
| 72 |
|
| 73 |
|
| 74 |
/** |
| 75 |
* @return {boolean|undefined} The value of the autoHilite_ flag. |
| 76 |
*/ |
| 77 |
goog.ui.ac.RenderOptions.prototype.getAutoHilite = function() { |
| 78 |
return this.autoHilite_; |
| 79 |
}; |