TizenRefApp-4925 Migrate application class 20/50820/5
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Wed, 4 Nov 2015 13:43:58 +0000 (15:43 +0200)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Wed, 4 Nov 2015 13:43:58 +0000 (15:43 +0200)
Change-Id: Ib0220d5450756dc2960825fea65c7ab5131ac8ed
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
16 files changed:
CMakeLists.txt
contacts/tizen-manifest.xml.in [deleted file]
main-app/CMakeLists.txt [moved from contacts/CMakeLists.txt with 100% similarity]
main-app/inc/MainApp.h [new file with mode: 0755]
main-app/inc/OperationController.h [new file with mode: 0644]
main-app/inc/OperationDefaultController.h [new file with mode: 0644]
main-app/shared/res/contacts.png [moved from contacts/shared/res/contacts.png with 100% similarity]
main-app/shared/res/phone.png [new file with mode: 0755]
main-app/smack.efl.in [moved from contacts/smack.efl.in with 100% similarity]
main-app/smack.manifest.in [moved from contacts/smack.manifest.in with 100% similarity]
main-app/src/MainApp.cpp [new file with mode: 0755]
main-app/src/OperationController.cpp [new file with mode: 0644]
main-app/src/OperationDefaultController.cpp [new file with mode: 0644]
main-app/src/main.cpp [moved from contacts/src/main.cpp with 83% similarity]
main-app/tizen-manifest.xml.in [new file with mode: 0644]
packaging/org.tizen.contacts.spec

