131dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project/*
231dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
331dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project *
431dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
531dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * you may not use this file except in compliance with the License.
631dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * You may obtain a copy of the License at
731dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project *
831dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
931dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project *
1031dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
1131dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS,
1231dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1331dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * See the License for the specific language governing permissions and
1431dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * limitations under the License.
1531dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project */
1631dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project
17325dc23624160689e59fbac708cf6f222b20d025Daniel Sandlerpackage com.android.launcher3;
1831dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project
1931dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Projectimport android.view.View;
2031dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project
21325dc23624160689e59fbac708cf6f222b20d025Daniel Sandlerimport com.android.launcher3.DropTarget.DragObject;
22c0dcf597084d00e4c23a7fea5fd0738f6c095a6bAdam Cohen
2331dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project/**
2431dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project * Interface defining an object that can originate a drag.
2531dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project *
2631dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project */
2731dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Projectpublic interface DragSource {
28a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung    /**
29a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     * @return whether items dragged from this source supports
30a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     */
31043f2af567178b82b0b41f12d379e7dd12da2936Winson Chung    boolean supportsFlingToDelete();
32a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung
331eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood    /**
341eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood     * @return whether items dragged from this source supports 'App Info'
351eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood     */
361eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood    boolean supportsAppInfoDropTarget();
371eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood
381eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood    /**
391eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood     * @return whether items dragged from this source supports 'Delete' drop target (e.g. to remove
401eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood     * a shortcut.
411eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood     */
421eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood    boolean supportsDeleteDropTarget();
431eeb3fc9d874d98dfb43883d17efb4202d83d88aMathew Inwood
44eeb5bbc9409978cc2ae52d48380399fcde3d9f85Winson Chung    /*
45eeb5bbc9409978cc2ae52d48380399fcde3d9f85Winson Chung     * @return the scale of the icons over the workspace icon size
46eeb5bbc9409978cc2ae52d48380399fcde3d9f85Winson Chung     */
47eeb5bbc9409978cc2ae52d48380399fcde3d9f85Winson Chung    float getIntrinsicIconScaleFactor();
48eeb5bbc9409978cc2ae52d48380399fcde3d9f85Winson Chung
49a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung    /**
50a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     * A callback specifically made back to the source after an item from this source has been flung
51a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     * to be deleted on a DropTarget.  In such a situation, this method will be called after
52a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     * onDropCompleted, and more importantly, after the fling animation has completed.
53a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     */
54a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung    void onFlingToDeleteCompleted();
55a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung
56a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung    /**
57a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     * A callback made back to the source after an item from this source has been dropped on a
58a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     * DropTarget.
59a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung     */
60a48487a814c07a9f1f45eb3ffe3d873b3dc31b3bWinson Chung    void onDropCompleted(View target, DragObject d, boolean isFlingToDelete, boolean success);
6131dd503c6aa69018e694d91724d46db49ea09327The Android Open Source Project}
62