Fix N_SE-36411 and N_SE-36349 issue and code clean up
authorTaeHo Choi <thanks.choi@samsung.com>
Fri, 26 Apr 2013 07:26:58 +0000 (16:26 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Fri, 26 Apr 2013 07:26:58 +0000 (16:26 +0900)
Change-Id: I5b6079bc2c0abbd5a3bc3b329a3cdc74a80e68db
Signed-off-by: TaeHo Choi <thanks.choi@samsung.com>
23 files changed:
inc/StTypes.h
inc/StWallpaperAlbumListDetailForm.h
src/StAccessibilityForm.cpp
src/StCertificateTrustedRootForm.cpp
src/StCertificateUserForm.cpp
src/StCertificateUserInstallForm.cpp
src/StDateTimeForm.cpp
src/StDisplayForm.cpp
src/StDownloadedApplicationForm.cpp
src/StFontForm.cpp
src/StKeyboardInfoForm.cpp
src/StLanguageAndRegionForm.cpp
src/StManageApplicationInfoForm.cpp
src/StNfcForm.cpp
src/StNfcPredefinedItemForm.cpp
src/StPrivacyForm.cpp
src/StScreenTypeForm.cpp
src/StTimeZoneForm.cpp
src/StTypes.cpp
src/StWallpaperAlbumListDetailForm.cpp
src/StWallpaperAlbumListForm.cpp
src/StWallpaperImageSelectForm.cpp
src/StWifiForm.cpp

index f06a577..dfb9c45 100644 (file)
@@ -157,7 +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 DIVIDE_BY_TWO;
 extern const int LINE_COUNT_2;
 extern const int LINE_COUNT_3;
 extern const int LINE_COUNT_4;
index 3198e5a..082bd77 100644 (file)
@@ -32,6 +32,7 @@ class WallpaperAlbumListDetailForm
        , public Tizen::Ui::IActionEventListener
        , public Tizen::Ui::IOrientationEventListener
        , public Tizen::Ui::Scenes::ISceneEventListener
+       , public Tizen::App::IAppControlResponseListener
 {
 public:
        WallpaperAlbumListDetailForm(void);
@@ -55,6 +56,7 @@ public:
        virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
        virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
        virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+       virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
 
 private:
        void CreateIconListView(void);
@@ -65,6 +67,7 @@ private:
 
 private:
        int __itemCount;
+       Tizen::Base::UuId* __pContentId;
        WallpaperAlbumListPresentationModel* __pPresentationModel;
        Tizen::Ui::Controls::IconListView* __pIconListView;
        Tizen::Base::Collection::ArrayList* __pAlbumPathList;
index 3526667..40bff14 100644 (file)
@@ -49,7 +49,6 @@ static const int ID_GROUP_SPEED_AT_WHICH_THE_TEXT_IS_SPOKEN = 2;
 
 static const int ID_GROUP_COUNT = 3;
 static const int REFRESH_GROUP_INDEX = -1;
-static const int DEVIDE_BY_TWO = 2;
 
 AccessibilityForm::AccessibilityForm(void)
        : ttsSpeechRate(0)
index ac8da0d..b87009c 100644 (file)
@@ -402,8 +402,8 @@ CertificateTrustedRootForm::CreateNoContents(void)
                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);
+               int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+               int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                Label* pLabel = new (std::nothrow) Label();
                pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index c73fb6e..5ada92e 100644 (file)
@@ -153,8 +153,8 @@ CertificateUserForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previou
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index 2df8414..811f0ca 100644 (file)
@@ -122,8 +122,8 @@ CertificateUserInstallForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId&
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index 0813afe..7c04a56 100644 (file)
@@ -66,8 +66,6 @@ static const int NEXT_INDEX = 1;
 static const int W_RESIZE_LABEL_GAP = 170;
 static const int H_TIME_FIELD = 150;
 
-static const int DIVIDE_BY_TWO = 2;
-
 static const int SECOND_CONTROL_ITEM = 1;
 static const int SECOND_TEXT_ITEM = 2;
 static const int MIN_YEAR = 1970;
@@ -123,6 +121,7 @@ DateTimeForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneI
        __pTableView->UpdateTableView();
        __pTableView->CollapseGroup(ID_GROUP_DATE_AND_TIME_FORMAT_LIST);
        __pTableView->RefreshItem(ID_GROUP_DATE_AND_TIME_FORMAT, 0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+       __pTableView->RefreshItem(ID_GROUP_DATE_AND_TIME_LOCAL_TIME, 1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
 
        if (SettingInfo::GetValue(SETTING_INFO_KEY_LOCALE_UPDATE_AUTO, automaticUpdate) == E_SUCCESS)
        {
@@ -592,7 +591,7 @@ DateTimeForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                        }
 
                        detailArrow = itemMainRectangle;
-                       detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
+                       detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
                        detailArrow.height = W_DETAIL_ARROW_BUTTON;
                        detailArrow.width = W_DETAIL_ARROW_BUTTON;
 
@@ -958,6 +957,6 @@ DateTimeForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::Group
 void
 DateTimeForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
 {
-       __pTableView->RefreshItem(ID_GROUP_DATE_AND_TIME_LOCAL_TIME, ID_ITEM_DATE_AND_TIME_DATE_AND_TIME, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
        BaseForm::OnOrientationChanged(source, orientationStatus);
+       __pTableView->RefreshItem(ID_GROUP_DATE_AND_TIME_LOCAL_TIME, ID_ITEM_DATE_AND_TIME_DATE_AND_TIME, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
 }
\ No newline at end of file
index 3ffd24f..ab700be 100644 (file)
@@ -323,7 +323,7 @@ DisplayForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        if (pBitmap)
        {
                detailArrow = itemMainRectangle;
-               detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
+               detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
                detailArrow.height = W_DETAIL_ARROW_BUTTON;
                detailArrow.width = W_DETAIL_ARROW_BUTTON;
 
@@ -523,7 +523,7 @@ DisplayForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::Tabl
                        pLabelBitmap->SetBackgroundBitmap(*pBitmap);
 
                        detailArrow = mainRectangle;
-                       detailArrow.y = mainRectangle.y + ((pItemRectangle.height - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
+                       detailArrow.y = mainRectangle.y + ((pItemRectangle.height - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
                        detailArrow.height = W_DETAIL_ARROW_BUTTON;
                        detailArrow.width = W_DETAIL_ARROW_BUTTON;
                        pLabelBitmap->SetBounds(detailArrow);
index c7de8a7..ffbd27d 100644 (file)
@@ -754,8 +754,8 @@ DownloadedApplicationForm::UpdateTableViewAndNoContent(void)
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index aad5090..9f9db20 100644 (file)
@@ -362,7 +362,7 @@ FontForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                        }
 
                        detailArrow = itemMainRectangle;
-                       detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
+                       detailArrow.y = itemMainRectangle.y + ((itemHeight - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
                        detailArrow.height = W_DETAIL_ARROW_BUTTON;
                        detailArrow.width = W_DETAIL_ARROW_BUTTON;
 
@@ -566,7 +566,7 @@ FontForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::TableVi
                        Label* pSecondLabel = static_cast<Label*>(pItem->GetControl(FONT_FORM_SECOND_CONTROL));
                        Label* pThirdLabel = static_cast<Label*>(pItem->GetControl(FONT_FORM_THIRD_CONTROL));
                        Rectangle detailArrow = pSecondLabel->GetBounds();
-                       detailArrow.y = itemMainRectangle.y + ((pItemBounds.height - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
+                       detailArrow.y = itemMainRectangle.y + ((pItemBounds.height - W_DETAIL_ARROW_BUTTON) / DIVIDE_BY_TWO);
 
                        pFirstLabel->SetBounds(itemMainRectangle);
                        pFirstLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
index 7037980..9fa64ce 100644 (file)
@@ -137,8 +137,8 @@ KeyboardInfoForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSc
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index 3e679de..2c619fe 100644 (file)
@@ -728,7 +728,7 @@ LocaleForm::CreateGroupItem(int groupIndex, int itemWidth)
                                }
                                itemHeight += tmpHeight;
                        }
-                       yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP / DEVIDE_TWO;
+                       yItemOffset = H_GROUP_INDEX_HELP_TEXT_TOP_GAP / DIVIDE_BY_TWO;
                }
                break;
 
index fd81078..ba078f9 100644 (file)
@@ -50,7 +50,7 @@ static const int ID_GROUP_APPLICATION_CLEAR_DEFAULT_HELP = 3;
 
 static const int ID_GROUP_APPLICATION_DETAIL = 4;
 
-static const int ID_TOTAL_GROUP_COUNT = 5;
+static const int ID_TOTAL_GROUP_COUNT = 2;
 
 static const int IDA_FORCE_STOP = 300;
 static const int IDA_UNINSTALL = 310;
@@ -76,7 +76,6 @@ static const int COMMAND_BUTTON_GAP = 20;
 static const int APPLICATION_NAME_MARGIN_GAP = 100;
 static const int APPLICATION_NAME_SECOND_CONTROL = 1;
 
-static const int DIVIDE_BY_TWO = 2;
 static const int KILOBYTE_TO_MEGABYTE = 1024;
 static const int MEGABYTE_TO_GIGABYTE = 1024;
 
index aa4aa37..6169035 100644 (file)
@@ -50,7 +50,6 @@ static const int ID_GROUP_NFC_PREDEFINED_ITEM_HELP_TEXT_LABEL = -1;
 
 static const int NFC_NOT_SUPPORT_PREDEFINED_ITEM_GROUP_COUNT = 2;
 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;
 
index dcbd4eb..bb72dc3 100644 (file)
@@ -42,7 +42,6 @@ static const int ID_GROUP_NFC_PREDEFINED_ITEM_LIST = 1;
 static const int ID_GROUP_NFC_PREDEFINED_ITEM_LIST_DEFAULT_COUNT = 0;\r
 \r
 static const int NFC_PREDEFINED_ITEM_DEFAULT_GROUP_COUNT = 2;\r
-static const int DIVIDE_BY_TWO = 2;\r
 static const int W_TEXT_GAP = 30;\r
 \r
 NfcPredefinedItemForm::NfcPredefinedItemForm(void)\r
index 4cc1455..bb4a063 100644 (file)
@@ -505,8 +505,8 @@ PrivacyForm::UpdateTableViewAndNoContent(void)
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index 79d4c91..592bd19 100644 (file)
@@ -587,8 +587,8 @@ ScreenTypeForm::UpdateTableViewAndNoContent(void)
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index 50b2b2e..b614d8f 100644 (file)
@@ -40,35 +40,14 @@ static const int ID_GROUP_MAX_ITEM_COUNT = 10;
 static const int IDA_FOOTER_ITEM_NAME = 100;
 static const int IDA_FOOTER_ITEM_TIME = 101;
 
-static const int X_FIRST_LINE_SUB_TEXT = 520;
-static const int W_FIRST_LINE_SUB_TEXT = 180;
-
-static const int TEXT_SIZE = 10;
-
 static const int MINUTES_TO_HOUR = 60;
-static const int GMT_START = -12;
-static const int GMT_END = 14;
-
-static const int NEXT_INDEX = 1;
-static const int DIVIDE_BY_TEN = 10;
-static const int DIVIDE_BY_TWO = 2;
-static const int MULTI_BY_SEVEN = 7;
-static const int MULTI_BY_THREE = 3;
-static const int MULTI_BY_EIGHT = 8;
-static const int MULTI_BY_TWO = 2;
-
-static const int GMT_TEXT_GAP = 20;
+
 static const int GROUP_INDEX_DEFAULT_LABEL_HEIGHT = 40;
 
 static const int H_SEARCH_BAR = 86;
-static const int H_SEARCH_BAR_ITEM = H_SEARCH_BAR;
 static const int Y_TABLE_VIEW_AREA = H_SEARCH_BAR;
 
-static const int H_PORTRAIT_KEY_PAD_INPUT_MODE_GAP = 0;
-static const int H_LANDSCAPE_KEY_PAD_INPUT_MODE_GAP = 0;
-
 static const int W_GMT_FIXED_SIZE = 200;
-static const int COUNTRY_TEXT_GAP = 30;
 
 TimeZoneForm::TimeZoneForm(void)
        : __isAppControlRequest(false)
@@ -590,6 +569,10 @@ TimeZoneForm::OnTextValueChanged(const Tizen::Ui::Control& source)
 void
 TimeZoneForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 {
+       if (__sortTabSelect == actionId)
+       {
+               return;
+       }
        switch (actionId)
        {
        case IDA_FOOTER_ITEM_NAME:
@@ -736,6 +719,11 @@ TiemZoneComparer::Compare(const Tizen::Base::Object& obj1, const Tizen::Base::Ob
        case DATA_TYPE_GMT:
                {
                        cmp = static_cast<const TimeZoneData&>(obj1).GetGMTData().CompareTo(static_cast<const TimeZoneData&>(obj2).GetGMTData());
+
+                       if (cmp == 0)
+                       {
+                               cmp = static_cast<const TimeZoneData&>(obj1).GetCountryData().CompareTo(static_cast<const TimeZoneData&>(obj2).GetCountryData());
+                       }
                }
                break;
 
index 430ca82..6ecc293 100644 (file)
@@ -153,7 +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 DIVIDE_BY_TWO = 2;
 const int LINE_COUNT_2 = 2;
 const int LINE_COUNT_3 = 3;
 const int LINE_COUNT_4 = 4;
index 5f8b409..62307cf 100644 (file)
  * @brief              This is the implementation file for WallpaperAlbumListDetailForm class.
  */
 
+#include <FSystem.h>
+#include <FIo.h>
 #include "StSettingScenesList.h"
 #include "StTypes.h"
 #include "StWallpaperAlbumListDetailForm.h"
 
+using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Content;
 using namespace Tizen::Graphics;
+using namespace Tizen::Io;
+using namespace Tizen::System;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
@@ -41,11 +46,15 @@ static const int LINE_COUNT_DEFAULT = 1;
 
 static const int BASE_FORM_DEFAULT_MARGIN = 32;
 
+static const String IMAGE_VIEWER_APP_ID = L"tizen.imageviewer";
+static const String IMAGE_VIEWER_CROP_OPERATION_ID = L"http://tizen.org/appcontrol/operation/image/crop";
+
 WallpaperAlbumListDetailForm::WallpaperAlbumListDetailForm(void)
        : __itemCount(0)
        , __pPresentationModel(null)
        , __pIconListView(null)
        , __pAlbumPathList(null)
+       , __pContentId(null)
 {
 }
 
@@ -112,8 +121,8 @@ WallpaperAlbumListDetailForm::UpdateIconListView(void)
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
@@ -272,6 +281,34 @@ WallpaperAlbumListDetailForm::OnIconListViewItemStateChanged(IconListView& view,
        AppLogDebug("ENTER");
        if (status == ICON_LIST_VIEW_ITEM_SELECTED)
        {
+#if 0
+               IList* pContentIdList = __pPresentationModel->GetContentIdList();
+               __pContentId = static_cast<ContentId*>(pContentIdList->GetAt(index));
+               HashMap extraData;
+               extraData.Construct();
+               String typeKey = L"http://tizen.org/appcontrol/data/image/crop_mode";
+               String typeVal = L"fit_to_screen";
+               extraData.Add(&typeKey, &typeVal);
+
+               ContentManager pContentManager;
+               pContentManager.Construct();
+               ImageContentInfo* pImageContentInfo = static_cast<ImageContentInfo*>(pContentManager.GetContentInfoN(*__pContentId));
+
+               Rectangle rect = GetClientAreaBounds();
+               if (pImageContentInfo == null)
+               {
+                       AppLogDebug("pImageContentInfo is null");
+                       return;
+               }
+               String uri = String(L"file://") + pImageContentInfo->GetContentPath();
+
+               AppControl* pAc = AppManager::FindAppControlN(IMAGE_VIEWER_APP_ID, IMAGE_VIEWER_CROP_OPERATION_ID);
+               if (pAc)
+               {
+                       pAc->Start(&uri, null, &extraData, this);
+                       delete pAc;
+               }
+#else
                SceneManager* pSceneManager = SceneManager::GetInstance();
 
                IList* pContentIdList = __pPresentationModel->GetContentIdList();
@@ -282,6 +319,7 @@ WallpaperAlbumListDetailForm::OnIconListViewItemStateChanged(IconListView& view,
                aList->Add(pContentId);
 
                pSceneManager->GoForward(ForwardSceneTransition(IDSCN_WALLPAPER_IMAGE_SELECT, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), aList);
+#endif
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
@@ -396,6 +434,172 @@ WallpaperAlbumListDetailForm::OnUserEventReceivedN(RequestId requestId, Tizen::B
 }
 
 void
+WallpaperAlbumListDetailForm::OnAppControlCompleteResponseReceived(const AppId& appId, const Tizen::Base::String& operationId, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
+{
+       if (appId.Equals(IMAGE_VIEWER_APP_ID)&&
+               operationId.Equals(IMAGE_VIEWER_CROP_OPERATION_ID))
+       {
+               if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
+               {
+                       int argIndex = 0;
+                       AppLog("Image crop succeeded.");
+                       String* pStr = WallpaperAlbumListPresentationModel::GetInstance()->GetHomeLockArgument();
+                       if (pStr->Equals(L"0", true))
+                       {
+                               argIndex = 0;
+                       }
+                       else if (pStr->Equals(L"1", true))
+                       {
+                               argIndex = 1;
+                       }
+                       else if (pStr->Equals(L"2", true))
+                       {
+                               argIndex = 2;
+                       }
+                       if (pExtraData)
+                       {
+                               IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+                               while (pEnum->MoveNext() == E_SUCCESS)
+                               {
+                                       String* pKey = dynamic_cast<String*>(pEnum->GetKey());
+                                       if (pKey->Equals(String(L"http://tizen.org/appcontrol/data/selected")))
+                                       {
+                                               IList* pValueList = dynamic_cast<IList*>(pEnum->GetValue());
+                                               if (pValueList)
+                                               {
+                                                       for (int i=0; i<pValueList->GetCount(); i++)
+                                                       {
+                                                               if (__pContentId == null)
+                                                               {
+                                                                       delete pEnum;
+                                                                       return;
+                                                               }
+                                                               ContentManager pContentManager;
+                                                               pContentManager.Construct();
+                                                               ImageContentInfo* pImageContentInfo = static_cast<ImageContentInfo*>(pContentManager.GetContentInfoN(*__pContentId));
+
+                                                               if (pImageContentInfo == null)
+                                                               {
+                                                                       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);
+
+                                                                       break;
+                                                               }
+
+                                                               String dstPath = Application::GetInstance()->GetAppDataPath();
+                                                               String srcPath = *dynamic_cast<String*>(pValueList->GetAt(i));
+                                                               String srcFileExtention = File::GetFileExtension(srcPath);
+
+                                                               switch (argIndex)
+                                                               {
+                                                               case 0:
+                                                                       {
+                                                                               dstPath.Append(L"/home.");
+                                                                               dstPath.Append(srcFileExtention);
+                                                                               File::Copy(srcPath, dstPath, false);
+
+                                                                               if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
+                                                                               {
+                                                                                       AppLogDebug("Wallpapaer Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
+                                                                               }
+                                                                       }
+                                                                       break;
+
+                                                               case 1:
+                                                                       {
+                                                                               dstPath.Append(L"/lock.");
+                                                                               dstPath.Append(srcFileExtention);
+                                                                               File::Copy(srcPath, dstPath, false);
+
+                                                                               if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
+                                                                               {
+                                                                                       AppLogDebug("Wallpapaer Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
+                                                                               }
+                                                                       }
+                                                                       break;
+
+                                                               case 2:
+                                                                       {
+                                                                               dstPath.Append(L"/homelock.");
+                                                                               dstPath.Append(srcFileExtention);
+                                                                               File::Copy(srcPath, dstPath, false);
+
+                                                                               if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
+                                                                               {
+                                                                                       AppLogDebug("Wallpapaer Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
+                                                                                       return;
+                                                                               }
+                                                                               if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
+                                                                               {
+                                                                                       AppLogDebug("Wallpapaer Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
+                                                                                       return;
+                                                                               }
+                                                                       }
+                                                                       break;
+
+                                                               default:
+                                                                       break;
+                                                               }
+                                                               SceneManager* pSceneManager = SceneManager::GetInstance();
+                                                               AppAssert(pSceneManager);
+                                                               IListT<SceneId>* sceneList = pSceneManager->GetSceneHistoryN();
+                                                               pSceneManager->ClearSceneHistory();
+                                                               int sceneIndex = 0;
+                                                               while (sceneIndex < sceneList->GetCount())
+                                                               {
+                                                                       String* pSceneId = new (std::nothrow) String();
+                                                                       sceneList->GetAt(sceneIndex++, *pSceneId);
+                                                                       if (pSceneId->Equals(IDSCN_WALLPAPER_ALBUM_LIST, true) == true)
+                                                                       {
+                                                                               if (pSceneManager->IsSceneAlive(*pSceneId) == true)
+                                                                               {
+                                                                                       pSceneManager->DestroyScene(*pSceneId);
+                                                                               }
+                                                                               delete pSceneId;
+                                                                               continue;
+                                                                       }
+
+                                                                       pSceneManager->AddToSceneHistory(*pSceneId);
+                                                                       delete pSceneId;
+                                                               }
+                                                               pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+                                                       }
+                                               }
+                                       }
+                               }
+                               delete pEnum;
+                       }
+                       return;
+               }
+               else if (appControlResult == APP_CTRL_RESULT_FAILED)
+               {
+                       AppLog("Image crop failed.");
+               }
+               else if (appControlResult == APP_CTRL_RESULT_CANCELED)
+               {
+                       AppLog("Image crop was canceled.");
+               }
+               else if (appControlResult == APP_CTRL_RESULT_TERMINATED)
+               {
+                       AppLog("Image crop was terminated.");
+               }
+               else if (appControlResult == APP_CTRL_RESULT_ABORTED)
+               {
+                       AppLog("Image crop was aborted.");
+               }
+
+               __pPresentationModel->InitializeAlbumInfoList();
+               SetAllAlbumPathList();
+               __pPresentationModel->InitializeFileList(__pAlbumPathList);
+               __itemCount = __pPresentationModel->GetFileCount();
+               UpdateIconListView();
+       }
+}
+
+void
 WallpaperAlbumListDetailForm::SetAllAlbumPathList(void)
 {
        String isAllAlbum = *static_cast<String*>(__pAlbumPathList->GetAt(0));
index 57d4968..2d1b767 100644 (file)
@@ -316,8 +316,8 @@ WallpaperAlbumListForm::UpdateIconListView(void)
                        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);
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
 
                        Label* pLabel = new (std::nothrow) Label();
                        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
index 5dc0838..167e365 100644 (file)
@@ -267,6 +267,12 @@ WallpaperImageSelectForm::CreateImage(void)
        pContentManager.Construct();
        ImageContentInfo* pImageContentInfo = static_cast<ImageContentInfo*>(pContentManager.GetContentInfoN(*__pContentId));
 
+       if (pImageContentInfo == null)
+       {
+               AppLogDebug("pImageContentInfo is null");
+               return;
+       }
+
        Rectangle rect = GetClientAreaBounds();
        Bitmap* pBitmap = ResourceManager::GetApplicationBitmapN(pImageContentInfo->GetContentPath());
        Rectangle clientRect = GetClientAreaBounds();
@@ -287,8 +293,8 @@ WallpaperImageSelectForm::CreateImage(void)
                bitmapHeight = pBitmap->GetHeight() * bitmapWidthRate;
                bitmapWidth = pBitmap->GetWidth() * bitmapWidthRate;
        }
-       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DEVIDE_TWO);
-       int yPos = (clientRect.height / LINE_COUNT_2) - (bitmapHeight / DEVIDE_TWO);
+       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+       int yPos = (clientRect.height / LINE_COUNT_2) - (bitmapHeight / DIVIDE_BY_TWO);
 
        Label* pLabel = new (std::nothrow) Label();
        pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
@@ -325,8 +331,8 @@ WallpaperImageSelectForm::OnOrientationChanged(const Tizen::Ui::Control& source,
                bitmapHeight = pBitmap->GetHeight() * bitmapWidthRate;
                bitmapWidth = pBitmap->GetWidth() * bitmapWidthRate;
        }
-       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DEVIDE_TWO);
-       int yPos = (clientRect.height / LINE_COUNT_2) - (bitmapHeight / DEVIDE_TWO);
+       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
+       int yPos = (clientRect.height / LINE_COUNT_2) - (bitmapHeight / DIVIDE_BY_TWO);
        pLabel->SetBounds(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight));
        Invalidate(true);
 }
\ No newline at end of file
index 4324727..783d773 100644 (file)
@@ -38,7 +38,6 @@ static const int IDA_POPUP_ACTION_ID_BASE = 200;
 static const int IDA_FOOTER_WIFI_SCAN = IDA_POPUP_ACTION_ID_BASE + 1;
 
 static const int W_RESIZE_LABEL_GAP = 170;
-static const int DIVIDE_BY_TWO = 2;
 
 static const int ID_GROUP_STATUS_COUNT_TURN_OFF = 2;
 static const int ID_GROUP_STATUS_COUNT_TURN_ON = 4;