static const int H_EXPANDED_NAME_FIELDS = 672;
static const int H_BUTTON = 74;
static const int W_THUMBNAIL = 360;
-static const int W_TITLE_LABEL = 160;
+static const int W_TITLE_LABEL = 170;
static const int X_MORE_INFORMATION_BUTTON = 60;
static const int Y_MORE_INFORMATION_BUTTON = 30;
static const int Y_DEFAULT_NUMBER_BUTTON = 19;
static const wchar_t* INPUT_TYPE_URL = L"url";
static const wchar_t* VIEW_TYPE = L"viewType";
static const wchar_t* VIEW_TYPE_VALUE_CONTACT = L"contact";
+static const wchar_t* VIEW_TYPE_CONTACT_ID = L"contactId";
ContactEditorForm::ContactEditorForm(void)
: __isExpandable(false)
Rectangle clientBounds = GetClientAreaBounds();
__pTableView->SetSize(clientBounds.width, clientBounds.height);
-
- if (__pCurrentFocusedItem != null)
- {
- SetFocus();
- }
}
break;
case IDA_BUTTON_MORE_INFO:
pDeleteButton->SetShowState(true);
- pEditField->HideKeypad();
- __pTableView->UpdateTableView();
- pEditField->ShowKeypad();
+ int index;
+ int groupIndex;
+ int itemCount;
+
+ Integer::Decode(pEditField->GetName(), index);
+ groupIndex = (index & TABLE_VIEW_GROUP_INDEX_MASK) >> TABLE_VIEW_GROUP_INDEX_SHIFT;
+ itemCount = __pTableView->GetItemCountAt(groupIndex);
+ if (groupIndex == TABLE_VIEW_PHONE_NUMBER_FIELD_INDEX)
+ {
+ if (itemCount == 1)
+ {
+ __isDefaultPhoneNumberButtonEnabled = true;
+ __pTableView->RefreshItem(groupIndex, __pTableView->GetItemCountAt(groupIndex), TABLE_VIEW_REFRESH_TYPE_ITEM_ADD);
+ }
+ else
+ {
+ itemCount--;
+ }
+ }
+ __pTableView->RefreshItem(groupIndex, itemCount, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD);
}
void
pViewType->Append(DELIMITER);
pViewType->Append(VIEW_TYPE_VALUE_CONTACT);
- pValueType->Append(RETURN_TYPE_ITEM_ID);
+ pValueType->Append(VIEW_TYPE_CONTACT_ID);
pValueType->Append(DELIMITER);
pValueType->Append(Integer::ToString(__pPresentationModel->GetContactId()));
* @brief This is the implementation file for the ContactsApp class.
*/
+#include <FIo.h>
#include "CtContactsApp.h"
#include "CtContactListPresentationModel.h"
#include "CtGroupContactListPresentationModel.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
+using namespace Tizen::Io;
using namespace Tizen::System;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
static const wchar_t* CONTACT_ID = L"contactId";
static const wchar_t* PATH = L"path";
static const wchar_t* VALUE_VIEW_TYPE_CONTACT = L"contact";
+static const wchar_t* VALUE_VIEW_TYPE_VCF = L"vcf";
+static const wchar_t* VIEW_MIME_TYPE_VCF = L"text/x-vcard";
+static const wchar_t* VIEW_URI_VCF_PREFIX = L"file:///";
ContactsApp::ContactsApp(void)
: __initialSceneId(IDSCN_CONTACT_LIST)
}
const String* pItemType = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_TYPE)));
- if (pItemType == null || pItemType->Equals(ITEM_TYPE_CONTACT, true) == false)
+ if (pItemType == null || pItemType->Equals(ITEM_TYPE_PERSON, true) == false)
{
AppLogDebug("To launch AppControl by the view operation, the item type should be input.");
AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
__initialSceneId = IDSCN_CONTACT_DETAILS;
__operationId = OPERATION_ID_VIEW;
}
- else if (operationId.Equals(OPERATION_ID_CONFIGURE, true))
- {
- __initialSceneId = IDSCN_SETTINGS;
- __operationId = OPERATION_ID_CONFIGURE;
- }
else if (operationId.Equals(OPERATION_ID_VIEW, true))
{
- if (pExtraData == null)
+ if (pMimeType == null || pMimeType->Equals(VIEW_MIME_TYPE_VCF, true) == false)
{
- AppLogDebug("To launch AppControl by the VIEW operation, the (key,value) pairs should be input.");
+ AppLogDebug("To launch AppControl by the view operation, the mime type should be input.");
+ AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
Terminate();
return;
}
- String* pViewType = new (std::nothrow) String(VIEW_TYPE);
- pViewType->Append(DELIMITER);
- pViewType->Append(*static_cast<const String*>(pExtraData->GetValue(String(VIEW_TYPE))));
- pArgs->Add(pViewType);
+ if (pUriData == null)
+ {
+ AppLogDebug("To launch AppControl by the view operation, the uri data should be input.");
+ AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
+ Terminate();
+
+ return;
+ }
- String* key = null;
- const String* value = null;
+ String vcfPrefix(VIEW_URI_VCF_PREFIX);
+ String path;
- value = static_cast<const String*>(pExtraData->GetValue(String(PATH)));
- if (value)
+ if (pUriData->StartsWith(vcfPrefix, 0) == false)
{
- key = new (std::nothrow) String(PATH);
- key->Append(DELIMITER);
- key->Append(*value);
- pArgs->Add(key);
+ AppLogDebug("To launch AppControl by the view operation, the uri data should be input.");
+ AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
+ Terminate();
+
+ return;
}
- value = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_ID)));
- if (value)
+ pUriData->SubString(vcfPrefix.GetLength() - 1, pUriData->GetLength() - vcfPrefix.GetLength() + 1, path);
+
+ if (File::IsFileExist(path) == false)
{
- key = new (std::nothrow) String(CONTACT_ID);
- key->Append(DELIMITER);
- key->Append(*value);
- pArgs->Add(key);
+ AppLogDebug("The vcf file is not existed.");
+ AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
+ Terminate();
+
+ return;
}
+ String* pViewType = new (std::nothrow) String(VIEW_TYPE);
+ pViewType->Append(DELIMITER);
+ pViewType->Append(VALUE_VIEW_TYPE_VCF);
+ pArgs->Add(pViewType);
+
+ String* pKey = new (std::nothrow) String(PATH);
+ pKey->Append(DELIMITER);
+ pKey->Append(path);
+ pArgs->Add(pKey);
+
__initialSceneId = IDSCN_CONTACT_DETAILS;
__operationId = OPERATION_ID_VIEW;
}
static const int IDA_FOOTER_MORE = 0;
static const int IDA_FOOTER_CREATE = 1;
-static const int IDA_MORE_DELETE = 2;
+static const int IDA_MORE_EDIT = 2;
static const int IDA_HEADER_CONTACTS = 10;
static const int IDA_HEADER_GROUPS = 11;
static const int IDA_HEADER_FAVORITES = 12;
__pContextMenuMore = new (std::nothrow) ContextMenu();
__pContextMenuMore->Construct(Point(X_MORE, clientBounds.y + clientBounds.height), CONTEXT_MENU_STYLE_LIST);
- __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_SK_DELETE"), IDA_MORE_DELETE);
+ __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_SK_EDIT"), IDA_MORE_EDIT);
__pContextMenuMore->AddActionEventListener(*this);
return E_SUCCESS;
__pContextMenuMore->Show();
}
break;
- case IDA_MORE_DELETE:
+ case IDA_MORE_EDIT:
{
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_GROUP_LIST_EDITOR));
}