The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* //device/java/android/android/view/IWindowSession.aidl |
| 2 | ** |
| 3 | ** Copyright 2006, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | package android.view; |
| 19 | |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 20 | import android.content.ClipData; |
Dianne Hackborn | 694f79b | 2010-03-17 19:44:59 -0700 | [diff] [blame] | 21 | import android.content.res.Configuration; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.graphics.Rect; |
| 23 | import android.graphics.Region; |
Dianne Hackborn | 7580493 | 2009-10-20 20:15:20 -0700 | [diff] [blame] | 24 | import android.os.Bundle; |
Jeff Brown | 46b9ac0 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 25 | import android.view.InputChannel; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | import android.view.IWindow; |
| 27 | import android.view.MotionEvent; |
| 28 | import android.view.WindowManager; |
| 29 | import android.view.Surface; |
| 30 | |
| 31 | /** |
| 32 | * System private per-application interface to the window manager. |
| 33 | * |
| 34 | * {@hide} |
| 35 | */ |
| 36 | interface IWindowSession { |
| 37 | int add(IWindow window, in WindowManager.LayoutParams attrs, |
Jeff Brown | 46b9ac0 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 38 | in int viewVisibility, out Rect outContentInsets, |
| 39 | out InputChannel outInputChannel); |
| 40 | int addWithoutInputChannel(IWindow window, in WindowManager.LayoutParams attrs, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | in int viewVisibility, out Rect outContentInsets); |
| 42 | void remove(IWindow window); |
| 43 | |
| 44 | /** |
| 45 | * Change the parameters of a window. You supply the |
| 46 | * new parameters, it returns the new frame of the window on screen (the |
| 47 | * position should be ignored) and surface of the window. The surface |
| 48 | * will be invalid if the window is currently hidden, else you can use it |
| 49 | * to draw the window's contents. |
| 50 | * |
| 51 | * @param window The window being modified. |
| 52 | * @param attrs If non-null, new attributes to apply to the window. |
| 53 | * @param requestedWidth The width the window wants to be. |
| 54 | * @param requestedHeight The height the window wants to be. |
| 55 | * @param viewVisibility Window root view's visibility. |
| 56 | * @param insetsPending Set to true if the client will be later giving |
| 57 | * internal insets; as a result, the window will not impact other window |
| 58 | * layouts until the insets are given. |
| 59 | * @param outFrame Rect in which is placed the new position/size on |
| 60 | * screen. |
| 61 | * @param outContentInsets Rect in which is placed the offsets from |
| 62 | * <var>outFrame</var> in which the content of the window should be |
| 63 | * placed. This can be used to modify the window layout to ensure its |
| 64 | * contents are visible to the user, taking into account system windows |
| 65 | * like the status bar or a soft keyboard. |
| 66 | * @param outVisibleInsets Rect in which is placed the offsets from |
| 67 | * <var>outFrame</var> in which the window is actually completely visible |
| 68 | * to the user. This can be used to temporarily scroll the window's |
| 69 | * contents to make sure the user can see it. This is different than |
| 70 | * <var>outContentInsets</var> in that these insets change transiently, |
| 71 | * so complex relayout of the window should not happen based on them. |
Dianne Hackborn | 694f79b | 2010-03-17 19:44:59 -0700 | [diff] [blame] | 72 | * @param outConfiguration New configuration of window, if it is now |
| 73 | * becoming visible and the global configuration has changed since it |
| 74 | * was last displayed. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | * @param outSurface Object in which is placed the new display surface. |
| 76 | * |
| 77 | * @return int Result flags: {@link WindowManagerImpl#RELAYOUT_SHOW_FOCUS}, |
| 78 | * {@link WindowManagerImpl#RELAYOUT_FIRST_TIME}. |
| 79 | */ |
| 80 | int relayout(IWindow window, in WindowManager.LayoutParams attrs, |
| 81 | int requestedWidth, int requestedHeight, int viewVisibility, |
| 82 | boolean insetsPending, out Rect outFrame, out Rect outContentInsets, |
Dianne Hackborn | 694f79b | 2010-03-17 19:44:59 -0700 | [diff] [blame] | 83 | out Rect outVisibleInsets, out Configuration outConfig, |
| 84 | out Surface outSurface); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Give the window manager a hint of the part of the window that is |
| 88 | * completely transparent, allowing it to work with the surface flinger |
| 89 | * to optimize compositing of this part of the window. |
| 90 | */ |
| 91 | void setTransparentRegion(IWindow window, in Region region); |
| 92 | |
| 93 | /** |
| 94 | * Tell the window manager about the content and visible insets of the |
| 95 | * given window, which can be used to adjust the <var>outContentInsets</var> |
| 96 | * and <var>outVisibleInsets</var> values returned by |
| 97 | * {@link #relayout relayout()} for windows behind this one. |
| 98 | * |
| 99 | * @param touchableInsets Controls which part of the window inside of its |
| 100 | * frame can receive pointer events, as defined by |
| 101 | * {@link android.view.ViewTreeObserver.InternalInsetsInfo}. |
| 102 | */ |
| 103 | void setInsets(IWindow window, int touchableInsets, in Rect contentInsets, |
| 104 | in Rect visibleInsets); |
| 105 | |
| 106 | /** |
| 107 | * Return the current display size in which the window is being laid out, |
| 108 | * accounting for screen decorations around it. |
| 109 | */ |
| 110 | void getDisplayFrame(IWindow window, out Rect outDisplayFrame); |
| 111 | |
| 112 | void finishDrawing(IWindow window); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 113 | |
| 114 | void setInTouchMode(boolean showFocus); |
| 115 | boolean getInTouchMode(); |
| 116 | |
| 117 | boolean performHapticFeedback(IWindow window, int effectId, boolean always); |
Dianne Hackborn | c8a0a75 | 2009-08-10 23:05:49 -0700 | [diff] [blame] | 118 | |
| 119 | /** |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 120 | * Allocate the drag's thumbnail surface. Also assigns a token that identifies |
| 121 | * the drag to the OS and passes that as the return value. A return value of |
| 122 | * null indicates failure. |
| 123 | */ |
| 124 | IBinder prepareDrag(IWindow window, boolean localOnly, |
| 125 | int thumbnailWidth, int thumbnailHeight, out Surface outSurface); |
| 126 | |
| 127 | /** |
| 128 | * Initiate the drag operation itself |
| 129 | */ |
| 130 | boolean performDrag(IWindow window, IBinder dragToken, float touchX, float touchY, |
| 131 | float thumbCenterX, float thumbCenterY, in ClipData data); |
| 132 | |
| 133 | /** |
| 134 | * Tell the OS that we've just dragged into a View that is willing to accept the drop |
| 135 | */ |
| 136 | void dragRecipientEntered(IWindow window); |
| 137 | |
| 138 | /** |
| 139 | * Tell the OS that we've just dragged *off* of a View that was willing to accept the drop |
| 140 | */ |
| 141 | void dragRecipientExited(IWindow window); |
| 142 | |
| 143 | /** |
Dianne Hackborn | c8a0a75 | 2009-08-10 23:05:49 -0700 | [diff] [blame] | 144 | * For windows with the wallpaper behind them, and the wallpaper is |
| 145 | * larger than the screen, set the offset within the screen. |
Marco Nelissen | bf6956b | 2009-11-09 15:21:13 -0800 | [diff] [blame] | 146 | * For multi screen launcher type applications, xstep and ystep indicate |
| 147 | * how big the increment is from one screen to another. |
Dianne Hackborn | c8a0a75 | 2009-08-10 23:05:49 -0700 | [diff] [blame] | 148 | */ |
Marco Nelissen | bf6956b | 2009-11-09 15:21:13 -0800 | [diff] [blame] | 149 | void setWallpaperPosition(IBinder windowToken, float x, float y, float xstep, float ystep); |
Dianne Hackborn | 19382ac | 2009-09-11 21:13:37 -0700 | [diff] [blame] | 150 | |
| 151 | void wallpaperOffsetsComplete(IBinder window); |
Dianne Hackborn | 7580493 | 2009-10-20 20:15:20 -0700 | [diff] [blame] | 152 | |
| 153 | Bundle sendWallpaperCommand(IBinder window, String action, int x, int y, |
| 154 | int z, in Bundle extras, boolean sync); |
| 155 | |
| 156 | void wallpaperCommandComplete(IBinder window, in Bundle result); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 157 | } |