diff options
-rw-r--r-- | core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | core/Tools/BookmarkFolder.cpp | 52 | ||||
-rw-r--r-- | core/Tools/BookmarkFolder.h | 75 | ||||
-rw-r--r-- | services/BookmarkFlowUI/BookmarkFlowUI.cpp | 6 | ||||
-rw-r--r-- | services/BookmarkFlowUI/BookmarkFlowUI.h | 1 | ||||
-rw-r--r-- | services/BookmarkManagerUI/BookmarkManagerUI.cpp | 25 | ||||
-rw-r--r-- | services/BookmarkManagerUI/BookmarkManagerUI.h | 3 | ||||
-rw-r--r-- | services/SessionStorage/SqlStorage.cpp | 189 | ||||
-rw-r--r-- | services/SessionStorage/SqlStorage.h | 48 | ||||
-rw-r--r-- | services/SimpleUI/CMakeLists.txt | 3 | ||||
-rw-r--r-- | services/SimpleUI/InputPopup.cpp | 240 | ||||
-rw-r--r-- | services/SimpleUI/InputPopup.h | 89 | ||||
-rw-r--r-- | services/SimpleUI/SimpleUI.cpp | 43 | ||||
-rw-r--r-- | services/SimpleUI/SimpleUI.h | 7 | ||||
-rw-r--r-- | services/SimpleUI/edc/InputPopup_mob.edc | 996 | ||||
-rw-r--r-- | services/SimpleUI/images/input_ic_cancel.png | bin | 0 -> 3039 bytes | |||
-rw-r--r-- | services/SimpleUI/images_mob/input_ic_cancel.png | bin | 0 -> 3039 bytes | |||
-rw-r--r-- | services/StorageService/Storage/include/SQLDatabase.h | 2 |
18 files changed, 1767 insertions, 14 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 9ad0ff5a..e67b28e5 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -35,6 +35,7 @@ set(browserCore_SRCS Tools/BrowserImage.cpp Tools/Blob.cpp Tools/BookmarkItem.cpp + Tools/BookmarkFolder.cpp Tools/CapiWebErrorCodes.cpp Tools/FeedItem.cpp Tools/FeedChannel.cpp @@ -73,6 +74,7 @@ set(browserCore_HDRS Tools/EflTools.h Tools/Blob.h Tools/BookmarkItem.h + Tools/BookmarkFolder.h Tools/CapiWebErrorCodes.h Tools/GeneralTools.h Tools/FeedItem.h diff --git a/core/Tools/BookmarkFolder.cpp b/core/Tools/BookmarkFolder.cpp new file mode 100644 index 00000000..402938ff --- /dev/null +++ b/core/Tools/BookmarkFolder.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * 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. + */ + +/* + * BookmarkFolder.cpp + * + * Created on: Nov 26, 2015 + * Author: m.kawonczyk@samsung.com + */ + +#include "browser_config.h" +#include "BookmarkFolder.h" + +#include <string> +#include <Evas.h> + +namespace tizen_browser{ +namespace services{ + +BookmarkFolder::BookmarkFolder() + : m_id(0), + m_name(), + m_count(0) +{ +} + +BookmarkFolder::BookmarkFolder(unsigned int id, const std::string& name, unsigned int count) + : m_id(id), + m_name(name), + m_count(count) +{ +} + +BookmarkFolder::~BookmarkFolder() +{ +} + +} +} diff --git a/core/Tools/BookmarkFolder.h b/core/Tools/BookmarkFolder.h new file mode 100644 index 00000000..d59ff52f --- /dev/null +++ b/core/Tools/BookmarkFolder.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * 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. + */ + +/* + * BookmarkFolder.h + * + * Created on: Nov 26, 2015 + * Author: m.kawonczyk@samsung.com + */ + + +#ifndef BOOKMARKFOLDER_H +#define BOOKMARKFOLDER_H + +#include "BrowserLogger.h" +#include "Config.h" +#include "BrowserImage.h" + +namespace tizen_browser { +namespace services { + +class BookmarkFolder +{ +public: + BookmarkFolder(); + BookmarkFolder( + unsigned int id, + const std::string& name, + unsigned int count + ); + virtual ~BookmarkFolder(); + + void setId(int id) { m_id = id; }; + unsigned int getId() const { return m_id; }; + + void setName(const std::string & name) { m_name = name; }; + std::string getName() const { return m_name; }; + + void setCount(int count) { m_count = count; }; + unsigned int getCount() const { return m_count; }; + +private: + unsigned int m_id; + std::string m_name; + unsigned int m_count; +}; + +typedef std::shared_ptr<BookmarkFolder> SharedBookmarkFolder; +typedef std::vector<SharedBookmarkFolder> SharedBookmarkFolderList; + +} + +namespace base_ui { + +typedef services::SharedBookmarkFolder SharedBookmarkFolder; +typedef std::vector<SharedBookmarkFolder> SharedBookmarkFolderList; + +} +} + +#endif // BOOKMARKITEM_H + diff --git a/services/BookmarkFlowUI/BookmarkFlowUI.cpp b/services/BookmarkFlowUI/BookmarkFlowUI.cpp index baff6d6b..000636e9 100644 --- a/services/BookmarkFlowUI/BookmarkFlowUI.cpp +++ b/services/BookmarkFlowUI/BookmarkFlowUI.cpp @@ -282,7 +282,11 @@ void BookmarkFlowUI::_inputCancel_clicked(void * data, Evas_Object *, void *) void BookmarkFlowUI::_folder_clicked(void * data, Evas_Object *, void *) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - M_UNUSED(data); + if (data != nullptr) + { + BookmarkFlowUI* bookmarkFlowUI = static_cast<BookmarkFlowUI*>(data); + bookmarkFlowUI->addFolder(); + } } void BookmarkFlowUI::_remove_clicked(void *data, Evas_Object *, void *) diff --git a/services/BookmarkFlowUI/BookmarkFlowUI.h b/services/BookmarkFlowUI/BookmarkFlowUI.h index 55315160..facfc112 100644 --- a/services/BookmarkFlowUI/BookmarkFlowUI.h +++ b/services/BookmarkFlowUI/BookmarkFlowUI.h @@ -69,6 +69,7 @@ public: boost::signals2::signal<void (BookmarkUpdate)> saveBookmark; boost::signals2::signal<void (BookmarkUpdate)> editBookmark; boost::signals2::signal<void ()> removeBookmark; + boost::signals2::signal<void ()> addFolder; private: Evas_Object* createBookmarkFlowLayout(Evas_Object* parent); void createTitleArea(); diff --git a/services/BookmarkManagerUI/BookmarkManagerUI.cpp b/services/BookmarkManagerUI/BookmarkManagerUI.cpp index 12359a20..3264c77a 100644 --- a/services/BookmarkManagerUI/BookmarkManagerUI.cpp +++ b/services/BookmarkManagerUI/BookmarkManagerUI.cpp @@ -488,7 +488,7 @@ void BookmarkManagerUI::addNewFolder() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); Elm_Object_Item* BookmarkView = elm_gengrid_item_append(m_gengrid, m_folder_new_item_class, - NULL, _bookmarkNewFolderClicked, NULL); + NULL, _bookmarkNewFolderClicked, this); elm_gengrid_item_selected_set(BookmarkView, EINA_FALSE); setEmptyGengrid(false); } @@ -531,6 +531,21 @@ void BookmarkManagerUI::addMobileFolder(std::vector<std::shared_ptr<tizen_browse setEmptyGengrid(false); } +void BookmarkManagerUI::addCustomFolders(services::SharedBookmarkFolderList folders) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + for (auto it = folders.begin(); it != folders.end(); ++it) { + FolderData *folderData = new FolderData(); + folderData->name = (*it)->getName(); + folderData->folder_id = (*it)->getId(); + folderData->count = (*it)->getCount(); + folderData->bookmarkManagerUI.reset(this); + addCustomFolder(folderData); + } + elm_object_part_content_set(b_mm_layout, "elm.swallow.grid", getGenGrid()); + evas_object_show(getGenGrid()); +} + void BookmarkManagerUI::addCustomFolders(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > items) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -628,10 +643,14 @@ void BookmarkManagerUI::_bookmarkCustomFolderClicked(void * data , Evas_Object * } } -void BookmarkManagerUI::_bookmarkNewFolderClicked(void * , Evas_Object *, void *) +void BookmarkManagerUI::_bookmarkNewFolderClicked(void * data, Evas_Object *, void *) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - //TODO: New Folder + if (data != nullptr) + { + BookmarkManagerUI* bookmarkManagerUI = static_cast<BookmarkManagerUI*>(data); + bookmarkManagerUI->newFolderItemClicked(); + } } void BookmarkManagerUI::_bookmarkAllFolderClicked(void * data , Evas_Object *, void *) diff --git a/services/BookmarkManagerUI/BookmarkManagerUI.h b/services/BookmarkManagerUI/BookmarkManagerUI.h index c3743290..f56fc28d 100644 --- a/services/BookmarkManagerUI/BookmarkManagerUI.h +++ b/services/BookmarkManagerUI/BookmarkManagerUI.h @@ -26,6 +26,7 @@ #include "service_macros.h" #include "services/HistoryService/HistoryItem.h" #include "BookmarkItem.h" +#include "BookmarkFolder.h" #include "FocusManager.h" namespace tizen_browser{ @@ -52,6 +53,7 @@ public: void addNewFolder(); void addAllFolder(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> >, std::string); void addMobileFolder(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> >, std::string); + void addCustomFolders(services::SharedBookmarkFolderList folders); void addCustomFolders(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> >); void addDetails(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> >, std::string); void showDetailsUI(); @@ -67,6 +69,7 @@ public: boost::signals2::signal<void (int)> customFolderClicked; boost::signals2::signal<void ()> mobileFolderClicked; boost::signals2::signal<void ()> allFolderClicked; + boost::signals2::signal<void ()> newFolderItemClicked; #endif private: diff --git a/services/SessionStorage/SqlStorage.cpp b/services/SessionStorage/SqlStorage.cpp index bbb2911d..985dfe4c 100644 --- a/services/SessionStorage/SqlStorage.cpp +++ b/services/SessionStorage/SqlStorage.cpp @@ -65,6 +65,19 @@ namespace{ + " ON DELETE CASCADE " + " ); "; + const std::string TABLE_FOLDER = "FOLDER_TABLE"; + const std::string COL_FOLDER_ID = "folder_id"; + const std::string COL_FOLDER_NAME = "name"; + const std::string CONSTRAINT_TABLE_PK = TABLE_FOLDER + "_PK"; + const std::string DDL_CREATE_TABLE_FOLDER + = " CREATE TABLE " + TABLE_FOLDER + + " ( " + COL_FOLDER_ID + " INTEGER, " + + " " + COL_FOLDER_NAME + " TEXT," + + " CONSTRAINT " + CONSTRAINT_TABLE_PK + + " PRIMARY KEY ( " + COL_FOLDER_ID + " ) " + + " ON CONFLICT REPLACE " + + " ); "; + } namespace tizen_browser @@ -117,16 +130,19 @@ bool SqlStorage::initSessionDatabase() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); - try{ - tizen_browser::services::StorageService::checkAndCreateTable(&scope - ,TABLE_SESSION - ,DDL_CREATE_TABLE_SESSION); + try { + tizen_browser::services::StorageService::checkAndCreateTable(&scope, + TABLE_SESSION, + DDL_CREATE_TABLE_SESSION); tizen_browser::services::StorageService::checkAndCreateTable(&scope ,TABLE_URL ,DDL_CREATE_TABLE_URL); + tizen_browser::services::StorageService::checkAndCreateTable(&scope, + TABLE_FOLDER, + DDL_CREATE_TABLE_FOLDER); scope.database()->exec(DDL_CREATE_INDEX_SESSION_DATE); return true; - }catch (storage::StorageException &e){ + } catch (storage::StorageException &e) { BROWSER_LOGE("[ERROR] Session Storage initalization Error code: %d: %s" , __PRETTY_FUNCTION__ , __LINE__ @@ -215,7 +231,6 @@ void SqlStorage::updateSession(tizen_browser::Session::Session& session, const s updateSessionTimeStamp(session, currentTime, connection); session.m_lastModificationTime = currentTime; } - } void SqlStorage::updateSession(Session& session, @@ -346,6 +361,168 @@ std::string SqlStorage::getUrlTitle(const std::string& url) return std::string(); } +services::SharedBookmarkFolder SqlStorage::getFolder(unsigned int id) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + std::string name = getFolderName(id); + services::SharedBookmarkFolder folder; + if (name != "") + folder = std::make_shared<services::BookmarkFolder>(id, name, 0); + return folder; +} + +services::SharedBookmarkFolderList SqlStorage::getFolders() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + services::SharedBookmarkFolderList folders; + int foldersCount = getFoldersCount(); + if (foldersCount != 0) { + boost::format getFoldersString("SELECT %1%, %2% FROM %3% ;"); + getFoldersString % COL_FOLDER_ID % COL_FOLDER_NAME % TABLE_FOLDER; + try { + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> connection = scope.database(); + storage::SQLQuery getFoldersQuery(connection->prepare(getFoldersString.str())); + getFoldersQuery.exec(); + for (int i = 0; i < foldersCount; ++i) { + //todo: bookmark count + services::SharedBookmarkFolder bookmark = std::make_shared<services::BookmarkFolder>(getFoldersQuery.getInt(0), getFoldersQuery.getString(1), 0); + folders.push_back(bookmark); + getFoldersQuery.next(); + } + } catch (storage::StorageException& e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } + } + return folders; +} + +unsigned int SqlStorage::getFoldersCount() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + boost::format getCountString("SELECT COUNT (*) FROM %1% ;"); + getCountString % TABLE_FOLDER; + try { + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> connection = scope.database(); + storage::SQLQuery getCountQuery(connection->prepare(getCountString.str())); + getCountQuery.exec(); + return getCountQuery.getInt(0); + } catch (storage::StorageException& e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } + return 0; +} + +unsigned int SqlStorage::addFolder(const std::string& name) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + boost::format addFolderQueryString("INSERT OR REPLACE INTO %1% ( %2% ) VALUES ( ? );"); + addFolderQueryString % TABLE_FOLDER % COL_FOLDER_NAME; + boost::posix_time::ptime currentTime(boost::posix_time::second_clock::local_time()); + try { + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> db = scope.database(); + storage::SQLQuery addFolderQuery(db->prepare(addFolderQueryString.str())); + addFolderQuery.bindText(1, name); + addFolderQuery.exec(); + return db->lastInsertId(); + } catch (storage::StorageException &e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } + return 0; +} + +void SqlStorage::updateFolderName(unsigned int id, const std::string& newName) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + boost::format updateFolderNameString("UPDATE %1% SET %2% = ? WHERE %3% = ?" ); + updateFolderNameString % TABLE_FOLDER % COL_FOLDER_NAME % COL_FOLDER_ID; + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> connection = scope.database(); + try { + storage::SQLQuery updateFolderNameQuery(connection->prepare(updateFolderNameString.str())); + updateFolderNameQuery.bindText(1, newName); + updateFolderNameQuery.bindInt(2, id); + updateFolderNameQuery.exec(); + } catch (storage::StorageException &e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } +} + +void SqlStorage::removeFolder(unsigned int id) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + boost::format deleteFolderString("DELETE FROM %1% WHERE %2% = ?;"); + deleteFolderString % TABLE_FOLDER % COL_FOLDER_ID; + + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> connection = scope.database(); + try { + storage::SQLQuery deleteFolderQurey(connection->prepare(deleteFolderString.str())); + deleteFolderQurey.bindInt(1, id); + deleteFolderQurey.exec(); + } catch (storage::StorageException &e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } +} + +bool SqlStorage::ifFolderExists(const std::string& name) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + boost::format getCountString("SELECT COUNT (*) FROM %1% WHERE %2% = ?;"); + getCountString % TABLE_FOLDER % COL_FOLDER_NAME; + try { + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> connection = scope.database(); + storage::SQLQuery getCountQuery(connection->prepare(getCountString.str())); + getCountQuery.bindText(1, name); + getCountQuery.exec(); + int number = getCountQuery.getInt(0); + return number != 0; + } catch (storage::StorageException& e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } + return true; +} + +unsigned int SqlStorage::getFolderId(const std::string& name) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + boost::format getIdString("SELECT %1% FROM %2% WHERE %3% = ?;"); + getIdString % COL_FOLDER_ID % TABLE_FOLDER % COL_FOLDER_NAME; + try { + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> connection = scope.database(); + storage::SQLQuery getIdQuery(connection->prepare(getIdString.str())); + getIdQuery.bindText(1, name); + getIdQuery.exec(); + return getIdQuery.getInt(0); + } catch (storage::StorageException& e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } + return 0; +} + +std::string SqlStorage::getFolderName(unsigned int id) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + boost::format getNameString("SELECT %1% FROM %2% WHERE %3% = ?;"); + getNameString % COL_FOLDER_NAME % TABLE_FOLDER % COL_FOLDER_ID; + try { + storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString)); + std::shared_ptr<storage::SQLDatabase> connection = scope.database(); + storage::SQLQuery getNameQuery(connection->prepare(getNameString.str())); + getNameQuery.bindInt(1, id); + getNameQuery.exec(); + + return getNameQuery.getString(0); + } catch (storage::StorageException& e) { + BROWSER_LOGD("[%s:%d] SQLException (%d): %s ", __PRETTY_FUNCTION__, __LINE__, e.getErrorCode(), e.getMessage()); + } + return std::string(); +} + void SqlStorage::readSession(Session& session, std::shared_ptr< storage::SQLDatabase > connection) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); diff --git a/services/SessionStorage/SqlStorage.h b/services/SessionStorage/SqlStorage.h index 876890e1..3c83e6b7 100644 --- a/services/SessionStorage/SqlStorage.h +++ b/services/SessionStorage/SqlStorage.h @@ -25,7 +25,8 @@ #include <core/Config/Config.h> #include "StorageService.h" #include "Session.h" - +#include "BookmarkFolder.h" +#include <memory> namespace tizen_browser { @@ -67,6 +68,51 @@ public: std::string getUrlTitle(const std::string& url); /** + * Returns created custom folder. + */ + services::SharedBookmarkFolder getFolder(unsigned int id); + + /** + * Returns all created custom folders. + */ + services::SharedBookmarkFolderList getFolders(); + + /** + * Returns all created custom folders. + */ + unsigned int getFoldersCount(); + + /** + * Adds folder with a specified name. + * Returns created folder id. + */ + unsigned int addFolder(const std::string& name); + + /** + * Updates folder with a specified name. + */ + void updateFolderName(unsigned int id, const std::string& newName); + + /** + * Remove folder with a specified id. + */ + void removeFolder(unsigned int id); + + /** + * Answers if folder of a specified name exists. + */ + bool ifFolderExists(const std::string& name); + /** + * Get id of a folder. + */ + unsigned int getFolderId(const std::string &name); + + /** + * Get name of a folder. + */ + std::string getFolderName(unsigned int id); + + /** * Store/update all items in storage */ void updateSession(tizen_browser::Session::Session& session); diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index 18ab2dc1..95b8b8ab 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -2,6 +2,7 @@ project(SimpleUI) set(SimpleUI_SRCS SimpleUI.cpp + InputPopup.cpp SimplePopup.cpp NotificationPopup.cpp ViewManager.cpp @@ -9,6 +10,7 @@ set(SimpleUI_SRCS set(SimpleUI_HEADERS SimpleUI.h + InputPopup.h SimplePopup.h NotificationPopup.h ViewManager.h @@ -94,6 +96,7 @@ include(EDCCompile) if (${PROFILE} MATCHES "mobile") set(edcFiles AuthenticationPopup.edc + InputPopup_mob.edc NotificationPopup_mob.edc Tooltip.edc ViewManager.edc diff --git a/services/SimpleUI/InputPopup.cpp b/services/SimpleUI/InputPopup.cpp new file mode 100644 index 00000000..be7a9e4a --- /dev/null +++ b/services/SimpleUI/InputPopup.cpp @@ -0,0 +1,240 @@ +#include "InputPopup.h" + +namespace tizen_browser { +namespace base_ui { + +InputPopup::InputPopup() : + m_parent(nullptr), + m_layout(nullptr) +{ + m_edjFilePath = EDJE_DIR; + m_edjFilePath.append("SimpleUI/InputPopup.edj"); + elm_theme_extension_add(nullptr, m_edjFilePath.c_str()); +} + +InputPopup::~InputPopup() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + evas_object_smart_callback_del(m_entry, "focused", _entry_focused); + evas_object_smart_callback_del(m_entry, "unfocused", _entry_unfocused); + evas_object_smart_callback_del(m_entry, "changed,user", _entry_changed); + evas_object_smart_callback_del(m_inputCancel, "clicked", _inputCancel_clicked); + evas_object_smart_callback_del(m_button_ok, "clicked", _okButton_clicked); + evas_object_smart_callback_del(m_button_cancel, "clicked", _cancelButton_clicked); + evas_object_del(m_inputCancel); + evas_object_del(m_entry); + evas_object_del(m_inputArea); + evas_object_del(m_button_ok); + evas_object_del(m_button_cancel); + evas_object_del(m_buttonsBox); + evas_object_del(m_layout); + button_clicked.disconnect_all_slots(); + popupDismissed.disconnect_all_slots(); + popupShown.disconnect_all_slots(); +} + +InputPopup* InputPopup::createInputPopup(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + InputPopup *inputPopup = new InputPopup(); + inputPopup->m_parent = parent; + return inputPopup; +} + +InputPopup* InputPopup::createInputPopup(Evas_Object *parent,const std::string& title,const std::string& message,const std::string& input, + const std::string& okButtonText, const std::string& cancelButtonText) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + InputPopup *inputPopup = new InputPopup(); + inputPopup->m_parent = parent; + inputPopup->m_title = title; + inputPopup->m_message = message; + inputPopup->m_input = input; + inputPopup->m_okButtonText = okButtonText; + inputPopup->m_cancelButtonText = cancelButtonText; + return inputPopup; +} + +void InputPopup::setInput(const std::string& input) +{ + m_input = input; +} + +void InputPopup::setTitle(const std::string& title) +{ + m_title = title; +} + +void InputPopup::setMessage(const std::string& message) +{ + m_message = message; +} + +void InputPopup::setOkButtonText(const std::string& okButtonText) +{ + m_okButtonText = okButtonText; +} + +void InputPopup::setCancelButtonText(const std::string& cancelButtonText) +{ + m_cancelButtonText = cancelButtonText; +} + +void InputPopup::show() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + createLayout(); + popupShown(this); +} + +void InputPopup::dismiss() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + popupDismissed(this); +} + +void InputPopup::onBackPressed() +{ + dismiss(); +} + +void InputPopup::createLayout() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + + m_layout = elm_layout_add(m_parent); + elm_layout_file_set(m_layout, m_edjFilePath.c_str(), "input-popup-layout"); + evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_text_set(m_layout, "title_text", m_title.c_str()); + + m_inputArea = elm_layout_add(m_layout); + elm_object_part_content_set(m_layout, "input_swallow", m_inputArea); + + evas_object_size_hint_weight_set(m_inputArea, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_inputArea, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(m_inputArea); + + elm_layout_file_set(m_inputArea, m_edjFilePath.c_str(), "input-area-layout"); + elm_object_part_text_set(m_inputArea, "input_message_text", m_message.c_str()); + + m_entry = elm_entry_add(m_inputArea); + elm_object_style_set(m_entry, "popup-input-entry"); + + elm_entry_single_line_set(m_entry, EINA_TRUE); + elm_entry_scrollable_set(m_entry, EINA_TRUE); + elm_entry_input_panel_layout_set(m_entry, ELM_INPUT_PANEL_LAYOUT_URL); + elm_object_part_content_set(m_inputArea, "input_text_swallow", m_entry); + elm_object_part_text_set(m_entry, "elm.text", m_input.c_str()); + + evas_object_smart_callback_add(m_entry, "focused", _entry_focused, (void*)this); + evas_object_smart_callback_add(m_entry, "unfocused", _entry_unfocused, (void*)this); + evas_object_smart_callback_add(m_entry, "changed,user", _entry_changed, (void*)this); + + m_inputCancel = elm_button_add(m_inputArea); + elm_object_style_set(m_inputCancel, "invisible_button"); + evas_object_smart_callback_add(m_inputCancel, "clicked", _inputCancel_clicked, this); + + evas_object_show(m_inputCancel); + elm_object_part_content_set(m_inputArea, "input_cancel_click", m_inputCancel); + + m_buttonsBox = elm_box_add(m_layout); + elm_box_horizontal_set(m_buttonsBox, EINA_TRUE); + evas_object_size_hint_weight_set(m_buttonsBox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_buttonsBox, EVAS_HINT_FILL, EVAS_HINT_FILL); + + m_button_cancel = elm_button_add(m_buttonsBox); + elm_object_style_set(m_button_cancel, "input-popup-button"); + evas_object_size_hint_weight_set(m_button_cancel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_button_cancel, 0.5, 0.5); + elm_object_part_text_set(m_button_cancel, "elm.text", m_cancelButtonText.c_str()); + elm_box_pack_end(m_buttonsBox, m_button_cancel); + evas_object_smart_callback_add(m_button_cancel, "clicked", _cancelButton_clicked, (void*)this); + + evas_object_show(m_button_cancel); + elm_object_tree_focus_allow_set(m_button_cancel, EINA_FALSE); + + m_button_ok = elm_button_add(m_buttonsBox); + elm_object_style_set(m_button_ok, "input-popup-button"); + evas_object_size_hint_weight_set(m_button_ok, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_button_ok, 0.5, 0.5); + elm_object_part_text_set(m_button_ok, "elm.text", m_okButtonText.c_str()); + elm_box_pack_end(m_buttonsBox, m_button_ok); + evas_object_smart_callback_add(m_button_ok, "clicked", _okButton_clicked, (void*)this); + + evas_object_show(m_button_ok); + elm_object_tree_focus_allow_set(m_button_ok, EINA_FALSE); + elm_object_signal_emit(m_button_ok, "visible", "ui"); + + evas_object_show(m_buttonsBox); + elm_object_part_content_set(m_layout, "buttons_swallow", m_buttonsBox); + + evas_object_show(m_layout); +} + +void InputPopup::_entry_focused(void* data, Evas_Object *, void *) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (data != nullptr) { + InputPopup* inputPopup = static_cast<InputPopup*>(data); + elm_object_focus_allow_set(inputPopup->m_inputCancel, EINA_TRUE); + elm_object_signal_emit(inputPopup->m_inputArea, "entry_focused", "ui"); + elm_object_signal_emit(inputPopup->m_entry, "focused", "ui"); + } +} + +void InputPopup::_entry_unfocused(void* data, Evas_Object *, void *) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (data != nullptr) { + InputPopup* inputPopup = static_cast<InputPopup*>(data); + elm_object_focus_allow_set(inputPopup->m_inputCancel, EINA_FALSE); + elm_object_signal_emit(inputPopup->m_inputArea, "entry_unfocused", "ui"); + elm_object_signal_emit(inputPopup->m_entry, "unfocused", "ui"); + } +} + +void InputPopup::_entry_changed(void* data, Evas_Object *, void *) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (data != nullptr) { + InputPopup* inputPopup = static_cast<InputPopup*>(data); + std::string text = elm_object_part_text_get(inputPopup->m_entry, "elm.text"); + if (text.empty()) { + elm_object_disabled_set(inputPopup->m_button_ok, EINA_TRUE); + elm_object_signal_emit(inputPopup->m_button_ok, "dissabled", "ui"); + } else { + elm_object_disabled_set(inputPopup->m_button_ok, EINA_FALSE); + elm_object_signal_emit(inputPopup->m_button_ok, "enabled", "ui"); + } + } +} + +void InputPopup::_inputCancel_clicked(void * data, Evas_Object *, void *) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (data != nullptr) { + InputPopup* inputPopup = static_cast<InputPopup*>(data); + elm_object_part_text_set(inputPopup->m_entry, "elm.text", ""); + elm_object_disabled_set(inputPopup->m_button_ok, EINA_TRUE); + elm_object_signal_emit(inputPopup->m_button_ok, "dissabled", "ui"); + } +} + +void InputPopup::_okButton_clicked(void *data, Evas_Object *, void*) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + InputPopup *inputPopup = static_cast<InputPopup*>(data); + inputPopup->button_clicked(elm_object_part_text_get(inputPopup->m_entry, "elm.text")); + inputPopup->dismiss(); +} + +void InputPopup::_cancelButton_clicked(void* data, Evas_Object *, void*) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + InputPopup *inputPopup = static_cast<InputPopup*>(data); + inputPopup->dismiss(); +} + +} +} diff --git a/services/SimpleUI/InputPopup.h b/services/SimpleUI/InputPopup.h new file mode 100644 index 00000000..700081b9 --- /dev/null +++ b/services/SimpleUI/InputPopup.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * 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. + */ + +/* + * InputPopup.h + * + * Created on: Nov 24, 2015 + * Author: m.kawonczyk@samsung.com + */ + +#ifndef __INPUT_POPUP_H__ +#define __INPUT_POPUP_H__ 1 + +#include <Evas.h> +#include <Elementary.h> +#include <string> +#include <list> +#include <memory> +#include "AbstractPopup.h" +#include "ServiceManager.h" + +namespace tizen_browser { +namespace base_ui { + +class InputPopup : public interfaces::AbstractPopup +{ + +public: + static InputPopup* createInputPopup(Evas_Object *parent); + static InputPopup* createInputPopup(Evas_Object *parent,const std::string& title,const std::string& message,const std::string& input, + const std::string& okButtonText, const std::string& cancelButtonText); + + void show(); + void dismiss(); + void onBackPressed(); + + void setContent(Evas_Object *content); + void setInput(const std::string &input); + void setTitle(const std::string &title); + void setMessage(const std::string &message); + void setOkButtonText(const std::string &okButtonText); + void setCancelButtonText(const std::string &cancelButtonText); + + boost::signals2::signal<void (const std::string&)> button_clicked; + +private: + InputPopup(); + ~InputPopup(); + void createLayout(); + + std::string m_edjFilePath; + static void _okButton_clicked(void *data, Evas_Object *btn, void*); + static void _cancelButton_clicked(void *data, Evas_Object *btn, void*); + static void _entry_changed(void * data, Evas_Object *, void*); + static void _entry_unfocused(void * data, Evas_Object *, void*); + static void _entry_focused(void * data, Evas_Object *, void*); + static void _inputCancel_clicked(void * data, Evas_Object *, void *); + + Evas_Object *m_parent; + Evas_Object *m_layout; + Evas_Object *m_buttonsBox; + Evas_Object *m_button_cancel; + Evas_Object *m_button_ok; + Evas_Object *m_inputArea; + Evas_Object *m_inputCancel; + Evas_Object *m_entry; + std::string m_input; + std::string m_title; + std::string m_message; + std::string m_okButtonText; + std::string m_cancelButtonText; +}; + +} +} +#endif //__INPUT_POPUP_H__ diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 63b7825e..b29d946b 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -113,6 +113,11 @@ std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > SimpleUI::g return m_favoriteService->getBookmarks(folder_id); } +services::SharedBookmarkFolderList SimpleUI::getBookmarkFolders() +{ + return m_sessionService->getStorage()->getFolders(); +} + const std::string SimpleUI::getBookmarkFolderName(int folder_id) { return m_favoriteService->getBookmarkFolderName(folder_id); @@ -334,6 +339,7 @@ void SimpleUI::connectUISignals() m_bookmarkFlowUI->saveBookmark.connect(boost::bind(&SimpleUI::addBookmark, this, _1)); m_bookmarkFlowUI->editBookmark.connect(boost::bind(&SimpleUI::editBookmark, this, _1)); m_bookmarkFlowUI->removeBookmark.connect(boost::bind(&SimpleUI::deleteBookmark, this)); + m_bookmarkFlowUI->addFolder.connect(boost::bind(&SimpleUI::onNewFolderClicked, this)); #endif M_ASSERT(m_bookmarkManagerUI.get()); @@ -343,6 +349,7 @@ void SimpleUI::connectUISignals() m_bookmarkManagerUI->customFolderClicked.connect(boost::bind(&SimpleUI::onBookmarkCustomFolderClicked, this, _1)); m_bookmarkManagerUI->mobileFolderClicked.connect(boost::bind(&SimpleUI::onBookmarkMobileClicked, this)); m_bookmarkManagerUI->allFolderClicked.connect(boost::bind(&SimpleUI::onBookmarkAllFolderClicked, this)); + m_bookmarkManagerUI->newFolderItemClicked.connect(boost::bind(&SimpleUI::onNewFolderClicked, this)); #endif M_ASSERT(m_zoomUI.get()); @@ -648,6 +655,36 @@ void SimpleUI::onBookmarkClicked(std::shared_ptr<tizen_browser::services::Bookma } } +#if PROFILE_MOBILE +void SimpleUI::onNewFolderClicked() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + InputPopup *inputPopup = InputPopup::createInputPopup(m_viewManager.getContent(), "New Folder", "Add New Folder?", + "New Folder #", "Add", "Cancel"); + inputPopup->button_clicked.connect(boost::bind(&SimpleUI::onInputPopupClick, this, _1)); + inputPopup->popupShown.connect(boost::bind(&SimpleUI::showPopup, this, _1)); + inputPopup->popupDismissed.connect(boost::bind(&SimpleUI::dismissPopup, this, _1)); + inputPopup->show(); +} + +#endif +void SimpleUI::onInputPopupClick(const std::string& folder_name) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (m_sessionService->getStorage()->ifFolderExists(folder_name)) { + BROWSER_LOGD("[%s:%d] Folder already exists.", __PRETTY_FUNCTION__, __LINE__); + return; + } + unsigned int id = m_sessionService->getStorage()->addFolder(folder_name); + if (m_viewManager.topOfStack() == m_bookmarkManagerUI.get()) { + SharedBookmarkFolder folder = m_sessionService->getStorage()->getFolder(id); + SharedBookmarkFolderList list; + list.push_back(folder); + m_bookmarkManagerUI->addCustomFolders(list); + } +} + + void SimpleUI::onGenerateThumb(basic_webengine::TabId tabId) { const int THUMB_WIDTH = boost::any_cast<int>( @@ -1177,7 +1214,8 @@ void SimpleUI::showBookmarkManagerUI() getBookmarkFolderName(tizen_browser::services::ALL_BOOKMARKS_ID)); m_bookmarkManagerUI->addMobileFolder(getBookmarks(tizen_browser::services::ROOT_FOLDER_ID), getBookmarkFolderName(tizen_browser::services::ROOT_FOLDER_ID)); - m_bookmarkManagerUI->addCustomFolders(getBookmarks(tizen_browser::services::ALL_BOOKMARKS_ID)); + //m_bookmarkManagerUI->addCustomFolders(getBookmarks(tizen_browser::services::ALL_BOOKMARKS_ID)); + m_bookmarkManagerUI->addCustomFolders(getBookmarkFolders()); m_bookmarkManagerUI->showUI(); #else m_bookmarkManagerUI->addBookmarkItems(getBookmarks(tizen_browser::services::ROOT_FOLDER_ID)); @@ -1207,7 +1245,8 @@ void SimpleUI::onBookmarkCustomFolderClicked(int folderId) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_bookmarkManagerUI->getDetailsContent(); - m_bookmarkManagerUI->addDetails(getBookmarks(folderId), getBookmarkFolderName(folderId)); + m_bookmarkManagerUI->addDetails(getBookmarks(folderId), m_sessionService->getStorage()->getFolderName(folderId)); + //m_bookmarkManagerUI->addDetails(getBookmarks(folderId), getBookmarkFolderName(folderId)); m_bookmarkManagerUI->showDetailsUI(); } #endif diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index 3336aa6f..9428782a 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -56,6 +56,7 @@ // other #include "Action.h" +#include "InputPopup.h" #include "SimplePopup.h" #include "WebConfirmation.h" #include "ConfigTypedef.h" @@ -137,6 +138,8 @@ private: void tabClosed(const tizen_browser::basic_webengine::TabId& id); std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > getBookmarks(int folder_id = -1); + services::SharedBookmarkFolderList getBookmarkFolders(); + const std::string getBookmarkFolderName(int folder_id); std::shared_ptr<services::HistoryItemVector> getHistory(); std::shared_ptr<services::HistoryItemVector> getMostVisitedItems(); @@ -145,6 +148,10 @@ private: void onBookmarkAdded(std::shared_ptr<tizen_browser::services::BookmarkItem> bookmarkItem); void onBookmarkClicked(std::shared_ptr<tizen_browser::services::BookmarkItem> bookmarkItem); +#if PROFILE_MOBILE + void onNewFolderClicked(); + void onInputPopupClick(const std::string& folder_name); +#endif void onBookmarkRemoved(const std::string& uri); void onHistoryRemoved(const std::string& uri); diff --git a/services/SimpleUI/edc/InputPopup_mob.edc b/services/SimpleUI/edc/InputPopup_mob.edc new file mode 100644 index 00000000..31ce5d53 --- /dev/null +++ b/services/SimpleUI/edc/InputPopup_mob.edc @@ -0,0 +1,996 @@ +#include "../../../core/Tools/edc/InvisibleButton.edc" + +#define DEVELOPMENT 0 +#define WIDTH 720 +#define HEIGHT 1280 +#define TITLE_HEIGHT 101 +#define INPUT_HEIGHT 205 +#define BUTTON_HEIGHT 120 +#define BUTTON_WIDTH 360 +#define TITLE_TEXT_OFFSET_X 100 +#define TITLE_TEXT_OFFSET_Y 44 +#define TITLE_TEXT_WIDTH 520 +#define TITLE_TEXT_HEIGHT 45 +#define BUTTON_TEXT_OFFSET_X 50 +#define BUTTON_TEXT_OFFSET_Y 40 +#define BUTTON_TEXT_WIDTH 260 +#define BUTTON_TEXT_HEIGHT 40 +#define MESSAGE_TEXT_OFFSET_X 44 +#define MESSAGE_TEXT_OFFSET_Y 30 +#define MESSAGE_TEXT_WIDTH 632 +#define MESSAGE_TEXT_HEIGHT 38 +#define INPUT_OFFSET_Y 78 +#define INPUT_AREA_HEIGHT 106 +#define INPUT_TEXT_OFFSET_X 44 +#define INPUT_TEXT_OFFSET_Y 26 +#define INPUT_TEXT_WIDTH 632 +#define INPUT_TEXT_SELECTED_WIDTH 578 +#define INPUT_TEXT_HEIGHT 40 +#define INPUT_CANCEL_OFFSET_X 24 +#define INPUT_DIVIDER_OFFSET_X 32 +#define INPUT_DIVIDER_OFFSET_Y 82 +#define INPUT_DIVIDER_HEIGHT 2 +#define INPUT_DIVIDER_WIDTH 656 + +collections{ + group { + name: "elm/entry/selection/browser_entry"; + parts { + part { + name: "bg"; + scale: 1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + } + } + } + group { + name: "elm/entry/cursor/browser_entry"; + parts { + part { + name: "bg"; + scale: 1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 10 132 229 255; + min: 3 50; + max: 3 50; + visible: 0; + } + description { + state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + action: STATE_SET "focused" 0.0; + target: "bg"; + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + } + } + } + group { + name: "elm/entry/base-single/popup-input-entry"; + styles { + style { + name: "input_text_style"; + base: "font=Tizen:style=Regular font_size=32 wrap=none color=#333333 align=0.0 valign=0.5"; //40 + } + style { + name: "guide_text_style"; + base: "font=Tizen:style=Regular font_size=32 wrap=none color=#969696 align=0.0 valign=0.5"; //40 + } + } + data { + item: focus_highlight "off"; + } + parts { + part { + name: "bg"; + scale: 1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 244 244 244 255; + } + description { + state: "focused" 0.0; + color: 224 237 251 255; + } + } + part { + name: "label.text.clip"; + scale: 1; + type: RECT; + description { + state: "default" 0.0; + } + } + part { + name: "elm.text"; + scale: 1; + multiline: 0; + entry_mode: EDITABLE; + select_mode: DEFAULT; + cursor_mode: BEFORE; + type: TEXTBLOCK; + clip_to: "label.text.clip"; + source: "elm/entry/selection/browser_entry"; + source4: "elm/entry/cursor/browser_entry"; + description { + state: "default" 0.0; + min: 0 INPUT_TEXT_HEIGHT; + max: -1 INPUT_TEXT_HEIGHT; + rel1 { + to: "bg"; + relative: 0.0 0.0; + } + rel2.relative: 1.0 1.0; + align: 0.0 0.0; + text.style: "input_text_style"; + } + } + part { + name: "elm.guide"; + scale: 1; + type: TEXTBLOCK; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "bg"; + relative: 0.0 0.0; + } + rel2.relative: 1.0 1.0; + min: 0 INPUT_TEXT_HEIGHT; + max: -1 INPUT_TEXT_HEIGHT; + text { + text: "Input folder name"; + style: "guide_text_style"; + } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + programs { + program { + name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { + name: "focused"; + signal: "focused"; + source: "ui"; + action: STATE_SET "focused" 0.0; + target: "bg"; + } + program { + name: "unfocused"; + signal: "unfocused"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "bg"; + } + program { + name: "gdisabled"; + signal: "elm,guide,disabled"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.guide"; + } + program { + name: "genabled"; + signal: "elm,guide,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.guide"; + } + } + } + group { + name: "input-popup-layout"; + styles { + style { + name: "title_text_style"; + base: "font=Tizen:style=Regular font_size=36 wrap=none color=#389ae9 align=0.5 valign=0.5"; //45 + } + } + parts { + part { + name: "bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 102.4; + align: 0.0 0.0; + min: WIDTH HEIGHT; + max: WIDTH HEIGHT; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { + name: "title_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + color: 255 255 255 255; + align: 0.0 0.0; + min: WIDTH TITLE_HEIGHT; + max: WIDTH TITLE_HEIGHT; + rel1 { + relative: 0.0 0.0; + to: "bg"; + } + rel2 { + relative: 1.0 1.0; + to: "bg"; + } + } + } + part { + name: "title_text_spacer"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: DEVELOPMENT; + color: 255 255 255 127; + min: TITLE_TEXT_OFFSET_X TITLE_TEXT_OFFSET_Y; + max: TITLE_TEXT_OFFSET_X TITLE_TEXT_OFFSET_Y; + align: 0.0 0.0; + rel1 { + relative: 0.0 0.0; + to: "title_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "bg"; + } + } + } + part { + name: "title_text_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: DEVELOPMENT; + color: 255 182 193 255; //lightpink + align: 0.0 0.0; + min: TITLE_TEXT_WIDTH TITLE_TEXT_HEIGHT; + max: TITLE_TEXT_WIDTH TITLE_TEXT_HEIGHT; + rel1 { + relative: 1.0 1.0; + to: "title_text_spacer"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "title_text"; + type: TEXTBLOCK; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + min: TITLE_TEXT_WIDTH TITLE_TEXT_HEIGHT; + max: TITLE_TEXT_WIDTH TITLE_TEXT_HEIGHT; + rel1 { + relative: 0.0 0.0; + to: "title_text_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "title_text_bg"; + } + text.style: "title_text_style"; + } + } + part { + name: "input_swallow"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + min: WIDTH INPUT_HEIGHT; + max: WIDTH INPUT_HEIGHT; + align: 0.0 0.0; + visible: 1; + rel1 { + relative: 0.0 1.0; + to: "title_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "bg"; + } + } + } + part { + name: "buttons_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + color: 0 255 255 255; + align: 0.0 0.0; + min: WIDTH BUTTON_HEIGHT; + max: WIDTH BUTTON_HEIGHT; + rel1 { + relative: 0.0 1.0; + to: "input_swallow"; + } + rel2 { + relative: 1.0 1.0; + to: "bg"; + } + } + } + part { + name: "buttons_swallow"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: WIDTH BUTTON_HEIGHT; + max: WIDTH BUTTON_HEIGHT; + align: 0.0 0.0; + rel1 { + relative: 0.0 0.0; + to: "buttons_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "buttons_bg"; + } + } + } + } + } + group { + name: "input-area-layout"; + styles { + style { + name: "message_text_style"; + base: "font=Tizen:style=Regular font_size=32 wrap=none color=#141414 align=0.0 valign=0.5"; //40 + } + } + images { + image: "input_ic_cancel.png" COMP; + } + parts { + part { + name: "bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + color: 255 255 255 255; + align: 0.0 0.0; + min: WIDTH INPUT_HEIGHT; + max: WIDTH INPUT_HEIGHT; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { + name: "input_message_spacer"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: DEVELOPMENT; + color: 255 0 0 127; + align: 0.0 0.0; + min: MESSAGE_TEXT_OFFSET_X MESSAGE_TEXT_OFFSET_Y; + max: MESSAGE_TEXT_OFFSET_X MESSAGE_TEXT_OFFSET_Y; + rel1 { + relative: 0.0 0.0; + to: "bg"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "input_message_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: DEVELOPMENT; + color: 202 225 255 255; //lightsteelblue + align: 0.0 0.0; + min: MESSAGE_TEXT_WIDTH MESSAGE_TEXT_HEIGHT; + max: MESSAGE_TEXT_WIDTH MESSAGE_TEXT_HEIGHT; + rel1 { + relative: 1.0 1.0; + to: "input_message_spacer"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "input_message_text"; + type: TEXTBLOCK; + scale: 1; + description { + state: "default"; + visible: 1; + align: 0.0 0.0; + min: MESSAGE_TEXT_WIDTH MESSAGE_TEXT_HEIGHT; + max: MESSAGE_TEXT_WIDTH MESSAGE_TEXT_HEIGHT; + rel1 { + relative: 0.0 0.0; + to: "input_message_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "input_message_bg"; + } + text.style: "message_text_style"; + } + } + part { + name: "input_area_spacer"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 INPUT_OFFSET_Y; + max: 0 INPUT_OFFSET_Y; + visible: DEVELOPMENT; + color: 255 255 255 127; + rel1 { + relative: 0.0 0.0; + to: "bg"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "input_area_bg"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: WIDTH INPUT_AREA_HEIGHT; + max: WIDTH INPUT_AREA_HEIGHT; + visible: 0; + color: 224 237 251 255; + rel1 { + relative: 1.0 1.0; + to: "input_area_spacer"; + } + rel2.relative: 1.0 1.0; + } + description { + state: "focused" 0.0; + inherit: "default"; + visible: 1; + } + } + part { + name: "input_spacer"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: INPUT_TEXT_OFFSET_X INPUT_TEXT_OFFSET_Y; + max: INPUT_TEXT_OFFSET_X INPUT_TEXT_OFFSET_Y; + visible: DEVELOPMENT; + color: 255 255 255 127; + rel1 { + relative: 0.0 0.0; + to: "input_area_bg"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "input_text_bg"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: INPUT_TEXT_WIDTH INPUT_TEXT_HEIGHT; + max: INPUT_TEXT_WIDTH INPUT_TEXT_HEIGHT; + visible: DEVELOPMENT; + color: 238 229 222 255; //seashell + rel1 { + relative: 1.0 1.0; + to: "input_spacer"; + } + rel2.relative: 1.0 1.0; + } + description { + state: "focused" 0.0; + inherit: "default"; + min: INPUT_TEXT_SELECTED_WIDTH INPUT_TEXT_HEIGHT; + max: INPUT_TEXT_SELECTED_WIDTH INPUT_TEXT_HEIGHT; + } + } + part { + name: "input_text_swallow"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: INPUT_TEXT_WIDTH INPUT_TEXT_HEIGHT; + max: INPUT_TEXT_WIDTH INPUT_TEXT_HEIGHT; + rel1 { + relative: 0.0 0.0; + to: "input_text_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "input_text_bg"; + } + } + description { + state: "focused"; + inherit: "default"; + min: INPUT_TEXT_SELECTED_WIDTH INPUT_TEXT_HEIGHT; + max: INPUT_TEXT_SELECTED_WIDTH INPUT_TEXT_HEIGHT; + } + } + part { + name: "input_cancel_spacer"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: INPUT_CANCEL_OFFSET_X 0; + max: INPUT_CANCEL_OFFSET_X 0; + visible: DEVELOPMENT; + color: 255 255 255 127; + rel1 { + relative: 1.0 0.0; + to: "input_text_bg"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "input_cancel_bg"; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: INPUT_TEXT_HEIGHT INPUT_TEXT_HEIGHT; + max: INPUT_TEXT_HEIGHT INPUT_TEXT_HEIGHT; + visible: 0; + align: 0.0 0.0; + color: 255 255 255 0; + rel1 { + relative: 1.0 1.0; + to: "input_cancel_spacer"; + } + rel2.relative: 1.0 1.0; + } + description { + state: "focused" 0.0; + inherit: "default"; + color: 224 237 251 255; + visible: 1; + } + } + part { + name: "input_cancel_icon"; + type: IMAGE; + scale: 1; + mouse_events: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: INPUT_TEXT_HEIGHT INPUT_TEXT_HEIGHT; + max: INPUT_TEXT_HEIGHT INPUT_TEXT_HEIGHT; + visible: 0; + rel1 { + relative: 0.0 0.0; + to: "input_cancel_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "input_cancel_bg"; + } + image { + normal: "input_ic_cancel.png"; + border: 0 0 0 0; + } + } + description { + state: "focused" 0.0; + inherit: "default"; + visible: 1; + } + } + part { + name: "input_cancel_click_spacer"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + visible: DEVELOPMENT; + color: 255 255 255 127; + min: WIDTH 0; + max: WIDTH 0; + rel1 { + relative: 0.0 0.0; + to: "input_area_bg"; + } + rel2.relative: 1.0 1.0; + } + description { + state: "focused" 0.0; + inherit: "default"; + min: (INPUT_TEXT_SELECTED_WIDTH+INPUT_TEXT_OFFSET_X) 0; + max: (INPUT_TEXT_SELECTED_WIDTH+INPUT_TEXT_OFFSET_X) 0; + } + } + part { + name: "input_cancel_click"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: (INPUT_CANCEL_OFFSET_X+INPUT_TEXT_HEIGHT+34) INPUT_AREA_HEIGHT; + max: (INPUT_CANCEL_OFFSET_X+INPUT_TEXT_HEIGHT+34) INPUT_AREA_HEIGHT; + visible: 1; + rel1 { + relative: 1.0 1.0; + to: "input_cancel_click_spacer"; + } + rel2 { + relative: 1.0 1.0; + to: "input_cancel_bg"; + } + } + description { + state: "focused" 0.0; + inherit: "default"; + visible: 1; + } + } + part { + name: "input_divider_spacer"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: INPUT_DIVIDER_OFFSET_X INPUT_DIVIDER_OFFSET_Y; + max: INPUT_DIVIDER_OFFSET_X INPUT_DIVIDER_OFFSET_Y; + visible: DEVELOPMENT; + color: 255 255 255 127; + rel1 { + relative: 0.0 0.0; + to: "input_area_bg"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "input_divider_bg"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: INPUT_DIVIDER_WIDTH INPUT_DIVIDER_HEIGHT; + max: INPUT_DIVIDER_WIDTH INPUT_DIVIDER_HEIGHT; + visible: 1; + color: 10 132 229 255; + rel1 { + relative: 1.0 1.0; + to: "input_divider_spacer"; + } + rel2.relative: 1.0 1.0; + } + } + } + programs { + program { + name: "entry_swallow_down"; + source: "input_text_swallow"; + signal: "mouse,down,*"; + action: STATE_SET "focused" 0.0; + target: "input_area_bg"; + } + program { + name: "entry_swallow_up"; + source: "input_text_swallow"; + signal: "mouse,up,*"; + action: STATE_SET "default" 0.0; + target: "input_area_bg"; + } + program { + name: "entry_focused"; + signal: "entry_focused"; + source: "ui"; + action: STATE_SET "focused" 0.0; + target: "input_text_bg"; + target: "input_text_swallow"; + target: "input_cancel_icon"; + target: "input_cancel_click_spacer"; + target: "input_cancel_click"; + } + program { + name: "entry_unfocused"; + signal: "entry_unfocused"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "input_text_bg"; + target: "input_text_swallow"; + target: "input_cancel_icon"; + target: "input_cancel_click_spacer"; + target: "input_cancel_click"; + } + program { + name: "input_cancel_down"; + source: "input_cancel_click"; + signal: "mouse,down,*"; + action: STATE_SET "focused" 0.0; + target: "input_cancel_bg"; + } + program { + name: "input_cancel_up"; + source: "input_cancel_click"; + signal: "mouse,up,*"; + action: STATE_SET "default" 0.0; + target: "input_cancel_bg"; + } + } + } + group { + name: "elm/button/base/input-popup-button"; + styles { + style { + name: "button_text_style"; + base: "font=Tizen:style=Regular font_size=32 wrap=none color=#141414 align=0.5 valign=0.5"; //40 + } + style { + name: "button_text_style_dissabled"; + base: "font=Tizen:style=Regular font_size=32 wrap=none color=#C0C0C0 align=0.5 valign=0.5"; //40 + } + } + parts { + part { + name: "bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + fixed: 1 1; + color: 244 244 244 255; + min: BUTTON_WIDTH BUTTON_HEIGHT; + max: BUTTON_WIDTH BUTTON_HEIGHT; + } + description { + state: "pressed" 0.0; + inherit: "default" 0.0; + color: 224 237 251 255; + } + } + part { + name: "divider_horizontal"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.0; + color: 0 0 0 38.4; + min: BUTTON_WIDTH 1; + max: BUTTON_WIDTH 1; + rel1 { + relative: 0.0 0.0; + to: "bg"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "divider_vertical"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + color: 0 0 0 38.4; + min: 1 BUTTON_HEIGHT; + max: 1 BUTTON_HEIGHT; + rel1 { + relative: 0.0 0.0; + to: "bg"; + } + rel2.relative: 1.0 1.0; + } + description { + state: "visible" 0.0; + inherit: "default"; + visible: 1; + } + } + part { + name: "text_spacer"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: DEVELOPMENT; + align: 0.0 0.0; + color: 255 255 255 127; + min: BUTTON_TEXT_OFFSET_X BUTTON_TEXT_OFFSET_Y; + max: BUTTON_TEXT_OFFSET_X BUTTON_TEXT_OFFSET_Y; + rel1 { + relative: 0.0 0.0; + to: "bg"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "text_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + visible: DEVELOPMENT; + align: 0.0 0.0; + color: 255 0 255 255; //magenta + min: BUTTON_TEXT_WIDTH BUTTON_TEXT_HEIGHT; + max: BUTTON_TEXT_WIDTH BUTTON_TEXT_HEIGHT; + rel1 { + relative: 1.0 1.0; + to: "text_spacer"; + } + rel2.relative: 1.0 1.0; + } + } + part { + name: "elm.text"; + type: TEXTBLOCK; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + min: BUTTON_TEXT_WIDTH BUTTON_TEXT_HEIGHT; + max: BUTTON_TEXT_WIDTH BUTTON_TEXT_HEIGHT; + rel1 { + relative: 0.0 0.0; + to: "text_bg"; + } + rel2 { + relative: 1.0 1.0; + to: "text_bg"; + } + text.style: "button_text_style"; + } + description { + state: "dissabled" 0.0; + inherit: "default"; + text.style: "button_text_style_dissabled"; + } + } + part { + name: "over"; + scale: 1; + mouse_events: 1; + repeat_events: 0; + type: RECT; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; to: "bg";} + rel2 { relative: 1.0 1.0; to: "bg";} + color: 0 0 0 0; + } + } + } + programs { + program { + name: "visible"; + source: "ui"; + signal: "visible"; + action: STATE_SET "visible" 0.0; + target: "divider_vertical"; + } + program { + name: "dissabled"; + source: "ui"; + signal: "dissabled"; + action: STATE_SET "dissabled" 0.0; + target: "elm.text"; + } + program { + name: "enabled"; + source: "ui"; + signal: "enabled"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { + name: "down"; + source: "over"; + signal: "mouse,down,*"; + action: STATE_SET "pressed" 0.0; + target: "bg"; + } + program { + name: "up"; + source: "over"; + signal: "mouse,up,*"; + action: STATE_SET "default" 0.0; + target: "bg"; + } + program { + name: "mouse_click"; + signal: "mouse,clicked,1"; + source: "over"; + script { + emit("elm,action,click", ""); + } + } + } + } +} diff --git a/services/SimpleUI/images/input_ic_cancel.png b/services/SimpleUI/images/input_ic_cancel.png Binary files differnew file mode 100644 index 00000000..95067720 --- /dev/null +++ b/services/SimpleUI/images/input_ic_cancel.png diff --git a/services/SimpleUI/images_mob/input_ic_cancel.png b/services/SimpleUI/images_mob/input_ic_cancel.png Binary files differnew file mode 100644 index 00000000..95067720 --- /dev/null +++ b/services/SimpleUI/images_mob/input_ic_cancel.png diff --git a/services/StorageService/Storage/include/SQLDatabase.h b/services/StorageService/Storage/include/SQLDatabase.h index 13682ef0..b5f555af 100644 --- a/services/StorageService/Storage/include/SQLDatabase.h +++ b/services/StorageService/Storage/include/SQLDatabase.h @@ -131,7 +131,7 @@ public: * \pre Query object must not be executed. * \throws StorageException on error */ - void bindNull(int paramNo); + void bindNull(int paramNo); /*! \brief Receive textual data from query result. * |