index 378b352..464fe81 100644 (file)
@@ -3,7 +3,9 @@ project(${PACKAGE} C CXX)
 
 include(FindPkgConfig)
 pkg_check_modules(TIZEN_PACKAGES REQUIRED
+       badge
        capi-appfw-application
+       capi-appfw-preference
        contacts-service2
        dlog
        efl-extension
@@ -31,4 +33,4 @@ add_definitions("-DEDJDIR=\"${EDJDIR}\"")
 add_definitions("-DIMGDIR=\"${IMGDIR}\"")
 
 add_subdirectory(lib-common)
-add_subdirectory(contacts)
+add_subdirectory(main-app)
diff --git a/contacts/tizen-manifest.xml.in b/contacts/tizen-manifest.xml.in
deleted file mode 100644 (file)
index 45cc66f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="@PACKAGE@" version="1.0.0">
-       <profile name="mobile"/>
-       <ui-application appid="@PACKAGE@" exec="@BINDIR@/contacts" hw-acceleration="use-GL" multiple="false" nodisplay="false" taskmanage="true" type="capp">
-               <label>Contacts</label>
-               <label xml:lang="ar-ae">الأسماء</label>
-               <label xml:lang="az-az">Adlar</label>
-               <label xml:lang="bg-bg">Телефонен указател</label>
-               <label xml:lang="ca-es">Contactes</label>
-               <label xml:lang="cs-cz">Kontakty</label>
-               <label xml:lang="da-dk">Kontakter</label>
-               <label xml:lang="de-de">Kontakte</label>
-               <label xml:lang="el-gr">Επαφές</label>
-               <label xml:lang="en-gb">Contacts</label>
-               <label xml:lang="en-ph">Contacts</label>
-               <label xml:lang="en-us">Contacts</label>
-               <label xml:lang="es-es">Contactos</label>
-               <label xml:lang="es-mx">Contactos</label>
-               <label xml:lang="et-ee">Kontaktid</label>
-               <label xml:lang="eu-es">Kontaktuak</label>
-               <label xml:lang="fi-fi">Yhteystiedot</label>
-               <label xml:lang="fr-ca">Contacts</label>
-               <label xml:lang="fr-fr">Contacts</label>
-               <label xml:lang="ga-ie">Teagmhálaithe</label>
-               <label xml:lang="gl-es">Contactos</label>
-               <label xml:lang="hi-in">संपर्क</label>
-               <label xml:lang="hr-hr">Imenik</label>
-               <label xml:lang="hu-hu">Névjegyek</label>
-               <label xml:lang="hy-am">Կոնտակտներ</label>
-               <label xml:lang="is-is">Tengiliðir</label>
-               <label xml:lang="it-it">Rubrica</label>
-               <label xml:lang="ja-jp">電話帳</label>
-               <label xml:lang="ka-ge">კონტაქტები</label>
-               <label xml:lang="kk-kz">Контактілер</label>
-               <label xml:lang="ko-kr">연락처</label>
-               <label xml:lang="lt-lt">Adresatai</label>
-               <label xml:lang="lv-lv">Kontakti</label>
-               <label xml:lang="mk-mk">Именик</label>
-               <label xml:lang="nb-no">Kontakter</label>
-               <label xml:lang="nl-nl">Contacten</label>
-               <label xml:lang="pl-pl">Kontakty</label>
-               <label xml:lang="pt-br">Contatos</label>
-               <label xml:lang="pt-pt">Contactos</label>
-               <label xml:lang="ro-ro">Contacte</label>
-               <label xml:lang="ru-ru">Контакты</label>
-               <label xml:lang="sk-sk">Kontakty</label>
-               <label xml:lang="sl-si">Imenik</label>
-               <label xml:lang="sr-rs">Kontakti</label>
-               <label xml:lang="sv-se">Kontakter</label>
-               <label xml:lang="tr-tr">Rehber</label>
-               <label xml:lang="uk-ua">Контакти</label>
-               <label xml:lang="uz-uz">Kontaktlar</label>
-               <label xml:lang="zh-cn">联系人</label>
-               <label xml:lang="zh-hk">聯絡人</label>
-               <label xml:lang="zh-tw">聯絡人</label>
-               <icon>contacts.png</icon>
-       </ui-application>
-</manifest>
diff --git a/main-app/inc/MainApp.h b/main-app/inc/MainApp.h
new file mode 100755 (executable)
index 0000000..470016e
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015 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 MAIN_APP_H
+#define MAIN_APP_H
+
+#include "App/Application.h"
+
+namespace Ui
+{
+       class Navigator;
+       class Window;
+}
+
+class OperationController;
+
+class MainApp : public App::Application
+{
+public:
+       MainApp();
+
+       /**
+        * @return Application main Window
+        */
+       Ui::Window *getWindow() const;
+
+       /**
+        * @return Application main Navigator
+        */
+       Ui::Navigator *getNavigator() const;
+
+private:
+       virtual bool onCreate() override;
+       virtual void onAppControl(app_control_h request) override;
+       virtual void onPause() override;
+       virtual void onResume() override;
+       virtual void onTerminate() override;
+       static void onLanguageChanged(app_event_info_h event, void *data);
+
+       Ui::Window *m_Window;
+       Ui::Navigator *m_Navigator;
+       OperationController *m_Controller;
+};
+
+#endif /* MAIN_APP_H */
diff --git a/main-app/inc/OperationController.h b/main-app/inc/OperationController.h
new file mode 100644 (file)
index 0000000..af4a0cb
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2015 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 OPERATION_CONTROLLER_H
+#define OPERATION_CONTROLLER_H
+
+#include <app_control.h>
+
+enum Operation
+{
+       OPERATION_DEFAULT = 1 << 0,
+       OPERATION_DIAL    = 1 << 1,
+       OPERATION_ADD     = 1 << 2,
+       OPERATION_EDIT    = 1 << 3,
+       OPERATION_VIEW    = 1 << 4,
+       OPERATION_PICK    = 1 << 5
+};
+
+class MainApp;
+
+/**
+ * @brief Handles operations requested through App Control
+ */
+class OperationController
+{
+public:
+       virtual ~OperationController();
+
+       /**
+        * @brief Create operation controller
+        * @param[in]   application     Main application instance
+        */
+       void create(MainApp *application);
+
+       /**
+        * @brief Request the controller to handle the operation
+        */
+       void request(Operation operation, app_control_h request);
+
+       /**
+        * @brief Called when application receives pause event
+        */
+       virtual void onPause() { }
+
+       /**
+        * @brief Called when application receives resume event
+        */
+       virtual void onResume() { }
+
+       /**
+        * @brief Check if operation is supported by the controller
+        */
+       bool isOperationSupported(Operation operation) const;
+
+       /**
+        * @brief Get operation from string representation
+        * @param[in]   operation   Operation string representation
+        * @return Operation value
+        */
+       static Operation getOperation(const char *operation);
+
+protected:
+       /**
+        * @brief Create operation controller
+        * @param[in]   supportedOperations     Supported operations mask
+        * @see Operation
+        */
+       OperationController(int supportedOperations);
+
+       /**
+        * @return Main application instance
+        */
+       MainApp *getApplication() const;
+
+       /**
+        * @return Last received request
+        */
+       app_control_h getRequest() const;
+
+       /**
+        * @brief Send failure reply to the last request
+        */
+       void replyFailure();
+
+       /**
+        * @brief Called after create() is called
+        */
+       virtual void onCreate() { }
+
+       /**
+        * @brief Called when application receives App Control request
+        */
+       virtual void onRequest(Operation operation, app_control_h request) = 0;
+
+private:
+       int m_SupportedOperations;
+       MainApp *m_Application;
+       app_control_h m_Request;
+};
+
+#endif /* OPERATION_CONTROLLER_H */
diff --git a/main-app/inc/OperationDefaultController.h b/main-app/inc/OperationDefaultController.h
new file mode 100644 (file)
index 0000000..b59ec93
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015 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 OPERATION_DEFAULT_CONTROLLER_H
+#define OPERATION_DEFAULT_CONTROLLER_H
+
+#include "OperationController.h"
+#include <string>
+
+namespace Ui
+{
+       class View;
+       class Navigator;
+}
+
+class OperationDefaultController : public OperationController
+{
+public:
+       OperationDefaultController();
+       virtual ~OperationDefaultController() override;
+
+private:
+       enum TabId
+       {
+               TabFirst,
+               TabDialer = TabFirst,
+               TabLogs,
+               TabContacts,
+               TabMax
+       };
+
+       virtual void onCreate() override;
+       virtual void onRequest(Operation operation, app_control_h request) override;
+
+       static std::string getPhoneNumber(app_control_h appControl);
+       static unsigned getBadgeCount(const char *package);
+
+       void saveLastTab();
+       static TabId getLastTab();
+
+       Ui::Navigator *m_Navigator;
+       Ui::View *m_Tabs[TabMax];
+};
+
+#endif /* OPERATION_DEFAULT_CONTROLLER_H */
diff --git a/main-app/shared/res/phone.png b/main-app/shared/res/phone.png
new file mode 100755 (executable)
index 0000000..803d1a3
Binary files /dev/null and b/main-app/shared/res/phone.png differ
similarity index 100%
rename from contacts/smack.efl.in
rename to main-app/smack.efl.in
diff --git a/main-app/src/MainApp.cpp b/main-app/src/MainApp.cpp
new file mode 100755 (executable)
index 0000000..7d8382a
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2015 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 <contacts.h>
+
+#include "MainApp.h"
+#include "Ui/Window.h"
+#include "Ui/Naviframe.h"
+#include "Utils/Logger.h"
+
+#include "OperationDefaultController.h"
+/* TODO:
+#include "OperationEditController.h"
+#include "OperationViewController.h"
+#include "OperationPickController.h"
+ */
+
+#define APP_BASE_SCALE 2.6
+
+MainApp::MainApp()
+       : m_Window(nullptr), m_Navigator(nullptr), m_Controller(nullptr)
+{
+}
+
+Ui::Window *MainApp::getWindow() const
+{
+       return m_Window;
+}
+
+Ui::Navigator *MainApp::getNavigator() const
+{
+       return m_Navigator;
+}
+
+bool MainApp::onCreate()
+{
+       int err = contacts_connect();
+       RETVM_IF(err != CONTACTS_ERROR_NONE, false, "contacts_connect() failed(%d)", err);
+
+       app_event_handler_h handle = nullptr;
+       ui_app_add_event_handler(&handle, APP_EVENT_LANGUAGE_CHANGED,
+                       &MainApp::onLanguageChanged, this);
+
+       elm_app_base_scale_set(APP_BASE_SCALE);
+
+       m_Window = new Ui::Window();
+       m_Window->create(nullptr);
+
+       m_Navigator = new Ui::Naviframe();
+       m_Window->attachView(m_Navigator);
+
+       return true;
+}
+
+void MainApp::onAppControl(app_control_h request)
+{
+       char *operationStr = nullptr;
+       app_control_get_operation(request, &operationStr);
+
+       Operation operation = OperationController::getOperation(operationStr);
+       if (!m_Controller || !m_Controller->isOperationSupported(operation)) {
+               delete m_Controller;
+               m_Controller = nullptr;
+
+               switch (operation) {
+                       case OPERATION_DEFAULT:
+                       case OPERATION_DIAL:
+                               m_Controller = new OperationDefaultController();
+                               break;
+                       case OPERATION_ADD:
+                       case OPERATION_EDIT:
+                               /* TODO: m_Controller = new OperationEditController(); */
+                               break;
+                       case OPERATION_VIEW:
+                               /* TODO: m_Controller = new OperationViewController(); */
+                               break;
+                       case OPERATION_PICK:
+                               /* TODO: m_Controller = new OperationPickController(); */
+                               break;
+               }
+
+               if (m_Controller) {
+                       m_Controller->create(this);
+               }
+       }
+
+       if (m_Controller) {
+               m_Controller->request(operation, request);
+       }
+
+       free(operationStr);
+}
+
+void MainApp::onPause()
+{
+       if (m_Controller) {
+               m_Controller->onPause();
+       }
+}
+
+void MainApp::onResume()
+{
+       if (m_Controller) {
+               m_Controller->onResume();
+       }
+}
+
+void MainApp::onTerminate()
+{
+       delete m_Controller;
+       m_Controller = nullptr;
+
+       contacts_disconnect();
+}
+
+void MainApp::onLanguageChanged(app_event_info_h event, void *data)
+{
+       char *lang = nullptr;
+       app_event_get_language(event, &lang);
+       if (lang) {
+               elm_language_set(lang);
+               free(lang);
+       }
+}
diff --git a/main-app/src/OperationController.cpp b/main-app/src/OperationController.cpp
new file mode 100644 (file)
index 0000000..1e3e92d
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2015 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 "OperationController.h"
+
+#include <string.h>
+
+OperationController::OperationController(int supportedOperations)
+       : m_SupportedOperations(supportedOperations), m_Application(nullptr), m_Request(nullptr)
+{
+}
+
+OperationController::~OperationController()
+{
+       app_control_destroy(m_Request);
+}
+
+void OperationController::create(MainApp *application)
+{
+       m_Application = application;
+       onCreate();
+}
+
+void OperationController::request(Operation operation, app_control_h request)
+{
+       app_control_destroy(m_Request);
+       m_Request = request;
+       onRequest(operation, request);
+}
+
+bool OperationController::isOperationSupported(Operation operation) const
+{
+       return (m_SupportedOperations & operation) != 0;
+}
+
+Operation OperationController::getOperation(const char *operation)
+{
+       if (!operation) {
+               return OPERATION_DEFAULT;
+       }
+       if (strcmp(operation, APP_CONTROL_OPERATION_DEFAULT) == 0) {
+               return OPERATION_DEFAULT;
+       }
+       if (strcmp(operation, APP_CONTROL_OPERATION_DIAL) == 0) {
+               return OPERATION_DIAL;
+       }
+       if (strcmp(operation, APP_CONTROL_OPERATION_ADD) == 0) {
+               return OPERATION_ADD;
+       }
+       if (strcmp(operation, APP_CONTROL_OPERATION_EDIT) == 0) {
+               return OPERATION_EDIT;
+       }
+       if (strcmp(operation, APP_CONTROL_OPERATION_VIEW) == 0) {
+               return OPERATION_VIEW;
+       }
+       if (strcmp(operation, APP_CONTROL_OPERATION_PICK) == 0) {
+               return OPERATION_PICK;
+       }
+
+       return OPERATION_DEFAULT;
+}
+
+MainApp *OperationController::getApplication() const
+{
+       return m_Application;
+}
+
+app_control_h OperationController::getRequest() const
+{
+       return m_Request;
+}
+
+void OperationController::replyFailure()
+{
+       app_control_h reply;
+       app_control_create(&reply);
+       app_control_reply_to_launch_request(reply, m_Request, APP_CONTROL_RESULT_FAILED);
+       app_control_destroy(reply);
+}
diff --git a/main-app/src/OperationDefaultController.cpp b/main-app/src/OperationDefaultController.cpp
new file mode 100644 (file)
index 0000000..c9f63b2
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 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 "OperationDefaultController.h"
+
+#include "MainApp.h"
+#include "Ui/TabView.h"
+
+#include <app_preference.h>
+#include <badge.h>
+
+#define APP_CONTROL_PHONE_APPID "org.tizen.phone"
+#define APP_CONTROL_URI_DIAL "tel:"
+
+#define PREFERENCE_KEY_LAST_TAB "last_tab"
+
+OperationDefaultController::OperationDefaultController()
+       : OperationController(OPERATION_DEFAULT | OPERATION_DIAL),
+         m_Navigator(nullptr), m_Tabs{nullptr}
+{
+}
+
+OperationDefaultController::~OperationDefaultController()
+{
+       saveLastTab();
+}
+
+void OperationDefaultController::onCreate()
+{
+       Ui::Navigator *mainNavigator = getApplication()->getNavigator();
+       m_Navigator = new Ui::TabView();
+       mainNavigator->navigateTo(m_Navigator);
+
+       /* TODO:
+       m_Tabs[TabDialer] = new Phone::DialerView();
+       m_Tabs[TabLogs] = new Phone::Logs::ListView();
+       m_Tabs[TabContacts] = new Contacts::ListView();
+        */
+
+       for (auto &&tab : m_Tabs) {
+               m_Navigator->navigateTo(tab);
+       }
+}
+
+void OperationDefaultController::onRequest(Operation operation, app_control_h request)
+{
+       char *appId = nullptr;
+       app_control_get_app_id(request, &appId);
+
+       TabId selectedTab = TabContacts;
+       if (operation == OPERATION_DIAL) {
+               /* TODO:
+               Phone::DialerView *dialer = static_cast<Phone::DialerView *>(m_Tabs[TabDialer]);
+               dialer->setNumber(getPhoneNumber(request));
+                */
+
+               selectedTab = TabDialer;
+       } else if (appId && strcmp(appId, APP_CONTROL_PHONE_APPID) == 0) {
+               if (getBadgeCount(APP_CONTROL_PHONE_APPID) > 0) {
+                       selectedTab = TabLogs;
+               } else {
+                       selectedTab = getLastTab();
+               }
+       }
+
+       m_Navigator->navigateTo(m_Tabs[selectedTab]);
+
+       free(appId);
+}
+
+std::string OperationDefaultController::getPhoneNumber(app_control_h appControl)
+{
+       std::string number;
+
+       char *uri = nullptr;
+       app_control_get_uri(appControl, &uri);
+
+       size_t length = sizeof(APP_CONTROL_URI_DIAL) - 1;
+       if (uri && strncmp(uri, APP_CONTROL_URI_DIAL, length) == 0) {
+               number = uri + length;
+       }
+
+       free(uri);
+       return number;
+}
+
+unsigned OperationDefaultController::getBadgeCount(const char *package)
+{
+       unsigned count = 0;
+       badge_get_count(package, &count);
+       return count;
+}
+
+void OperationDefaultController::saveLastTab()
+{
+       Ui::View *currentTab = m_Navigator->getCurrentView();
+       for (int tab = TabFirst; tab < TabMax; ++tab) {
+               if (currentTab == m_Tabs[tab]) {
+                       if (tab != TabContacts) {
+                               preference_set_int(PREFERENCE_KEY_LAST_TAB, tab);
+                       }
+
+                       break;
+               }
+       }
+}
+
+OperationDefaultController::TabId OperationDefaultController::getLastTab()
+{
+       TabId lastTab = TabDialer;
+       preference_get_int(PREFERENCE_KEY_LAST_TAB, (int *) &lastTab);
+       return lastTab;
+}
similarity index 83%
rename from contacts/src/main.cpp
rename to main-app/src/main.cpp
index 3775554..61d4586 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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
  *
@@ -15,8 +15,9 @@
  *
  */
 
+#include "MainApp.h"
 
 int main(int argc, char *argv[])
 {
-       return 0;
+       return MainApp().run(argc, argv);
 }
diff --git a/main-app/tizen-manifest.xml.in b/main-app/tizen-manifest.xml.in
new file mode 100644 (file)
index 0000000..0c4ddb0
--- /dev/null
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="@PACKAGE@" version="1.0.0">
+       <ui-application appid="@PACKAGE@" exec="@BINDIR@/contacts" hw-acceleration="use-GL" multiple="false" nodisplay="false" taskmanage="true" type="capp">
+               <icon>contacts.png</icon>
+               <label>Contacts</label>
+               <label xml:lang="ar-ae">الأسماء</label>
+               <label xml:lang="az-az">Adlar</label>
+               <label xml:lang="bg-bg">Телефонен указател</label>
+               <label xml:lang="ca-es">Contactes</label>
+               <label xml:lang="cs-cz">Kontakty</label>
+               <label xml:lang="da-dk">Kontakter</label>
+               <label xml:lang="de-de">Kontakte</label>
+               <label xml:lang="el-gr">Επαφές</label>
+               <label xml:lang="en-gb">Contacts</label>
+               <label xml:lang="en-ph">Contacts</label>
+               <label xml:lang="en-us">Contacts</label>
+               <label xml:lang="es-es">Contactos</label>
+               <label xml:lang="es-mx">Contactos</label>
+               <label xml:lang="et-ee">Kontaktid</label>
+               <label xml:lang="eu-es">Kontaktuak</label>
+               <label xml:lang="fi-fi">Yhteystiedot</label>
+               <label xml:lang="fr-ca">Contacts</label>
+               <label xml:lang="fr-fr">Contacts</label>
+               <label xml:lang="ga-ie">Teagmhálaithe</label>
+               <label xml:lang="gl-es">Contactos</label>
+               <label xml:lang="hi-in">संपर्क</label>
+               <label xml:lang="hr-hr">Imenik</label>
+               <label xml:lang="hu-hu">Névjegyek</label>
+               <label xml:lang="hy-am">Կոնտակտներ</label>
+               <label xml:lang="is-is">Tengiliðir</label>
+               <label xml:lang="it-it">Rubrica</label>
+               <label xml:lang="ja-jp">電話帳</label>
+               <label xml:lang="ka-ge">კონტაქტები</label>
+               <label xml:lang="kk-kz">Контактілер</label>
+               <label xml:lang="ko-kr">연락처</label>
+               <label xml:lang="lt-lt">Adresatai</label>
+               <label xml:lang="lv-lv">Kontakti</label>
+               <label xml:lang="mk-mk">Именик</label>
+               <label xml:lang="nb-no">Kontakter</label>
+               <label xml:lang="nl-nl">Contacten</label>
+               <label xml:lang="pl-pl">Kontakty</label>
+               <label xml:lang="pt-br">Contatos</label>
+               <label xml:lang="pt-pt">Contactos</label>
+               <label xml:lang="ro-ro">Contacte</label>
+               <label xml:lang="ru-ru">Контакты</label>
+               <label xml:lang="sk-sk">Kontakty</label>
+               <label xml:lang="sl-si">Imenik</label>
+               <label xml:lang="sr-rs">Kontakti</label>
+               <label xml:lang="sv-se">Kontakter</label>
+               <label xml:lang="tr-tr">Rehber</label>
+               <label xml:lang="uk-ua">Контакти</label>
+               <label xml:lang="uz-uz">Kontaktlar</label>
+               <label xml:lang="zh-cn">联系人</label>
+               <label xml:lang="zh-hk">聯絡人</label>
+               <label xml:lang="zh-tw">聯絡人</label>
+       </ui-application>
+       <ui-application appid="org.tizen.phone" exec="@BINDIR@/contacts" hw-acceleration="use-GL" multiple="false" nodisplay="false" taskmanage="true" type="capp">
+               <icon>phone.png</icon>
+               <label>Phone</label>
+               <label xml:lang="ar-ae">الهاتف</label>
+               <label xml:lang="az-az">Telefon</label>
+               <label xml:lang="bg-bg">Телефон</label>
+               <label xml:lang="ca-es">Telèfon</label>
+               <label xml:lang="cs-cz">Telefon</label>
+               <label xml:lang="da-dk">Telefon</label>
+               <label xml:lang="de-de">Telefon</label>
+               <label xml:lang="el-gr">Τηλέφωνο</label>
+               <label xml:lang="en-gb">Phone</label>
+               <label xml:lang="en-ph">Phone</label>
+               <label xml:lang="en-us">Phone</label>
+               <label xml:lang="es-es">Teléfono</label>
+               <label xml:lang="es-mx">Teléfono</label>
+               <label xml:lang="et-ee">Telefon</label>
+               <label xml:lang="eu-es">Telefon</label>
+               <label xml:lang="fi-fi">Puhelin</label>
+               <label xml:lang="fr-ca">Téléphone</label>
+               <label xml:lang="fr-fr">Téléphone</label>
+               <label xml:lang="ga-ie">Teileafón</label>
+               <label xml:lang="gl-es">Teléfono</label>
+               <label xml:lang="hi-in">टेलीफोन</label>
+               <label xml:lang="hr-hr">Telefon</label>
+               <label xml:lang="hu-hu">Telefon</label>
+               <label xml:lang="hy-am">Հեռախոս</label>
+               <label xml:lang="is-is">Sími</label>
+               <label xml:lang="it-it">Telefono</label>
+               <label xml:lang="ja-jp">電話</label>
+               <label xml:lang="ka-ge">ტელეფონი</label>
+               <label xml:lang="kk-kz">Телефон</label>
+               <label xml:lang="ko-kr">일반 전화</label>
+               <label xml:lang="lt-lt">Telefonas</label>
+               <label xml:lang="lv-lv">Tālrunis</label>
+               <label xml:lang="mk-mk">Телефон</label>
+               <label xml:lang="nb-no">Telefon</label>
+               <label xml:lang="nl-nl">Telefoon</label>
+               <label xml:lang="pl-pl">Telefon</label>
+               <label xml:lang="pt-br">Telefone</label>
+               <label xml:lang="pt-pt">Telefone</label>
+               <label xml:lang="ro-ro">Telefon</label>
+               <label xml:lang="ru-ru">Телефон</label>
+               <label xml:lang="sk-sk">Telefón</label>
+               <label xml:lang="sl-si">Telefon</label>
+               <label xml:lang="sr-rs">Telefon</label>
+               <label xml:lang="sv-se">Telefon</label>
+               <label xml:lang="tr-tr">Telefon</label>
+               <label xml:lang="uk-ua">Телефон</label>
+               <label xml:lang="uz-uz">Telefon</label>
+               <label xml:lang="zh-cn">电话</label>
+               <label xml:lang="zh-hk">電話</label>
+               <label xml:lang="zh-tw">電話</label>
+               <app-control>
+                       <operation name="http://tizen.org/appcontrol/operation/dial" />
+                       <uri name="tel" />
+               </app-control>
+       </ui-application>
+       <privileges>
+               <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+               <privilege>http://tizen.org/privilege/contact.read</privilege>
+               <privilege>http://tizen.org/privilege/contact.write</privilege>
+       </privileges>
+</manifest>
index a53e9fe..72c4814 100644 (file)
@@ -8,7 +8,9 @@ Source: %{name}-%{version}.tar.gz
 
 BuildRequires: cmake
 BuildRequires: edje-bin
+BuildRequires: pkgconfig(badge)
 BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-appfw-preference)
 BuildRequires: pkgconfig(contacts-service2)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(efl-extension)