Merge "[Copy&Paste] remove "Paste" button when CBHM has no item"
[framework/uifw/elementary.git] / src / edje_externals / elm_nocontents.c
1 #include "private.h"
2
3 typedef struct _Elm_Params_Nocontents
4 {
5    Elm_Params base;
6 }Elm_Params_Nocontents;
7
8 static void
9 external_nocontents_state_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
10                               const void *from_params, const void *to_params,
11                               float pos __UNUSED__)
12 {
13    const Elm_Params_Nocontents *p;
14
15    if (to_params) p = to_params;
16    else if (from_params) p = from_params;
17    else return;
18
19    //if (p->base.label) elm_nocontents_label_set(obj, p->base.label);
20 }
21
22 static Eina_Bool
23 external_nocontents_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
24 {
25    if (!strcmp(param->name, "label"))
26      {
27         if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
28           {
29                 elm_nocontents_label_set(obj, param->s);
30              return EINA_TRUE;
31           }
32      }
33
34    ERR("unknown parameter '%s' of type '%s'",
35        param->name, edje_external_param_type_str(param->type));
36
37    return EINA_FALSE;
38 }
39
40 static Eina_Bool
41 external_nocontents_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
42 {
43    if (!strcmp(param->name, "label"))
44      {
45         if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
46           {
47              param->s = elm_nocontents_label_get(obj);
48              return EINA_TRUE;
49           }
50      }
51
52    ERR("unknown parameter '%s' of type '%s'",
53        param->name, edje_external_param_type_str(param->type));
54
55    return EINA_FALSE;
56 }
57
58 static void *
59 external_nocontents_params_parse(void *data __UNUSED__,
60                            Evas_Object *obj __UNUSED__,
61                            const Eina_List *params __UNUSED__)
62 {
63    Elm_Params_Nocontents *mem;
64
65    mem = ELM_NEW(Elm_Params_Nocontents);
66    if (!mem)
67      return NULL;
68
69    return mem;
70 }
71
72 static Evas_Object *external_nocontents_content_get(void *data __UNUSED__,
73                 const Evas_Object *obj __UNUSED__,
74                 const char *content __UNUSED__)
75 {
76         ERR("so content");
77         return NULL;
78 }
79
80 static void
81 external_nocontents_params_free(void *params)
82 {
83    free(params);
84 }
85
86 static Edje_External_Param_Info external_nocontents_params[] = {
87    DEFINE_EXTERNAL_COMMON_PARAMS,
88    EDJE_EXTERNAL_PARAM_INFO_SENTINEL
89 };
90
91 DEFINE_EXTERNAL_ICON_ADD(nocontents, "nocontents");
92 DEFINE_EXTERNAL_TYPE_SIMPLE(nocontents, "Nocontents");