blob: 6ee300bfae2c22a68ae683c7b9320e5312918e33 [file] [log] [blame]
Michael Jurka0280c3b2010-09-17 15:00:07 -07001/*
2 * Copyright (C) 2010 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.launcher2;
18
Winson Chung68846fd2010-10-29 11:00:27 -070019import android.appwidget.AppWidgetProviderInfo;
Michael Jurka0280c3b2010-09-17 15:00:07 -070020import android.content.ComponentName;
Winson Chung55cef262010-10-28 14:14:18 -070021import android.os.Parcelable;
Michael Jurka0280c3b2010-09-17 15:00:07 -070022
23/**
24 * We pass this object with a drag from the customization tray
25 */
26class PendingAddItemInfo extends ItemInfo {
27 /**
28 * The component that will be created.
29 */
30 ComponentName componentName;
Michael Jurkab60fd0e2011-08-29 14:02:47 -070031
32 public PendingAddItemInfo(String whereCreated) {
33 super(whereCreated);
34 }
Michael Jurka3e7c7632010-10-02 16:01:03 -070035}
36
37class PendingAddWidgetInfo extends PendingAddItemInfo {
38 int minWidth;
39 int minHeight;
Winson Chung55cef262010-10-28 14:14:18 -070040
41 // Any configuration data that we want to pass to a configuration activity when
42 // starting up a widget
Winson Chung68846fd2010-10-29 11:00:27 -070043 String mimeType;
Winson Chung55cef262010-10-28 14:14:18 -070044 Parcelable configurationData;
Winson Chung68846fd2010-10-29 11:00:27 -070045
Michael Jurkab60fd0e2011-08-29 14:02:47 -070046 public PendingAddWidgetInfo(
47 AppWidgetProviderInfo i, String dataMimeType, Parcelable data, String whereCreated) {
48 super(whereCreated);
Winson Chung68846fd2010-10-29 11:00:27 -070049 itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
50 componentName = i.provider;
51 minWidth = i.minWidth;
52 minHeight = i.minHeight;
53 if (dataMimeType != null && data != null) {
54 mimeType = dataMimeType;
55 configurationData = data;
56 }
57 }
Michael Jurka0280c3b2010-09-17 15:00:07 -070058}