-
Notifications
You must be signed in to change notification settings - Fork 947
/
MDCInkTouchControllerDelegate.h
93 lines (74 loc) · 3.6 KB
/
MDCInkTouchControllerDelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Copyright 2020-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import <UIKit/UIKit.h>
API_DEPRECATED_BEGIN(
"🕘 Schedule time to migrate. "
"Use default system highlight behavior instead: go/material-ios-touch-response. "
"This is go/material-ios-migrations#not-scriptable 🕘",
ios(12, 12))
@class MDCInkTouchController;
@class MDCInkView;
NS_SWIFT_UI_ACTOR
@protocol MDCInkTouchControllerDelegate <NSObject>
@optional
/**
Inserts the ink view into the given view.
If this method is not implemented, the ink view is added as a subview of the view when the
controller's addInkView method is called. Delegates can choose to insert the ink view below the
contents as a background view. When inkTouchController:inkViewAtTouchLocation is implemented
this method will not be invoked.
@param inkTouchController The ink touch controller.
@param inkView The ink view.
@param view The view to add the ink view to.
*/
- (void)inkTouchController:(nonnull MDCInkTouchController *)inkTouchController
insertInkView:(nonnull UIView *)inkView
intoView:(nonnull UIView *)view;
/**
Returns the ink view to use for a touch located at location in inkTouchController.view.
If the delegate implements this method, the controller will not create an ink view of its own and
inkTouchController:insertInkView:intoView: will not be called. This method allows the delegate
to control the creation and reuse of ink views.
@param inkTouchController The ink touch controller.
@param location The touch location in the coords of @c inkTouchController.view.
@return An ink view to use at the touch location.
*/
- (nullable MDCInkView *)inkTouchController:(nonnull MDCInkTouchController *)inkTouchController
inkViewAtTouchLocation:(CGPoint)location;
/**
Controls whether the ink touch controller should be processing touches.
The touch controller will query this method to determine if it should start or continue to
process touches controlling the ink. Returning NO at the start of a gesture will prevent any ink
from being displayed, and returning NO in the middle of a gesture will cancel that gesture and
evaporate the ink.
If not implemented then YES is assumed.
@param inkTouchController The ink touch controller.
@param location The touch location relative to the inkTouchController view.
@return YES if the controller should process touches at @c location.
@see cancelInkTouchProcessing
*/
- (BOOL)inkTouchController:(nonnull MDCInkTouchController *)inkTouchController
shouldProcessInkTouchesAtTouchLocation:(CGPoint)location;
/**
Notifies the receiver that the ink touch controller did process an ink view at the
touch location.
@param inkTouchController The ink touch controller.
@param inkView The ink view.
@param location The touch location relative to the inkTouchController superView.
*/
- (void)inkTouchController:(nonnull MDCInkTouchController *)inkTouchController
didProcessInkView:(nonnull MDCInkView *)inkView
atTouchLocation:(CGPoint)location;
@end
API_DEPRECATED_END