1. Apply modified listeners to CContextView 77/34877/3 accepted/tizen/tv/20150205.022736 submit/tizen_tv/20150204.221929
authorKim Tae Soo <taesoo46.kim@samsung.com>
Wed, 4 Feb 2015 05:54:47 +0000 (14:54 +0900)
committerKim Tae Soo <taesoo46.kim@samsung.com>
Wed, 4 Feb 2015 06:25:17 +0000 (15:25 +0900)
2. Fix UI abnormal behavior

Change-Id: I5a07cf56d6b2bfee495e29343d1168374140e685
Signed-off-by: Kim Tae Soo <taesoo46.kim@samsung.com>
include/context-view.h
res/edc/widgets/button.edc
res/edc/widgets/ctxpopup.edc [changed mode: 0755->0644]
res/edc/widgets/gengrid.edc
res/edc/widgets/genlist.edc
res/edc/widgets/progressbar.edc
res/edc/widgets/slider.edc
src/main.cpp
src/views/context-view.cpp

index c3c852c..8212262 100644 (file)
 struct SContentInfo;
 struct SRltvCtnt;
 
-class CContextView : public CBaseView, public CListenerMgr, public IKeyDownListener {
+class CContextView : public CBaseView, public CListenerMgr,
+       public IKeyDownListener, public IKeyUpListener,
+       public IMouseMoveListener, public IMouseUpListener,
+       public IFocusedListener, public IUnfocusedListener {
 private:
        struct SContextView* m;
 
 private:
        static void sm_CbRltdCtntSelected(void *data, Evas_Object *obj, const char *emission, const char *source);
-       static void sm_CbAddScroller(void *cookie, Evas_Object *base, Evas_Object **scroller);
-       void m_OnAddScroller(Evas_Object *base, Evas_Object **scroller);
+
+       static void sm_CbPopupKeyPressed(void *data, Evas *e, Evas_Object *obj, void *ei);
+       void m_OnPopUpKeyPressed(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
+
+       static void sm_CbRemove(void *data, Evas_Object *obj, void *ei);
+       void m_OnRemove(Evas_Object *obj);
+
+       static void sm_CbCancel(void *data, Evas_Object *obj, void *ei);
+       void m_OnCancel(Evas_Object *obj);
+
+       static int sm_CbSortPlaylist(const void *d1, const void *d2);
+       static void sm_CbPopupDeleted(void *data, Evas *e, Evas_Object *obj, void *ei);
+
+       static void sm_CbPopupBtnClicked(void *data, Evas_Object *obj, void *ei);
+       void m_OnPopupBtnClicked(Evas_Object *obj);
+
+       static Eina_Bool sm_CbSelectIdler(void *dt);
+       Eina_Bool m_OnSelectIdler(void);
+
+
 
 private:
        Evas_Object *m_AddScroller(Evas_Object *base);
@@ -60,6 +81,13 @@ private:
        bool m_CreateMoreinfoLayout(SRltvCtnt *rctnt, Evas_Object *img);
        bool m_CreateInfoPart(void);
        bool m_CreateFullView(void);
+       Evas_Object *m_CreatePlaylistPopup(void);
+       Evas_Object *m_CreateRemovePopup(Evas_Object *base, const char *msg,
+               Evas_Object_Event_Cb _close_cb, Evas_Smart_Cb _remove_cb,
+               Evas_Smart_Cb _cancel_cb, void *dt);
+       void m_DestroyPopup(void);
+       void m_HandleBtnSelected(int btnType);
+       void m_HandleMoreinfoSelected(Evas_Object *obj);
 
 protected:
        virtual void t_OnShow(void);
@@ -67,7 +95,15 @@ protected:
        virtual void t_OnUpdate(void* data);
 
 public:
-       CContextView(const char *pViewId) : CBaseView(pViewId), IKeyDownListener(this), m(0) {}
+       CContextView(const char *pViewId) :
+               CBaseView(pViewId),
+               IKeyDownListener(this),
+               IKeyUpListener(this),
+               IMouseMoveListener(this),
+               IMouseUpListener(this),
+               IFocusedListener(this),
+               IUnfocusedListener(this),
+               m(0) {}
        virtual ~CContextView() {}
 
        virtual bool Create(void *data);
@@ -77,6 +113,11 @@ public:
 
 public:
        virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
+       virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
+       virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
+       virtual void OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev);
+       virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item);
+       virtual void OnUnfocused(int id, Evas_Object *obj, Elm_Object_Item *item);
 };
 
 
index 108e7da..192686d 100644 (file)
@@ -3,6 +3,7 @@
 
 group {
        name: "elm/button/base/music_hover_entry";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_TICK COMP;
        }
