• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.browser.search;
17 
18 import android.content.Context;
19 import android.database.Cursor;
20 import android.os.Bundle;
21 
22 /**
23  * Interface for search engines.
24  */
25 public interface SearchEngine {
26 
27     // Used if the search engine is Google
28     static final String GOOGLE = "google";
29 
30     /**
31      * Gets the unique name of this search engine.
32      */
getName()33     public String getName();
34 
35     /**
36      * Gets the human-readable name of this search engine.
37      */
getLabel()38     public CharSequence getLabel();
39 
40     /**
41      * Starts a search.
42      */
startSearch(Context context, String query, Bundle appData, String extraData)43     public void startSearch(Context context, String query, Bundle appData, String extraData);
44 
45     /**
46      * Gets search suggestions.
47      */
getSuggestions(Context context, String query)48     public Cursor getSuggestions(Context context, String query);
49 
50     /**
51      * Checks whether this search engine supports search suggestions.
52      */
supportsSuggestions()53     public boolean supportsSuggestions();
54 
55     /**
56      * Closes this search engine.
57      */
close()58     public void close();
59 
60     /**
61      * Checks whether this search engine should be sent zero char query.
62      */
wantsEmptyQuery()63     public boolean wantsEmptyQuery();
64 }
65