Debian Codegraph @

core/java/android/view/selectiontoolbar/ShowInfo.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2021 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 package android.view.selectiontoolbar;
18
19 import android.annotation.NonNull;
20 import android.graphics.Rect;
21 import android.os.IBinder;
22 import android.os.Parcelable;
23
24 import com.android.internal.util.DataClass;
25
26 import java.util.List;
27
28
29 /**
30 * The class holds menu information for render service to render the selection toolbar.
31 *
32 * @hide
33 */
34 @DataClass(genToString = true, genEqualsHashCode = true)
35 public final class ShowInfo implements Parcelable {
36
37 /**
38 * The token that is used to identify the selection toolbar. This is initially set to 0
39 * until a selection toolbar has been created for the showToolbar request.
40 */
41 private final long mWidgetToken;
42
43 /**
44 * If the toolbar menu items need to be re-layout.
45 */
46 private final boolean mLayoutRequired;
47
48 /**
49 * The menu items to be rendered in the selection toolbar.
50 */
51 @NonNull
52 private final List<ToolbarMenuItem> mMenuItems;
53
54 /**
55 * A rect specifying where the selection toolbar on the screen.
56 */
57 @NonNull
58 private final Rect mContentRect;
59
60 /**
61 * A recommended maximum suggested width of the selection toolbar.
62 */
63 private final int mSuggestedWidth;
64
65 /**
66 * The portion of the screen that is available to the selection toolbar.
67 */
68 @NonNull
69 private final Rect mViewPortOnScreen;
70
71 /**
72 * The host application's input token, this allows the remote render service to transfer
73 * the touch focus to the host application.
74 */
75 @NonNull
76 private final IBinder mHostInputToken;
77
78 /**
79 * If the host application uses light theme.
80 */
81 private final boolean mIsLightTheme;
82
83
84
85 // Code below generated by codegen v1.0.23.
86 //
87 // DO NOT MODIFY!
88 // CHECKSTYLE:OFF Generated code
89 //
90 // To regenerate run:
91 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/view/selectiontoolbar/ShowInfo.java
92 //
93 // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
94 // Settings > Editor > Code Style > Formatter Control
95 //@formatter:off
96
97
98 /**
99 * Creates a new ShowInfo.
100 *
101 * @param widgetToken
102 * The token that is used to identify the selection toolbar. This is initially set to 0
103 * until a selection toolbar has been created for the showToolbar request.
104 * @param layoutRequired
105 * If the toolbar menu items need to be re-layout.
106 * @param menuItems
107 * The menu items to be rendered in the selection toolbar.
108 * @param contentRect
109 * A rect specifying where the selection toolbar on the screen.
110 * @param suggestedWidth
111 * A recommended maximum suggested width of the selection toolbar.
112 * @param viewPortOnScreen
113 * The portion of the screen that is available to the selection toolbar.
114 * @param hostInputToken
115 * The host application's input token, this allows the remote render service to transfer
116 * the touch focus to the host application.
117 * @param isLightTheme
118 * If the host application uses light theme.
119 */
120 @DataClass.Generated.Member
121 public ShowInfo(
122 long widgetToken,
123 boolean layoutRequired,
124 @NonNull List<ToolbarMenuItem> menuItems,
125 @NonNull Rect contentRect,
126 int suggestedWidth,
127 @NonNull Rect viewPortOnScreen,
128 @NonNull IBinder hostInputToken,
129 boolean isLightTheme) {
130 this.mWidgetToken = widgetToken;
131 this.mLayoutRequired = layoutRequired;
132 this.mMenuItems = menuItems;
133 com.android.internal.util.AnnotationValidations.validate(
134 NonNull.class, null, mMenuItems);
135 this.mContentRect = contentRect;
136 com.android.internal.util.AnnotationValidations.validate(
137 NonNull.class, null, mContentRect);
138 this.mSuggestedWidth = suggestedWidth;
139 this.mViewPortOnScreen = viewPortOnScreen;
140 com.android.internal.util.AnnotationValidations.validate(
141 NonNull.class, null, mViewPortOnScreen);
142 this.mHostInputToken = hostInputToken;
143 com.android.internal.util.AnnotationValidations.validate(
144 NonNull.class, null, mHostInputToken);
145 this.mIsLightTheme = isLightTheme;
146
147 // onConstructed(); // You can define this method to get a callback
148 }
149
150 /**
151 * The token that is used to identify the selection toolbar. This is initially set to 0
152 * until a selection toolbar has been created for the showToolbar request.
153 */
154 @DataClass.Generated.Member
155 public long getWidgetToken() {
156 return mWidgetToken;
157 }
158
159 /**
160 * If the toolbar menu items need to be re-layout.
161 */
162 @DataClass.Generated.Member
163 public boolean isLayoutRequired() {
164 return mLayoutRequired;
165 }
166
167 /**
168 * The menu items to be rendered in the selection toolbar.
169 */
170 @DataClass.Generated.Member
171 public @NonNull List<ToolbarMenuItem> getMenuItems() {
172 return mMenuItems;
173 }
174
175 /**
176 * A rect specifying where the selection toolbar on the screen.
177 */
178 @DataClass.Generated.Member
179 public @NonNull Rect getContentRect() {
180 return mContentRect;
181 }
182
183 /**
184 * A recommended maximum suggested width of the selection toolbar.
185 */
186 @DataClass.Generated.Member
187 public int getSuggestedWidth() {
188 return mSuggestedWidth;
189 }
190
191 /**
192 * The portion of the screen that is available to the selection toolbar.
193 */
194 @DataClass.Generated.Member
195 public @NonNull Rect getViewPortOnScreen() {
196 return mViewPortOnScreen;
197 }
198
199 /**
200 * The host application's input token, this allows the remote render service to transfer
201 * the touch focus to the host application.
202 */
203 @DataClass.Generated.Member
204 public @NonNull IBinder getHostInputToken() {
205 return mHostInputToken;
206 }
207
208 /**
209 * If the host application uses light theme.
210 */
211 @DataClass.Generated.Member
212 public boolean isIsLightTheme() {
213 return mIsLightTheme;
214 }
215
216 @Override
217 @DataClass.Generated.Member
218 public String toString() {
219 // You can override field toString logic by defining methods like:
220 // String fieldNameToString() { ... }
221
222 return "ShowInfo { " +
223 "widgetToken = " + mWidgetToken + ", " +
224 "layoutRequired = " + mLayoutRequired + ", " +
225 "menuItems = " + mMenuItems + ", " +
226 "contentRect = " + mContentRect + ", " +
227 "suggestedWidth = " + mSuggestedWidth + ", " +
228 "viewPortOnScreen = " + mViewPortOnScreen + ", " +
229 "hostInputToken = " + mHostInputToken + ", " +
230 "isLightTheme = " + mIsLightTheme +
231 " }";
232 }
233
234 @Override
235 @DataClass.Generated.Member
236 public boolean equals(@android.annotation.Nullable Object o) {
237 // You can override field equality logic by defining either of the methods like:
238 // boolean fieldNameEquals(ShowInfo other) { ... }
239 // boolean fieldNameEquals(FieldType otherValue) { ... }
240
241 if (this == o) return true;
242 if (o == null || getClass() != o.getClass()) return false;
243 @SuppressWarnings("unchecked")
244 ShowInfo that = (ShowInfo) o;
245 //noinspection PointlessBooleanExpression
246 return true
247 && mWidgetToken == that.mWidgetToken
248 && mLayoutRequired == that.mLayoutRequired
249 && java.util.Objects.equals(mMenuItems, that.mMenuItems)
250 && java.util.Objects.equals(mContentRect, that.mContentRect)
251 && mSuggestedWidth == that.mSuggestedWidth
252 && java.util.Objects.equals(mViewPortOnScreen, that.mViewPortOnScreen)
253 && java.util.Objects.equals(mHostInputToken, that.mHostInputToken)
254 && mIsLightTheme == that.mIsLightTheme;
255 }
256
257 @Override
258 @DataClass.Generated.Member
259 public int hashCode() {
260 // You can override field hashCode logic by defining methods like:
261 // int fieldNameHashCode() { ... }
262
263 int _hash = 1;
264 _hash = 31 * _hash + Long.hashCode(mWidgetToken);
265 _hash = 31 * _hash + Boolean.hashCode(mLayoutRequired);
266 _hash = 31 * _hash + java.util.Objects.hashCode(mMenuItems);
267 _hash = 31 * _hash + java.util.Objects.hashCode(mContentRect);
268 _hash = 31 * _hash + mSuggestedWidth;
269 _hash = 31 * _hash + java.util.Objects.hashCode(mViewPortOnScreen);
270 _hash = 31 * _hash + java.util.Objects.hashCode(mHostInputToken);
271 _hash = 31 * _hash + Boolean.hashCode(mIsLightTheme);
272 return _hash;
273 }
274
275 @Override
276 @DataClass.Generated.Member
277 public void writeToParcel(@NonNull android.os.Parcel dest, int flags) {
278 // You can override field parcelling by defining methods like:
279 // void parcelFieldName(Parcel dest, int flags) { ... }
280
281 int flg = 0;
282 if (mLayoutRequired) flg |= 0x2;
283 if (mIsLightTheme) flg |= 0x80;
284 dest.writeInt(flg);
285 dest.writeLong(mWidgetToken);
286 dest.writeParcelableList(mMenuItems, flags);
287 dest.writeTypedObject(mContentRect, flags);
288 dest.writeInt(mSuggestedWidth);
289 dest.writeTypedObject(mViewPortOnScreen, flags);
290 dest.writeStrongBinder(mHostInputToken);
291 }
292
293 @Override
294 @DataClass.Generated.Member
295 public int describeContents() { return 0; }
296
297 /** @hide */
298 @SuppressWarnings({"unchecked", "RedundantCast"})
299 @DataClass.Generated.Member
300 /* package-private */ ShowInfo(@NonNull android.os.Parcel in) {
301 // You can override field unparcelling by defining methods like:
302 // static FieldType unparcelFieldName(Parcel in) { ... }
303
304 int flg = in.readInt();
305 boolean layoutRequired = (flg & 0x2) != 0;
306 boolean isLightTheme = (flg & 0x80) != 0;
307 long widgetToken = in.readLong();
308 List<ToolbarMenuItem> menuItems = new java.util.ArrayList<>();
309 in.readParcelableList(menuItems, ToolbarMenuItem.class.getClassLoader());
310 Rect contentRect = (Rect) in.readTypedObject(Rect.CREATOR);
311 int suggestedWidth = in.readInt();
312 Rect viewPortOnScreen = (Rect) in.readTypedObject(Rect.CREATOR);
313 IBinder hostInputToken = (IBinder) in.readStrongBinder();
314
315 this.mWidgetToken = widgetToken;
316 this.mLayoutRequired = layoutRequired;
317 this.mMenuItems = menuItems;
318 com.android.internal.util.AnnotationValidations.validate(
319 NonNull.class, null, mMenuItems);
320 this.mContentRect = contentRect;
321 com.android.internal.util.AnnotationValidations.validate(
322 NonNull.class, null, mContentRect);
323 this.mSuggestedWidth = suggestedWidth;
324 this.mViewPortOnScreen = viewPortOnScreen;
325 com.android.internal.util.AnnotationValidations.validate(
326 NonNull.class, null, mViewPortOnScreen);
327 this.mHostInputToken = hostInputToken;
328 com.android.internal.util.AnnotationValidations.validate(
329 NonNull.class, null, mHostInputToken);
330 this.mIsLightTheme = isLightTheme;
331
332 // onConstructed(); // You can define this method to get a callback
333 }
334
335 @DataClass.Generated.Member
336 public static final @NonNull Parcelable.Creator<ShowInfo> CREATOR
337 = new Parcelable.Creator<ShowInfo>() {
338 @Override
339 public ShowInfo[] newArray(int size) {
340 return new ShowInfo[size];
341 }
342
343 @Override
344 public ShowInfo createFromParcel(@NonNull android.os.Parcel in) {
345 return new ShowInfo(in);
346 }
347 };
348
349 @DataClass.Generated(
350 time = 1645108384245L,
351 codegenVersion = "1.0.23",
352 sourceFile = "frameworks/base/core/java/android/view/selectiontoolbar/ShowInfo.java",
353 inputSignatures = "private final long mWidgetToken\nprivate final boolean mLayoutRequired\nprivate final @android.annotation.NonNull java.util.List<android.view.selectiontoolbar.ToolbarMenuItem> mMenuItems\nprivate final @android.annotation.NonNull android.graphics.Rect mContentRect\nprivate final int mSuggestedWidth\nprivate final @android.annotation.NonNull android.graphics.Rect mViewPortOnScreen\nprivate final @android.annotation.NonNull android.os.IBinder mHostInputToken\nprivate final boolean mIsLightTheme\nclass ShowInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genEqualsHashCode=true)")
354 @Deprecated
355 private void __metadata() {}
356
357
358 //@formatter:on
359 // End of generated code
360
361 }