PFObserverDelegate


A formal protocol declaring delegate messages sent by PFObserver.

Extends Protocol: NSObject
Declared In: PFObserver.h

Discussion

The PFObserverDelegate protocol implements one optional delegate method, applicationWithIdentifier:atPath:didPostAccessibilityNotification:fromObservedUIElement:forAffectedUIElement:.

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:


Sent when the receiving observer detects an accessibility notification.

- (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 other 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

Last Updated: Friday, July 30, 2010