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