• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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 package com.android.internal.widget.remotecompose.core.operations.layout;
17 
18 import android.annotation.NonNull;
19 
20 import com.android.internal.widget.remotecompose.core.CoreDocument;
21 import com.android.internal.widget.remotecompose.core.RemoteContext;
22 import com.android.internal.widget.remotecompose.core.operations.utilities.StringSerializer;
23 import com.android.internal.widget.remotecompose.core.serialize.Serializable;
24 
25 /** Operations representing actions on the document */
26 public interface ActionOperation extends Serializable {
27     /**
28      * Serialize the string
29      *
30      * @param indent padding to display
31      * @param serializer append the string
32      */
serializeToString(int indent, @NonNull StringSerializer serializer)33     void serializeToString(int indent, @NonNull StringSerializer serializer);
34 
35     /**
36      * Run the action
37      *
38      * @param context remote context
39      * @param document document
40      * @param component component
41      * @param x the x location of the action
42      * @param y the y location of the action
43      */
runAction( @onNull RemoteContext context, @NonNull CoreDocument document, @NonNull Component component, float x, float y)44     void runAction(
45             @NonNull RemoteContext context,
46             @NonNull CoreDocument document,
47             @NonNull Component component,
48             float x,
49             float y);
50 }
51