Extends Protocol: |
|
Declared In: |
|
Introduction
A formal protocol declaring delegate messages sent by PFObserver.
Discussion
The PFObserverDelegate protocol implements two optional delegate methods, applicationWithIdentifier:atPath:didPostAccessibilityNotification:fromObservedUIElement:forAffectedUIElement: and -applicationWithIdentifier:atPath:didPostAccessibilityNotification:fromObservedUIElement:forAffectedUIElement:withInfo:.
Clients that implement this delegate method must declare that they adopt this formal protocol.
Methods
- -applicationWithIdentifier:atPath:didPostAccessibilityNotification:fromObservedUIElement:forAffectedUIElement:
Sent when the receiving observer detects an accessibility notification.
- -applicationWithIdentifier:atPath:didPostAccessibilityNotification:fromObservedUIElement:forAffectedUIElement:withInfo:
Sent when the receiving observer detects an accessibility notification containing an info dictionary.
Sent when the receiving observer detects an accessibility notification.
@optional
- (void)applicationWithIdentifier:(NSString *)identifier
atPath:(NSString *)fullPath didPostAccessibilityNotification:(NSString *)notification
fromObservedUIElement:(PFUIElement *)observedUIElement
forAffectedUIElement:(PFUIElement *)affectedUIElement;
Parameters
-
identifier
The identifier of the observed target application.
-
fullPath
The full path to the observed target application.
-
notification
An NSString representing the notification.
-
observedUIElement
A PFUIElement object representing the observed UI element.
-
affectedUIElement
A PFUIElement object representing the affected UI element.
Discussion
Sent when the accessibility API detects a change in the observed UI element.
To use this delegate method, a client application must implement it, create a PFObserver object using -initWithPath: or one of the similar initializers or factory methods that do not include parameters for a callback (i.e., temporary notification delegate and callback selector), set one of its classes as the delegate of the PFObserver object, and register to observe the notification. In the delegate method, use the identifier or fullPath parameter to identify the application that posted the notification, and use the notification , observedUIElement and affectedUIElement parameters to obtain information about the notification that was triggered by a change in the target application. It is the client's responsibility to manage the observer's delegate appropriately.
As an alternative to this delegate method, a client application can implement an Objective-C callback method and register it with the observer using -initWithPath:notificationDelegate:callbackSelector:, or one of the other initializers or factory methods that include parameters for a callback (i.e., temporary notification delegate and callback selector). Use a callback method for more complex scenarios, where the client application must use information saved in the contextInfo parameter when the observer was registered. The client application's Objective-C callback selector must have the following signature:
- (void)observer:(PFObserver *)observer notification:(NSString *)notification element:(PFUIElement *)element contextInfo:(void *)contextInfo
Sent when the receiving observer detects an accessibility notification containing an info dictionary.
@optional
- (void)applicationWithIdentifier:(NSString *)identifier
atPath:(NSString *)fullPath didPostAccessibilityNotification:(NSString *)notification
fromObservedUIElement:(PFUIElement *)observedUIElement
forAffectedUIElement:(PFUIElement *)affectedUIElement
withInfo:(nullable NSDictionary *)notificationInfo;
Parameters
-
identifier
The identifier of the observed target application.
-
fullPath
The full path to the observed target application.
-
notification
An NSString representing the notification.
-
observedUIElement
A PFUIElement object representing the observed UI element.
-
affectedUIElement
A PFUIElement object representing the affected UI element.
-
notificationInfo
an NSDictionary object containing info provided by the notification, or nil .
Discussion
Sent when the accessibility API detects a change in the observed UI element.
To use this delegate method, a client application must implement it, create a PFObserver object using -initForInfoWithPath: or one of the similar initializers or factory methods for info notifications that do not include parameters for a callback (i.e., temporary notification delegate and callback selector), set one of its classes as the delegate of the PFObserver object, and register to observe the notification. In the delegate method, use the identifier or fullPath parameter to identify the application that posted the notification, and use the notification , observedUIElement , affectedUIElement and notificationInfo parameters to obtain information about the notification that was triggered by a change in the target application. It is the client's responsibility to manage the observer's delegate appropriately.
As an alternative to this delegate method, a client application can implement an Objective-C callback method and register it with the observer using -initWithPath:notificationDelegate:callbackSelector:, or one of the other initializers or factory methods that include parameters for a callback (i.e., temporary notification delegate and callback selector). Use a callback method for more complex scenarios, where the client application must use information saved in the contextInfo parameter when the observer was registered. The client application's Objective-C callback selector must have the following signature:
- (void)observer:(PFObserver *)observer notification:(NSString *)notification element:(PFUIElement *)element notificationInfo:(NSDictionary *)notificationInfo contextInfo:(void *)contextInfo
Last Updated: Friday, October 19, 2018
|