blob: b6b009b33a0bd287bb28ab867ae6e2ccaa40868d [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/* //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
18package android.view;
19
20import android.graphics.Rect;
21import android.graphics.Region;
Dianne Hackborn75804932009-10-20 20:15:20 -070022import android.os.Bundle;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.view.IWindow;
24import android.view.MotionEvent;
25import android.view.WindowManager;
26import android.view.Surface;
27
28/**
29 * System private per-application interface to the window manager.
30 *
31 * {@hide}
32 */
33interface IWindowSession {
34 int add(IWindow window, in WindowManager.LayoutParams attrs,
35 in int viewVisibility, out Rect outContentInsets);
36 void remove(IWindow window);
37
38 /**
39 * Change the parameters of a window. You supply the
40 * new parameters, it returns the new frame of the window on screen (the
41 * position should be ignored) and surface of the window. The surface
42 * will be invalid if the window is currently hidden, else you can use it
43 * to draw the window's contents.
44 *
45 * @param window The window being modified.
46 * @param attrs If non-null, new attributes to apply to the window.
47 * @param requestedWidth The width the window wants to be.
48 * @param requestedHeight The height the window wants to be.
49 * @param viewVisibility Window root view's visibility.
50 * @param insetsPending Set to true if the client will be later giving
51 * internal insets; as a result, the window will not impact other window
52 * layouts until the insets are given.
53 * @param outFrame Rect in which is placed the new position/size on
54 * screen.
55 * @param outContentInsets Rect in which is placed the offsets from
56 * <var>outFrame</var> in which the content of the window should be
57 * placed. This can be used to modify the window layout to ensure its
58 * contents are visible to the user, taking into account system windows
59 * like the status bar or a soft keyboard.
60 * @param outVisibleInsets Rect in which is placed the offsets from
61 * <var>outFrame</var> in which the window is actually completely visible
62 * to the user. This can be used to temporarily scroll the window's
63 * contents to make sure the user can see it. This is different than
64 * <var>outContentInsets</var> in that these insets change transiently,
65 * so complex relayout of the window should not happen based on them.
66 * @param outSurface Object in which is placed the new display surface.
67 *
68 * @return int Result flags: {@link WindowManagerImpl#RELAYOUT_SHOW_FOCUS},
69 * {@link WindowManagerImpl#RELAYOUT_FIRST_TIME}.
70 */
71 int relayout(IWindow window, in WindowManager.LayoutParams attrs,
72 int requestedWidth, int requestedHeight, int viewVisibility,
73 boolean insetsPending, out Rect outFrame, out Rect outContentInsets,
74 out Rect outVisibleInsets, out Surface outSurface);
75
76 /**
77 * Give the window manager a hint of the part of the window that is
78 * completely transparent, allowing it to work with the surface flinger
79 * to optimize compositing of this part of the window.
80 */
81 void setTransparentRegion(IWindow window, in Region region);
82
83 /**
84 * Tell the window manager about the content and visible insets of the
85 * given window, which can be used to adjust the <var>outContentInsets</var>
86 * and <var>outVisibleInsets</var> values returned by
87 * {@link #relayout relayout()} for windows behind this one.
88 *
89 * @param touchableInsets Controls which part of the window inside of its
90 * frame can receive pointer events, as defined by
91 * {@link android.view.ViewTreeObserver.InternalInsetsInfo}.
92 */
93 void setInsets(IWindow window, int touchableInsets, in Rect contentInsets,
94 in Rect visibleInsets);
95
96 /**
97 * Return the current display size in which the window is being laid out,
98 * accounting for screen decorations around it.
99 */
100 void getDisplayFrame(IWindow window, out Rect outDisplayFrame);
101
102 void finishDrawing(IWindow window);
103
104 void finishKey(IWindow window);
105 MotionEvent getPendingPointerMove(IWindow window);
106 MotionEvent getPendingTrackballMove(IWindow window);
107
108 void setInTouchMode(boolean showFocus);
109 boolean getInTouchMode();
110
111 boolean performHapticFeedback(IWindow window, int effectId, boolean always);
Dianne Hackbornc8a0a752009-08-10 23:05:49 -0700112
113 /**
114 * For windows with the wallpaper behind them, and the wallpaper is
115 * larger than the screen, set the offset within the screen.
Marco Nelissenbf6956b2009-11-09 15:21:13 -0800116 * For multi screen launcher type applications, xstep and ystep indicate
117 * how big the increment is from one screen to another.
Dianne Hackbornc8a0a752009-08-10 23:05:49 -0700118 */
Marco Nelissenbf6956b2009-11-09 15:21:13 -0800119 void setWallpaperPosition(IBinder windowToken, float x, float y, float xstep, float ystep);
Dianne Hackborn19382ac2009-09-11 21:13:37 -0700120
121 void wallpaperOffsetsComplete(IBinder window);
Dianne Hackborn75804932009-10-20 20:15:20 -0700122
123 Bundle sendWallpaperCommand(IBinder window, String action, int x, int y,
124 int z, in Bundle extras, boolean sync);
125
126 void wallpaperCommandComplete(IBinder window, in Bundle result);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127}