Added Android code
[wl-app.git] / Android / webViewMarker / src / main / java / com / blahti / drag / DragSource.java
1 /*
2  * This is a modified version of a class from the Android Open Source Project. 
3  * The original copyright and license information follows.
4  * 
5  * Copyright (C) 2008 The Android Open Source Project
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 package com.blahti.drag;
21
22 import android.view.View;
23
24 /**
25  * Interface defining an object where drag operations originate.
26  *
27  */
28 public interface DragSource {
29
30     /**
31      * This method is called to determine if the DragSource has something to drag.
32      * 
33      * @return True if there is something to drag
34      */
35
36     boolean allowDrag ();
37
38     /**
39      * This method is used to tell the DragSource which drag controller it is working with.
40      * 
41      * @param dragger DragController
42      */
43
44     void setDragController(DragController dragger);
45
46     /**
47      * This method is called on the completion of the drag operation so the DragSource knows 
48      * whether it succeeded or failed.
49      * 
50      * @param target View - the view that accepted the dragged object
51      * @param success boolean - true means that the object was dropped successfully
52      */
53
54     void onDropCompleted (View target, boolean success);
55 }