Modification due to the change of CBaseView
[profile/tv/apps/native/musicplayer.git] / src / views / context-view.cpp
index 383bf4b..b368da1 100644 (file)
@@ -90,7 +90,6 @@ struct SRltvCtnt {
 
 struct SContextView {
        Evas_Object *win;
-       Evas_Object *base;
        Evas_Object *table;
        Evas_Object *moreinfo;
        Evas_Object *playbtn;
@@ -530,7 +529,7 @@ bool CContextView::m_CreateBtnsPart(void)
        btninfo[CTXBTN_DELETE].icon = MUSIC_IMAGE_CTXT_BTNDEL;
        btninfo[CTXBTN_DELETE].type = CONTEXT_VIEW_BUTTON_DELETE;
 
-       box = m_AddBtnBox(m->base);
+       box = m_AddBtnBox(Base());
        if (!box)
                return false;
 
@@ -585,7 +584,7 @@ bool CContextView::m_CreateBtnsPart(void)
        elm_object_focus_next_object_set(btn, firstbtn,
                ELM_FOCUS_RIGHT);
 
-       elm_object_part_content_set(m->base, MUSIC_PART_CTXT_BTNAREA, box);
+       elm_object_part_content_set(Base(), MUSIC_PART_CTXT_BTNAREA, box);
 
        return true;
 }
@@ -918,7 +917,7 @@ bool CContextView::m_CreateRltvContent(Eina_List *list)
                return false;
        }
 
-       scroller = m_AddScroller(m->base);
+       scroller = m_AddScroller(Base());
        if (!scroller) {
                _ERR("m_AddScroller failed.");
                return false;
@@ -941,7 +940,7 @@ bool CContextView::m_CreateRltvContent(Eina_List *list)
        }
 
        elm_object_content_set(scroller, table);
-       elm_object_part_content_set(m->base, MUSIC_PART_CTXT_RELCTNTAREA,
+       elm_object_part_content_set(Base(), MUSIC_PART_CTXT_RELCTNTAREA,
                scroller);
 
        return true;
@@ -955,7 +954,7 @@ bool CContextView::m_CreateMoreinfoLayout(SRltvCtnt *rctnt, Evas_Object *img)
        if (!rctnt)
                return false;
 
-       ly = elm_layout_add(m->base);
+       ly = elm_layout_add(Base());
        if (!ly)
                return false;
 
@@ -974,7 +973,7 @@ bool CContextView::m_CreateMoreinfoLayout(SRltvCtnt *rctnt, Evas_Object *img)
        elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_LEFT);
        elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_RIGHT);
 
-       elm_object_part_content_set(m->base, MUSIC_PART_CTXT_INFO, ly);
+       elm_object_part_content_set(Base(), MUSIC_PART_CTXT_INFO, ly);
 
        m->moreinfo = ly;
 
@@ -1005,11 +1004,11 @@ bool CContextView::m_CreateInfoPart(void)
                &rltvtitle, &ctntinfo, &rltvlist))
                return false;
 
-       img = elm_image_add(m->base);
+       img = elm_image_add(Base());
        if (!img)
                return false;
 
-       icon = elm_image_add(m->base);
+       icon = elm_image_add(Base());
        if (!icon)
                return false;
 
@@ -1031,12 +1030,12 @@ bool CContextView::m_CreateInfoPart(void)
                elm_image_aspect_fixed_set(icon, EINA_FALSE);
        }
 
