sbLibrarySearchSuggester.js File Reference

Go to the source code of this file.

Functions

Components utils import ("resource://gre/modules/XPCOMUtils.jsm")
 
function AutoCompleteResult (searchString, defaultIndex, errorDescription, results)
 
function LibrarySearchSuggester ()
 
function NSGetModule (compMgr, fileSpec)
 

Variables

const Cc = Components.classes
 
const Ci = Components.interfaces
 
const Cr = Components.results
 
const CONTRACTID = "@mozilla.org/autocomplete/search;1?name=library-distinct-properties"
 
const DESCRIPTION = "Songbird Library Search Suggestions"
 
const CID = Components.ID("{1ed101bc-a11c-4e03-83af-514672bd3a70}")
 
const XPCOM_SHUTDOWN_TOPIC = "xpcom-shutdown"
 
var gDefaultValues = {}
 
AutoCompleteResult prototype
 

Detailed Description

BEGIN SONGBIRD GPL

This file is part of the Songbird web player.

Copyright(c) 2005-2008 POTI, Inc. http://songbirdnest.com

This file may be licensed under the terms of of the GNU General Public License Version 2 (the "GPL").

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the GPL for the specific language governing rights and limitations.

You should have received a copy of the GPL along with this program. If not, go to http://www.gnu.org/licenses/gpl.html or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

END SONGBIRD GPL

Provides autocomplete suggestions based on distinct values for a property Originally based on the Mozilla nsSearchSuggestions.js implementation.

The format of the searchparam attribute is the following:

property;libraryguid;defaultvalues;unit

  • 'property' is a property id, such as http://songbirdnest.com/data/1.0#artistName
  • 'libraryguid' is the guid of a library from which to get distinct values, or no value to get from all libraries
  • 'defaultvalues' is a comma separated list of additional default values which are always matched against this input even if they are not part of the distinct values set
  • 'unit' is the unit into which the distinct values should be converted to before being matched against the input and inserted in the suggestion result set.

Definition in file sbLibrarySearchSuggester.js.

Function Documentation

function AutoCompleteResult (   searchString,
  defaultIndex,
  errorDescription,
  results 
)

AutoCompleteResult contains the results returned by the Suggest service - it implements nsIAutoCompleteResult and is used by the auto- complete controller to populate the front end.

Definition at line 84 of file sbLibrarySearchSuggester.js.

Components utils import ( "resource://gre/modules/XPCOMUtils.jsm"  )
function LibrarySearchSuggester ( )

Implements nsIAutoCompleteSearch to provide suggestions based on Songbird's state.

To access this suggester set autocompletesearch="library-distinct-properties" on an autocomplete textbox. See the search.xml binding for details.

Definition at line 239 of file sbLibrarySearchSuggester.js.

Here is the caller graph for this function:

function NSGetModule (   compMgr,
  fileSpec 
)

Definition at line 503 of file sbLibrarySearchSuggester.js.

Here is the call graph for this function:

Variable Documentation

const Cc = Components.classes

Definition at line 50 of file sbLibrarySearchSuggester.js.

Definition at line 51 of file sbLibrarySearchSuggester.js.

const CID = Components.ID("{1ed101bc-a11c-4e03-83af-514672bd3a70}")

Definition at line 56 of file sbLibrarySearchSuggester.js.

const CONTRACTID = "@mozilla.org/autocomplete/search;1?name=library-distinct-properties"

Definition at line 54 of file sbLibrarySearchSuggester.js.

const Cr = Components.results

Definition at line 52 of file sbLibrarySearchSuggester.js.

const DESCRIPTION = "Songbird Library Search Suggestions"

Definition at line 55 of file sbLibrarySearchSuggester.js.

gDefaultValues["video"] = {}

Map of properties to hard-coded default values

Definition at line 64 of file sbLibrarySearchSuggester.js.

Definition at line 93 of file sbLibrarySearchSuggester.js.

const XPCOM_SHUTDOWN_TOPIC = "xpcom-shutdown"

Definition at line 58 of file sbLibrarySearchSuggester.js.