b7cc216bb9975be3f4d27a57d4384e181da2cfe6
[platform/framework/web/crosswalk-tizen.git] /
1 /*
2  * Copyright (C) 2013-2016 Samsung Electronics. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY SAMSUNG ELECTRONICS. AND ITS CONTRIBUTORS
14  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
15  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SAMSUNG ELECTRONICS. OR ITS
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #ifndef ewk_user_media_internal_h
27 #define ewk_user_media_internal_h
28
29 #include <Eina.h>
30 #include <tizen.h>
31 #include "ewk_security_origin_internal.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 typedef struct _Ewk_User_Media_Permission_Request Ewk_User_Media_Permission_Request;
38
39 /**
40  * Requests for getting origin of local media permission request.
41  *
42  * @param request Ewk_User_Media_Permission_Request object to get origin for
43  *        userMedia permission request
44  *
45  * @return security origin of userMedia permission request
46  */
47 EXPORT_API const Ewk_Security_Origin* ewk_user_media_permission_request_origin_get(const Ewk_User_Media_Permission_Request* request);
48
49 /**
50  * Sets the permission to access local media
51  *
52  * @param request Ewk_View_User_Media_Permission_Request object for userMedia
53  *        permission
54  * @param allowed decided permission value from user
55  */
56 EXPORT_API void ewk_user_media_permission_request_set(Ewk_User_Media_Permission_Request* request, Eina_Bool allowed);
57
58 /**
59  * Suspend the operation for user media permission
60  *
61  * @param request user media permission request object
62  *
63  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
64  */
65 EXPORT_API Eina_Bool ewk_user_media_permission_request_suspend(Ewk_User_Media_Permission_Request* request);
66
67 /**
68  * Reply the result about user media permission.
69  *
70  * @param request Ewk_User_Media_Permission_Request object to get
71  *        the information about user media permission request
72  * @param allow result about user media permission
73  */
74 EXPORT_API void ewk_user_media_permission_reply(Ewk_User_Media_Permission_Request* request, Eina_Bool allow);
75
76 #ifdef __cplusplus
77 }
78 #endif
79 #endif // ewk_user_media_internal_h