Debian Codegraph @

core/java/android/view/selectiontoolbar/WidgetInfo.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.Parcel;
22 import android.os.Parcelable;
23 import android.view.SurfaceControlViewHost;
24
25 import com.android.internal.util.DataClass;
26
27 /**
28 * The class holds the rendered content and the related information from the render service to
29 * be used to show on the selection toolbar.
30 *
31 * @hide
32 */
33 @DataClass(genToString = true, genEqualsHashCode = true)
34 public final class WidgetInfo implements Parcelable {
35
36 /**
37 * The token that is used to identify the selection toolbar.
38 */
39 private final long mWidgetToken;
40
41 /**
42 * A Rect that defines the size and positioning of the remote view with respect to
43 * its host window.
44 */
45 @NonNull
46 private final Rect mContentRect;
47
48 /**
49 * The SurfacePackage pointing to the remote view.
50 */
51 @NonNull
52 private final SurfaceControlViewHost.SurfacePackage mSurfacePackage;
53
54
55
56 // Code below generated by codegen v1.0.23.
57 //
58 // DO NOT MODIFY!
59 // CHECKSTYLE:OFF Generated code
60 //
61 // To regenerate run:
62 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/view/selectiontoolbar/WidgetInfo.java
63 //
64 // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
65 // Settings > Editor > Code Style > Formatter Control
66 //@formatter:off
67
68
69 /**
70 * Creates a new WidgetInfo.
71 *
72 * @param widgetToken
73 * The token that is used to identify the selection toolbar.
74 * @param contentRect
75 * A Rect that defines the size and positioning of the remote view with respect to
76 * its host window.
77 * @param surfacePackage
78 * The SurfacePackage pointing to the remote view.
79 */
80 @DataClass.Generated.Member
81 public WidgetInfo(
82 long widgetToken,
83 @NonNull Rect contentRect,
84 @NonNull SurfaceControlViewHost.SurfacePackage surfacePackage) {
85 this.mWidgetToken = widgetToken;
86 this.mContentRect = contentRect;
87 com.android.internal.util.AnnotationValidations.validate(
88 NonNull.class, null, mContentRect);
89 this.mSurfacePackage = surfacePackage;
90 com.android.internal.util.AnnotationValidations.validate(
91 NonNull.class, null, mSurfacePackage);
92
93 // onConstructed(); // You can define this method to get a callback
94 }
95
96 /**
97 * The token that is used to identify the selection toolbar.
98 */
99 @DataClass.Generated.Member
100 public long getWidgetToken() {
101 return mWidgetToken;
102 }
103
104 /**
105 * A Rect that defines the size and positioning of the remote view with respect to
106 * its host window.
107 */
108 @DataClass.Generated.Member
109 public @NonNull Rect getContentRect() {
110 return mContentRect;
111 }
112
113 /**
114 * The SurfacePackage pointing to the remote view.
115 */
116 @DataClass.Generated.Member
117 public @NonNull SurfaceControlViewHost.SurfacePackage getSurfacePackage() {
118 return mSurfacePackage;
119 }
120
121 @Override
122 @DataClass.Generated.Member
123 public String toString() {
124 // You can override field toString logic by defining methods like:
125 // String fieldNameToString() { ... }
126
127 return "WidgetInfo { " +
128 "widgetToken = " + mWidgetToken + ", " +
129 "contentRect = " + mContentRect + ", " +
130 "surfacePackage = " + mSurfacePackage +
131 " }";
132 }
133
134 @Override
135 @DataClass.Generated.Member
136 public boolean equals(@android.annotation.Nullable Object o) {
137 // You can override field equality logic by defining either of the methods like:
138 // boolean fieldNameEquals(WidgetInfo other) { ... }
139 // boolean fieldNameEquals(FieldType otherValue) { ... }
140
141 if (this == o) return true;
142 if (o == null || getClass() != o.getClass()) return false;
143 @SuppressWarnings("unchecked")
144 WidgetInfo that = (WidgetInfo) o;
145 //noinspection PointlessBooleanExpression
146 return true
147 && mWidgetToken == that.mWidgetToken
148 && java.util.Objects.equals(mContentRect, that.mContentRect)
149 && java.util.Objects.equals(mSurfacePackage, that.mSurfacePackage);
150 }
151
152 @Override
153 @DataClass.Generated.Member
154 public int hashCode() {
155 // You can override field hashCode logic by defining methods like:
156 // int fieldNameHashCode() { ... }
157
158 int _hash = 1;
159 _hash = 31 * _hash + Long.hashCode(mWidgetToken);
160 _hash = 31 * _hash + java.util.Objects.hashCode(mContentRect);
161 _hash = 31 * _hash + java.util.Objects.hashCode(mSurfacePackage);
162 return _hash;
163 }
164
165 @Override
166 @DataClass.Generated.Member
167 public void writeToParcel(@NonNull Parcel dest, int flags) {
168 // You can override field parcelling by defining methods like:
169 // void parcelFieldName(Parcel dest, int flags) { ... }
170
171 dest.writeLong(mWidgetToken);
172 dest.writeTypedObject(mContentRect, flags);
173 dest.writeTypedObject(mSurfacePackage, flags);
174 }
175
176 @Override
177 @DataClass.Generated.Member
178 public int describeContents() { return 0; }
179
180 /** @hide */
181 @SuppressWarnings({"unchecked", "RedundantCast"})
182 @DataClass.Generated.Member
183 /* package-private */ WidgetInfo(@NonNull Parcel in) {
184 // You can override field unparcelling by defining methods like:
185 // static FieldType unparcelFieldName(Parcel in) { ... }
186
187 long widgetToken = in.readLong();
188 Rect contentRect = (Rect) in.readTypedObject(Rect.CREATOR);
189 SurfaceControlViewHost.SurfacePackage surfacePackage = (SurfaceControlViewHost.SurfacePackage) in.readTypedObject(SurfaceControlViewHost.SurfacePackage.CREATOR);
190
191 this.mWidgetToken = widgetToken;
192 this.mContentRect = contentRect;
193 com.android.internal.util.AnnotationValidations.validate(
194 NonNull.class, null, mContentRect);
195 this.mSurfacePackage = surfacePackage;
196 com.android.internal.util.AnnotationValidations.validate(
197 NonNull.class, null, mSurfacePackage);
198
199 // onConstructed(); // You can define this method to get a callback
200 }
201
202 @DataClass.Generated.Member
203 public static final @NonNull Parcelable.Creator<WidgetInfo> CREATOR
204 = new Parcelable.Creator<WidgetInfo>() {
205 @Override
206 public WidgetInfo[] newArray(int size) {
207 return new WidgetInfo[size];
208 }
209
210 @Override
211 public WidgetInfo createFromParcel(@NonNull Parcel in) {
212 return new WidgetInfo(in);
213 }
214 };
215
216 @DataClass.Generated(
217 time = 1643281495056L,
218 codegenVersion = "1.0.23",
219 sourceFile = "frameworks/base/core/java/android/view/selectiontoolbar/WidgetInfo.java",
220 inputSignatures = "private final long mWidgetToken\nprivate final @android.annotation.NonNull android.graphics.Rect mContentRect\nprivate final @android.annotation.NonNull android.view.SurfaceControlViewHost.SurfacePackage mSurfacePackage\nclass WidgetInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genEqualsHashCode=true)")
221 @Deprecated
222 private void __metadata() {}
223
224
225 //@formatter:on
226 // End of generated code
227
228 }