AbstractSuggestionCursorWrapper.java revision 839a9fd2828f37c9dc8345f93aefa5b8ad2f857f
1/*
2 * Copyright (C) 2009 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
17package com.android.quicksearchbox;
18
19/**
20 * A SuggestionCursor that delegates all suggestions-specific calls to one or more
21 * other suggestion cursors.
22 */
23public abstract class AbstractSuggestionCursorWrapper extends AbstractSuggestionCursor {
24
25    public AbstractSuggestionCursorWrapper(String userQuery) {
26        super(userQuery);
27    }
28
29    /**
30     * Gets the SuggestionCursor to use for the current suggestion.
31     */
32    protected abstract SuggestionCursor current();
33
34    public String getShortcutId() {
35        return current().getShortcutId();
36    }
37
38    public String getSuggestionFormat() {
39        return current().getSuggestionFormat();
40    }
41
42    public String getSuggestionIcon1() {
43        return current().getSuggestionIcon1();
44    }
45
46    public String getSuggestionIcon2() {
47        return current().getSuggestionIcon2();
48    }
49
50    public String getSuggestionIntentAction() {
51        return current().getSuggestionIntentAction();
52    }
53
54    public String getSuggestionIntentDataString() {
55        return current().getSuggestionIntentDataString();
56    }
57
58    public String getSuggestionIntentExtraData() {
59        return current().getSuggestionIntentExtraData();
60    }
61
62    public String getSuggestionKey() {
63        return current().getSuggestionKey();
64    }
65
66    public String getSuggestionLogType() {
67        return current().getSuggestionLogType();
68    }
69
70    public String getSuggestionQuery() {
71        return current().getSuggestionQuery();
72    }
73
74    public Source getSuggestionSource() {
75        return current().getSuggestionSource();
76    }
77
78    public String getSuggestionText1() {
79        return current().getSuggestionText1();
80    }
81
82    public String getSuggestionText2() {
83        return current().getSuggestionText2();
84    }
85
86    public String getSuggestionText2Url() {
87        return current().getSuggestionText2Url();
88    }
89
90    public boolean isSpinnerWhileRefreshing() {
91        return current().isSpinnerWhileRefreshing();
92    }
93
94    public boolean isSuggestionShortcut() {
95        return current().isSuggestionShortcut();
96    }
97}
98