1960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam/*
2960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * Copyright (C) 2015 The Android Open Source Project
3960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam *
4960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * Licensed under the Apache License, Version 2.0 (the "License");
5960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * you may not use this file except in compliance with the License.
6960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * You may obtain a copy of the License at
7960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam *
8960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam *      http://www.apache.org/licenses/LICENSE-2.0
9960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam *
10960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * Unless required by applicable law or agreed to in writing, software
11960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * distributed under the License is distributed on an "AS IS" BASIS,
12960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * See the License for the specific language governing permissions and
14960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * limitations under the License.
15960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam */
16960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam
17960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lampackage com.android.setupwizardlib.items;
18960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam
19960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lamimport android.view.View;
20960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam
21960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam/**
22960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam * Representation of an item in an {@link ItemHierarchy}.
23960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam */
24960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lampublic interface IItem {
25960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam
26960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam    /**
27960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     * Get the Android resource ID for locating the layout for this item.
28960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     *
29960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     * @return Resource ID for the layout of this item. This layout will be used to inflate the View
30960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     *         passed to {@link #onBindView(android.view.View)}.
31960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     */
32960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam    int getLayoutResource();
33960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam
34960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam    /**
35960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     * Called by items framework to display the data specified by this item. This method should
36960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     * update {@code view} to reflect its data.
37960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     *
38960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     * @param view A view inflated from {@link #getLayoutResource()}, which should be updated to
39960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     *             display data from this item. This view may be recycled from other items with the
40960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     *             same layout resource.
41960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     */
42960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam    void onBindView(View view);
43960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam
44960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam    /**
45960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     * @return True if this item is enabled.
46960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam     */
47960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam    boolean isEnabled();
48960c0ea0b1d36904beef0f01715dd43a211e88caMaurice Lam}
49