-       elm_object_part_content_set(m->base, MUSIC_PART_CTXT_ICON, img);
-       elm_object_part_text_set(m->base, MUSIC_PART_CTXT_TITLE, title);
-       elm_object_part_text_set(m->base, MUSIC_PART_CTXT_SUBTITLE, subtitle);
-       elm_object_part_text_set(m->base, MUSIC_PART_CTXT_SUBTITLE2,
+       elm_object_part_content_set(Base(), MUSIC_PART_CTXT_ICON, img);
+       elm_object_part_text_set(Base(), MUSIC_PART_CTXT_TITLE, title);
+       elm_object_part_text_set(Base(), MUSIC_PART_CTXT_SUBTITLE, subtitle);
+       elm_object_part_text_set(Base(), MUSIC_PART_CTXT_SUBTITLE2,
                subtitle2);
-       elm_object_part_text_set(m->base, MUSIC_PART_CTXT_RELCTNTTEXT,
+       elm_object_part_text_set(Base(), MUSIC_PART_CTXT_RELCTNTTEXT,
                _(rltvtitle));
 
        if (cinfo->type == CONTEXT_TYPE_ARTIST || cinfo->type == CONTEXT_TYPE_GENRE ||
@@ -1050,7 +1049,7 @@ bool CContextView::m_CreateInfoPart(void)
        if (ctntinfo)
                m_CreateMoreinfoLayout(ctntinfo, icon);
        else
-               elm_object_signal_emit(m->base, MUSIC_SIGNAL_HIDE,
+               elm_object_signal_emit(Base(), MUSIC_SIGNAL_HIDE,
                MUSIC_CONTEXT_VIEW);
 
        return true;
@@ -1092,7 +1091,7 @@ CContextPopup *CContextView::m_CreatePlaylistPopup(void)
        CContextPopup::SCallback cb;
        cb.onSelected = sm_CbCtxPopupBtnSelected;
        cb.cookie = this;
-       r = ctxpopup->Create(m->base, &cb, list);
+       r = ctxpopup->Create(Base(), &cb, list);
        if (!r) {
                _ERR("PlayListCtxpopup Creation failed");
                delete ctxpopup;
@@ -1172,11 +1171,11 @@ void CContextView::m_HandleBtnSelected(int btnType)
        case CONTEXT_VIEW_BUTTON_ADDTO:
                m->ctxpopup = (CPlayListCtxPopup *)m_CreatePlaylistPopup();
                if (!m->ctxpopup)
-                       CCommonUI::CreateMsgBox(m->base, MUSIC_TEXT_NOLIST_MSG);
+                       CCommonUI::CreateMsgBox(Base(), MUSIC_TEXT_NOLIST_MSG);
                break;
 
        case CONTEXT_VIEW_BUTTON_DEL:
-               m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(m->base, MUSIC_TEXT_REMOVE_SMSG);
+               m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(Base(), MUSIC_TEXT_REMOVE_SMSG);
                break;
 
        case CONTEXT_VIEW_BUTTON_RENAME:
@@ -1192,7 +1191,7 @@ void CContextView::m_HandleBtnSelected(int btnType)
                break;
 
        case CONTEXT_VIEW_BUTTON_DELETE:
-               m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(m->base, MUSIC_TEXT_REMOVE_PLMSG);
+               m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(Base(), MUSIC_TEXT_REMOVE_PLMSG);
                break;
 
        default:
@@ -1232,7 +1231,7 @@ void CContextView::m_HandleMoreinfoSelected(Evas_Object *obj)
 }
 
 
-bool CContextView::Create(void *data)
+bool CContextView::Create(void *data, Evas_Object *eoBase)
 {
        ASSERT(!m);
        ASSERT(data);
@@ -1247,26 +1246,25 @@ bool CContextView::Create(void *data)
        }
 
        _CREATE_BEGIN{
+               Evas_Object *eoBase;
+
                _CHECK(m = new SContextView)
                _CHECK(m->vmgr = CViewMgr::GetInstance())
                _CHECK(m->win = m->vmgr->Window())
                _CHECK(m->pController = new CMusicController)
                _CHECK(m->pController->Create())
-               _CHECK(m->base = CCommonUI::AddBase(m->win, MUSIC_CONTEXT_VIEW))
-               _CHECK(CBaseView::Create(NULL))
-
-               _WHEN_SUCCESS{
+               _CHECK(eoBase = CCommonUI::AddBase(m->win, MUSIC_CONTEXT_VIEW))
+               _CHECK(CBaseView::Create(NULL, eoBase))
+               _COMMAND{
                        m->type = ctxtinfo->type;
                        m->ctxtinfo = ctxtinfo;
-
-                       Connect(m->base, CONTEXT_VIEW, TYPE_KEY_DOWN);
-
-                       _CHECK(m_CreateFullView())
-                       _CHECK_FAIL{}
+                       Connect(eoBase, CONTEXT_VIEW, TYPE_KEY_DOWN);
                }
+               _CHECK(m_CreateFullView())
 
+               _CHECK_FAIL{ /* m_CreateFullView() */ }
                _CHECK_FAIL{ CBaseView::Destroy(); }
-               _CHECK_FAIL{ evas_object_del(m->base); }
+               _CHECK_FAIL{ evas_object_del(eoBase); }
                _CHECK_FAIL{ m->pController->Destroy(); }
                _CHECK_FAIL{ delete m->pController; }
                _CHECK_FAIL{ /* Window() */ }
@@ -1282,13 +1280,15 @@ void CContextView::Destroy(void)
 {
        ASSERT(m);
 
-       Disconnect(m->base);
+       Evas_Object *eoBase = Base();
+
+       Disconnect(eoBase);
 
        if (m->idler)
                ecore_idler_del(m->idler);
 
        CBaseView::Destroy();
-       evas_object_del(m->base);
+       evas_object_del(eoBase);
 
        m->pController->Destroy();
        delete m->pController;
@@ -1297,19 +1297,11 @@ void CContextView::Destroy(void)
 }
 
 
-Evas_Object* CContextView::Base(void)
-{
-       ASSERT(m);
-
-       return m->base;
-}
-
-
 void CContextView::t_OnShow(void)
 {
        ASSERT(m);
 
-       evas_object_show(m->base);
+       evas_object_show(Base());
 }
 
 
@@ -1352,7 +1344,7 @@ void CContextView::t_OnHide(void)
 {
        ASSERT(m);
 
-       evas_object_hide(m->base);
+       evas_object_hide(Base());
 }