2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
27 * @file ewk_form_submission_request.h
28 * @brief Describes the Ewk Form Submission Request API.
30 * @note Ewk_Form_Submission_Request provides information regarding
31 * a form about the be submitted, in particular its text fields.
34 #ifndef ewk_form_submission_request_h
35 #define ewk_form_submission_request_h
43 /** Creates a type name for Ewk_Form_Submission_Request */
44 typedef struct Ewk_Form_Submission_Request Ewk_Form_Submission_Request;
47 * Increases the reference count of the given object.
49 * @param request the request object to increase the reference count
51 * @return a pointer to the object on success, @c NULL otherwise.
53 EAPI Ewk_Form_Submission_Request *ewk_form_submission_request_ref(Ewk_Form_Submission_Request *request);
56 * Decreases the reference count of the given object, possibly freeing it.
58 * When the reference count reaches 0, the request is freed.
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
64 * @param request the request object to decrease the reference count
66 EAPI void ewk_form_submission_request_unref(Ewk_Form_Submission_Request *request);
69 * Returns the list of field names contained in the form associated to @a request.
71 * @param request the request object to query.
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().
77 * @see ewk_form_submission_request_field_value_get()
79 EAPI Eina_List *ewk_form_submission_request_field_names_get(Ewk_Form_Submission_Request *request);
82 * Returns the value of specific field contained in the form associated to @a request.
84 * @param request the request object to query.
85 * @param name name of the field to query the value for.
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.
91 * @see ewk_form_submission_request_field_names_get()
93 EAPI const char *ewk_form_submission_request_field_value_get(Ewk_Form_Submission_Request *request, const char *name);
96 * Continues the form request submission.
98 * If you don't call this function explicitly, the form request will be submitted
99 * upon @a request object destruction.
101 * @param request the request object to submit.
103 * @return @c EINA_TRUE is if successful, @c EINA_FALSE otherwise.
105 EAPI Eina_Bool ewk_form_submission_request_submit(Ewk_Form_Submission_Request *request);
111 #endif // ewk_form_submission_request_h