-
Notifications
You must be signed in to change notification settings - Fork 5
/
UIView+FMReady.h
80 lines (67 loc) · 2.84 KB
/
UIView+FMReady.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
/* This file is part of FoneMonkey.
FoneMonkey is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FoneMonkey is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FoneMonkey. If not, see <http://www.gnu.org/licenses/>. */
//
// UIResponder+FMReady.h
// FoneMonkey
//
// Created by Stuart Stern on 10/19/09.
// Copyright 2009 Gorilla Logic, Inc.. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class FMCommandEvent;
/**
FoneMonkey UIView extensions provide recording and playback of Touch and Motion events. UIView subclasses can override one or more of these methods to cusotmize recording and playback logic for a class.
*/
@interface UIView (FoneMonkey)
/** Interpret the command and generate the necessary UI events for the component.
*/
- (void) playbackMonkeyEvent:(FMCommandEvent*)event;
/**
A string value uniquely identifying this instance of the component class
*/
- (NSString*) monkeyID;
/**
Returns YES if the supplied touch should be recorded. By default, returns YES if touch.phase == UITouchPhaseEnded and NO otherwise. Override this method to filter which touch events should be recorded for a class.
*/
- (BOOL) shouldRecordMonkeyTouch:(UITouch*)touch;
/**
Evaluates touch events and records corresponding command.
*/
- (void) handleMonkeyTouchEvent:(NSSet*)touches withEvent:(UIEvent*)event;
/**
Evaluates motion (shake) event and records corresponding command.
*/
- (void) handleMonkeyMotionEvent:(UIEvent*)event;
/**
Returns NO if recording should be disabled for the component. By default, returns YES for UIView subclasses, but NO for UIView class instances (since these are component containers).
*/
- (BOOL) isFMEnabled;
/**
Returns YES if this component might have been substituted for one with the supplied class name. The only known example
of component swapping is UIToolbarTextButton which swaps with UINavigationButton on an iPad multiview controller.
*/
- (BOOL) swapsWith:(NSString*)className;
/**
Return the corresponding UIAutomation command executable by Instruments
*/
+ (NSString*) uiAutomationCommand:(FMCommandEvent*)command;
/**
Return the corresponding CommandEvent source executable in ObjC
*/
+ (NSString*) objcCommandEvent:(FMCommandEvent*)command;
/**
Called to give an component's automation extension an opportunity to init itself.
May (will) be called multiple (countless) times.
*/
- (void) fmAssureAutomationInit;
@end