Apply string id to support multi language and fix some display error and prevent...
authorTaeHo Choi <thanks.choi@samsung.com>
Tue, 16 Apr 2013 06:52:54 +0000 (15:52 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Tue, 16 Apr 2013 06:52:54 +0000 (15:52 +0900)
Change-Id: Ibe3be6ea1cdf61fc0d044adbc80014ed55e6b56f
Signed-off-by: TaeHo Choi <thanks.choi@samsung.com>
19 files changed:
inc/StCertificateTrustedRootForm.h
inc/StPrivacyForm.h
inc/StTypes.h
inc/StWallpaperAlbumListForm.h
src/StAppSettingForm.cpp
src/StCertificateTrustedRootForm.cpp
src/StCertificateUserForm.cpp
src/StCertificateUserInstallForm.cpp
src/StCertificateUserUnInstallForm.cpp
src/StDateTimeForm.cpp
src/StFontForm.cpp
src/StFontSizeForm.cpp
src/StKeyboardInfoForm.cpp
src/StLanguageAndRegionForm.cpp
src/StPrivacyForm.cpp
src/StTypes.cpp
src/StWallpaperAlbumListDetailForm.cpp
src/StWallpaperAlbumListForm.cpp
src/StWallpaperImageSelectForm.cpp

index e6fb72f..6f8121f 100644 (file)
@@ -55,11 +55,13 @@ public:
        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;
index 4185ffe..d93e24a 100644 (file)
@@ -57,7 +57,7 @@ public:
        
 private:
        void InitPackgaeManager(void);
-       void InitPrivacyAppPackageList(void);
+       result InitPrivacyAppPackageList(void);
        Tizen::Base::String GetDisplayPackageName(int itemIndex);
        Tizen::Base::String GetUsedPrivacyService(int itemIndex);
 
index 9957446..ff91f06 100644 (file)
@@ -157,6 +157,7 @@ extern const int Y_ITEM_TYPE_4_LABEL_SUB;
 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;
index c5e123a..360455a 100644 (file)
@@ -59,6 +59,8 @@ public:
 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;
index 3e7cb67..36f3e9d 100644 (file)
@@ -1196,7 +1196,7 @@ AppSettingForm::CreateGroupItem(int groupIndex, int itemWidth)
                pItem->AddControl(*pLabel);
                pItem->SetBackgroundColor(COLOR_BG_GROUP_INDEX_DEFAULT, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
                pItem->SetEnabled(true);
-
+               delete groupText;
                return pItem;
        }
        else
index 2e8c7d9..b8c62a6 100644 (file)
@@ -60,13 +60,21 @@ CertificateTrustedRootForm::OnInitializing(void)
 {
        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;
 }
 
@@ -105,7 +113,10 @@ CertificateTrustedRootForm::OnTerminating(void)
 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
@@ -182,6 +193,7 @@ CertificateTrustedRootForm::CreateGroupItem(int groupIndex, int itemWidth)
 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();
@@ -339,4 +351,58 @@ CertificateTrustedRootForm::GetTrustedRootCertificateStoreCount(void)
                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
index f739b40..6f43b81 100644 (file)
@@ -55,8 +55,6 @@ static const int X_ALERT_POPUP_ITEM_RECT_RHS_BUTTON_RESIZE = 20;
 
 static const int ALERT_POPUP_LABEL_FONT_SIZE = 40;
 
-static const int DEVIDE_TWO = 2;
-
 CertificateUserForm::CertificateUserForm(void)
        : __pCertificatePresentationModelInstance(null)
        , __installFromSDCardPopup(null)
index f33985e..594d999 100644 (file)
@@ -34,7 +34,6 @@ using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
 static const int ID_GROUP_COUNT = 1;
-static const int DEVIDE_TWO = 2;
 
 CertificateUserInstallForm::CertificateUserInstallForm(void)
        : __pCertificatePresentationModelInstance(null)
index eed3fc9..34ee964 100644 (file)
@@ -37,22 +37,10 @@ static const int IDA_CERTIFICATE_USER_FORM_FOOTER_CANCEL = IDA_CERTIFICATE_USER_
 
 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)
index 0e49c91..011524d 100644 (file)
@@ -69,7 +69,6 @@ static const int H_TIME_FIELD = 150;
 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;
