AbstractSuggestionCursorWrapper.java revision 965d98377ddfdc52b772c2444d840000b665e000
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    @Override
39    public String getSuggestionDisplayQuery() {
40        return current().getSuggestionDisplayQuery();
41    }
42
43    public String getSuggestionFormat() {
44        return current().getSuggestionFormat();
45    }
46
47    public String getSuggestionIcon1() {
48        return current().getSuggestionIcon1();
49    }
50
51    public String getSuggestionIcon2() {
52        return current().getSuggestionIcon2();
53    }
54
55    public String getSuggestionIntentAction() {
56        return current().getSuggestionIntentAction();
57    }
58
59    public String getSuggestionIntentDataString() {
60        return current().getSuggestionIntentDataString();
61    }
62
63    public String getSuggestionIntentExtraData() {
64        return current().getSuggestionIntentExtraData();
65    }
66
67    public String getSuggestionKey() {
68        return current().getSuggestionKey();
69    }
70
71    public String getSuggestionLogType() {
72        return current().getSuggestionLogType();
73    }
74
75    public String getSuggestionQuery() {
76        return current().getSuggestionQuery();
77    }
78
79    public Source getSuggestionSource() {
80        return current().getSuggestionSource();
81    }
82
83    public String getSuggestionText1() {
84        return current().getSuggestionText1();
85    }
86
87    public String getSuggestionText2() {
88        return current().getSuggestionText2();
89    }
90
91    public String getSuggestionText2Url() {
92        return current().getSuggestionText2Url();
93    }
94
95    public boolean isSpinnerWhileRefreshing() {
96        return current().isSpinnerWhileRefreshing();
97    }
98
99    public boolean isSuggestionShortcut() {
100        return current().isSuggestionShortcut();
101    }
102}
103