2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (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://www.tizenopensource.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.
18 #include "FormManager.h"
19 #include "SystemInfoForm.h"
20 #include "CustomListElement.h"
22 using namespace Osp::Base;
23 using namespace Osp::Ui;
24 using namespace Osp::Ui::Controls;
25 using namespace Osp::System;
26 using namespace Osp::Graphics;
28 const int NumberOfSystemElement = 21;
30 SystemInfoForm::SystemInfoForm(void)
37 SystemInfoForm::~SystemInfoForm(void)
43 SystemInfoForm::Initialize()
45 Construct(L"IDF_SYSTEM_INFO_FORM");
46 __pListView = new ListView();
47 __pListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, false);
48 __pListView->SetItemProvider(*this);
49 __pListView->AddListViewItemEventListener(*this);
51 listElements.Construct(NumberOfSystemElement);
53 AddControl(*__pListView);
58 SystemInfoForm::OnInitializing(void)
62 Footer* pFooter = GetFooter();
63 FormManager::MakeSystemAppFooter(this, pFooter, FormManager::REQUEST_FORM_SYSTEM_INFO);
69 SystemInfoForm::OnTerminating(void)
77 SystemInfoForm::OnActionPerformed(const Osp::Ui::Control& source, int actionId)
83 Frame *pFrame = Osp::App::Application::GetInstance()->GetAppFrame()->GetFrame();
84 FormManager* pFormManager = static_cast<FormManager*>(pFrame->GetControl(String(L"FormManager")));
85 if (pFormManager != null)
87 pFormManager->SendUserEvent(static_cast<RequestId>(actionId), null);
91 AppLog("FormManager getting has failed.");
101 SystemInfoForm::OnListViewContextItemStateChanged(Osp::Ui::Controls::ListView& listView,
104 Osp::Ui::Controls::ListContextItemStatus state)
109 SystemInfoForm::OnListViewItemStateChanged(Osp::Ui::Controls::ListView& listView,
112 Osp::Ui::Controls::ListItemStatus status)
117 SystemInfoForm::OnListViewItemSwept(Osp::Ui::Controls::ListView& listView,
119 Osp::Ui::Controls::SweepDirection direction)
123 Osp::Ui::Controls::ListItemBase*
124 SystemInfoForm::CreateItem(int index, int itemWidth)
126 ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
127 CustomItem* pItem = new CustomItem();
130 String szDescription;
133 CustomListElement* pCustomListElement;
134 pItem->Construct(Osp::Graphics::Dimension(itemWidth, 100), style);
140 szTitle = "APIVersion";
141 SystemInfo::GetValue(szTitle, szDescription);
147 szTitle = "BluetoothSupported";
148 SystemInfo::GetValue(szTitle, bResult);
150 szDescription = "Supported";
152 szDescription = "Unsupported";
158 szTitle = "CameraCount";
159 SystemInfo::GetValue(szTitle, nResult);
161 szDescription.Append(nResult);
167 szTitle = "GPSSupported";
168 SystemInfo::GetValue(szTitle, bResult);
170 szDescription = "Supported";
172 szDescription = "Unsupported";
178 szTitle = "KeyboardType";
179 SystemInfo::GetValue(szTitle, szDescription);
185 szTitle = "NetworkType";
186 SystemInfo::GetValue(szTitle, szDescription);
192 szTitle = "OpenGLESVersion";
193 SystemInfo::GetValue(szTitle, szDescription);
199 szTitle = "PlatformVersion";
200 SystemInfo::GetValue(szTitle, szDescription);
206 szTitle = "ScreenBitsPerPixel";
207 SystemInfo::GetValue(szTitle, nResult);
209 szDescription.Append(nResult);
215 szTitle = "ScreenHeight";
216 SystemInfo::GetValue(szTitle, nResult);
218 szDescription.Append(nResult);
224 szTitle = "ScreenWidth";
225 SystemInfo::GetValue(szTitle, nResult);
227 szDescription.Append(nResult);
233 szTitle = "WiFiSupported";
234 SystemInfo::GetValue(szTitle, bResult);
236 szDescription = "Supported";
238 szDescription = "Unsupported";
244 szTitle = "FmRadioSupported";
245 SystemInfo::GetValue(szTitle, bResult);
247 szDescription = "Supported";
249 szDescription = "Unsupported";
255 szTitle = "TvOutSupported";
256 SystemInfo::GetValue(szTitle, bResult);
258 szDescription = "Supported";
260 szDescription = "Unsupported";
266 szTitle = "MultiPointTouchCount";
267 SystemInfo::GetValue(szTitle, nResult);
269 szDescription.Append(nResult);
275 szTitle = "MaxSystemSoundVolume";
276 SystemInfo::GetValue(szTitle, nResult);
278 szDescription.Append(nResult);
284 szTitle = "MaxMediaSoundVolume";
285 SystemInfo::GetValue(szTitle, nResult);
287 szDescription.Append(nResult);
293 szTitle = "MaxRingtoneSoundVolume";
294 SystemInfo::GetValue(szTitle, nResult);
296 szDescription.Append(nResult);
302 szTitle = "MaxNotificationSoundVolume";
303 SystemInfo::GetValue(szTitle, nResult);
305 szDescription.Append(nResult);
311 szTitle = "NFCSupported";
312 SystemInfo::GetValue(szTitle, bResult);
314 szDescription = "Supported";
316 szDescription = "Unsupported";
322 szTitle = "WiFiDirectSupported";
323 SystemInfo::GetValue(szTitle, bResult);
325 szDescription = "Supported";
327 szDescription = "Unsupported";
335 listElements.RemoveAt(index, true);
337 pCustomListElement = new CustomListElement();
338 pCustomListElement->SetTitleDescription(szTitle, szDescription);
339 listElements.InsertAt(*((Object*) pCustomListElement), index);
340 pItem->AddElement(Rectangle(0, 0, GetClientAreaBounds().width, 90), ID_FORMAT_CUSTOM, *(static_cast<ICustomElement*>(pCustomListElement)));
346 SystemInfoForm::DeleteItem(int index, Osp::Ui::Controls::ListItemBase* pItem, int itemWidth)
349 listElements.RemoveAt(index, true);
357 SystemInfoForm::GetItemCount(void)
359 return NumberOfSystemElement;