index cee1b3b..82fed6c 100644 (file)
@@ -63,7 +63,6 @@ static const int H_HELP_TEXT_GAP = 6;
 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)
index 2335103..e8b30fd 100644 (file)
@@ -47,6 +47,8 @@ static const int ID_GROUP_FONT_TEXT_ITEM_COUNT = 0;
 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)
@@ -212,7 +214,7 @@ FontSizeForm::CreateGroupItem(int groupIndex, int itemWidth)
                {
                        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;
 
@@ -338,6 +340,7 @@ FontSizeForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        }
 
        ItemTypeOneLine(itemRectangle);
+       itemRectangle.height = itemRectangle.height + H_GROUP_INDEX_HELP_TEXT_GAP;
 
        RelativeLayout relativeLayout;
        relativeLayout.Construct();
@@ -477,7 +480,7 @@ FontSizeForm::UpdateGroupItem(int groupIndex, Tizen::Ui::Controls::TableViewGrou
        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);
index 6a0e409..cad077f 100644 (file)
@@ -42,7 +42,6 @@ static const int ID_ITEM_KEYBOARD_HARDWARE_SELECT_KEYBOARD = 0;
 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)
index c8b09e5..6fe4574 100644 (file)
@@ -57,7 +57,6 @@ static const int FIRST_CONTROL = 0;
 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;
 
index d36b63b..18a112e 100644 (file)
@@ -65,12 +65,18 @@ PrivacyForm::OnInitializing(void)
 {
        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
@@ -103,13 +109,14 @@ PrivacyForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId
        }
 }
 
-void
+result
 PrivacyForm::InitPrivacyAppPackageList(void)
 {
        __pPrivacyManager = PrivacyManager::GetInstance();
        if (__pPrivacyManager == null)
        {
                AppLogDebug("pPrivacyManager is null");
+               return E_FAILURE;
        }
 
        __privacyPackageList = static_cast<ArrayList*>(__pPrivacyManager->GetPrivacyAppPackageListN());
@@ -117,13 +124,21 @@ PrivacyForm::InitPrivacyAppPackageList(void)
        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)
        {
@@ -136,15 +151,17 @@ PrivacyForm::GetDisplayPackageName(int itemIndex)
        {
                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
index 9c0e73a..73155dc 100644 (file)
@@ -153,6 +153,7 @@ const int Y_ITEM_TYPE_4_LABEL_SUB = H_ITEM_TYPE_4_LABEL_MAIN;
 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;
index 2f93520..a378e90 100644 (file)
@@ -34,7 +34,6 @@ using namespace Tizen::Ui::Scenes;
 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;
@@ -352,7 +351,14 @@ WallpaperAlbumListDetailForm::CreateIconListView(void)
 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);
 }
 
index ab73d79..5553c92 100644 (file)
@@ -34,6 +34,12 @@ static const int W_FOLDER_SIZE = 334;
 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)
@@ -190,14 +196,7 @@ WallpaperAlbumListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& prev
 
        __pPresentationModel->InitializeAlbumInfoList();
        __itemCount = __pPresentationModel->GetFolderCount();
-       if (__pIconListView == null)
-       {
-               CreateIconListView();
-       }
-       else
-       {
-               __pIconListView->UpdateList();
-       }
+       UpdateIconListView();
        CreateHeader(ResourceManager::GetString(L"IDS_MP_BODY_ADD_IMAGE"));
        CreateFooter();
 }
@@ -210,6 +209,11 @@ WallpaperAlbumListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& cur
 void
 WallpaperAlbumListForm::CreateIconListView(void)
 {
+       if (__pIconListView != null)
+       {
+               __pIconListView->UpdateList();
+               return;
+       }
        Dimension itemSize(W_FOLDER_SIZE, H_FOLDER_SIZE);
 
        __pIconListView = new (std::nothrow) IconListView();
@@ -227,7 +231,14 @@ WallpaperAlbumListForm::CreateIconListView(void)
 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);
 }
 
@@ -238,11 +249,119 @@ WallpaperAlbumListForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::C
        {
                __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
index e463b1c..03ccc70 100644 (file)
@@ -39,8 +39,6 @@ using namespace Tizen::Ui::Scenes;
 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)