You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.5 KiB

6 years ago
5 years ago
6 years ago
5 years ago
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <TargetConditionals.h>
  17. #if !TARGET_OS_OSX && !TARGET_OS_TV
  18. #import <UIKit/UIKit.h>
  19. @class FIRAuthWebViewController;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** @protocol FIRAuthWebViewControllerDelegate
  22. @brief Defines a delegate for FIRAuthWebViewController
  23. */
  24. @protocol FIRAuthWebViewControllerDelegate <NSObject>
  25. /** @fn webViewController:canHandleURL:
  26. @brief Determines if a URL should be handled by the delegate.
  27. @param URL The URL to handle.
  28. @return Whether the URL could be handled or not.
  29. */
  30. - (BOOL)webViewController:(FIRAuthWebViewController *)webViewController canHandleURL:(NSURL *)URL;
  31. /** @fn webViewControllerDidCancel:
  32. @brief Notifies the delegate that the web view controller is being cancelled by the user.
  33. @param webViewController The web view controller in question.
  34. */
  35. - (void)webViewControllerDidCancel:(FIRAuthWebViewController *)webViewController;
  36. /** @fn webViewController:didFailWithError:
  37. @brief Notifies the delegate that the web view controller failed to load a page.
  38. @param webViewController The web view controller in question.
  39. @param error The error that has occurred.
  40. */
  41. - (void)webViewController:(FIRAuthWebViewController *)webViewController
  42. didFailWithError:(NSError *)error;
  43. @end
  44. /** @class FIRAuthWebViewController
  45. @brief Reponsible for creating a UIViewController for presenting a FIRAutWebView.
  46. */
  47. @interface FIRAuthWebViewController : UIViewController
  48. /** @fn initWithNibName:bundle:
  49. * @brief Please call initWithURL:delegate:
  50. */
  51. - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil
  52. bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
  53. /** @fn initWithCoder:
  54. * @brief Please call initWithURL:delegate:
  55. */
  56. - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
  57. - (instancetype)initWithURL:(NSURL *)URL
  58. delegate:(__weak id<FIRAuthWebViewControllerDelegate>)delegate
  59. NS_DESIGNATED_INITIALIZER;
  60. @end
  61. NS_ASSUME_NONNULL_END
  62. #endif