Font Size Modificaion related Changes
[apps/osp/Calendar.git] / src / ClImportForm.cpp
index 8316e02..6a234c8 100644 (file)
@@ -52,6 +52,8 @@ ImportForm::ImportForm(void)
        , __pThread(null)
        , __pProgressPopup(null)
        , __calendarId(INVALID_RECORD_ID)
+       , __fontSize(44.f)
+       , __itemHeight(112.f)
 {
 }
 
@@ -68,6 +70,35 @@ ImportForm::Initialize(void)
 result
 ImportForm::OnInitializing(void)
 {
+       String fontSizeString;
+       Tizen::System::SettingInfo::GetValue(L"http://tizen.org/setting/font.size", fontSizeString);
+
+       AppLogDebug("fontSize: %ls", fontSizeString.GetPointer());
+       if (fontSizeString == L"small")
+       {
+               __fontSize = 36.f;
+               __itemHeight = 120.f;
+       }
+       else if (fontSizeString == L"medium")
+       {
+               __fontSize = 44.f;
+               __itemHeight = 140.f;
+       }
+       else if (fontSizeString == L"large")
+       {
+               __fontSize = 64.f;
+               __itemHeight = 157.f;
+       }
+       else if (fontSizeString == L"huge")
+       {
+               __fontSize = 81.f;
+               __itemHeight = 176.f;
+       }
+       else if (fontSizeString == L"giant")
+       {
+               __fontSize = 106.f;
+               __itemHeight = 205.f;
+       }
        __pListViewContents = dynamic_cast<ListView*>(GetControl(L"IDC_LISTVIEW"));
        TryReturn(__pListViewContents != null, E_FAILURE, "[E_FAILURE] Unable to get listview.");
        __pListViewContents->SetItemProvider(*this);
@@ -347,8 +378,9 @@ ImportForm::CreateItem(int index, int itemWidth)
        if (pEvent != null)
        {
                EventItem* pItem = new (std::nothrow) EventItem();
-               pItem->Initialize(pEvent->GetRecordId() != INVALID_RECORD_ID ? EVENT_ITEM_STYLE_NORMAL : EVENT_ITEM_STYLE_SELECTION, itemWidth);
+               pItem->Initialize(pEvent->GetRecordId() != INVALID_RECORD_ID ? EVENT_ITEM_STYLE_NORMAL : EVENT_ITEM_STYLE_SELECTION, itemWidth, __itemHeight);
                pItem->SetTitle(pEvent->GetSubject());
+               pItem->SetFontSize(__fontSize);
                pItem->SetCalendarColor(pEvent->GetRecordId() != INVALID_RECORD_ID ? GetCalendarColor(pEvent->GetCalendarId()) : Color());
                pItem->SetLocation(pEvent->GetLocation());
                DateTime startTime = ResourceManager::ConvertUtcTimeToWallTime(pEvent->GetStartTime());
@@ -365,8 +397,9 @@ ImportForm::CreateItem(int index, int itemWidth)
        if (pTodo != null)
        {
                TaskItem* pItem = new (std::nothrow) TaskItem();
-               pItem->Initialize(pTodo->GetRecordId() != INVALID_RECORD_ID ? TASK_ITEM_STYLE_NORMAL : TASK_ITEM_STYLE_SELECTION, itemWidth);
+               pItem->Initialize(pTodo->GetRecordId() != INVALID_RECORD_ID ? TASK_ITEM_STYLE_NORMAL : TASK_ITEM_STYLE_SELECTION, itemWidth,__itemHeight);
                pItem->SetTitle(pTodo->GetSubject());
+               pItem->SetFontSize(__fontSize);
                pItem->SetCalendarColor(pTodo->GetRecordId() != INVALID_RECORD_ID ? GetCalendarColor(pTodo->GetCalendarId()) : Color());
                pItem->SetLocation(pTodo->GetLocation());
                pItem->SetDueDate(ResourceManager::ConvertUtcTimeToWallTime(pTodo->GetDueDate()), __pDateTimeFormatter);