virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+ virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
private:
void CreateTableView(void);
result InitCertificatePresentationModelInstance(void);
int GetTrustedRootCertificateStoreCount(void);
+ void CreateNoContents(void);
private:
CertificatePresentationModel* __pCertificatePresentationModelInstance;
private:
void InitPackgaeManager(void);
- void InitPrivacyAppPackageList(void);
+ result InitPrivacyAppPackageList(void);
Tizen::Base::String GetDisplayPackageName(int itemIndex);
Tizen::Base::String GetUsedPrivacyService(int itemIndex);
extern const int W_ITEM_TYPE_4_LABEL_SUB;
extern const int H_ITEM_TYPE_4_LABEL_SUB;
+extern const int DEVIDE_TWO;
extern const int LINE_COUNT_2;
extern const int LINE_COUNT_3;
extern const int LINE_COUNT_4;
private:
void CreateIconListView(void);
void SetOrientationAutoMode(void);
+ void UpdateIconListView(void);
+ int GetHeightForStringArea(const Tizen::Base::String source, int width, int fontSize = 0) const;
private:
int __itemCount;
pItem->AddControl(*pLabel);
pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
pItem->SetEnabled(true);
-
+ delete groupText;
return pItem;
}
else
{
CreateHeader(ResourceManager::GetString(L"IDS_ST_BODY_TRUSTED_ROOT_CERTIFICATES"));
CreateFooter();
- CreateTableView();
result r = InitCertificatePresentationModelInstance();
if (r == E_FAILURE)
{
__pCertificatePresentationModelInstance = null;
}
+
+ if (GetTrustedRootCertificateStoreCount() == 0)
+ {
+ CreateNoContents();
+ }
+ else
+ {
+ CreateTableView();
+ }
return E_SUCCESS;
}
void
CertificateTrustedRootForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
{
- __pTableView->UpdateTableView();
+ if (GetTrustedRootCertificateStoreCount() != 0)
+ {
+ __pTableView->UpdateTableView();
+ }
}
void
TableViewItem*
CertificateTrustedRootForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
{
+ AppLogDebug("GroupIndex %d, ItemIndex %d, ItemWidth %d", groupIndex, itemIndex, itemWidth);
Rectangle itemRectangle;
TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
int fontSize = GetFontSize();
return 0;
}
return __pCertificatePresentationModelInstance->GetCertificateStoreCount();
+}
+
+void
+CertificateTrustedRootForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
+{
+ if (__pTableView == null)
+ {
+ if (GetTrustedRootCertificateStoreCount() == 0)
+ {
+ CreateNoContents();
+ }
+ return;
+ }
+}
+
+void
+CertificateTrustedRootForm::CreateNoContents(void)
+{
+ int controlCount = GetControlCount();
+ for (int i = 0; i < controlCount; i++)
+ {
+ RemoveControl(GetControl(0));
+ }
+ Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+ if (pLabel == null)
+ {
+ Rectangle clientRect = GetClientAreaBounds();
+ Bitmap* pBitmp = ResourceManager::GetBitmapN(IDB_NO_CONTENTS);
+
+ int bitmapWidth = pBitmp->GetWidth();
+ int bitmapHeight = pBitmp->GetHeight();
+ String labelText = ResourceManager::GetString(L"IDS_ST_BODY_NO_CONTENT");
+ Color textColor = COLOR_HELP_TEXT_TYPE_03_NORMAL;
+ int noContentTextHeight = GetHeightForStringArea(labelText, bitmapWidth, 32);
+
+ int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DEVIDE_TWO);
+ int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DEVIDE_TWO);
+
+ Label* pLabel = new (std::nothrow) Label();
+ pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
+ pLabel->SetName(NO_CONTENTS);
+ pLabel->SetBackgroundBitmap(*pBitmp);
+
+ yPos = yPos + bitmapHeight;
+
+ Label* pLabelNoContents = new (std::nothrow) Label();
+ pLabelNoContents->Construct(Rectangle(0, yPos, clientRect.width, noContentTextHeight), L"");
+ pLabelNoContents->SetName(NO_CONTENTS_TEXT);
+ pLabelNoContents->SetTextColor(textColor);
+ pLabelNoContents->SetText(labelText);
+
+ AddControl(*pLabel);
+ AddControl(*pLabelNoContents);
+ }
}
\ No newline at end of file
static const int ALERT_POPUP_LABEL_FONT_SIZE = 40;
-static const int DEVIDE_TWO = 2;
-
CertificateUserForm::CertificateUserForm(void)
: __pCertificatePresentationModelInstance(null)
, __installFromSDCardPopup(null)
using namespace Tizen::Ui::Scenes;
static const int ID_GROUP_COUNT = 1;
-static const int DEVIDE_TWO = 2;
CertificateUserInstallForm::CertificateUserInstallForm(void)
: __pCertificatePresentationModelInstance(null)
static const int ID_GROUP_COUNT = 1;
static const int ID_ITEM_COUNT_MAX = 0;
-static const int DEVIDE_TWO = 2;
static const int ID_FOOTER_UNINSTALL = 0;
static const int ID_FOOTER_CANCEL = 1;
-static const int ALERT_POPUP_CLIENT_RECT_Y = 160;
-static const int ALERT_POPUP_CLIENT_RECT_RESIZE_HEIGHT = 400;
-static const int ALERT_POPUP_ITEM_RECT_LEBEL_Y = 20;
-static const int ALERT_POPUP_ITEM_RECT_LEBEL_HEIGHT = 340;
-static const int ALERT_POPUP_ITEM_RECT_LHS_BUTTON_X = 20;
-static const int ALERT_POPUP_ITEM_RECT_LHS_BUTTON_Y = 350;
-static const int ALERT_POPUP_ITEM_RECT_LHS_BUTTON_WIDTH = 310;
-static const int ALERT_POPUP_ITEM_RECT_LHS_BUTTON_HEIGHT = 80;
-static const int ALERT_POPUP_ITEM_RECT_RHS_BUTTON_RESIZE_X = 20;
-static const int ALERT_POPUP_FONT_SIZE = 40;
-
static const int RELATIVE_LAYOUT_LEFT_RADIO_BUTTON_MARGIN = 80;
CertificateUserUnInstallForm::CertificateUserUnInstallForm(void)
static const int DIVIDE_BY_TWO = 2;
static const int TIME_FIELD_GAP = 20;
-static const int DEVIDE_TWO = 2;
static const int SECOND_CONTROL_ITEM = 1;
static const int SECOND_TEXT_ITEM = 2;
static const int MIN_YEAR = 1970;
static const int FONT_FORM_FIRST_CONTROL = 0;
static const int FONT_FORM_SECOND_CONTROL = 1;
static const int FONT_FORM_THIRD_CONTROL = 2;
-static const int DEVIDE_TWO = 2;
static const int SECOND_CONTROL_ITEM = 1;
FontForm::FontForm(void)
static const int ID_GROUP_COUNT = 2;
static const int ID_GROUP_MAX_ITEM_COUNT = ID_GROUP_FONT_ITEM_COUNT;
+static const int H_GROUP_INDEX_HELP_TEXT_GAP = 20;
+
static const int DIVIDE_BT_TWO = 2;
FontSizeForm::FontSizeForm(void)
{
yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP / DIVIDE_BT_TWO ;
groupText = ResourceManager::GetString(L"IDS_ST_BODY_CHANGING_THE_FONT_SIZE_IN_ACCESSIBILITY_SETTINGS_WILL_OVERRIDE_THE_FONT_SIZE_IN_EACH_APPLICATION");
- itemHeight = GetHeightForStringArea(groupText, itemWidth, fontSize);
+ itemHeight = GetHeightForStringArea(groupText, itemWidth, fontSize) + H_GROUP_INDEX_HELP_TEXT_GAP;
}
break;
}
ItemTypeOneLine(itemRectangle);
+ itemRectangle.height = itemRectangle.height + H_GROUP_INDEX_HELP_TEXT_GAP;
RelativeLayout relativeLayout;
relativeLayout.Construct();
Rectangle itemRect = pItem->GetBounds();
String groupText = pLabel->GetText();
int fontSize = GetFontSize();
- int itemHeight = GetHeightForStringArea(groupText, clientRect.width, fontSize);
+ int itemHeight = GetHeightForStringArea(groupText, clientRect.width, fontSize) + H_GROUP_INDEX_HELP_TEXT_GAP;
itemRect.height = itemHeight + H_GROUP_INDEX_HELP_TEXT_TOP_GAP;
pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
static const int ID_ITEM_KEYBOARD_HARDWARE_KEYBOARD_SETTING = 1;
static const int ID_GROUP_COUNT = 1;
-static const int DEVIDE_TWO = 2;
KeyboardInfoForm::KeyboardInfoForm(void)
: __pInputMethodInfo(null)
static const int SECOND_CONTROL = 1;
static const int REFRESH_GROUP_ITEM_INDEX = -1;
static const int MAIN_TEXT_WIDTH_GAP = 32;
-static const int DEVIDE_TWO = 2;
static const long DEFAULT_INPUT_NUMBER = 123456789;
{
AppLogDebug("Enter");
- InitPrivacyAppPackageList();
+ result r = InitPrivacyAppPackageList();
+ if (IsFailed(r))
+ {
+ AppLogDebug("InitPrivacyAppPackageList");
+ return E_FAILURE;
+ }
+
CreateHeader(ResourceManager::GetString(L"IDS_COM_BODY_PRIVACY"));
CreateFooter();
CreateTableView();
- return E_SUCCESS;
+ return r;
}
result
}
}
-void
+result
PrivacyForm::InitPrivacyAppPackageList(void)
{
__pPrivacyManager = PrivacyManager::GetInstance();
if (__pPrivacyManager == null)
{
AppLogDebug("pPrivacyManager is null");
+ return E_FAILURE;
}
__privacyPackageList = static_cast<ArrayList*>(__pPrivacyManager->GetPrivacyAppPackageListN());
if (__privacyPackageList == null)
{
AppLogDebug("__privacyPackageList is null");
+ return E_FAILURE;
}
+ return E_SUCCESS;
}
Tizen::Base::String
PrivacyForm::GetDisplayPackageName(int itemIndex)
{
String result;
+
+ if (__privacyPackageList == null)
+ {
+ return result;
+ }
+
String packageId = *static_cast<String*>(__privacyPackageList->GetAt(itemIndex));
if (packageId.IsEmpty() == true)
{
{
AppLogDebug("pPackageManager is null");
}
-
- PackageInfo* pPackageInfo = pPackageManager->GetPackageInfoN(packageId);
- if (pPackageInfo == null)
+ else
{
- AppLogDebug("pPackageInfo is null. GetDisplayName fail");
- return result;
+ PackageInfo* pPackageInfo = pPackageManager->GetPackageInfoN(packageId);
+ if (pPackageInfo == null)
+ {
+ AppLogDebug("pPackageInfo is null. GetDisplayName fail");
+ return result;
+ }
+ return pPackageInfo->GetDisplayName();
}
-
- return pPackageInfo->GetDisplayName();
+ return result;
}
Tizen::Base::String
const int W_ITEM_TYPE_4_LABEL_SUB = W_ITEM_TYPE_4_LABEL_MAIN;
const int H_ITEM_TYPE_4_LABEL_SUB = 48;
+const int DEVIDE_TWO = 2;
const int LINE_COUNT_2 = 2;
const int LINE_COUNT_3 = 3;
const int LINE_COUNT_4 = 4;
static const int MAX_UNDER_FILE_SIZE = 334;
static const int MAX_OVER_FILE_SIZE = 158;
static const int FOLDER_BITMAP_MAX = 6;
-static const int DEVIDE_TWO = 2;
static const int W_LARGE_SIZE_TEXT_GAP = 110;
static const int W_HUGE_SIZE_PORTRAIT_TEXT_GAP = 90;
static const int W_HUGE_SIZE_LANDSCAPE_TEXT_GAP = 220;
void
WallpaperAlbumListDetailForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
{
- __pIconListView->SetBounds(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
+ if (__pIconListView == null)
+ {
+ UpdateIconListView();
+ }
+ else
+ {
+ __pIconListView->SetBounds(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
+ }
Invalidate(true);
}
static const int H_FOLDER_SIZE = 334;
static const wchar_t* ALBUM_NAME_ALL_ALBUMS = L"All albums";
+static const int W_LARGE_SIZE_TEXT_GAP = 110;
+static const int W_HUGE_SIZE_PORTRAIT_TEXT_GAP = 90;
+static const int W_HUGE_SIZE_LANDSCAPE_TEXT_GAP = 220;
+static const int LINE_COUNT_DEFAULT = 1;
+static const int BASE_FORM_DEFAULT_MARGIN = 32;
+
WallpaperAlbumListForm::WallpaperAlbumListForm(void)
: __itemCount(0)
, __pPresentationModel(null)
__pPresentationModel->InitializeAlbumInfoList();
__itemCount = __pPresentationModel->GetFolderCount();
- if (__pIconListView == null)
- {
- CreateIconListView();
- }
- else
- {
- __pIconListView->UpdateList();
- }
+ UpdateIconListView();
CreateHeader(ResourceManager::GetString(L"IDS_MP_BODY_ADD_IMAGE"));
CreateFooter();
}
void
WallpaperAlbumListForm::CreateIconListView(void)
{
+ if (__pIconListView != null)
+ {
+ __pIconListView->UpdateList();
+ return;
+ }
Dimension itemSize(W_FOLDER_SIZE, H_FOLDER_SIZE);
__pIconListView = new (std::nothrow) IconListView();
void
WallpaperAlbumListForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
{
- __pIconListView->SetBounds(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
+ if (__pIconListView != null)
+ {
+ __pIconListView->SetBounds(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
+ }
+ else
+ {
+ UpdateIconListView();
+ }
Invalidate(true);
}
{
__pPresentationModel->InitializeAlbumInfoList();
__itemCount = __pPresentationModel->GetFolderCount();
- __pIconListView->UpdateList();
+ UpdateIconListView();
if (pArgs)
{
pArgs->RemoveAll(true);
delete pArgs;
}
}
+}
+
+void
+WallpaperAlbumListForm::UpdateIconListView(void)
+{
+ bool createIconListView = true;
+ if (__itemCount == 0)
+ {
+ createIconListView = false;
+ }
+ if (__pIconListView != null)
+ {
+ if (createIconListView)
+ {
+ __pIconListView->UpdateList();
+ return;
+ }
+ }
+
+ int controlCount = GetControlCount();
+ for (int i = 0; i < controlCount; i++)
+ {
+ RemoveControl(GetControl(0));
+ }
+// RemoveAllControls();
+
+ if (createIconListView)
+ {
+ CreateIconListView();
+ }
+ else
+ {
+ Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+ if (pLabel == null)
+ {
+ Rectangle clientRect = GetClientAreaBounds();
+ Bitmap* pBitmp = ResourceManager::GetBitmapN(IDB_NO_CONTENTS);
+
+ int bitmapWidth = pBitmp->GetWidth();
+ int bitmapHeight = pBitmp->GetHeight();
+ String labelText = ResourceManager::GetString(L"IDS_ST_BODY_NO_CONTENT");
+ Color textColor = COLOR_HELP_TEXT_TYPE_03_NORMAL;
+ int noContentTextHeight = GetHeightForStringArea(labelText, bitmapWidth, 32);
+
+ int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DEVIDE_TWO);
+ int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DEVIDE_TWO);
+
+ Label* pLabel = new (std::nothrow) Label();
+ pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
+ pLabel->SetName(NO_CONTENTS);
+ pLabel->SetBackgroundBitmap(*pBitmp);
+
+ yPos = yPos + bitmapHeight;
+
+ Label* pLabelNoContents = new (std::nothrow) Label();
+ pLabelNoContents->Construct(Rectangle(0, yPos, clientRect.width, noContentTextHeight), L"");
+ pLabelNoContents->SetName(NO_CONTENTS_TEXT);
+ pLabelNoContents->SetTextColor(textColor);
+ pLabelNoContents->SetText(labelText);
+
+ AddControl(*pLabel);
+ AddControl(*pLabelNoContents);
+ }
+ }
+}
+
+int
+WallpaperAlbumListForm::GetHeightForStringArea(const Tizen::Base::String source, int width, int fontSize) const
+{
+ Font font;
+ Dimension dim;
+ String temp;
+
+ int lineCount = LINE_COUNT_DEFAULT;
+ int margin = BASE_FORM_DEFAULT_MARGIN + RELATIVE_LAYOUT_RIGHT_MARGIN;
+ if (fontSize > FONT_MAIN_TEXT_SIZE_LARGE)
+ {
+ OrientationStatus orientationStatus = GetOrientationStatus();
+ if (((orientationStatus == ORIENTATION_STATUS_PORTRAIT)
+ || (orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE))
+ && (fontSize == FONT_MAIN_TEXT_SIZE_HUGE))
+ {
+ width -= W_HUGE_SIZE_PORTRAIT_TEXT_GAP;
+ }
+ else if (((orientationStatus == ORIENTATION_STATUS_LANDSCAPE)
+ || (orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE))
+ && (fontSize == FONT_MAIN_TEXT_SIZE_HUGE))
+ {
+ width -= W_HUGE_SIZE_LANDSCAPE_TEXT_GAP;
+ }
+ width -= W_LARGE_SIZE_TEXT_GAP;
+ }
+ int boudwidth = width - margin;
+ font.Construct(FONT_STYLE_PLAIN, fontSize);
+
+ for (int i = 0; i < source.GetLength(); i++)
+ {
+ temp.Append(source[i]);
+ font.GetTextExtent(temp, temp.GetLength(), dim);
+ if (dim.width > boudwidth)
+ {
+ temp.Clear();
+ temp.Append(source[i]);
+ lineCount++;
+ }
+ }
+
+ return dim.height * lineCount;
}
\ No newline at end of file
static const int IDA_POPUP_ACTION_ID_BASE = 200;
static const int IDA_FOOTER_SAVE = IDA_POPUP_ACTION_ID_BASE + 1;
-static const int DEVIDE_TWO = 2;
-
WallpaperImageSelectForm::WallpaperImageSelectForm(void)
: __pContentId(null)
, __argIndex(0)