2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (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
8 // http://floralicense.org/license/
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.
18 * @file MpYearPickerPanel.cpp
19 * @brief This is the implementation file for YearPickerPanel class.
22 #include "MpYearPickerPanel.h"
23 #include "MpNowPlayContentPanel.h"
25 using namespace Tizen::Base;
26 using namespace Tizen::Base::Collection;
27 using namespace Tizen::Content;
28 using namespace Tizen::Graphics;
29 using namespace Tizen::Social;
30 using namespace Tizen::Ui;
31 using namespace Tizen::Ui::Controls;
32 using namespace Tizen::Ui::Scenes;
34 YearPickerPanel::YearPickerPanel(void)
40 YearPickerPanel::~YearPickerPanel(void)
47 YearPickerPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
48 const Tizen::Ui::Scenes::SceneId& currentSceneId,
49 Tizen::Base::Collection::IList* pArgs)
52 Form* pForm = dynamic_cast<Form*>(GetParent());
55 CommonUtil::CreateCancelFooter(*pForm);
56 pForm->SetFormBackEventListener(this);
58 SceneManager* pSceneManager = SceneManager::GetInstance();
59 AppAssert(pSceneManager);
60 __pPresentationModel->UpdateYearList();
61 // CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllYearCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
63 if (pSceneManager->IsSceneAlive(IDSCN_PLAYER))
65 if (__pNowPlayContentPanel == null)
67 __pNowPlayContentPanel = new (std::nothrow) NowPlayContentPanel();
68 __pNowPlayContentPanel->Initialize();
69 AddControl(__pNowPlayContentPanel);
71 CommonUtil::ShowNowPlayPanel(*__pContentTableView, __pNowPlayContentPanel->GetPlayStatus(), pForm->GetClientAreaBounds());
76 pArgs->RemoveAll(true);
83 YearPickerPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
84 const Tizen::Ui::Scenes::SceneId& nextSceneId)
87 Form* pForm = dynamic_cast<Form*>(GetParent());
90 Footer* pFooter = pForm->GetFooter();
91 pFooter->RemoveAllButtons();
92 pFooter->RemoveAllItems();
97 YearPickerPanel::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView,
99 Tizen::Ui::Controls::TableViewItem* pItem,
100 Tizen::Ui::Controls::TableViewItemStatus status)
102 AppLogDebug("ENTER");
103 SceneManager* pSceneManager = SceneManager::GetInstance();
104 AppAssert(pSceneManager);
106 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
108 __pPresentationModel->InitializeContentList(itemIndex);
109 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_YEAR_CONTENT_PICKER));