13e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert/*
21e938ea2f5edefab446b9562b316bc5dc72adebbBryan Mawhinney * Copyright (C) 2010 The Android Open Source Project
33e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert *
43e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * Licensed under the Apache License, Version 2.0 (the "License");
53e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * you may not use this file except in compliance with the License.
63e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * You may obtain a copy of the License at
73e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert *
83e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert *      http://www.apache.org/licenses/LICENSE-2.0
93e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert *
103e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * Unless required by applicable law or agreed to in writing, software
113e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * distributed under the License is distributed on an "AS IS" BASIS,
123e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * See the License for the specific language governing permissions and
143e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert * limitations under the License.
153e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert */
163e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert
17185bb2e3881452c084fde44d9bee657f65881b0eBjorn Bringertpackage com.android.quicksearchbox.ui;
18185bb2e3881452c084fde44d9bee657f65881b0eBjorn Bringert
195229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwoodimport com.android.quicksearchbox.Suggestion;
203e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert
213e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert/**
221e938ea2f5edefab446b9562b316bc5dc72adebbBryan Mawhinney * Interface to be implemented by any view appearing in the list of suggestions.
233e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert */
241e938ea2f5edefab446b9562b316bc5dc72adebbBryan Mawhinneypublic interface SuggestionView {
25185bb2e3881452c084fde44d9bee657f65881b0eBjorn Bringert    /**
261e938ea2f5edefab446b9562b316bc5dc72adebbBryan Mawhinney     * Set the view's contents based on the given suggestion.
27185bb2e3881452c084fde44d9bee657f65881b0eBjorn Bringert     */
285229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood    void bindAsSuggestion(Suggestion suggestion, String userQuery);
295229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood
305229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood    /**
315229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood     * Binds this view to a list adapter.
325229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood     *
335229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood     * @param adapter The adapter of the list which the view is appearing in
345229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood     * @param position The position of this view with the list.
355229b06f00d20aac76cd8519b37f2a579d61c54fMathew Inwood     */
367a0c3a7c6fdabce949b59e0a2c6ec1d44a140c24Mathew Inwood    void bindAdapter(SuggestionsAdapter<?> adapter, long position);
373e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert
383e44ff1f2a204db3f479698cf0b3eab3d451dec2Bjorn Bringert}
39