blob: 65fa7742f3253df38655995cee080385478e4bb3 [file] [log] [blame]
The Android Open Source Project31dd5032009-03-03 19:32:27 -08001/*
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.launcher;
18
19import android.content.ContentValues;
20import android.gadget.GadgetHostView;
21
22/**
23 * Represents a gadget, which just contains an identifier.
24 */
25class LauncherGadgetInfo extends ItemInfo {
26
27 /**
28 * Identifier for this gadget when talking with {@link GadgetManager} for updates.
29 */
30 int gadgetId;
31
32 /**
33 * View that holds this gadget after it's been created. This view isn't created
34 * until Launcher knows it's needed.
35 */
36 GadgetHostView hostView = null;
37
38 LauncherGadgetInfo(int gadgetId) {
39 itemType = LauncherSettings.Favorites.ITEM_TYPE_GADGET;
40 this.gadgetId = gadgetId;
41 }
42
43 @Override
44 void onAddToDatabase(ContentValues values) {
45 super.onAddToDatabase(values);
46 values.put(LauncherSettings.Favorites.GADGET_ID, gadgetId);
47 }
48
49 @Override
50 public String toString() {
51 return Integer.toString(gadgetId);
52 }
53}