forked from ludei/atomic-plugins-ads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdService.h
98 lines (82 loc) · 2.59 KB
/
AdService.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#pragma once
#include "AdBanner.h"
#include "AdInterstitial.h"
namespace ludei { namespace ads {
/**
* The different ad providers available.
*/
enum class AdProvider {
/*
* Automatic. The provider is automatically selected depending on linked classes.
*/
AUTO,
/**
* Mopub.
*/
MOPUB,
/**
* Admob.
*/
ADMOB
};
/**
* Ad service configuration settings.
*/
struct AdServiceSettings {
/**
* Default adunit for banners.
*/
std::string banner;
/**
* Default adunit for interstitials.
*/
std::string interstitial;
/**
* Optional adunit. If empty, the 'banner' property is used on tablets.
*/
std::string bannerTablet;
/**
* Optional adunit. If empty, the 'interstitial' property is used on tablets.
*/
std::string interstitialTablet;
};
/**
* The ad service.
*/
class AdService {
public:
virtual ~AdService(){};
/**
* Creates a new AdService
*
* @param provider The Ad Provider that will be used or AUTO to automatically select the one linked within the binary
* @result The AdService with the selected provider or NULL if the provider is not available
*/
static AdService * create(AdProvider provider = AdProvider::AUTO);
/**
* Creates a new AdService
*
* @param className The className of the provider
* @result The AdService with the selected provider or NULL if the provider is not available
*/
static AdService * create(const char * className);
/**
* Stablishes the default configuration for the ad service.
*
* @param settings The default settings.
*/
virtual void configure(const AdServiceSettings & settings) = 0;
/**
* Creates a new banner. If no adunit is specified, the default one will be used.
*
* @param adunit
*/
virtual AdBanner * createBanner(const char * adunit = 0, AdBannerSize size = AdBannerSize::SMART_SIZE) = 0;
/**
* Creates a new interstitial. If no adunit is specified, the default one will be used.
*
* @param adunit The interstitial adunit.
*/
virtual AdInterstitial * createInterstitial(const char * adunit = 0) = 0;
};
} }