GIDSignInButton.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright 2021 Google LLC
  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. #import <TargetConditionals.h>
  17. #if TARGET_OS_IOS || TARGET_OS_MACCATALYST
  18. #import <UIKit/UIKit.h>
  19. NS_ASSUME_NONNULL_BEGIN
  20. /// The layout styles supported by the `GIDSignInButton`.
  21. ///
  22. /// The minimum size of the button depends on the language used for text.
  23. /// The following dimensions (in points) fit for all languages:
  24. /// - kGIDSignInButtonStyleStandard: 230 x 48
  25. /// - kGIDSignInButtonStyleWide: 312 x 48
  26. /// - kGIDSignInButtonStyleIconOnly: 48 x 48 (no text, fixed size)
  27. typedef NS_ENUM(NSInteger, GIDSignInButtonStyle) {
  28. kGIDSignInButtonStyleStandard = 0,
  29. kGIDSignInButtonStyleWide = 1,
  30. kGIDSignInButtonStyleIconOnly = 2
  31. };
  32. /// The color schemes supported by the `GIDSignInButton`.
  33. typedef NS_ENUM(NSInteger, GIDSignInButtonColorScheme) {
  34. kGIDSignInButtonColorSchemeDark = 0,
  35. kGIDSignInButtonColorSchemeLight = 1
  36. };
  37. /// This class provides the "Sign in with Google" button.
  38. ///
  39. /// You can instantiate this class programmatically or from a NIB file. You
  40. /// should connect this control to an `IBAction`, or something similar, that
  41. /// calls signInWithConfiguration:presentingViewController:callback: on
  42. /// `GIDSignIn` and add it to your view hierarchy.
  43. @interface GIDSignInButton : UIControl
  44. /// The layout style for the sign-in button.
  45. /// Possible values:
  46. /// - kGIDSignInButtonStyleStandard: 230 x 48 (default)
  47. /// - kGIDSignInButtonStyleWide: 312 x 48
  48. /// - kGIDSignInButtonStyleIconOnly: 48 x 48 (no text, fixed size)
  49. @property(nonatomic, assign) GIDSignInButtonStyle style;
  50. /// The color scheme for the sign-in button.
  51. /// Possible values:
  52. /// - kGIDSignInButtonColorSchemeDark
  53. /// - kGIDSignInButtonColorSchemeLight (default)
  54. @property(nonatomic, assign) GIDSignInButtonColorScheme colorScheme;
  55. @end
  56. NS_ASSUME_NONNULL_END
  57. #endif