1 #ifndef ELM_WIDGET_CONFORMANT_H
2 #define ELM_WIDGET_CONFORMANT_H
4 #include "elm_widget_layout.h"
10 * @section elm-conformant-class The Elementary Conformant Class
12 * Elementary, besides having the @ref Conformant widget, exposes its
13 * foundation -- the Elementary Conformant Class -- in order to create other
14 * widgets which are a conformant with some more logic on top.
18 * @def ELM_CONFORMANT_CLASS
20 * Use this macro to cast whichever subclass of
21 * #Elm_Conformant_Smart_Class into it, so to access its fields.
25 #define ELM_CONFORMANT_CLASS(x) ((Elm_Conformant_Smart_Class *)x)
28 * @def ELM_CONFORMANT_DATA
30 * Use this macro to cast whichever subdata of
31 * #Elm_Conformant_Smart_Data into it, so to access its fields.
35 #define ELM_CONFORMANT_DATA(x) ((Elm_Conformant_Smart_Data *)x)
38 * @def ELM_CONFORMANT_SMART_CLASS_VERSION
40 * Current version for Elementary conformant @b base smart class, a value
41 * which goes to _Elm_Conformant_Smart_Class::version.
45 #define ELM_CONFORMANT_SMART_CLASS_VERSION 1
48 * @def ELM_CONFORMANT_SMART_CLASS_INIT
50 * Initializer for a whole #Elm_Conformant_Smart_Class structure, with
51 * @c NULL values on its specific fields.
53 * @param smart_class_init initializer to use for the "base" field
54 * (#Evas_Smart_Class).
56 * @see EVAS_SMART_CLASS_INIT_NULL
57 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
58 * @see ELM_CONFORMANT_SMART_CLASS_INIT_NULL
59 * @see ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION
63 #define ELM_CONFORMANT_SMART_CLASS_INIT(smart_class_init) \
64 {smart_class_init, ELM_CONFORMANT_SMART_CLASS_VERSION}
67 * @def ELM_CONFORMANT_SMART_CLASS_INIT_NULL
69 * Initializer to zero out a whole #Elm_Conformant_Smart_Class structure.
71 * @see ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION
72 * @see ELM_CONFORMANT_SMART_CLASS_INIT
76 #define ELM_CONFORMANT_SMART_CLASS_INIT_NULL \
77 ELM_CONFORMANT_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
80 * @def ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION
82 * Initializer to zero out a whole #Elm_Conformant_Smart_Class structure and
83 * set its name and version.
85 * This is similar to #ELM_CONFORMANT_SMART_CLASS_INIT_NULL, but it will
86 * also set the version field of #Elm_Conformant_Smart_Class (base field)
87 * to the latest #ELM_CONFORMANT_SMART_CLASS_VERSION and name it to the
90 * It will keep a reference to the name field as a <c>"const char *"</c>,
91 * i.e., the name must be available while the structure is
92 * used (hint: static or global variable!) and must not be modified.
94 * @see ELM_CONFORMANT_SMART_CLASS_INIT_NULL
95 * @see ELM_CONFORMANT_SMART_CLASS_INIT
99 #define ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION(name) \
100 ELM_CONFORMANT_SMART_CLASS_INIT \
101 (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
104 * Elementary conformant base smart class. This inherits directly from
105 * #Elm_Layout_Smart_Class and is meant to build widgets extending the
106 * behavior of a conformant.
108 * All of the functions listed on @ref Conformant namespace will work for
109 * objects deriving from #Elm_Conformant_Smart_Class.
111 typedef struct _Elm_Conformant_Smart_Class
113 Elm_Layout_Smart_Class base;
115 int version; /**< Version of this smart class definition */
116 } Elm_Conformant_Smart_Class;
119 * Base layout smart data extended with conformant instance data.
121 typedef struct _Elm_Conformant_Smart_Data Elm_Conformant_Smart_Data;
122 struct _Elm_Conformant_Smart_Data
124 Elm_Layout_Smart_Data base;
125 Evas_Object *portrait_indicator;
126 Evas_Object *landscape_indicator;
127 Evas_Object *indicator_event;
128 Evas_Object *softkey;
129 Evas_Object *virtualkeypad;
130 Evas_Object *clipboard;
131 Evas_Object *scroller;
133 #ifdef HAVE_ELEMENTARY_X
134 Ecore_Event_Handler *prop_hdl;
135 Ecore_X_Virtual_Keyboard_State vkb_state;
136 Ecore_X_Illume_Clipboard_State clipboard_state;
140 Ecore_Animator *animator; // animaton timer
141 double start; // time started
142 Evas_Coord auto_x, auto_y; // desired delta
143 Evas_Coord x, y; // current delta
145 Ecore_Job *show_region_job;
146 Elm_Win_Indicator_Mode indmode;
147 Elm_Win_Indicator_Opacity_Mode ind_o_mode;
148 Ecore_Timer *land_indi_timer;
149 Ecore_Timer *port_indi_timer;
150 Ecore_Timer *indicator_effect_timer;
155 Eina_Bool on_indicator_effect : 1;
156 Eina_Bool keypad_disable;
157 Eina_Bool clipboard_disable;
158 Eina_Bool split_window;
159 Elm_Win_Indicator_Mode split_indmode;
160 Elm_Win_Indicator_Opacity_Mode split_ind_o_mode;
163 /* Enum to identify conformant swallow parts */
164 typedef enum _Conformant_Part_Type Conformant_Part_Type;
165 enum _Conformant_Part_Type
167 ELM_CONFORMANT_INDICATOR_PART = 1,
168 ELM_CONFORMANT_SOFTKEY_PART = 2,
169 ELM_CONFORMANT_VIRTUAL_KEYPAD_PART = 4,
170 ELM_CONFORMANT_CLIPBOARD_PART = 8
177 EAPI extern const char ELM_CONFORMANT_SMART_NAME[];
178 EAPI const Elm_Conformant_Smart_Class *elm_conformant_smart_class_get(void);
180 #define ELM_CONFORMANT_DATA_GET(o, sd) \
181 Elm_Conformant_Smart_Data * sd = evas_object_smart_data_get(o)
183 #define ELM_CONFORMANT_DATA_GET_OR_RETURN(o, ptr) \
184 ELM_CONFORMANT_DATA_GET(o, ptr); \
187 CRITICAL("No widget data for object %p (%s)", \
188 o, evas_object_type_get(o)); \
192 #define ELM_CONFORMANT_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
193 ELM_CONFORMANT_DATA_GET(o, ptr); \
196 CRITICAL("No widget data for object %p (%s)", \
197 o, evas_object_type_get(o)); \
201 #define ELM_CONFORMANT_CHECK(obj) \
202 if (!obj || !elm_widget_type_check \
203 ((obj), ELM_CONFORMANT_SMART_NAME, __func__)) \