Stay organized with collections Save and categorize content based on your preferences.

firebase::gma::AdSize

#include <types.h>

The size of a banner ad.

Summary

Constructors and Destructors

AdSize(uint32_t width, uint32_t height)
Creates a new AdSize.

Public types

Orientation{
  kOrientationCurrent = 0,
  kOrientationLandscape,
  kOrientationPortrait
}
enum
Denotes the orientation of the AdSize.
Type{
  kTypeStandard = 0,
  kTypeAnchoredAdaptive,
  kTypeInlineAdaptive
}
enum
Denotes the type size object that the AdSize represents.

Public static attributes

kBanner
const AdSize
Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels).
kFullBanner
const AdSize
Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).
kLargeBanner
const AdSize
Taller version of kBanner. Typically 320x100.
kLeaderboard
const AdSize
Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).
kMediumRectangle
const AdSize
Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).

Public functions

height() const
uint32_t
The height of the region represented by this AdSize.
operator!=(const AdSize & rhs) const
bool
Comparison operator.
operator==(const AdSize & rhs) const
bool
Comparison operator.
orientation() const
The AdSize orientation.
type() const
The AdSize type, either standard size or adaptive.
width() const
uint32_t
The width of the region represented by this AdSize.

Public static functions

GetCurrentOrientationAnchoredAdaptiveBannerAdSize(uint32_t width)
Creates an AdSize with the given width and a Google-optimized height to create a banner ad given the current orientation.
GetCurrentOrientationInlineAdaptiveBannerAdSize(int width)
A convenience method to return an inline adaptive banner ad size given the current interface orientation.
GetInlineAdaptiveBannerAdSize(int width, int max_height)
This ad size is most suitable for banner ads given a maximum height.
GetLandscapeAnchoredAdaptiveBannerAdSize(uint32_t width)
Creates an AdSize with the given width and a Google-optimized height to create a banner ad in landscape mode.
GetLandscapeInlineAdaptiveBannerAdSize(int width)
Creates an AdSize with the given width and the device’s landscape height.
GetPortraitAnchoredAdaptiveBannerAdSize(uint32_t width)
Creates an AdSize with the given width and a Google-optimized height to create a banner ad in portrait mode.
GetPortraitInlineAdaptiveBannerAdSize(int width)
Creates an AdSize with the given width and the device’s portrait height.

Public types

Orientation

 Orientation

Denotes the orientation of the AdSize.

Properties
kOrientationCurrent

AdSize should reflect the current orientation of the device.

kOrientationLandscape

AdSize will be adaptively formatted in Landscape mode.

kOrientationPortrait

AdSize will be adaptively formatted in Portrait mode.

Type

 Type

Denotes the type size object that the AdSize represents.

Properties
kTypeAnchoredAdaptive

An adaptive size anchored to a portion of the screen.

kTypeInlineAdaptive

An adaptive size intended to be embedded in scrollable content.

kTypeStandard

The standard AdSize type of a set height and width.

Public static attributes

kBanner

const AdSize kBanner

Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels).

kFullBanner

const AdSize kFullBanner

Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).

kLargeBanner

const AdSize kLargeBanner

Taller version of kBanner. Typically 320x100.

kLeaderboard

const AdSize kLeaderboard

Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).

kMediumRectangle

const AdSize kMediumRectangle

Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).

Public functions

AdSize

 AdSize(
  uint32_t width,
  uint32_t height
)

Creates a new AdSize.

Details
Parameters
width
The width of the ad in density-independent pixels.
height
The height of the ad in density-independent pixels.

height

uint32_t height() const 

The height of the region represented by this AdSize.

Value is in density-independent pixels.

operator!=

bool operator!=(
  const AdSize & rhs
) const 

Comparison operator.

Details
Returns
true if rhs refers to a different AdSize as this.

operator==

bool operator==(
  const AdSize & rhs
) const 

Comparison operator.

Details
Returns
true if rhs refers to the same AdSize as this.

orientation

Orientation orientation() const 

The AdSize orientation.

type

Type type() const 

The AdSize type, either standard size or adaptive.

width

uint32_t width() const 

The width of the region represented by this AdSize.

Value is in density-independent pixels.

Public static functions

GetCurrentOrientationAnchoredAdaptiveBannerAdSize

AdSize GetCurrentOrientationAnchoredAdaptiveBannerAdSize(
  uint32_t width
)

Creates an AdSize with the given width and a Google-optimized height to create a banner ad given the current orientation.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
an AdSize with the given width and a Google-optimized height to create a banner ad. The size returned will have an aspect ratio similar to AdSize, suitable for anchoring near the top or bottom of your app. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded.

GetCurrentOrientationInlineAdaptiveBannerAdSize

AdSize GetCurrentOrientationInlineAdaptiveBannerAdSize(
  int width
)

A convenience method to return an inline adaptive banner ad size given the current interface orientation.

This AdSize allows Google servers to choose an optimal ad size with a height less than or equal to the height of the screen in the requested orientation.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded.

GetInlineAdaptiveBannerAdSize

AdSize GetInlineAdaptiveBannerAdSize(
  int width,
  int max_height
)

This ad size is most suitable for banner ads given a maximum height.

This AdSize allows Google servers to choose an optimal ad size with a height less than or equal to the max height given in

Details
Parameters
width
The width of the ad in density-independent pixels.
max_height
The maximum height that a loaded ad will have. Must be at least 32 dp, but a maxHeight of 50 dp or higher is recommended.
Returns
an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded.

GetLandscapeAnchoredAdaptiveBannerAdSize

AdSize GetLandscapeAnchoredAdaptiveBannerAdSize(
  uint32_t width
)

Creates an AdSize with the given width and a Google-optimized height to create a banner ad in landscape mode.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
an AdSize with the given width and a Google-optimized height to create a banner ad. The size returned will have an aspect ratio similar to BANNER, suitable for anchoring near the top or bottom of your app. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded.

GetLandscapeInlineAdaptiveBannerAdSize

AdSize GetLandscapeInlineAdaptiveBannerAdSize(
  int width
)

Creates an AdSize with the given width and the device’s landscape height.

This ad size allows Google servers to choose an optimal ad size with a height less than or equal to the height of the screen in landscape orientation.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded.

GetPortraitAnchoredAdaptiveBannerAdSize

AdSize GetPortraitAnchoredAdaptiveBannerAdSize(
  uint32_t width
)

Creates an AdSize with the given width and a Google-optimized height to create a banner ad in portrait mode.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
an AdSize with the given width and a Google-optimized height to create a banner ad. The size returned will have an aspect ratio similar to BANNER, suitable for anchoring near the top or bottom of your app. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded.

GetPortraitInlineAdaptiveBannerAdSize

AdSize GetPortraitInlineAdaptiveBannerAdSize(
  int width
)

Creates an AdSize with the given width and the device’s portrait height.

This ad size allows Google servers to choose an optimal ad size with a height less than or equal to the height of the screen in portrait orientation.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
an AdSize with the given width and a height that is always 0. The exact size of the ad returned can be retrieved by calling AdView::ad_size once the ad has been loaded.