FBActiveAppDetectionPoint.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import <XCTest/XCTest.h>
  10. @protocol FBXCAccessibilityElement;
  11. NS_ASSUME_NONNULL_BEGIN
  12. @interface FBActiveAppDetectionPoint : NSObject
  13. @property (nonatomic) CGPoint coordinates;
  14. /**
  15. * Retrieves singleton representation of the current class
  16. */
  17. + (instancetype)sharedInstance;
  18. /**
  19. * Calculates the accessbility element which is located at the given screen coordinates
  20. *
  21. * @param point The screen coordinates
  22. * @returns The retrieved accessbility element or nil if it cannot be detected
  23. */
  24. + (nullable id<FBXCAccessibilityElement>)axElementWithPoint:(CGPoint)point;
  25. /**
  26. * Retrieves the accessbility element for the current screen point
  27. *
  28. * @returns The retrieved accessbility element or nil if it cannot be detected
  29. */
  30. - (nullable id<FBXCAccessibilityElement>)axElement;
  31. /**
  32. * Sets the coordinates for the current screen point
  33. *
  34. * @param coordinatesStr The coordinates string in `x,y` format. x and y can be any float numbers
  35. * @param error Is assigned to the actual error object if coordinates cannot be set
  36. * @returns YES if the coordinates were successfully set
  37. */
  38. - (BOOL)setCoordinatesWithString:(NSString *)coordinatesStr error:(NSError **)error;
  39. /**
  40. * Retrieves the coordinates of the current screen point in string representation
  41. *
  42. * @returns Point coordinates as `x,y` string
  43. */
  44. - (NSString *)stringCoordinates;
  45. @end
  46. NS_ASSUME_NONNULL_END