9f49dcaf30ed1dc0bee8248bb116dca818f4eb09
[platform/core/uifw/efl-assist.git] / src / include / efl_assist_editfield.h
1 /*
2  * Copyright (c) 2013 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 #ifndef __EFL_ASSIST_EDITFIELD_H__
19 #define __EFL_ASSIST_EDITFIELD_H__
20
21 #include <Elementary.h>
22 #include <stdbool.h>
23 #ifndef DESKTOP
24         #include <tizen.h>
25 #endif
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * @typedef Ea_Editfield_Type
33  *
34  * Editfield Entry types.
35  *
36  * @see ea_editfield_add()
37  */
38 typedef enum
39 {
40    EA_EDITFIELD_SINGLELINE,
41    EA_EDITFIELD_MULTILINE,
42    EA_EDITFIELD_SCROLL_SINGLELINE,
43    EA_EDITFIELD_SCROLL_MULTILINE,
44    EA_EDITFIELD_SCROLL_SINGLELINE_PASSWORD,
45    EA_EDITFIELD_SEARCHBAR
46 } Ea_Editfield_Type;
47
48 /**
49  * @brief Add an elementary entry widget with clear button and rename icon.
50  *
51  * @details Add an elementary entry widget with some special features.
52  *          The first is clear button that will delete all characters in current entry widget.
53  *          The second is rename icon which symbolizes the editable field in dialogue view.
54  *          Visible state of each clear button and rename icon will be changed automatically.
55  *          This API will return an elementary entry widget, and some elm_entry APIs can change
56  *          the internal state of this widget. For maintaining the original states of entry widget,
57  *          following signal emitting is needed :
58  *
59  *          1. For maintaining visible state of rename icon :
60  *                 "elm,state,rename,visible", "elm,state,rename,hidden"
61  *
62  *          2. For maintaining visible state of clear button :
63  *                 "elm,state,clear,visible", "elm,state,clear,hidden"
64  *
65  *          3. For maintaining scrollable state of entry :
66  *                 "elm,state,scroll,enabled", "elm,state,scroll,disabled"
67  *
68  *
69  * @param [in] parent The parent widget object
70  * @param [in] type Types for supporting different entry widget modes.
71  *
72  * @return elementary entry widget
73  *
74  */
75 Evas_Object *ea_editfield_add(Evas_Object *parent, Ea_Editfield_Type type);
76
77 /**
78  * @brief Disable the clear button. It makes the clear button be hidden always or not.
79  *
80  * @details Disable the clear button. If @param disable is EINA_TRUE, it will hide the clear button always.
81  *          If @param disable is EINA_FALSE, the clear button will be shown or hidden automatically.
82  *
83  * @param [in] obj the entry widget object
84  * @param [in] disable EINA_TRUE : the clear button will be hidden always
85  *                     EINA_FALSE : the clear button will be shown or hidden automatically
86  *
87  */
88 EXPORT_API void ea_editfield_clear_button_disabled_set(Evas_Object *obj, Eina_Bool disable);
89
90 /**
91  * @brief Get the disabled state of the clear button.
92  *
93  * @details Get the disabled state of clear button. It was seted by ea_editfield_clear_button_disabled_set.
94  *          If @return is EINA_TRUE, the clear button was hidden always.
95  *          If @return is EINA_FALSE, the clear button will be shown or hidden automatically.
96  *
97  * @see ea_editfield_clear_button_disabled_set()
98  *
99  * @param [in] obj the entry widget object
100  *
101  * @return return the disabled state of the clear button
102  *
103  */
104 EXPORT_API Eina_Bool ea_editfield_clear_button_disabled_get(Evas_Object *obj);
105
106 /**
107  * @}
108  */
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #endif /* __EFL_ASSIST_EDITFIELD_H__ */