-
Notifications
You must be signed in to change notification settings - Fork 22
/
AdInterstitial.h
81 lines (65 loc) · 2.08 KB
/
AdInterstitial.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
#pragma once
#include <string>
namespace ludei { namespace ads {
class AdInterstitialListener;
/**
* Defines an interstitial ad.
*/
class AdInterstitial {
public:
virtual ~AdInterstitial(){};
/**
* Shows the interstitial.
*/
virtual void show() = 0;
/**
* Hides the interstitial.
*/
virtual void load() = 0;
/**
* Sets a new listener for the interstitial.
*
* @param listener The listener to be set.
*/
virtual void setListener(AdInterstitialListener * listener) = 0;
};
/**
* Allows to listen to events regarding interstitials.
*/
class AdInterstitialListener {
public:
virtual ~AdInterstitialListener(){}
/**
* Triggered when the interstitial has loaded a new ad.
*
* @param interstitial The interstitial.
*/
virtual void onLoaded(AdInterstitial * interstitial) = 0;
/**
* Triggered when the interstitial has failed on loading a new ad.
*
* @param interstitial The interstitial.
* @param code The code of the error.
* @param message The error message.
*/
virtual void onFailed(AdInterstitial * interstitial, int32_t code, const std::string & message) = 0;
/**
* Triggered when the interstitial has been clicked.
*
* @param interstitial The interstitial.
*/
virtual void onClicked(AdInterstitial * interstitial) = 0;
/**
* Triggered when the interstitial shows its modal content.
*
* @param interstitial The interstitial.
*/
virtual void onShown(AdInterstitial * interstitial) = 0;
/**
* Triggered when the interstitial is hidden.
*
* @param interstitial The interstitial.
*/
virtual void onHidden(AdInterstitial * interstitial) = 0;
};
} }