Guest User

Untitled

a guest
Jan 25th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  GADAdSize.h
  3. //  Google Ads iOS SDK
  4. //
  5. //  Copyright 2012 Google Inc. All rights reserved.
  6. //
  7. //  A valid GADAdSize is considered to be one of the predefined GADAdSize
  8. //  constants or a GADAdSize constructed by GADAdSizeFromCGSize,
  9. //  GADAdSizeFullWidthPortraitWithHeight, GADAdSizeFullWidthLandscapeWithHeight.
  10. //
  11.  
  12. #import <UIKit/UIKit.h>
  13.  
  14. // Do not create a GADAdSize manually. Use one of the kGADAdSize constants.
  15. // Treat GADAdSize as an opaque type. Do not access any fields directly. To
  16. // obtain a concrete CGSize, use the function CGSizeFromGADAdSize().
  17. typedef struct GADAdSize {
  18.   CGSize size;
  19.   NSUInteger flags;
  20. } GADAdSize;
  21.  
  22. #pragma mark Standard Sizes
  23.  
  24. // iPhone and iPod Touch ad size. Typically 320x50.
  25. extern GADAdSize const kGADAdSizeBanner;
  26.  
  27. // Medium Rectangle size for the iPad (especially in a UISplitView's left pane).
  28. // Typically 300x250.
  29. extern GADAdSize const kGADAdSizeMediumRectangle;
  30.  
  31. // Full Banner size for the iPad (especially in a UIPopoverController or in
  32. // UIModalPresentationFormSheet). Typically 468x60.
  33. extern GADAdSize const kGADAdSizeFullBanner;
  34.  
  35. // Leaderboard size for the iPad. Typically 728x90.
  36. extern GADAdSize const kGADAdSizeLeaderboard;
  37.  
  38. // Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer
  39. // this size. Typically 120x600.
  40. extern GADAdSize const kGADAdSizeSkyscraper;
  41.  
  42. // An ad size that spans the full width of the application in portrait
  43. // orientation. The height is typically 50 pixels on an iPhone/iPod UI, and 90
  44. // pixels tall on an iPad UI.
  45. extern GADAdSize const kGADAdSizeSmartBannerPortrait;
  46.  
  47. // An ad size that spans the full width of the application in landscape
  48. // orientation. The height is typically 32 pixels on an iPhone/iPod UI, and 90
  49. // pixels tall on an iPad UI.
  50. extern GADAdSize const kGADAdSizeSmartBannerLandscape;
  51.  
  52. // Invalid ad size marker.
  53. extern GADAdSize const kGADAdSizeInvalid;
  54.  
  55. #pragma mark Custom Sizes
  56.  
  57. // Given a CGSize, return a custom GADAdSize. Use this only if you require a
  58. // non-standard size, otherwise, use one of the standard size constants above.
  59. GADAdSize GADAdSizeFromCGSize(CGSize size);
  60.  
  61. // Get a custom GADAdSize that spans the full width of the application in
  62. // portrait orientation with the height provided.
  63. GADAdSize GADAdSizeFullWidthPortraitWithHeight(CGFloat height);
  64.  
  65. // Get a custom GADAdSize that spans the full width of the application in
  66. // landscape orientation with the height provided.
  67. GADAdSize GADAdSizeFullWidthLandscapeWithHeight(CGFloat height);
  68.  
  69. #pragma mark Convenience Functions
  70.  
  71. // Checks whether the two GADAdSizes are equal.
  72. BOOL GADAdSizeEqualToSize(GADAdSize size1, GADAdSize size2);
  73.  
  74. // Given a GADAdSize constant, returns a CGSize. If the GADAdSize is unknown,
  75. // returns CGSizeZero.
  76. CGSize CGSizeFromGADAdSize(GADAdSize size);
  77.  
  78. // Returns YES if |size| is one of the predefined constants or is a custom
  79. // GADAdSize generated by GADAdSizeFromCGSize.
  80. BOOL IsGADAdSizeValid(GADAdSize size);
  81.  
  82. // Given a GADAdSize constant, returns a NSString describing the GADAdSize.
  83. NSString *NSStringFromGADAdSize(GADAdSize size);
  84.  
  85. #pragma mark Deprecated Macros
  86.  
  87. #define GAD_SIZE_320x50 CGSizeFromGADAdSize(kGADAdSizeBanner)
  88. #define GAD_SIZE_300x250 CGSizeFromGADAdSize(kGADAdSizeMediumRectangle)
  89. #define GAD_SIZE_468x60 CGSizeFromGADAdSize(kGADAdSizeFullBanner)
  90. #define GAD_SIZE_728x90 CGSizeFromGADAdSize(kGADAdSizeLeaderboard)
  91. #define GAD_SIZE_120x600 CGSizeFromGADAdSize(kGADAdSizeSkyscraper)
Advertisement
Add Comment
Please, Sign In to add comment