@@ -269,6 +270,7 @@ group {
 
 group {
        name: "elm/button/base/music_sourcebtn";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_PULLDOWN_ARROW COMP;
                image: MUSIC_IMAGE_PLAYBACK_ROUND_ICON COMP;
@@ -595,6 +597,7 @@ group {
 group {
        name: "elm/button/base/music_sortbtn";
        inherit: "elm/button/base/music_sourcebtn";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                        name: "bg";
@@ -609,6 +612,7 @@ group {
 
 group {
        name: "elm/button/base/menubtn";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_GROUPBTN_BG COMP;
        }
@@ -807,6 +811,7 @@ group {
 
 group {
        name: "elm/button/base/playbackbtn";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_PLAYBACK_ICON COMP;
                image: MUSIC_IMAGE_PLAYBACK_ROUND_ICON COMP;
@@ -885,6 +890,7 @@ group {
 
 group {
        name: "elm/button/base/music_btn_common";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_BTN_NORMAL_BG COMP;
                image: MUSIC_IMAGE_BTN_FOCUS_BG COMP;
@@ -1065,6 +1071,7 @@ group {
 group {
        name: "elm/button/base/music_btn_settings";
        inherit: "elm/button/base/music_btn_common";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_BTN_SETTINGS COMP;
        }
@@ -1084,6 +1091,7 @@ group {
 group {
        name: "elm/button/base/music_btn_rewind";
        inherit: "elm/button/base/music_btn_common";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_BTN_REWIND COMP;
        }
@@ -1103,6 +1111,7 @@ group {
 group {
        name: "elm/button/base/music_btn_forward";
        inherit: "elm/button/base/music_btn_common";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_BTN_FORWARD COMP;
        }
@@ -1122,6 +1131,7 @@ group {
 group {
        name: "elm/button/base/music_btn_shuffle";
        inherit: "elm/button/base/music_btn_common";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_BTN_SHUFFLE_OFF COMP;
                image: MUSIC_IMAGE_BTN_SHUFFLE_ON COMP;
@@ -1164,6 +1174,7 @@ group {
 group {
        name: "elm/button/base/music_btn_repeat";
        inherit: "elm/button/base/music_btn_common";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_BTN_REPEAT_OFF COMP;
                image: MUSIC_IMAGE_BTN_REPEAT_ON COMP;
@@ -1218,6 +1229,7 @@ group {
 group {
        name: "elm/button/base/music_btn_play";
        inherit: "elm/button/base/music_btn_common";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_BTN_PLAY COMP;
                image: MUSIC_IMAGE_BTN_PAUSE COMP;
@@ -1258,6 +1270,7 @@ group {
 
 group {
        name: "elm/button/base/music_btn_settings_option_t";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_PLAYBACK_ROUNDT_ICON COMP;
                image: MUSIC_IMAGE_PLAYBACK_ROUNDB_ICON COMP;
@@ -1436,6 +1449,7 @@ group {
 group {
        name: "elm/button/base/music_btn_settings_option_b";
        inherit: "elm/button/base/music_btn_settings_option_t";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_POPUP_DOWN_ARROW COMP;
        }
@@ -1513,6 +1527,7 @@ group {
 
 group {
        name: "elm/button/base/music_btn_edit";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_PLAYBACK_ROUND_ICON COMP;
        }
@@ -1656,6 +1671,7 @@ group {
 
 group {
        name: "elm/button/base/add_common_btn";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_ADDBTN_BG_NORMAL COMP;
                image: MUSIC_IMAGE_ADDBTN_BG_FOCUS COMP;
@@ -1862,6 +1878,7 @@ group {
 
 group {
        name: "elm/button/base/add_play_btn";
+       data.item: "focus_highlight" "on";
        inherit: "elm/button/base/add_common_btn";
        parts {
                part {
@@ -1888,6 +1905,7 @@ group {
 
 group {
        name: "elm/button/base/add_next_btn";
+       data.item: "focus_highlight" "on";
        inherit: "elm/button/base/add_common_btn";
        parts {
                part {
@@ -1914,6 +1932,7 @@ group {
 
 group {
        name: "elm/button/base/add_last_btn";
+       data.item: "focus_highlight" "on";
        inherit: "elm/button/base/add_common_btn";
        parts {
                part {
@@ -1940,6 +1959,7 @@ group {
 
 group {
        name: "elm/button/base/music_listbtn";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_ADDBTN_BG_NORMAL COMP;
                image: MUSIC_IMAGE_ADDBTN_BG_FOCUS COMP;
@@ -2072,6 +2092,7 @@ group {
 
 group {
        name: "elm/button/base/music_middletext_btn";
+       data.item: "focus_highlight" "on";
        script {
                public bottom;
        }
@@ -2231,6 +2252,7 @@ group {
 }
 group {
        name: "elm/button/base/music_toptext_btn";
+       data.item: "focus_highlight" "on";
        inherit: "elm/button/base/music_middletext_btn";
        images {
                image: MUSIC_IMAGE_PLAYBACK_ROUNDT_ICON COMP;
@@ -2335,6 +2357,7 @@ group {
 }
 group {
        name: "elm/button/base/music_bottomtext_btn";
+       data.item: "focus_highlight" "on";
        inherit: "elm/button/base/music_middletext_btn";
        images {
                image: MUSIC_IMAGE_PLAYBACK_ROUNDB_ICON COMP;
old mode 100755 (executable)
new mode 100644 (file)
index f385bc0..19dcd48
@@ -1,4 +1,6 @@
-group { name: "elm/ctxpopup/base/music-common-popup";
+group {
+       name: "elm/ctxpopup/base/music-common-popup";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                         name: "elm.swallow.content";
@@ -12,6 +14,7 @@ group { name: "elm/ctxpopup/base/music-common-popup";
 
 group {
        name, "elm/ctxpopup/base/music_listpopup";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                         name: "elm.swallow.content";
index 7e884b3..efd090b 100644 (file)
@@ -3,6 +3,7 @@ group {
        data.item: "selectraise" "on";
        data.item: "texts" "elm.text elm.text1";
        data.item: "contents" "elm.swallow.icon";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                        name: "bg_with_border";
index b85b059..d246efc 100644 (file)
@@ -4,6 +4,7 @@ group {
        data.item: "focusraise" "on";
        data.item: "texts" "elm.text elm.text1 elm.text2 elm.text3";
        data.item: "contents" "elm.swallow.icon";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                        name: "bg";
@@ -322,6 +323,7 @@ group {
        data.item: "selectraise" "on";
        data.item: "focusraise" "on";
        data.item: "texts" "elm.text elm.text1 elm.text2 elm.text3";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                        name: "bg";
@@ -586,6 +588,7 @@ group {
        data.item: "focusraise" "on";
        data.item: "texts" "elm.text0 elm.text1 elm.text2 elm.text3 elm.text4";
        data.item: "contents" "elm.swallow.icon";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_PLAY_ICON COMP;
                image: MUSIC_IMAGE_UNCHECK_NORMAL COMP;
@@ -1224,6 +1227,7 @@ group {
        data.item: "focusraise" "on";
        data.item: "texts" "elm.text elm.text1 elm.text2";
        data.item: "contents" "elm.swallow.icon";
+       data.item: "focus_highlight" "on";
        images {
                image: MUSIC_IMAGE_UNCHECK_NORMAL COMP;
                image: MUSIC_IMAGE_UNCHECK_FOCUS COMP;
index f0ee4cf..cfe8e87 100644 (file)
@@ -17,6 +17,7 @@
 
 group {
        name: "elm/progressbar/horizontal/music_volume_bar";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                        name: "elm.background.progressbar";
index 71e5d1c..41e8c94 100644 (file)
@@ -2,6 +2,7 @@
 
 group {
        name: "elm/slider/horizontal/music_progress_slider";
+       data.item: "focus_highlight" "on";
        parts {
                part {
                        name: "background"; type: RECT;
@@ -271,6 +272,7 @@ group {
 }
 group {
        name: "elm/slider/horizontal/music_indicator/default";
+       data.item: "focus_highlight" "on";
        alias: "elm/slider/horizontal/popup/default";
        images {
                image: MUSIC_IMAGE_SLIDER_NOB_NORMAL COMP;
index ba357f7..07aa2a1 100644 (file)
@@ -78,7 +78,9 @@ protected:
        {
                Evas_Object *win;
 
-               win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+               // To fix ghost phenomenon
+               //win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+               win = elm_win_util_standard_add(name, NULL);
                if (!win)
                        return NULL;
 
index c8dd6a6..c210bc3 100644 (file)
 #define MUSIC_CTXT_TABLE_HPAD 14
 
 
+enum EObjectType {
+       CONTEXT_VIEW,
+
+       CONTEXT_VIEW_BUTTON_PLAY,
+       CONTEXT_VIEW_BUTTON_NEXT,
+       CONTEXT_VIEW_BUTTON_LAST,
+       CONTEXT_VIEW_BUTTON_ADDTO,
+       CONTEXT_VIEW_BUTTON_PLAYSONG,
+       CONTEXT_VIEW_BUTTON_DEL,
+       CONTEXT_VIEW_BUTTON_RENAME,
+       CONTEXT_VIEW_BUTTON_ADDSONG,
+       CONTEXT_VIEW_BUTTON_REMOVESONG,
+       CONTEXT_VIEW_BUTTON_DELETE,
+
+       CONTEXT_VIEW_MORE_INFO,
+
+       CONTEXT_VIEW_RELATIVE_CONTENT
+};
+
 enum EBtnType {
        CTXBTN_INVALID = -1,
        CTXBTN_PLAY = 0,
@@ -64,6 +83,7 @@ enum EBtnType {
 struct SBtnInfo {
        const char *txt;
        const char *icon;
+       EObjectType type;
 };
 
 struct SRltvCtnt {
@@ -89,587 +109,11 @@ struct SContextView {
        int lid;
        CContextView *parent;
 
-       class CHandlerButton : public CListenerMgr,
-               public IMouseMoveListener, public IMouseUpListener, public IKeyUpListener,
-               public IFocusedListener, public IUnfocusedListener {
-       public:
-               struct SCallback {
-                       void(*addScroller)(void* cookie, Evas_Object *base, Evas_Object **scroller);
-                       void* cookie;
-               };
-
-       private:
-               SContextView *m;
-               SCallback m_callback;
-
-       private:
-               static void sm_CbPopupKeyPressed(void *data, Evas *e, Evas_Object *obj, void *ei)
-               {
-                       CHandlerButton *root = (CHandlerButton *)data;
-                       if (root)
-                               root->m_OnPopUpKeyPressed(e, obj, (Evas_Event_Key_Down *)ei);
-               }
-
-               void m_OnPopUpKeyPressed(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
-               {
-                       if (!ev->keyname)
-                               return;
-
-                       if (!strcmp(ev->keyname, KEY_BACK))
-                               m_DestroyPopup();
-               }
-
-               static void sm_CbRemove(void *data, Evas_Object *obj, void *ei)
-               {
-                       CHandlerButton *root = (CHandlerButton *)data;
-                       if (root)
-                               root->m_OnRemove(obj);
-               }
-
-               void m_OnRemove(Evas_Object *obj)
-               {
-                       SContentInfo *cinfo = NULL;
-
-                       if (!obj) {
-                               _ERR("Invalid argument.");
-                               return;
-                       }
-
-                       m_DestroyPopup();
-
-                       if (!m->ctxtinfo || !m->ctxtinfo->update)
-                               return;
-
-                       cinfo = m->ctxtinfo;
-                       cinfo->update(cinfo->cbdata, ACTION_TYPE_DELETE, 0);
-               }
-
-               static void sm_CbCancel(void *data, Evas_Object *obj, void *ei)
-               {
-                       CHandlerButton *root = (CHandlerButton *)data;
-                       if (root)
-                               root->m_OnCancel(obj);
-               }
-
-               void m_OnCancel(Evas_Object *obj)
-               {
-                       if (!obj) {
-                               _ERR("Invalid argument.");
-                               return;
-                       }
-
-                       m_DestroyPopup();
-               }
-
-               static int sm_CbSortPlaylist(const void *d1, const void *d2)
-               {
-                       SCtxtPlaylistItem *info1 = (SCtxtPlaylistItem *)d1;
-                       SCtxtPlaylistItem *info2 = (SCtxtPlaylistItem *)d2;
-                       char *txt1 = NULL;
-                       char *txt2 = NULL;
-
-                       txt1 = info1->name;
-                       txt2 = info2->name;
-
-                       if (!txt1)
-                               return 1;
-                       if (!txt2)
-                               return -1;
-
-                       return strcasecmp(txt1, txt2);
-               }
-
-               static void sm_CbPopupDeleted(void *data, Evas *e, Evas_Object *obj, void *ei)
-               {
-                       Eina_List *list = (Eina_List *)data;
-                       SCtxtPlaylistItem *item = NULL;
-                       void *listObj = NULL;
-
-                       if (!list)
-                               return;
-
-                       EINA_LIST_FREE(list, listObj) {
-                               item = (SCtxtPlaylistItem *)listObj;
-                               free(item->name);
-                               free(item);
-                       }
-               }
-
-               static void sm_CbPopupBtnClicked(void *data, Evas_Object *obj, void *ei)
-               {
-                       CHandlerButton *root = (CHandlerButton *)data;
-                       if (root)
-                               root->m_OnPopupBtnClicked(obj);
-               }
-
-               void m_OnPopupBtnClicked(Evas_Object *obj)
-               {
-                       SCtxtPlaylistItem *item = (SCtxtPlaylistItem *)_GET_PRIV(obj);
-
-                       if (!item) {
-                               _ERR("Invalid argument.");
-                               return;
-                       }
-
-                       m->lid = item->id;
-                       m->idler = ecore_idler_add(sm_CbSelectIdler, this);
-               }
-
-               static Eina_Bool sm_CbSelectIdler(void *dt)
-               {
-                       CHandlerButton *root = (CHandlerButton *)dt;
-                       Eina_Bool r;
-
-                       if (root)
-                               r = root->m_OnSelectIdler();
-
-                       return r;
-               }
-
-               Eina_Bool m_OnSelectIdler(void)
-               {
-                       SContentInfo *cinfo = NULL;
-
-                       m->idler = NULL;
-                       m_DestroyPopup();
-
-                       if (!m->ctxtinfo || !m->ctxtinfo->update)
-                               return ECORE_CALLBACK_CANCEL;
-
-                       cinfo = m->ctxtinfo;
-                       cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDTO, m->lid);
-                       cinfo->close(cinfo->cbdata);
-
-                       return ECORE_CALLBACK_CANCEL;
-               }
-
-       private:
-               void m_HandleBtnSelected(int btnType)
-               {
-                       SContentInfo *cinfo = NULL;
-
-                       if (!m->ctxtinfo || !m->ctxtinfo->update)
-                               return;
-
-                       EBtnType type = (EBtnType)btnType;
-
-                       cinfo = m->ctxtinfo;
-
-                       switch (type) {
-                       case CTXBTN_PLAY:
-                       case CTXBTN_PLAYSONG:
-                               cinfo->update(cinfo->cbdata, ACTION_TYPE_PLAY, 0);
-                               break;
-
-                       case CTXBTN_NEXT:
-                               cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDNEXT, 0);
-                               break;
-
-                       case CTXBTN_LAST:
-                               cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDLAST, 0);
-                               break;
-
-                       case CTXBTN_ADDTO:
-                               m->popup = m_CreatePlaylistPopup();
-                               if (!m->popup)
-                                       _create_message_box(m->base, MUSIC_TEXT_NOLIST_MSG);
-                               break;
-
-                       case CTXBTN_DEL:
-                               m->popup = m_CreateRemovePopup(m->base,
-                                       MUSIC_TEXT_REMOVE_SMSG, sm_CbPopupKeyPressed,
-                                       sm_CbRemove, sm_CbCancel, this);
-                               break;
-
-                       case CTXBTN_RENAME:
-                               cinfo->update(cinfo->cbdata, ACTION_TYPE_RENAME, 0);
-                               break;
-
-                       case CTXBTN_ADDSONG:
-                               cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDSONG, 0);
-                               break;
-
-                       case CTXBTN_REMOVESONG:
-                               cinfo->update(cinfo->cbdata, ACTION_TYPE_REMOVESONG, 0);
-                               break;
-
-                       case CTXBTN_DELETE:
-                               m->popup = m_CreateRemovePopup(m->base,
-                                       MUSIC_TEXT_REMOVE_PLMSG, sm_CbPopupKeyPressed,
-                                       sm_CbRemove, sm_CbCancel, this);
-                               break;
-
-                       default:
-                               _ERR("Wrong btn type");
-                       }
-               }
-
-               Evas_Object *m_CreatePlaylistPopup(void)
-               {
-                       Evas_Object *popup = NULL, *box = NULL, *btn = NULL, *scr = NULL, *firstbtn = NULL;
-                       Eina_List *l = NULL, *list = NULL;
-                       struct SCtxtPlaylistItem *item = NULL;
-                       void *obj = NULL;
-                       int i, tc;
-
-                       popup = elm_ctxpopup_add(m->base);
-                       if (!popup) {
-                               _ERR("elm_ctxpopup_add failed.");
-                               return NULL;
-                       }
-
-                       box = elm_box_add(popup);
-                       if (!box) {
-                               _ERR("elm_box_add failed.");
-                               evas_object_del(popup);
-                               return NULL;
-                       }
-
-                       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
-                       evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
-
-                       list = CMediadata::PlaylistsForCtxt();
-                       if (!list || eina_list_count(list) == 0) {
-                               _ERR("Fetching list of playlists failed");
-                               evas_object_del(popup);
-                               return NULL;
-                       }
-
-                       list = eina_list_sort(list, 0, sm_CbSortPlaylist);
-                       elm_object_style_set(popup, MUSIC_STYLE_LIST_POPUP);
-                       evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL,
-                               sm_CbPopupDeleted, list);
-
-                       btn = NULL;
-                       firstbtn = NULL;
-                       i = 0;
-                       tc = eina_list_count(list);
-
-                       EINA_LIST_FOREACH(list, l, obj) {
-                               item = (SCtxtPlaylistItem *)obj;
-                               btn = elm_button_add(box);
-                               if (!btn) {
-                                       _ERR("elm_button_add failed.");
-                                       evas_object_del(popup);
-                                       return NULL;
-                               }
-
-                               if (i == 0) {
-                                       elm_object_style_set(btn, MUSIC_STYLE_TOPTEXT_BTN);
-                                       firstbtn = btn;
-                               }
-                               else if (i == tc - 1) {
-                                       _INFO();
-                                       elm_object_style_set(btn, MUSIC_STYLE_BOTTOMTEXT_BTN);
-                                       elm_object_signal_emit(btn, MUSIC_SIGNAL_HIDELINE,
-                                               MUSIC_CONTEXT_VIEW);
-                               }
-                               else {
-                                       elm_object_style_set(btn, MUSIC_STYLE_MIDDLETEXT_BTN);
-                               }
-
-                               i++;
-                               elm_object_text_set(btn, item->name);
-                               evas_object_show(btn);
-                               elm_box_pack_end(box, btn);
-                               _SET_PRIV(btn, item);
-
-                               evas_object_smart_callback_add(btn, MUSIC_SIGNAL_CLICKED,
-                                       sm_CbPopupBtnClicked, this);
-                               evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_MOVE,
-                                       _object_mouse_moved, NULL);
-                               evas_object_event_callback_add(btn, EVAS_CALLBACK_KEY_DOWN,
-                                       sm_CbPopupKeyPressed, m);
-                       }
-
-                       m_callback.addScroller(m_callback.cookie, popup, &scr);
-                       if (!scr) {
-                               evas_object_del(popup);
-                               return NULL;
-                       }
-
-                       elm_object_content_set(scr, box);
-                       elm_object_content_set(popup, scr);
-                       elm_object_part_content_set(m->base, MUSIC_PART_PLIST_POPUP, popup);
-
-                       elm_ctxpopup_direction_priority_set(popup, (Elm_Ctxpopup_Direction)0, (Elm_Ctxpopup_Direction)0, (Elm_Ctxpopup_Direction)0, (Elm_Ctxpopup_Direction)0);
-
-                       if (firstbtn && btn) {
-                               elm_object_focus_set(firstbtn, EINA_TRUE);
-                               elm_object_focus_next_object_set(firstbtn, btn, ELM_FOCUS_UP);
-                               elm_object_focus_next_object_set(btn, firstbtn, ELM_FOCUS_DOWN);
-                       }
-
-                       return popup;
-               }
-
-               Evas_Object *m_CreateRemovePopup(Evas_Object *base, const char *msg,
-                       Evas_Object_Event_Cb _close_cb, Evas_Smart_Cb _remove_cb,
-                       Evas_Smart_Cb _cancel_cb, void *dt)
-               {
-                       Evas_Object *popup, *yesbtn, *nobtn, *lbl;
-
-                       if (!base || !_remove_cb || !_cancel_cb || !dt) {
-                               _ERR("Invalid argument.");
-                               return NULL;
-                       }
-
-                       popup = elm_popup_add(base);
-                       if (!popup) {
-                               _ERR("elm_popup_add failed.");
-                               return NULL;
-                       }
-
-                       elm_object_style_set(popup, MUSIC_STYLE_REMOVE_POPUP);
-                       elm_object_part_text_set(popup, MUSIC_PART_RPOPUP_TITLE,
-                               _(MUSIC_TEXT_REMOVE));
-                       elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
-                       evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_DOWN,
-                               _close_cb, dt);
-                       evas_object_show(popup);
-
-                       lbl = elm_label_add(popup);
-                       if (!lbl) {
-                               _ERR("Add Evas_Object failed.");
-                               evas_object_del(popup);
-                               return NULL;
-                       }
-
-                       elm_object_style_set(lbl, MUSIC_STYLE_REMOVE_LABEL);
-                       elm_object_text_set(lbl, _(msg));
-                       elm_object_content_set(popup, lbl);
-
-                       yesbtn = elm_button_add(popup);
-                       if (!yesbtn) {
-                               _ERR("Add Evas_Object failed.");
-                               evas_object_del(popup);
-                               return NULL;
-                       }
-
-                       elm_object_text_set(yesbtn, _(MUSIC_TEXT_REMOVE));
-                       elm_object_part_content_set(popup, MUSIC_PART_RPOPUP_BTN1, yesbtn);
-                       evas_object_smart_callback_add(yesbtn, MUSIC_SIGNAL_CLICKED,
-                               _remove_cb, dt);
-
-                       nobtn = elm_button_add(popup);
-                       if (!nobtn) {
-                               _ERR("Add Evas_Object failed.");
-                               evas_object_del(popup);
-                               return NULL;
-                       }
-
-                       elm_object_text_set(nobtn, _(MUSIC_TEXT_CANCEL));
-                       elm_object_part_content_set(popup, MUSIC_PART_RPOPUP_BTN2, nobtn);
-                       evas_object_smart_callback_add(nobtn, MUSIC_SIGNAL_CLICKED,
-                               _cancel_cb, dt);
-                       elm_object_focus_set(nobtn, EINA_TRUE);
-
-                       return popup;
-               }
-
-               void m_DestroyPopup(void)
-               {
-                       if (!m->popup)
-                               return;
-
-                       evas_object_del(m->popup);
-                       m->popup = NULL;
-               }
-
-       public:
-               CHandlerButton(SContextView *ins) :
-                       IMouseMoveListener(this),
-                       IMouseUpListener(this),
-                       IKeyUpListener(this),
-                       IFocusedListener(this),
-                       IUnfocusedListener(this) {
-                       m = ins;
-               }
-
-               ~CHandlerButton() {
-                       m_DestroyPopup();
-               }
-
-               void SetCallback(const SCallback* cb) {
-                       m_callback = *cb;
-               }
-
-               virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
-               {
-                       if (!obj)
-                               return;
-
-                       if (!elm_object_focus_get(obj))
-                               elm_object_focus_set(obj, EINA_TRUE);
-               }
-
-               virtual void OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev)
-               {
-                       m_HandleBtnSelected(id);
-               }
-
-               virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev)
-               {
-                       if (strcmp(ev->keyname, KEY_ENTER))
-                               return;
-
-                       m_HandleBtnSelected(id);
-               }
-
-               virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
-               {
-                       if (!obj)
-                               return;
-
-                       elm_object_signal_emit(obj, MUSIC_SIGNAL_FOCUSED, MUSIC_CONTEXT_VIEW);
-               }
-
-               virtual void OnUnfocused(int id, Evas_Object *obj, Elm_Object_Item *item)
-               {
-                       if (!obj)
-                               return;
-
-                       elm_object_signal_emit(obj, MUSIC_SIGNAL_UNFOCUSED, MUSIC_CONTEXT_VIEW);
-               }
-       } *pHandlerButton;
-
-       class CHandlerLayout : public CListenerMgr,
-               public IMouseMoveListener, public IMouseUpListener, public IKeyUpListener,
-               public IFocusedListener, public IUnfocusedListener {
-       protected:
-               SContextView *m;
-
-       public:
-               CHandlerLayout(SContextView *ins) :
-                       IMouseMoveListener(this),
-                       IMouseUpListener(this),
-                       IKeyUpListener(this),
-                       IFocusedListener(this),
-                       IUnfocusedListener(this) {
-                       m = ins;
-               };
-
-               virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
-               {
-                       if (!obj)
-                               return;
-
-                       if (!elm_object_focus_get(obj))
-                               elm_object_focus_set(obj, EINA_TRUE);
-               }
-
-               virtual void OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev) = 0;
-               virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev) = 0;
-
-               virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
-               {
-                       if (!obj)
-                               return;
-
-                       elm_object_signal_emit(obj, MUSIC_SIGNAL_FOCUSED, MUSIC_CONTEXT_VIEW);
-               }
-
-               virtual void OnUnfocused(int id, Evas_Object *obj, Elm_Object_Item *item)
-               {
-                       if (!obj)
-                               return;
-
-                       elm_object_signal_emit(obj, MUSIC_SIGNAL_UNFOCUSED, MUSIC_CONTEXT_VIEW);
-               }
-       };
-
-       class CHandlerRelativeContentLayout : public CHandlerLayout {
-       public:
-               CHandlerRelativeContentLayout(SContextView *ins) : CHandlerLayout(ins) {}
-
-               virtual void OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev)
-               {
-                       if (!obj)
-                               return;
-
-                       elm_object_signal_emit(obj, MUSIC_SIGNAL_CONTENT_CLICKED,
-                               MUSIC_CONTEXT_VIEW);
-               }
-
-               virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev)
-               {
-                       if (!obj || !ev)
-                               return;
-
-                       if (strcmp(ev->keyname, KEY_ENTER))
-                               return;
-
-                       elm_object_signal_emit(obj, MUSIC_SIGNAL_CONTENT_CLICKED,
-                               MUSIC_CONTEXT_VIEW);
-               }
-       };
-
-       Eina_List *listRltvCtntLayout;
-
-       class CHandlerMoreInfoLayout : public CHandlerLayout {
-       private:
-               void m_HandleMoreinfoSelected(Evas_Object *obj)
-               {
-                       SRltvCtnt *rctnt = NULL;
-
-                       if (!obj)
-                               return;
-
-                       rctnt = (SRltvCtnt *)_GET_PRIV(obj);
-                       if (!rctnt)
-                               return;
-
-                       /* Using prints till actual APIs come from wiki and youtube */
-                       switch (m->type) {
-                       case CONTEXT_TYPE_ALBUM:
-                               _INFO("Album more info clicked %s", rctnt->link);
-                               break;
-
-                       case CONTEXT_TYPE_ARTIST:
-                               _INFO("Artist more info clicked %s", rctnt->link);
-                               break;
-
-                       case CONTEXT_TYPE_GENRE:
-                               _INFO("Genre more info clicked %s", rctnt->link);
-                               break;
-
-                       default:
-                               _ERR("Wrong content type for more info");
-                       }
-               }
-
-       public:
-               CHandlerMoreInfoLayout(SContextView *ins) : CHandlerLayout(ins) {}
-
-               virtual void OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev)
-               {
-                       if (!obj)
-                               return;
-
-                       m_HandleMoreinfoSelected(obj);
-               }
-
-               virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev)
-               {
-                       if (!obj || !ev)
-                               return;
-
-                       if (strcmp(ev->keyname, KEY_ENTER))
-                               return;
-
-                       m_HandleMoreinfoSelected(obj);
-               }
-       } *pHandlerMoreInfoLayout;
-
        SContextView() {
                memset(this, 0, sizeof(SContextView));
-               pHandlerButton = new CHandlerButton(this);
-               pHandlerMoreInfoLayout = new CHandlerMoreInfoLayout(this);
        }
 
        ~SContextView() {
-               delete pHandlerButton;
-               delete pHandlerMoreInfoLayout;
        }
 };
 
@@ -725,18 +169,155 @@ void CContextView::sm_CbRltdCtntSelected(void *data, Evas_Object *obj, const cha
 }
 
 
-void CContextView::sm_CbAddScroller(void *cookie, Evas_Object *base, Evas_Object **scroller)
+void CContextView::sm_CbPopupKeyPressed(void *data, Evas *e, Evas_Object *obj, void *ei)
 {
-       CContextView *root = (CContextView *)cookie;
+       CContextView *root = (CContextView *)data;
        if (root)
-               root->m_OnAddScroller(base, scroller);
+               root->m_OnPopUpKeyPressed(e, obj, (Evas_Event_Key_Down *)ei);
+}
+
+
+void CContextView::m_OnPopUpKeyPressed(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+{
+       if (!ev->keyname)
+               return;
+
+       if (!strcmp(ev->keyname, KEY_BACK))
+               m_DestroyPopup();
+}
+
+
+void CContextView::sm_CbRemove(void *data, Evas_Object *obj, void *ei)
+{
+       CContextView *root = (CContextView *)data;
+       if (root)
+               root->m_OnRemove(obj);
+}
+
+
+void CContextView::m_OnRemove(Evas_Object *obj)
+{
+       SContentInfo *cinfo = NULL;
+
+       if (!obj) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       m_DestroyPopup();
+
+       if (!m->ctxtinfo || !m->ctxtinfo->update)
+               return;
+
+       cinfo = m->ctxtinfo;
+       cinfo->update(cinfo->cbdata, ACTION_TYPE_DELETE, 0);
+}
+
+
+void CContextView::sm_CbCancel(void *data, Evas_Object *obj, void *ei)
+{
+       CContextView *root = (CContextView *)data;
+       if (root)
+               root->m_OnCancel(obj);
+}
+
+
+void CContextView::m_OnCancel(Evas_Object *obj)
+{
+       if (!obj) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       m_DestroyPopup();
+}
+
+
+int CContextView::sm_CbSortPlaylist(const void *d1, const void *d2)
+{
+       SCtxtPlaylistItem *info1 = (SCtxtPlaylistItem *)d1;
+       SCtxtPlaylistItem *info2 = (SCtxtPlaylistItem *)d2;
+       char *txt1 = NULL;
+       char *txt2 = NULL;
+
+       txt1 = info1->name;
+       txt2 = info2->name;
+
+       if (!txt1)
+               return 1;
+       if (!txt2)
+               return -1;
+
+       return strcasecmp(txt1, txt2);
+}
+
+
+void CContextView::sm_CbPopupDeleted(void *data, Evas *e, Evas_Object *obj, void *ei)
+{
+       Eina_List *list = (Eina_List *)data;
+       SCtxtPlaylistItem *item = NULL;
+       void *listObj = NULL;
+
+       if (!list)
+               return;
+
+       EINA_LIST_FREE(list, listObj) {
+               item = (SCtxtPlaylistItem *)listObj;
+               free(item->name);
+               free(item);
+       }
+}
+
+
+void CContextView::sm_CbPopupBtnClicked(void *data, Evas_Object *obj, void *ei)
+{
+       CContextView *root = (CContextView *)data;
+       if (root)
+               root->m_OnPopupBtnClicked(obj);
+}
+
+
+void CContextView::m_OnPopupBtnClicked(Evas_Object *obj)
+{
+       SCtxtPlaylistItem *item = (SCtxtPlaylistItem *)_GET_PRIV(obj);
+
+       if (!item) {
+               _ERR("Invalid argument.");
+               return;
+       }
+
+       m->lid = item->id;
+       m->idler = ecore_idler_add(sm_CbSelectIdler, this);
+}
+
+
+Eina_Bool CContextView::sm_CbSelectIdler(void *dt)
+{
+       CContextView *root = (CContextView *)dt;
+       Eina_Bool r;
+
+       if (root)
+               r = root->m_OnSelectIdler();
+
+       return r;
 }
 
 
-void CContextView::m_OnAddScroller(Evas_Object *base, Evas_Object **scroller)
+Eina_Bool CContextView::m_OnSelectIdler(void)
 {
-       Evas_Object *scr = m_AddScroller(base);
-       *scroller = scr;
+       SContentInfo *cinfo = NULL;
+
+       m->idler = NULL;
+       m_DestroyPopup();
+
+       if (!m->ctxtinfo || !m->ctxtinfo->update)
+               return ECORE_CALLBACK_CANCEL;
+
+       cinfo = m->ctxtinfo;
+       cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDTO, m->lid);
+       cinfo->close(cinfo->cbdata);
+
+       return ECORE_CALLBACK_CANCEL;
 }
 
 
@@ -957,33 +538,43 @@ bool CContextView::m_CreateBtnsPart(void)
 
        btninfo[CTXBTN_PLAY].txt = MUSIC_TEXT_PLAY_THIS;
        btninfo[CTXBTN_PLAY].icon = MUSIC_IMAGE_CTXT_BTNPLAY;
+       btninfo[CTXBTN_PLAY].type = CONTEXT_VIEW_BUTTON_PLAY;
 
        btninfo[CTXBTN_NEXT].txt = MUSIC_TEXT_ADD_NEXT;
        btninfo[CTXBTN_NEXT].icon = MUSIC_IMAGE_CTXT_BTNNEXT;
+       btninfo[CTXBTN_NEXT].type = CONTEXT_VIEW_BUTTON_NEXT;
 
        btninfo[CTXBTN_LAST].txt = MUSIC_TEXT_ADD_LAST;
        btninfo[CTXBTN_LAST].icon = MUSIC_IMAGE_CTXT_BTNLAST;
+       btninfo[CTXBTN_LAST].type = CONTEXT_VIEW_BUTTON_LAST;
 
        btninfo[CTXBTN_ADDTO].txt = MUSIC_TEXT_ADD_TO_PLAYLIST;
        btninfo[CTXBTN_ADDTO].icon = MUSIC_IMAGE_CTXT_ADDTO;
+       btninfo[CTXBTN_ADDTO].type = CONTEXT_VIEW_BUTTON_ADDTO;
 
        btninfo[CTXBTN_PLAYSONG].txt = MUSIC_TEXT_PLAY;
        btninfo[CTXBTN_PLAYSONG].icon = MUSIC_IMAGE_CTXT_BTNPLAY;
+       btninfo[CTXBTN_PLAYSONG].type = CONTEXT_VIEW_BUTTON_PLAYSONG;
 
        btninfo[CTXBTN_DEL].txt = MUSIC_TEXT_DEL;
        btninfo[CTXBTN_DEL].icon = MUSIC_IMAGE_CTXT_BTNDEL;
+       btninfo[CTXBTN_DEL].type = CONTEXT_VIEW_BUTTON_DEL;
 
        btninfo[CTXBTN_RENAME].txt = MUSIC_TEXT_RENAME;
        btninfo[CTXBTN_RENAME].icon = MUSIC_IMAGE_CTXT_RENAME;
+       btninfo[CTXBTN_RENAME].type = CONTEXT_VIEW_BUTTON_RENAME;
 
        btninfo[CTXBTN_ADDSONG].txt = MUSIC_TEXT_ADDSONG;
        btninfo[CTXBTN_ADDSONG].icon = MUSIC_IMAGE_CTXT_ADDSONG;
+       btninfo[CTXBTN_ADDSONG].type = CONTEXT_VIEW_BUTTON_ADDSONG;
 
        btninfo[CTXBTN_REMOVESONG].txt = MUSIC_TEXT_REMOVESONG;
        btninfo[CTXBTN_REMOVESONG].icon = MUSIC_IMAGE_CTXT_REMOVESONG;
+       btninfo[CTXBTN_REMOVESONG].type = CONTEXT_VIEW_BUTTON_REMOVESONG;
 
        btninfo[CTXBTN_DELETE].txt = MUSIC_TEXT_DEL;
        btninfo[CTXBTN_DELETE].icon = MUSIC_IMAGE_CTXT_BTNDEL;
+       btninfo[CTXBTN_DELETE].type = CONTEXT_VIEW_BUTTON_DELETE;
 
        box = m_AddBtnBox(m->base);
        if (!box)
@@ -1015,7 +606,7 @@ bool CContextView::m_CreateBtnsPart(void)
                        return false;
                }
 
-               m->pHandlerButton->Connect(btn, i);
+               Connect(btn, btninfo[i].type, TYPE_MOUSE_MOVE | TYPE_MOUSE_UP | TYPE_KEY_UP | TYPE_FOCUSED | TYPE_UNFOCUSED);
 
                if (!m_AddBtnInfo(btn, btninfo[i].icon, btninfo[i].txt)) {
                        evas_object_del(box);
@@ -1288,7 +879,7 @@ bool CContextView::m_AddTableContents(Eina_List *list)
        Evas_Object *ly = NULL;
        Eina_List *l = NULL;
        SRltvCtnt *rctnt = NULL;
-       SContextView::CHandlerRelativeContentLayout *layoutHandler = NULL;
+       int objectId = (int)CONTEXT_VIEW_RELATIVE_CONTENT;
        void *obj = NULL;
 
        if (!list)
@@ -1309,9 +900,8 @@ bool CContextView::m_AddTableContents(Eina_List *list)
                elm_object_signal_callback_add(ly, MUSIC_SIGNAL_BTN_CLICKED,
                        MUSIC_CONTEXT_VIEW, sm_CbRltdCtntSelected, m);
 
-               layoutHandler = new SContextView::CHandlerRelativeContentLayout(m);
-               layoutHandler->Connect(ly);
-               m->listRltvCtntLayout = eina_list_append(m->listRltvCtntLayout, layoutHandler);
+               Connect(ly, objectId, TYPE_MOUSE_MOVE | TYPE_MOUSE_UP | TYPE_KEY_UP | TYPE_FOCUSED | TYPE_UNFOCUSED);
+               objectId++;
 
                if (row == 0)
                        m->first_line[col] = ly;
@@ -1425,7 +1015,7 @@ bool CContextView::m_CreateMoreinfoLayout(SRltvCtnt *rctnt, Evas_Object *img)
        elm_object_focus_allow_set(ly, EINA_TRUE);
        _SET_PRIV(ly, rctnt);
 
-       m->pHandlerMoreInfoLayout->Connect(ly);
+       Connect(ly, CONTEXT_VIEW_MORE_INFO, TYPE_MOUSE_MOVE | TYPE_MOUSE_UP | TYPE_KEY_UP | TYPE_FOCUSED | TYPE_UNFOCUSED);
 
        elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_LEFT);
        elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_RIGHT);
@@ -1525,6 +1115,273 @@ bool CContextView::m_CreateFullView(void)
 }
 
 
+Evas_Object *CContextView::m_CreatePlaylistPopup(void)
+{
+       Evas_Object *popup = NULL, *box = NULL, *btn = NULL, *scr = NULL, *firstbtn = NULL;
+       Eina_List *l = NULL, *list = NULL;
+       struct SCtxtPlaylistItem *item = NULL;
+       void *obj = NULL;
+       int i, tc;
+
+       popup = elm_ctxpopup_add(m->base);
+       if (!popup) {
+               _ERR("elm_ctxpopup_add failed.");
+               return NULL;
+       }
+
+       box = elm_box_add(popup);
+       if (!box) {
+               _ERR("elm_box_add failed.");
+               evas_object_del(popup);
+               return NULL;
+       }
+
+       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
+       evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
+
+       list = CMediadata::PlaylistsForCtxt();
+       if (!list || eina_list_count(list) == 0) {
+               _ERR("Fetching list of playlists failed");
+               evas_object_del(popup);
+               return NULL;
+       }
+
+       list = eina_list_sort(list, 0, sm_CbSortPlaylist);
+       elm_object_style_set(popup, MUSIC_STYLE_LIST_POPUP);
+       evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL,
+               sm_CbPopupDeleted, list);
+
+       btn = NULL;
+       firstbtn = NULL;
+       i = 0;
+       tc = eina_list_count(list);
+
+       EINA_LIST_FOREACH(list, l, obj) {
+               item = (SCtxtPlaylistItem *)obj;
+               btn = elm_button_add(box);
+               if (!btn) {
+                       _ERR("elm_button_add failed.");
+                       evas_object_del(popup);
+                       return NULL;
+               }
+
+               if (i == 0) {
+                       elm_object_style_set(btn, MUSIC_STYLE_TOPTEXT_BTN);
+                       firstbtn = btn;
+               }
+               else if (i == tc - 1) {
+                       _INFO();
+                       elm_object_style_set(btn, MUSIC_STYLE_BOTTOMTEXT_BTN);
+                       elm_object_signal_emit(btn, MUSIC_SIGNAL_HIDELINE,
+                               MUSIC_CONTEXT_VIEW);
+               }
+               else {
+                       elm_object_style_set(btn, MUSIC_STYLE_MIDDLETEXT_BTN);
+               }
+
+               i++;
+               elm_object_text_set(btn, item->name);
+               evas_object_show(btn);
+               elm_box_pack_end(box, btn);
+               _SET_PRIV(btn, item);
+
+               evas_object_smart_callback_add(btn, MUSIC_SIGNAL_CLICKED,
+                       sm_CbPopupBtnClicked, this);
+               evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_MOVE,
+                       _object_mouse_moved, NULL);
+               evas_object_event_callback_add(btn, EVAS_CALLBACK_KEY_DOWN,
+                       sm_CbPopupKeyPressed, m);
+       }
+
+       scr = m_AddScroller(popup);
+       if (!scr) {
+               evas_object_del(popup);
+               return NULL;
+       }
+
+       elm_object_content_set(scr, box);
+       elm_object_content_set(popup, scr);
+       elm_object_part_content_set(m->base, MUSIC_PART_PLIST_POPUP, popup);
+
+       elm_ctxpopup_direction_priority_set(popup, (Elm_Ctxpopup_Direction)0, (Elm_Ctxpopup_Direction)0, (Elm_Ctxpopup_Direction)0, (Elm_Ctxpopup_Direction)0);
+
+       if (firstbtn && btn) {
+               elm_object_focus_set(firstbtn, EINA_TRUE);
+               elm_object_focus_next_object_set(firstbtn, btn, ELM_FOCUS_UP);
+               elm_object_focus_next_object_set(btn, firstbtn, ELM_FOCUS_DOWN);
+       }
+
+       return popup;
+}
+
+
+Evas_Object *CContextView::m_CreateRemovePopup(Evas_Object *base, const char *msg,
+       Evas_Object_Event_Cb _close_cb, Evas_Smart_Cb _remove_cb,
+       Evas_Smart_Cb _cancel_cb, void *dt)
+{
+       Evas_Object *popup, *yesbtn, *nobtn, *lbl;
+
+       if (!base || !_remove_cb || !_cancel_cb || !dt) {
+               _ERR("Invalid argument.");
+               return NULL;
+       }
+
+       popup = elm_popup_add(base);
+       if (!popup) {
+               _ERR("elm_popup_add failed.");
+               return NULL;
+       }
+
+       elm_object_style_set(popup, MUSIC_STYLE_REMOVE_POPUP);
+       elm_object_part_text_set(popup, MUSIC_PART_RPOPUP_TITLE,
+               _(MUSIC_TEXT_REMOVE));
+       elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
+       evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_DOWN,
+               _close_cb, dt);
+       evas_object_show(popup);
+
+       lbl = elm_label_add(popup);
+       if (!lbl) {
+               _ERR("Add Evas_Object failed.");
+               evas_object_del(popup);
+               return NULL;
+       }
+
+       elm_object_style_set(lbl, MUSIC_STYLE_REMOVE_LABEL);
+       elm_object_text_set(lbl, _(msg));
+       elm_object_content_set(popup, lbl);
+
+       yesbtn = elm_button_add(popup);
+       if (!yesbtn) {
+               _ERR("Add Evas_Object failed.");
+               evas_object_del(popup);
+               return NULL;
+       }
+
+       elm_object_text_set(yesbtn, _(MUSIC_TEXT_REMOVE));
+       elm_object_part_content_set(popup, MUSIC_PART_RPOPUP_BTN1, yesbtn);
+       evas_object_smart_callback_add(yesbtn, MUSIC_SIGNAL_CLICKED,
+               _remove_cb, dt);
+
+       nobtn = elm_button_add(popup);
+       if (!nobtn) {
+               _ERR("Add Evas_Object failed.");
+               evas_object_del(popup);
+               return NULL;
+       }
+
+       elm_object_text_set(nobtn, _(MUSIC_TEXT_CANCEL));
+       elm_object_part_content_set(popup, MUSIC_PART_RPOPUP_BTN2, nobtn);
+       evas_object_smart_callback_add(nobtn, MUSIC_SIGNAL_CLICKED,
+               _cancel_cb, dt);
+       elm_object_focus_set(nobtn, EINA_TRUE);
+
+       return popup;
+}
+
+
+void CContextView::m_DestroyPopup(void)
+{
+       if (!m->popup)
+               return;
+
+       evas_object_del(m->popup);
+       m->popup = NULL;
+}
+
+
+void CContextView::m_HandleBtnSelected(int btnType)
+{
+       SContentInfo *cinfo = NULL;
+
+       if (!m->ctxtinfo || !m->ctxtinfo->update)
+               return;
+
+       EBtnType type = (EBtnType)btnType;
+
+       cinfo = m->ctxtinfo;
+
+       switch (type) {
+       case CONTEXT_VIEW_BUTTON_PLAY:
+       case CONTEXT_VIEW_BUTTON_PLAYSONG:
+               cinfo->update(cinfo->cbdata, ACTION_TYPE_PLAY, 0);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_NEXT:
+               cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDNEXT, 0);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_LAST:
+               cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDLAST, 0);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_ADDTO:
+               m->popup = m_CreatePlaylistPopup();
+               if (!m->popup)
+                       _create_message_box(m->base, MUSIC_TEXT_NOLIST_MSG);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_DEL:
+               m->popup = m_CreateRemovePopup(m->base,
+                       MUSIC_TEXT_REMOVE_SMSG, sm_CbPopupKeyPressed,
+                       sm_CbRemove, sm_CbCancel, this);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_RENAME:
+               cinfo->update(cinfo->cbdata, ACTION_TYPE_RENAME, 0);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_ADDSONG:
+               cinfo->update(cinfo->cbdata, ACTION_TYPE_ADDSONG, 0);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_REMOVESONG:
+               cinfo->update(cinfo->cbdata, ACTION_TYPE_REMOVESONG, 0);
+               break;
+
+       case CONTEXT_VIEW_BUTTON_DELETE:
+               m->popup = m_CreateRemovePopup(m->base,
+                       MUSIC_TEXT_REMOVE_PLMSG, sm_CbPopupKeyPressed,
+                       sm_CbRemove, sm_CbCancel, this);
+               break;
+
+       default:
+               _ERR("Wrong btn type");
+       }
+}
+
+
+void CContextView::m_HandleMoreinfoSelected(Evas_Object *obj)
+{
+       SRltvCtnt *rctnt = NULL;
+
+       if (!obj)
+               return;
+
+       rctnt = (SRltvCtnt *)_GET_PRIV(obj);
+       if (!rctnt)
+               return;
+
+       /* Using prints till actual APIs come from wiki and youtube */
+       switch (m->type) {
+       case CONTEXT_TYPE_ALBUM:
+               _INFO("Album more info clicked %s", rctnt->link);
+               break;
+
+       case CONTEXT_TYPE_ARTIST:
+               _INFO("Artist more info clicked %s", rctnt->link);
+               break;
+
+       case CONTEXT_TYPE_GENRE:
+               _INFO("Genre more info clicked %s", rctnt->link);
+               break;
+
+       default:
+               _ERR("Wrong content type for more info");
+       }
+}
+
+
 bool CContextView::Create(void *data)
 {
        ASSERT(!m);
@@ -1588,7 +1445,6 @@ bool CContextView::Create(void *data)
        m->base = base;
        m->ctxtinfo = ctxtinfo;
        m->parent = this;
-       m->listRltvCtntLayout = NULL;
 
        if (!m_CreateFullView()) {
                _ERR(" create full failed ");
@@ -1599,11 +1455,6 @@ bool CContextView::Create(void *data)
 
        Connect(base);
 
-       SContextView::CHandlerButton::SCallback cb;
-       cb.addScroller = &sm_CbAddScroller;
-       cb.cookie = this;
-       m->pHandlerButton->SetCallback(&cb);
-
        return true;
 }
 
@@ -1615,15 +1466,6 @@ void CContextView::Destroy(void)
        if (m->idler)
                ecore_idler_del(m->idler);
 
-       if (m->listRltvCtntLayout) {
-               SContextView::CHandlerRelativeContentLayout *layoutHandler;
-               void *obj;
-               EINA_LIST_FREE(m->listRltvCtntLayout, obj) {
-                       layoutHandler = (SContextView::CHandlerRelativeContentLayout *)obj;
-                       delete layoutHandler;
-               }
-       }
-
        CBaseView::Destroy();
        evas_object_del(m->base);
 
@@ -1692,10 +1534,169 @@ void CContextView::t_OnHide(void)
 
 void CContextView::OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
 {
-       if (!strcmp(ev->keyname, KEY_BACK)) {
-               if (m->ctxtinfo && m->ctxtinfo->close)
-                       m->ctxtinfo->close(m->ctxtinfo->cbdata);
+       switch (id) {
+       case CONTEXT_VIEW:
+               {
+                       if (!strcmp(ev->keyname, KEY_BACK)) {
+                               if (m->ctxtinfo && m->ctxtinfo->close)
+                                       m->ctxtinfo->close(m->ctxtinfo->cbdata);
+                       }
+                       else if (!strcmp(ev->keyname, KEY_EXIT))
+                               elm_exit();
+               }
+               break;
+
+       default:
+               break;
+       }
+}
+
+
+void CContextView::OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev)
+{
+       switch (id) {
+       case CONTEXT_VIEW:
+               break;
+
+       case CONTEXT_VIEW_BUTTON_PLAY:
+       case CONTEXT_VIEW_BUTTON_NEXT:
+       case CONTEXT_VIEW_BUTTON_LAST:
+       case CONTEXT_VIEW_BUTTON_ADDTO:
+       case CONTEXT_VIEW_BUTTON_PLAYSONG:
+       case CONTEXT_VIEW_BUTTON_DEL:
+       case CONTEXT_VIEW_BUTTON_RENAME:
+       case CONTEXT_VIEW_BUTTON_ADDSONG:
+       case CONTEXT_VIEW_BUTTON_REMOVESONG:
+       case CONTEXT_VIEW_BUTTON_DELETE:
+               {
+                       if (strcmp(ev->keyname, KEY_ENTER))
+                               return;
+
+                       m_HandleBtnSelected(id);
+               }
+               break;
+
+       case CONTEXT_VIEW_MORE_INFO:
+               {
+                       if (!obj || !ev)
+                               return;
+
+                       if (strcmp(ev->keyname, KEY_ENTER))
+                               return;
+
+                       m_HandleMoreinfoSelected(obj);
+               }
+               break;
+
+       default: // CONTEXT_VIEW_RELATIVE_CONTENT
+               {
+                       if (!obj || !ev)
+                               return;
+
+                       if (strcmp(ev->keyname, KEY_ENTER))
+                               return;
+
+                       elm_object_signal_emit(obj, MUSIC_SIGNAL_CONTENT_CLICKED,
+                               MUSIC_CONTEXT_VIEW);
+               }
+               break;
+       }
+}
+
+
+void CContextView::OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+{
+       switch (id) {
+       case CONTEXT_VIEW:
+               break;
+
+       default:
+               {
+                       if (!obj)
+                               return;
+
+                       if (!elm_object_focus_get(obj))
+                               elm_object_focus_set(obj, EINA_TRUE);
+               }
+               break;
+       }
+}
+
+
+void CContextView::OnMouseUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Up *ev)
+{
+       switch (id) {
+       case CONTEXT_VIEW:
+               break;
+
+       case CONTEXT_VIEW_BUTTON_PLAY:
+       case CONTEXT_VIEW_BUTTON_NEXT:
+       case CONTEXT_VIEW_BUTTON_LAST:
+       case CONTEXT_VIEW_BUTTON_ADDTO:
+       case CONTEXT_VIEW_BUTTON_PLAYSONG:
+       case CONTEXT_VIEW_BUTTON_DEL:
+       case CONTEXT_VIEW_BUTTON_RENAME:
+       case CONTEXT_VIEW_BUTTON_ADDSONG:
+       case CONTEXT_VIEW_BUTTON_REMOVESONG:
+       case CONTEXT_VIEW_BUTTON_DELETE:
+               {
+                       m_HandleBtnSelected(id);
+               }
+               break;
+
+       case CONTEXT_VIEW_MORE_INFO:
+               {
+                       if (!obj)
+                               return;
+
+                       m_HandleMoreinfoSelected(obj);
+               }
+               break;
+
+       default: // CONTEXT_VIEW_RELATIVE_CONTENT
+               {
+                       if (!obj)
+                               return;
+
+                       elm_object_signal_emit(obj, MUSIC_SIGNAL_CONTENT_CLICKED,
+                               MUSIC_CONTEXT_VIEW);
+               }
+               break;
+       }
+}
+
+
+void CContextView::OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+{
+       switch (id) {
+       case CONTEXT_VIEW:
+               break;
+
+       default:
+               {
+                       if (!obj)
+                       return;
+
+                       elm_object_signal_emit(obj, MUSIC_SIGNAL_FOCUSED, MUSIC_CONTEXT_VIEW);
+               }
+               break;
+       }
+}
+
+
+void CContextView::OnUnfocused(int id, Evas_Object *obj, Elm_Object_Item *item)
+{
+       switch (id) {
+       case CONTEXT_VIEW:
+               break;
+
+       default:
+               {
+                       if (!obj)
+                       return;
+
+                       elm_object_signal_emit(obj, MUSIC_SIGNAL_UNFOCUSED, MUSIC_CONTEXT_VIEW);
+               }
+               break;
        }
-       else if (!strcmp(ev->keyname, KEY_EXIT))
-               elm_exit();
 }