wchar_t element;
__pEditField->GetText().GetCharAt(i, element);
- if (element != ISSPACE )
+ if (element != ISSPACE)
{
showEmptyMessageBox = false;
break;
wchar_t element;
__pEditField->GetText().GetCharAt(i, element);
- if (element != ISSPACE )
+ if (element != ISSPACE)
{
showEmptyMessageBox = false;
break;
using namespace Tizen::Ui::Scenes;
static const int APPSETTING_DEFAULT_COUNT = 1;
-static const int LIMIT_EDITFIELD = 30;
-static const int STRING_SIZE_LIMIT = 10;
static const int ID_APPSETTTING_ARGUMENT_DEFAULT = 0;
static const int ID_APPSETTTING_ARGUMENT_APP_ID = 1;
static const int ID_APPSETTTING_ARGUMENT_COUNT = 2;
static const wchar_t* ID_APPSETTING_ATTRIBUTE_TYPE_MIN = L"min";
static const wchar_t* ID_APPSETTING_ATTRIBUTE_TYPE_MAX = L"max";
static const wchar_t* ID_APPSETTING_ATTRIBUTE_TYPE_VALUE = L"value";
+static const wchar_t* ID_APPSETTING_ATTRIBUTE_TYPE_MIN_LENGTH = L"minlength";
+static const wchar_t* ID_APPSETTING_ATTRIBUTE_TYPE_MAX_LENGTH = L"maxlength";
static const int ITEM_WIDTH_GAP = 100;
static const int H_RESIZE_LANDSCAPE_CLIPBOARD = 292;
void
AppSettingForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
{
- SceneManager* pSceneManager = SceneManager::GetInstance();
- AppAssert(pSceneManager);
+ bool errorStatus = false;
+ int currentLength = 0;
+ int stringLengthMax = 0;
+ int stringLengthMin = 0;
if (__pIOAppSetting != null)
{
- __pIOAppSetting->UpdateChangedValue();
- }
+ Node* pRootNode = null;
+ Enumerator* pEnum = null;
+ pRootNode = __pAppSettingManager->GetAppSettingRootNode(__appId);
+ pEnum = pRootNode->CreateEnumerator();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ Node* pCurrent = static_cast<Node*>(pEnum->GetCurrentObject());
+ if (pCurrent->GetType().Equals(ID_APPSETTING_ITEM_TYPE_STRING, false))
+ {
+ String* itemText = pCurrent->GetAttributeN(ID_APPSETTING_ATTRIBUTE_TYPE_VALUE);
+ String* pMinLength = pCurrent->GetAttributeN(ID_APPSETTING_ATTRIBUTE_TYPE_MIN_LENGTH);
+ String* pMaxLength = pCurrent->GetAttributeN(ID_APPSETTING_ATTRIBUTE_TYPE_MAX_LENGTH);
+
+ currentLength = itemText->GetLength();
+ Integer::Parse(*pMinLength, stringLengthMin);
+ Integer::Parse(*pMaxLength, stringLengthMax);
+
+ delete itemText;
+ delete pMinLength;
+ delete pMaxLength;
+
+ if ((currentLength > stringLengthMax) || (currentLength < stringLengthMin))
+ {
+ if (currentLength > stringLengthMax)
+ {
+ AppLogDebug("value length(%d) greater than maximum range(%d), show popup", currentLength, stringLengthMax);
+ }
+ else
+ {
+ AppLogDebug("value length(%d) smaller than minimum range(%d), show popup", currentLength, stringLengthMin);
+ }
+
+ MessageBox messageBox;
+ int result = E_SUCCESS;
+
+ messageBox.Construct(ResourceManager::GetString(L"IDS_EMAIL_POP_ALERT"), ResourceManager::GetString(L"IDS_COM_POP_FAILED"), MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
+ messageBox.ShowAndWait(result);
+
+ errorStatus = true;
+ break;
+ }
+ }
+ }
+ delete pEnum;
+
+ if (errorStatus == false)
+ {
+ __pIOAppSetting->UpdateChangedValue();
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
- pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+ }
+ }
}
int
else if ((pItemNode->GetType()).Equals(ID_APPSETTING_ITEM_TYPE_STRING, false))
{
itemRectangle.x = 0;
+ int stringLengthMin = 0;
+ int stringLengthMax = 0;
+
+ String minLength = *static_cast<String*>(pItemNode->GetAttributeN(ID_APPSETTING_ATTRIBUTE_TYPE_MIN_LENGTH));
+ if (minLength != null)
+ {
+ Integer::Parse(minLength, stringLengthMin);
+
+ AppLogDebug("max String size [%d]", stringLengthMin);
+ }
+
+ String maxLength = *static_cast<String*>(pItemNode->GetAttributeN(ID_APPSETTING_ATTRIBUTE_TYPE_MAX_LENGTH));
+ if (maxLength != null)
+ {
+ Integer::Parse(maxLength, stringLengthMax);
+
+ AppLogDebug("max String size [%d]", stringLengthMax);
+ }
RelativeLayout relativeLayout;
relativeLayout.Construct();
String* secondLine = pItemNode->GetAttributeN(ID_APPSETTING_ATTRIBUTE_TYPE_VALUE);
itemRectangle.x = X_GROUP_DEFAULT;
- pEditField->Construct(itemRectangle, EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY, EDIT_FIELD_TITLE_STYLE_TOP, true, LIMIT_EDITFIELD, GROUP_STYLE_NONE);
+ pEditField->Construct(itemRectangle, EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY, EDIT_FIELD_TITLE_STYLE_TOP, true, stringLengthMax, GROUP_STYLE_NONE);
pEditField->SetGuideText((*itemText).GetPointer());
pEditField->SetTitleText((*itemText).GetPointer());
pEditField->SetText((*secondLine).GetPointer());
pEditField->AddKeypadEventListener(*this);
pItem->AddControl(*pEditField);
- pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT ,TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
+ pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
pItem->SetIndividualSelectionEnabled(pEditField, true);
relativeLayout.SetMargin(*pEditField, 0, RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
if (!((pCurrentIEnumerator != null)
&& (pCurrentIEnumerator->MoveNext() == E_SUCCESS)))
{
- AppLogDebug("Expandlist & remove");
+ AppLogDebug("Expandlist has no expandItems & remove");
delete pCurrentIEnumerator;
return null;
}
ModifyTableViewItem(groupIndex, itemIndex);
break;
}
+ result r = __pBluetoothPresentationModelInstance->PairToFoundBluetoothDeviceAt(itemIndex);
+ if (IsFailed(r))
+ {
+ AppLogDebug("BluetoothPairToFoundDeviceList fail [%s]", GetErrorMessage(r));
+ break;
+ }
+
+ SetStateChangedTableviewItemTag(groupIndex, itemIndex);
+ ModifyTableViewItem(groupIndex, itemIndex);
}
- result r = __pBluetoothPresentationModelInstance->PairToFoundBluetoothDeviceAt(itemIndex);
- if (IsFailed(r))
+ else
{
- AppLogDebug("BluetoothPairToFoundDeviceList fail [%s]", GetErrorMessage(r));
- break;
+ AppLogDebug("__pBluetoothPresentationModelInstance is null.");
}
-
- SetStateChangedTableviewItemTag(groupIndex, itemIndex);
- ModifyTableViewItem(groupIndex, itemIndex);
}
break;
result
BluetoothPresentationModel::UnpairToPairedBluetoothDeviceAt(int index)
{
-
if (__pPairedRemoteDeviceList == null)
{
AppLogDebug("__pPairedRemoteDeviceList is null");
if (IsFailed(r) || pICertificate == null)
{
- AppLogDebug("__pCertificateList->GetAt(%d) failed(%s) or pICertificate is null",i , GetErrorMessage(r));
+ AppLogDebug("__pCertificateList->GetAt(%d) failed(%s) or pICertificate is null", i, GetErrorMessage(r));
return null;
}
CertificateTrustedRootForm::GetItemCount(int groupIndex)
{
int itemCount = 0;
- if (groupIndex == 0 )
+ if (groupIndex == 0)
{
itemCount = GetTrustedRootCertificateStoreCount();
}
RemoveControl(GetControl(0));
}
// RemoveAllControls();
- if ( GetUserCertificateStoreCount() != 0)
+ if (GetUserCertificateStoreCount() != 0)
{
AppLogDebug("GetUserCertificateStoreCount %d", GetUserCertificateStoreCount());
CreateTableView();
return;
}
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CERTIFICATE_USER_INSTALL_PASSWORD, SCENE_TRANSITION_ANIMATION_TYPE_LEFT,
- SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
+ SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
}
int
-//
+//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.0 (the License);
{
for (int i = 0; i < GetUserCertificateStoreCount(); i++)
{
- if (__pTableView->IsItemChecked(0,i) == true)
+ if (__pTableView->IsItemChecked(0, i) == true)
{
ICertificate* pICertificate =__pCertificatePresentationModelInstance->GetCertificateFromCertificateStoreN(0);
if (pICertificate == null)
{
case ID_GROUP_KEYBOARD_SOFTWARE:
{
- if ( __pInputMethodInfoList != null)
+ if (__pInputMethodInfoList != null)
{
itemCount = __pInputMethodInfoList->GetCount();
}
tmpText.Remove(0, tmpText.GetLength());
if (lineCount > 1)
{
- tmpHeight = (lineCount+1)*lineHeight;
+ tmpHeight = (lineCount + 1) * lineHeight;
}
else
{
tempHeight = GetLineheight(tmpText, labelWidth, fontSize, lineCount, lineHeight);
if (lineCount > 1)
{
- tempHeight = (lineCount+1)*lineHeight;
+ tempHeight = (lineCount + 1) * lineHeight;
}
else
{
int fontSize = GetFontSize();
unsigned int itemHeight = 0;
- bool isTwoLineItemText = false;
bool isDrawBitmapIcon = true;
Rectangle itemRectIcon;
Rectangle itemRectLabel;
relativeLayout.SetMargin(*pLabel, itemRectLabel.x, MAIN_RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
-
- if (isTwoLineItemText)
- {
- pLabel = new (std::nothrow) Label();
- pLabel->Construct(itemRectSecondLabel, itemTextTwoLine);
- pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
- pLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
- pLabel->SetTextColor(COLOR_SUB_TEXT);
-
- pItem->AddControl(*pLabel);
- relativeLayout.SetMargin(*pLabel, itemRectSecondLabel.x, MAIN_RELATIVE_LAYOUT_RIGHT_MARGIN, 0, 0);
- relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_LEFT_TO_LEFT);
- relativeLayout.SetRelation(*pLabel, *pItem, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
- }
}
return pItem;
static const int NFC_SUPPORT_PREDEFINED_ITEM_GROUP_COUNT = 4;
static const int DIVIDE_BY_TWO = 2;
static const int W_TEXT_GAP = 30;
+static const int H_TEXT_GAP = 20;
NfcForm::NfcForm(void)
: __pNfcPresentationModelInstance(null)
case ID_GROUP_NFC_HELP:
{
- yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP / DIVIDE_BY_TWO ;
+ yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP / DIVIDE_BY_TWO;
groupText = ResourceManager::GetString(L"IDS_NFC_BODY_WHEN_NFC_IS_ON_YOU_CAN_SEND_OR_RECEIVE_DATA_WHEN_YOUR_DEVICE_TOUCHES_OTHER_NFC_CAPABLE_DEVICES_OR_NFC_TAGS");
- itemHeight = GetHeightForStringArea(groupText, itemWidth - W_TEXT_GAP, fontSize);
+ itemHeight = GetHeightForStringArea(groupText, itemWidth - W_TEXT_GAP, fontSize) + H_TEXT_GAP;
}
break;
case ID_GROUP_NFC_PREDEFINED_ITEM_HELP:
{
- yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP / DIVIDE_BY_TWO ;
+ yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP / DIVIDE_BY_TWO;
groupText = ResourceManager::GetString(L"IDS_NFC_BODY_YOU_CAN_BEAM_PREDEFINED_ITEMS_TO_ANOTHER_NFC_DEVICE_JUST_BRING_THE_DEVICES_CLOSE_TOGETHER_MSG");
- itemHeight = GetHeightForStringArea(groupText, itemWidth - W_TEXT_GAP, fontSize);
+ itemHeight = GetHeightForStringArea(groupText, itemWidth - W_TEXT_GAP, fontSize) + H_TEXT_GAP;
}
break;
Rectangle itemRect = pItem->GetBounds();
String groupText = pLabel->GetText();
int fontSize = GetFontSize();
- int itemHeight = GetHeightForStringArea(groupText, clientRect.width - W_TEXT_GAP, fontSize);
+ int itemHeight = GetHeightForStringArea(groupText, clientRect.width - W_TEXT_GAP, fontSize) + H_TEXT_GAP;
itemRect.height = itemHeight + H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
String key = pPrivacyService->GetDisplayName();
StringTokenizer stringTokenizer(key, L"/");
- while(stringTokenizer.HasMoreTokens() == true)
+ while (stringTokenizer.HasMoreTokens() == true)
{
stringTokenizer.GetNextToken(tokenData);
}
result.Append(tokenData);
- if (index != (serviceCount-1))
+ if (index != (serviceCount - 1))
{
result.Append(L", ");
}
gmtHour = timeZone.GetRawOffset();
SetTimeZoneLocaleList(new (std::nothrow) TimeZoneData(region, country, gmtHour));
- SetTimeZoneLocaleSearchList( new (std::nothrow) TimeZoneData(region, country, gmtHour));
+ SetTimeZoneLocaleSearchList(new (std::nothrow) TimeZoneData(region, country, gmtHour));
delete pKey;
}
WallpaperAlbumListPresentationModel::CreateInstance(void)
{
AppLogDebug("ENTER");
- __pPresentationModelInstance = new (std::nothrow) WallpaperAlbumListPresentationModel;
+ __pPresentationModelInstance = new (std::nothrow) WallpaperAlbumListPresentationModel();
result r = __pPresentationModelInstance->Construct();
if (IsFailed(r) == true)
-//
+//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.0 (the License);
}
r = InitWifiPresentationModelInstance();
- if(IsFailed(r))
+ if (IsFailed(r))
{
AppLogDebug("InitWifiPresentationModelInstance fail [%s]", GetErrorMessage(r));
return;
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_UNLOCK_03);
}
else if ((wifiBssInfoRssi <= WIFI_RSSI_DETAIL_MAX)
- && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MID))
+ && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MID))
{
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_UNLOCK_02);
}
else if ((wifiBssInfoRssi <= WIFI_RSSI_DETAIL_MID)
- && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MIN))
+ && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MIN))
{
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_UNLOCK_01);
}
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_LOCK_03);
}
else if ((wifiBssInfoRssi <= WIFI_RSSI_DETAIL_MAX)
- && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MID))
+ && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MID))
{
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_LOCK_02);
}
else if ((wifiBssInfoRssi <= WIFI_RSSI_DETAIL_MID)
- && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MIN))
+ && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MIN))
{
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_LOCK_01);
}
-//
+//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.0 (the License);
{
case ID_GROUP_WIFI_EAP_CONNECT_MAIN:
{
- switch(itemIndex)
+ switch (itemIndex)
{
case ID_ITEM_WIFI_EAP_CONNECT_EAP_METHOD:
{
default:
{
- switch(itemIndex)
+ switch (itemIndex)
{
case ID_ITEM_WIFI_EAP_CONNECT_MAC_ADDRESS:
{
-//
+//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.0 (the License);
for (count = 0; count < FRAME_COUNT; count++)
{
String searchIconFilePath;
- searchIconFilePath.Format(searchIconFilePath.GetLength(),IDB_SEARCH_ICON_SIZE_LAGER_IMAGE_PATH_FORMAT, count);
+ searchIconFilePath.Format(searchIconFilePath.GetLength(), IDB_SEARCH_ICON_SIZE_LAGER_IMAGE_PATH_FORMAT, count);
pBitmap = ResourceManager::GetBitmapN(searchIconFilePath);
if (pBitmap == null)
{
-//
+//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.0 (the License);
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_UNLOCK_03);
}
else if ((wifiBssInfoRssi <= WIFI_RSSI_DETAIL_MAX)
- && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MID))
+ && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MID))
{
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_UNLOCK_02);
}
else if ((wifiBssInfoRssi <= WIFI_RSSI_DETAIL_MID)
- && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MIN))
+ && (wifiBssInfoRssi > WIFI_RSSI_DETAIL_MIN))
{
pBitmap = ResourceManager::GetBitmapN(IDB_WIFI_RSSI_UNLOCK_01);
}
else
{
__networkGroupItemTotalCount = GetGroupItemTotalCount(GROUP_INDEX_2_WIFI_NETWORK) - itemCount;
- if ( __networkGroupItemTotalCount <= 0)
+ if (__networkGroupItemTotalCount <= 0)
{
__networkGroupItemTotalCount = WIFI_NETWORK_GROUP_ITEM_BASE;
}