Adlib
adlib.h
1 /*
2 * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
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 */
17 
18 /*
19  * adlib.h
20  *
21  * Created on: Oct 22, 2015
22  * Author: anand.r
23  */
24 
39 #ifndef _ADLIB_H_
40 #define _ADLIB_H_
41 
42 #include <tizen.h>
43 #include <Elementary.h>
44 
45 #ifdef __cplusplus
46 extern "C" { // only need to export C interface if
47 // used by C++ source code
48 #endif
49 
59 typedef struct _banner_addata banner_ad_h;
60 
65 typedef enum _adlib_err
66 {
75 } adlib_err;
76 
81 typedef enum adlib_event_type
82 {
88 
93 typedef enum _adlib_state_type
94 {
99 
104 typedef enum _adlib_gender
105 {
109 
123 typedef enum _banner_adposition
124 {
133 
138 typedef enum _banner_ad_size
139 {
143 
165 typedef void (*on_banner_request_succeeded_event_cb) (Evas_Object *banner_ad_obj, void *user_data);
166 
180 typedef void (*on_banner_request_failed_event_cb) (Evas_Object *banner_ad_obj, adlib_err err, void *user_data);
181 
194 typedef void (*on_banner_ad_opened_event_cb) (Evas_Object *banner_ad_obj, void *user_data);
195 
207 typedef void (*on_interstitial_request_succeeded_event_cb) ( void *user_data);
208 
221 typedef void (*on_interstitial_request_failed_event_cb) (adlib_err err, void *user_data);
222 
223 
235 typedef void (*on_interstitial_ad_opened_event_cb) (void *user_data);
236 
248 typedef void (*on_interstitial_ad_closed_event_cb) (void *user_data);
249 
254 typedef struct banner_ad_event_cb
255 {
260 
266 {
272 
289 EXPORT_API adlib_err
290 adlib_init(const char *banner_site_id, const char *interstitial_site_id, const char *js_namespace, const char *js_src_url, const char *ad_conf_str_name);
291 
300 EXPORT_API void
301 adlib_deinit();
302 
308 EXPORT_API void
309 adlib_set_age(int age);
310 
316 EXPORT_API void
317 adlib_set_gender(adlib_gender_e gender);
318 
324 EXPORT_API void
325 adlib_set_location(char *location);
326 
332 EXPORT_API void
333 adlib_set_interests(char *interests);
334 
340 EXPORT_API void
341 adlib_set_postal_code(char *postalCode);
342 
348 EXPORT_API void
349 adlib_set_area_code(char *areaCode);
350 
356 EXPORT_API void
357 adlib_set_date_of_birth(char *dob);
358 
364 EXPORT_API void
365 adlib_set_income(char *income);
366 
372 EXPORT_API void
373 adlib_set_education(char *education);
374 
380 EXPORT_API void
381 adlib_set_ethnicity(char *ethnicity);
382 
407 EXPORT_API adlib_err
408 adview_add_banner_ad(Evas_Object **banner_ad_obj, Evas_Object *eo, banner_ad_size_e size);
409 
423 EXPORT_API adlib_err
424 adview_banner_load(Evas_Object *banner_ad_obj);
425 
440 EXPORT_API adlib_err
441 adview_banner_set_enable_auto_refresh(Evas_Object *banner_ad_obj, Eina_Bool enable);
442 
455 EXPORT_API adlib_err
456 adview_banner_set_refresh_interval(Evas_Object *banner_ad_obj, double duration);
457 
471 EXPORT_API adlib_err
472 adview_banner_ad_set_position(Evas_Object *banner_ad_obj, banner_adposition_e pos);
473 
488 EXPORT_API adlib_err
489 adview_banner_ad_register_callbacks(Evas_Object *banner_ad_obj, banner_ad_event_callback_s *callback, void *user_data);
490 
516 EXPORT_API adlib_err
517 adview_add_interstitial_ad(Evas_Object *eo);
518 
531 EXPORT_API adlib_err
533 
543 EXPORT_API adlib_err
545 
560 EXPORT_API adlib_err
562 
567 #ifdef __cplusplus
568 }
569 #endif
570 
571 #endif // _ADLIB_H_
572 
void(* on_interstitial_request_failed_event_cb)(adlib_err err, void *user_data)
Called when the interstitial ad load is failed.
Definition: adlib.h:221
enum _adlib_err adlib_err
Enumeration for the error codes of adlib.
EXPORT_API adlib_err adview_banner_ad_register_callbacks(Evas_Object *banner_ad_obj, banner_ad_event_callback_s *callback, void *user_data)
Adds the banner ad callback handler.
EXPORT_API void adlib_set_gender(adlib_gender_e gender)
Set the user&#39;s gender for targeting purposes.
enum _adlib_state_type adlib_state_type_e
Enumeration for the state types of adlib.
EXPORT_API void adlib_set_ethnicity(char *ethnicity)
Set the user&#39;s ethnicity for targeting purposes.
Definition: adlib.h:96
Definition: adlib.h:131
_adlib_gender
Enumeration for the gender used in adlib.
Definition: adlib.h:104
struct _banner_addata banner_ad_h
Banner ad handle for handling banner ads.
Definition: adlib.h:59
Definition: adlib.h:127
_banner_adposition
Enumeration for the position to set in banner ads.
Definition: adlib.h:123
on_interstitial_request_failed_event_cb interstitial_ad_load_request_failed
Definition: adlib.h:268
enum _banner_adposition banner_adposition_e
Enumeration for the position to set in banner ads.
EXPORT_API adlib_err adview_interstitial_show(void)
Shows the interstitial ad.
adlib_event_type
Enumeration for the event types of adlib.
Definition: adlib.h:81
Definition: adlib.h:107
EXPORT_API adlib_err adlib_init(const char *banner_site_id, const char *interstitial_site_id, const char *js_namespace, const char *js_src_url, const char *ad_conf_str_name)
Initializes adlib and its core.
EXPORT_API adlib_err adview_banner_set_refresh_interval(Evas_Object *banner_ad_obj, double duration)
This api will set the auto refresh interval for the ad. Minimum refresh interval should be greater th...
Definition: adlib.h:85
EXPORT_API void adlib_set_date_of_birth(char *dob)
Set the user&#39;s date of birth for targeting purposes.
Definition: adlib.h:126
void(* on_interstitial_ad_opened_event_cb)(void *user_data)
Called when the interstitial ad is clicked.
Definition: adlib.h:235
_adlib_state_type
Enumeration for the state types of adlib.
Definition: adlib.h:93
struct interstitial_ad_event_cb interstitial_ad_event_callback_s
Interstitial ad event callbacks.
void(* on_interstitial_request_succeeded_event_cb)(void *user_data)
Called when the interstitial ad load is succeeded.
Definition: adlib.h:207
Definition: adlib.h:141
Definition: adlib.h:140
Definition: adlib.h:74
void(* on_banner_ad_opened_event_cb)(Evas_Object *banner_ad_obj, void *user_data)
Called when the banner ad is clicked.
Definition: adlib.h:194
EXPORT_API void adlib_set_education(char *education)
Set the user&#39;s education for targeting purposes.
EXPORT_API void adlib_set_location(char *location)
Set the user&#39;s location for targeting purposes.
enum adlib_event_type adlib_event_type_e
Enumeration for the event types of adlib.
_banner_ad_size
Enumeration for the size to set in banner ads.
Definition: adlib.h:138
on_interstitial_ad_opened_event_cb interstitial_ad_opened
Definition: adlib.h:269
void(* on_interstitial_ad_closed_event_cb)(void *user_data)
Called when the interstitial ad is closed.
Definition: adlib.h:248
EXPORT_API void adlib_set_income(char *income)
Set the user&#39;s income group for targeting purposes.
enum _adlib_gender adlib_gender_e
Enumeration for the gender used in adlib.
Definition: adlib.h:129
on_interstitial_ad_closed_event_cb interstitial_ad_closed
Definition: adlib.h:270
enum _banner_ad_size banner_ad_size_e
Enumeration for the size to set in banner ads.
Definition: adlib.h:125
Definition: adlib.h:73
void(* on_banner_request_succeeded_event_cb)(Evas_Object *banner_ad_obj, void *user_data)
Called when the banner ad load is succeeded.
Definition: adlib.h:165
EXPORT_API void adlib_set_interests(char *interests)
Set the user&#39;s interests for targeting purposes.
on_banner_request_failed_event_cb banner_ad_load_request_failed
Definition: adlib.h:257
Definition: adlib.h:95
void(* on_banner_request_failed_event_cb)(Evas_Object *banner_ad_obj, adlib_err err, void *user_data)
Called when the banner ad load is failed.
Definition: adlib.h:180
EXPORT_API void adlib_deinit()
Disconnects adlib core and clears networkconnection.
on_banner_request_succeeded_event_cb banner_ad_load_request_succeeded
Definition: adlib.h:256
Banner ad event callbacks.
Definition: adlib.h:254
_adlib_err
Enumeration for the error codes of adlib.
Definition: adlib.h:65
EXPORT_API void adlib_set_area_code(char *areaCode)
Set the user&#39;s area code for targeting purposes.
Definition: adlib.h:83
Definition: adlib.h:84
Definition: adlib.h:130
EXPORT_API adlib_err adview_add_interstitial_ad(Evas_Object *eo)
This api will add the interstitial ad on the parent received.
EXPORT_API void adlib_set_postal_code(char *postalCode)
Set the user&#39;s postal code for targeting purposes.
Definition: adlib.h:71
Definition: adlib.h:97
Definition: adlib.h:70
EXPORT_API adlib_err adview_banner_ad_set_position(Evas_Object *banner_ad_obj, banner_adposition_e pos)
Sets the position of the ad. Application can set the position of the ad to the predefined positions d...
EXPORT_API void adlib_set_age(int age)
Set the user&#39;s age for targeting purposes.
Definition: adlib.h:69
Definition: adlib.h:106
Definition: adlib.h:68
EXPORT_API adlib_err adview_interstitial_load(void)
Loads the interstitial ad. Returns the success or failure result to the listener callbacks. Please see OnLoadFailed and OnLoadSucceeded callbacks.
on_interstitial_request_succeeded_event_cb interstitial_ad_load_request_succeeded
Definition: adlib.h:267
on_banner_ad_opened_event_cb banner_ad_opened
Definition: adlib.h:258
Definition: adlib.h:128
struct banner_ad_event_cb banner_ad_event_callback_s
Banner ad event callbacks.
Definition: adlib.h:67
Definition: adlib.h:86
EXPORT_API adlib_err adview_banner_load(Evas_Object *banner_ad_obj)
Loads and shows the ad. Returns the success or failure result to the listener callbacks.
Interstitial ad event callbacks.
Definition: adlib.h:265
Definition: adlib.h:72
EXPORT_API adlib_err adview_banner_set_enable_auto_refresh(Evas_Object *banner_ad_obj, Eina_Bool enable)
This api will set the auto refresh feature to either enabled or disabled. If set to disabled ads will...
EXPORT_API adlib_err adview_add_banner_ad(Evas_Object **banner_ad_obj, Evas_Object *eo, banner_ad_size_e size)
This api will add the banner ad on the parent received.
EXPORT_API adlib_err adview_interstitial_ad_register_callbacks(interstitial_ad_event_callback_s *callback, void *user_data)
Adds the interstitial ad callback handler.