Fix for desktop build
[framework/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 search icon which symbolizes the search field in search bar.
54  *          Visible state of the clear button 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 clear button :
60  *                 "elm,state,clear,visible", "elm,state,clear,hidden"
61  *
62  *          2. For maintaining scrollable state of entry :
63  *                 "elm,state,scroll,enabled", "elm,state,scroll,disabled"
64  *
65  *          The visible state of search icon can be changed by the following EFL elementary API :
66  *
67  *          EAPI void elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
68  *
69  *
70  * @param [in] parent The parent widget object
71  * @param [in] type Types for supporting different entry widget modes.
72  *
73  * @return elementary entry widget
74  *
75  */
76 Evas_Object *ea_editfield_add(Evas_Object *parent, Ea_Editfield_Type type);
77
78 /**
79  * @brief Disable the clear button. It makes the clear button be hidden always or not.
80  *
81  * @details Disable the clear button. If @param disable is EINA_TRUE, it will hide the clear button always.
82  *          If @param disable is EINA_FALSE, the clear button will be shown or hidden automatically.
83  *          Basically, the clear button will be shown when the text is not empty and
84  *          be hidden when the text is empty or the entry loses focus.
85  *
86  * @param [in] obj the entry widget object
87  * @param [in] disable EINA_TRUE : the clear button will be hidden always
88  *                     EINA_FALSE : the clear button will be shown or hidden automatically
89  *
90  */
91 void ea_editfield_clear_button_disabled_set(Evas_Object *obj, Eina_Bool disable);
92
93 /**
94  * @brief Get the disabled state of the clear button.
95  *
96  * @details Get the disabled state of clear button. It was seted by ea_editfield_clear_button_disabled_set.
97  *          If @return is EINA_TRUE, the clear button was hidden always.
98  *          If @return is EINA_FALSE, the clear button will be shown or hidden automatically.
99  *
100  * @see ea_editfield_clear_button_disabled_set()
101  *
102  * @param [in] obj the entry widget object
103  *
104  * @return return the disabled state of the clear button
105  *
106  */
107 Eina_Bool ea_editfield_clear_button_disabled_get(Evas_Object *obj);
108
109 /**
110  * @}
111  */
112
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif /* __EFL_ASSIST_EDITFIELD_H__ */