[go: nahoru, domu]

blob: d58caf5a2b318c6623df10dfc3949e2390b7053f [file] [log] [blame]
Qingqing Dengb745a942019-06-05 18:26:52 -07001/*
2 * Copyright 2019 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
17package androidx.ui.core.selection
18
19import androidx.ui.core.LayoutCoordinates
20import androidx.ui.core.PxPosition
21
22/**
23 * An interface handling selection. Get selection from a widget by passing in the start and end of
24 * selection in a selection container as a pair, and the layout coordinates of the selection
25 * container.
26 */
27internal interface TextSelectionHandler {
28 fun getSelection(
29 selectionCoordinates: Pair<PxPosition, PxPosition>,
30 containerLayoutCoordinates: LayoutCoordinates,
31 mode: SelectionMode
32 ): Selection?
33}