1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /**
18  * @addtogroup NativeActivity Native Activity
19  * @{
20  */
21 
22 /**
23  * @file window.h
24  */
25 
26 #ifndef ANDROID_WINDOW_H
27 #define ANDROID_WINDOW_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /**
34  * Window flags, as per the Java API at android.view.WindowManager.LayoutParams.
35  */
36 enum {
37     /**
38      * As long as this window is visible to the user, allow the lock
39      * screen to activate while the screen is on.  This can be used
40      * independently, or in combination with {@link
41      * AWINDOW_FLAG_KEEP_SCREEN_ON} and/or {@link
42      * AWINDOW_FLAG_SHOW_WHEN_LOCKED}
43      */
44     AWINDOW_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001,
45     /** Everything behind this window will be dimmed. */
46     AWINDOW_FLAG_DIM_BEHIND                 = 0x00000002,
47     /**
48      * Blur everything behind this window.
49      * @deprecated Blurring is no longer supported.
50      */
51     AWINDOW_FLAG_BLUR_BEHIND                = 0x00000004,
52     /**
53      * This window won't ever get key input focus, so the
54      * user can not send key or other button events to it.  Those will
55      * instead go to whatever focusable window is behind it.  This flag
56      * will also enable {@link AWINDOW_FLAG_NOT_TOUCH_MODAL} whether or not that
57      * is explicitly set.
58      *
59      * Setting this flag also implies that the window will not need to
60      * interact with
61      * a soft input method, so it will be Z-ordered and positioned
62      * independently of any active input method (typically this means it
63      * gets Z-ordered on top of the input method, so it can use the full
64      * screen for its content and cover the input method if needed.  You
65      * can use {@link AWINDOW_FLAG_ALT_FOCUSABLE_IM} to modify this behavior.
66      */
67     AWINDOW_FLAG_NOT_FOCUSABLE              = 0x00000008,
68     /** this window can never receive touch events. */
69     AWINDOW_FLAG_NOT_TOUCHABLE              = 0x00000010,
70     /**
71      * Even when this window is focusable (its
72      * {@link AWINDOW_FLAG_NOT_FOCUSABLE} is not set), allow any pointer events
73      * outside of the window to be sent to the windows behind it.  Otherwise
74      * it will consume all pointer events itself, regardless of whether they
75      * are inside of the window.
76      */
77     AWINDOW_FLAG_NOT_TOUCH_MODAL            = 0x00000020,
78     /**
79      * When set, if the device is asleep when the touch
80      * screen is pressed, you will receive this first touch event.  Usually
81      * the first touch event is consumed by the system since the user can
82      * not see what they are pressing on.
83      *
84      * @deprecated This flag has no effect.
85      */
86     AWINDOW_FLAG_TOUCHABLE_WHEN_WAKING      = 0x00000040,
87     /**
88      * As long as this window is visible to the user, keep
89      * the device's screen turned on and bright.
90      */
91     AWINDOW_FLAG_KEEP_SCREEN_ON             = 0x00000080,
92     /**
93      * Place the window within the entire screen, ignoring
94      * decorations around the border (such as the status bar).  The
95      * window must correctly position its contents to take the screen
96      * decoration into account.
97      */
98     AWINDOW_FLAG_LAYOUT_IN_SCREEN           = 0x00000100,
99     /** allow window to extend outside of the screen. */
100     AWINDOW_FLAG_LAYOUT_NO_LIMITS           = 0x00000200,
101     /**
102      * Hide all screen decorations (such as the status
103      * bar) while this window is displayed.  This allows the window to
104      * use the entire display space for itself -- the status bar will
105      * be hidden when an app window with this flag set is on the top
106      * layer. A fullscreen window will ignore a value of
107      * <a href="/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_RESIZE">
108      * SOFT_INPUT_ADJUST_RESIZE</a>; the window will stay
109      * fullscreen and will not resize.
110      */
111     AWINDOW_FLAG_FULLSCREEN                 = 0x00000400,
112     /**
113      * Override {@link AWINDOW_FLAG_FULLSCREEN} and force the
114      * screen decorations (such as the status bar) to be shown.
115      */
116     AWINDOW_FLAG_FORCE_NOT_FULLSCREEN       = 0x00000800,
117     /**
118      * Turn on dithering when compositing this window to
119      * the screen.
120      * @deprecated This flag is no longer used.
121      */
122     AWINDOW_FLAG_DITHER                     = 0x00001000,
123     /**
124      * Treat the content of the window as secure, preventing
125      * it from appearing in screenshots or from being viewed on non-secure
126      * displays.
127      */
128     AWINDOW_FLAG_SECURE                     = 0x00002000,
129     /**
130      * A special mode where the layout parameters are used
131      * to perform scaling of the surface when it is composited to the
132      * screen.
133      */
134     AWINDOW_FLAG_SCALED                     = 0x00004000,
135     /**
136      * Intended for windows that will often be used when the user is
137      * holding the screen against their face, it will aggressively
138      * filter the event stream to prevent unintended presses in this
139      * situation that may not be desired for a particular window, when
140      * such an event stream is detected, the application will receive
141      * a {@link AMOTION_EVENT_ACTION_CANCEL} to indicate this so
142      * applications can handle this accordingly by taking no action on
143      * the event until the finger is released.
144      */
145     AWINDOW_FLAG_IGNORE_CHEEK_PRESSES       = 0x00008000,
146     /**
147      * A special option only for use in combination with
148      * {@link AWINDOW_FLAG_LAYOUT_IN_SCREEN}.  When requesting layout in the
149      * screen your window may appear on top of or behind screen decorations
150      * such as the status bar.  By also including this flag, the window
151      * manager will report the inset rectangle needed to ensure your
152      * content is not covered by screen decorations.
153      */
154     AWINDOW_FLAG_LAYOUT_INSET_DECOR         = 0x00010000,
155     /**
156      * Invert the state of {@link AWINDOW_FLAG_NOT_FOCUSABLE} with
157      * respect to how this window interacts with the current method.
158      * That is, if FLAG_NOT_FOCUSABLE is set and this flag is set,
159      * then the window will behave as if it needs to interact with the
160      * input method and thus be placed behind/away from it; if {@link
161      * AWINDOW_FLAG_NOT_FOCUSABLE} is not set and this flag is set,
162      * then the window will behave as if it doesn't need to interact
163      * with the input method and can be placed to use more space and
164      * cover the input method.
165      */
166     AWINDOW_FLAG_ALT_FOCUSABLE_IM           = 0x00020000,
167     /**
168      * If you have set {@link AWINDOW_FLAG_NOT_TOUCH_MODAL}, you
169      * can set this flag to receive a single special MotionEvent with
170      * the action
171      * {@link AMOTION_EVENT_ACTION_OUTSIDE} for
172      * touches that occur outside of your window.  Note that you will not
173      * receive the full down/move/up gesture, only the location of the
174      * first down as an {@link AMOTION_EVENT_ACTION_OUTSIDE}.
175      */
176     AWINDOW_FLAG_WATCH_OUTSIDE_TOUCH        = 0x00040000,
177     /**
178      * Special flag to let windows be shown when the screen
179      * is locked. This will let application windows take precedence over
180      * key guard or any other lock screens. Can be used with
181      * {@link AWINDOW_FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
182      * directly before showing the key guard window.  Can be used with
183      * {@link AWINDOW_FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
184      * non-secure keyguards.  This flag only applies to the top-most
185      * full-screen window.
186      */
187     AWINDOW_FLAG_SHOW_WHEN_LOCKED           = 0x00080000,
188     /**
189      * Ask that the system wallpaper be shown behind
190      * your window.  The window surface must be translucent to be able
191      * to actually see the wallpaper behind it; this flag just ensures
192      * that the wallpaper surface will be there if this window actually
193      * has translucent regions.
194      */
195     AWINDOW_FLAG_SHOW_WALLPAPER             = 0x00100000,
196     /**
197      * When set as a window is being added or made
198      * visible, once the window has been shown then the system will
199      * poke the power manager's user activity (as if the user had woken
200      * up the device) to turn the screen on.
201      */
202     AWINDOW_FLAG_TURN_SCREEN_ON             = 0x00200000,
203     /**
204      * When set the window will cause the keyguard to
205      * be dismissed, only if it is not a secure lock keyguard.  Because such
206      * a keyguard is not needed for security, it will never re-appear if
207      * the user navigates to another window (in contrast to
208      * {@link AWINDOW_FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
209      * hide both secure and non-secure keyguards but ensure they reappear
210      * when the user moves to another UI that doesn't hide them).
211      * If the keyguard is currently active and is secure (requires an
212      * unlock pattern) than the user will still need to confirm it before
213      * seeing this window, unless {@link AWINDOW_FLAG_SHOW_WHEN_LOCKED} has
214      * also been set.
215      */
216     AWINDOW_FLAG_DISMISS_KEYGUARD           = 0x00400000,
217 };
218 
219 #ifdef __cplusplus
220 };
221 #endif
222 
223 #endif // ANDROID_WINDOW_H
224 
225 /** @} */
226