</option>
<option id="gnu.cpp.compiler.option.include.paths.1578788940" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/AppControl/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/ConvList/Controller/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/ConvList/View/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/Main/Controller/inc}""/>
</option>
<option id="gnu.cpp.compiler.option.include.paths.2132319922" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/AppControl/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/ConvList/Controller/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/ConvList/View/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/Main/Controller/inc}""/>
${CMAKE_CURRENT_SOURCE_DIR}/src/Conversation/ContactList/Controller/inc/
${CMAKE_CURRENT_SOURCE_DIR}/src/Conversation/ConvList/View/inc/
${CMAKE_CURRENT_SOURCE_DIR}/src/Conversation/ConvList/Controller/inc/
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/Conversation/AppControl/inc/
${CMAKE_CURRENT_SOURCE_DIR}/src/MsgThread/Controller/inc/
${CMAKE_CURRENT_SOURCE_DIR}/src/MsgThread/View/inc/
${CMAKE_CURRENT_SOURCE_DIR}/src/Settings/Controller/inc/
--- /dev/null
+/*
+ * Copyright (c) 2009-2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef ContactViewer_h_
+#define ContactViewer_h_
+
+#include "AppControlUtils.h"
+
+namespace Msg
+{
+ /**
+ * An utility-class aimed to launch contacts-application with view-operation passed via app-control.
+ */
+ class ContactViewer
+ {
+ public:
+ ContactViewer();
+
+ /**
+ * Launches view-operation.
+ * @param personId Contact person id
+ * @return true in case of success, otherwise returns false.
+ */
+ static bool launch(int personId);
+
+ private:
+ ContactViewer(const ContactViewer&) = delete;
+ ContactViewer& operator=(const ContactViewer&) = delete;
+ };
+}
+
+#endif /* ContactViewer_h_ */
--- /dev/null
+/*
+ * Copyright (c) 2009-2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "ContactViewer.h"
+#include "Logger.h"
+
+#include <app_control.h>
+#include <string>
+
+using namespace Msg;
+
+namespace
+{
+ const char* mimeContact = "application/vnd.tizen.contact";
+}
+
+ContactViewer::ContactViewer()
+{
+}
+
+bool ContactViewer::launch(int personId)
+{
+ bool res = false;
+ app_control_h svc_handle = nullptr;
+
+ if(APP_CONTROL_ERROR_NONE == app_control_create(&svc_handle))
+ {
+ app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_VIEW);
+ app_control_set_mime(svc_handle, mimeContact);
+ app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_ID, std::to_string(personId).c_str());
+ app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);
+ int ret = app_control_send_launch_request(svc_handle, nullptr, nullptr);
+ MSG_LOG("Result code: ", ret);
+ res = ret == APP_CONTROL_ERROR_NONE;
+ app_control_destroy(svc_handle);
+ }
+
+ return res;
+}
+
//TODO: We have to request a possibility to acquire phone numbers and emails at the same time
app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_TYPE, resultTypePhone);
+ app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);
int ret = app_control_send_launch_request(svc_handle, APP_CONTROL_RES_CALLBACK(ContactPicker, onAppControlRes), this);
MSG_LOG("launching contacts, result-code: ", ret);
res = (ret == APP_CONTROL_ERROR_NONE);
#include "RecipientItem.h"
#include "LangUtils.h"
#include "CallbackAssist.h"
+#include "ContactViewer.h"
#include <Elementary.h>
#include <sstream>
// TODO: impl for email
ContactPersonNumber contactPersonNumber = getApp().getContactManager().getContactPersonNumber(address);
if(contactPersonNumber.isValid())
- {
- // TODO: show Phone-Contacts
- }
+ ContactViewer::launch(contactPersonNumber.getPersonId());
else
- {
showRecipPopup(address);
- }
}
void Conversation::navigateTo(MsgId msgId)