3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.1 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file SlideShowPopUp.cpp
20 * @brief This file contains the definitions of the SlideShowPopUp class.
23 #include <FUiScenes.h>
25 #include "GlResourceManager.h"
26 #include "GlSlideSettingListener.h"
27 #include "GlSlideShowPopUp.h"
29 using namespace Tizen::App;
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32 using namespace Tizen::Graphics;
33 using namespace Tizen::Ui;
34 using namespace Tizen::Ui::Controls;
35 using namespace Tizen::Ui::Scenes;
37 static const int ID_FORMAT_START = 501;
38 static const int ID_FORMAT_SETTING = 502;
39 static const int ID_CANCEL_BUTTON = 503;
41 SlideShowPopUp::SlideShowPopUp(void)
47 SlideShowPopUp::~SlideShowPopUp(void)
52 SlideShowPopUp::Initialize(void)
54 Button* pCancelButton = null;
55 Popup::Construct(L"IDL_SLIDESHOW_SETTING_POPUP");
57 __pList = static_cast<ListView*>(GetControl(L"IDC_POPUP_LIST"));
64 __pList->SetItemProvider(*this);
65 __pList->AddListViewItemEventListener(*this);
67 pCancelButton = static_cast<Button*>(GetControl(L"IDC_BUTTON", true));
69 if (pCancelButton != null)
71 pCancelButton->AddActionEventListener(*this);
72 pCancelButton->SetActionId(ID_CANCEL_BUTTON);
79 SlideShowPopUp::OnTerminating(void)
85 SlideShowPopUp::OnActionPerformed(const Control& source, int actionId)
89 case ID_CANCEL_BUTTON:
91 Popup::SetShowState(false);
103 SlideShowPopUp::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
105 if (__pListener != null)
107 __pListener->OnSlideSettingPopUpItemSelected(index);
112 SlideShowPopUp::CreateItem(int index, int itemWidth)
114 ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
115 int listItemHeight = 112;
117 CustomItem* pItem = new (std::nothrow) CustomItem();
118 result r = pItem->Construct(Dimension(GetClientAreaBounds().width, listItemHeight), style);
119 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, Color::GetColor(COLOR_ID_WHITE));
123 AppLogDebug("Create Item Failed with error %s", GetErrorMessage(r));
131 pItem->AddElement(Rectangle(25, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_START,
132 ResourceManager::GetString(L"IDS_MEDIABR_OPT_START_SLIDESHOW"), true);
138 pItem->AddElement(Rectangle(25, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_SETTING,
139 ResourceManager::GetString(L"IDS_MEDIABR_BODY_SLIDESHOW_SETTINGS"), true);
152 SlideShowPopUp::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
158 SlideShowPopUp::GetItemCount(void)
164 SlideShowPopUp::SetEventListner(ISlideSettingListener* listner)
166 __pListener = listner;