Create string tightly when retrive string from cbhm callback event
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_form_submission_request.h
1 /*
2  * Copyright (C) 2012 Intel Corporation. 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 APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 /**
27  * @file    ewk_form_submission_request.h
28  * @brief   Describes the Ewk Form Submission Request API.
29  *
30  * @note Ewk_Form_Submission_Request provides information regarding
31  * a form about the be submitted, in particular its text fields.
32  */
33
34 #ifndef ewk_form_submission_request_h
35 #define ewk_form_submission_request_h
36
37 #include <Eina.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /** Creates a type name for Ewk_Form_Submission_Request */
44 typedef struct Ewk_Form_Submission_Request Ewk_Form_Submission_Request;
45
46 /**
47  * Increases the reference count of the given object.
48  *
49  * @param request the request object to increase the reference count
50  *
51  * @return a pointer to the object on success, @c NULL otherwise.
52  */
53 EAPI Ewk_Form_Submission_Request *ewk_form_submission_request_ref(Ewk_Form_Submission_Request *request);
54
55 /**
56  * Decreases the reference count of the given object, possibly freeing it.
57  *
58  * When the reference count reaches 0, the request is freed.
59  *
60  * If the reference count reaches 0 and the form request has not be submitted yet,
61  * ewk_form_submission_request_submit() will be called automatically before
62  * destruction.
63  *
64  * @param request the request object to decrease the reference count
65  */
66 EAPI void ewk_form_submission_request_unref(Ewk_Form_Submission_Request *request);
67
68 /**
69  * Returns the list of field names contained in the form associated to @a request.
70  *
71  * @param request the request object to query.
72  *
73  * @return a #Eina_List with the form text fields names, or @c NULL in case of error.
74  * The items of the list are guaranteed to be stringshared so use eina_stringshare_add()
75  * instead of strdup() to copy them and free them using eina_stringshare_del().
76  *
77  * @see ewk_form_submission_request_field_value_get()
78  */
79 EAPI Eina_List *ewk_form_submission_request_field_names_get(Ewk_Form_Submission_Request *request);
80
81 /**
82  * Returns the value of specific field contained in the form associated to @a request.
83  *
84  * @param request the request object to query.
85  * @param name name of the field to query the value for.
86  *
87  * @return a #Eina_List with the form text fields names, or @c NULL in case of error.
88  * The string returned is guaranteed to be stringshared. You need to call
89  * eina_stringshare_del() on the returned value once you are done with it.
90  *
91  * @see ewk_form_submission_request_field_names_get()
92  */
93 EAPI const char *ewk_form_submission_request_field_value_get(Ewk_Form_Submission_Request *request, const char *name);
94
95 /**
96  * Continues the form request submission.
97  *
98  * If you don't call this function explicitly, the form request will be submitted
99  * upon @a request object destruction.
100  *
101  * @param request the request object to submit.
102  *
103  * @return @c EINA_TRUE is if successful, @c EINA_FALSE otherwise.
104  */
105 EAPI Eina_Bool ewk_form_submission_request_submit(Ewk_Form_Submission_Request *request);
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif // ewk_form_submission_request_h