#include "service_macros.h"
// components
+#include "WebPageUI.h"
#include "AbstractWebEngine.h"
#include "MoreMenuUI.h"
#include "HistoryUI.h"
#include "SettingsUI.h"
-#include "MainUI.h"
+#include "QuickAccess.h"
#include "TabUI.h"
-#include "ButtonBar.h"
+#include "ZoomUI.h"
#include "HistoryService.h"
#include "BookmarkManagerUI.h"
-#include "SimpleURI.h"
-#include "SimpleScroller.h"
-#include "WebTitleBar.h"
#include "PlatformInputManager.h"
#include "SessionStorage.h"
#include "SqlStorage.h"
#include "Action.h"
#include "SimplePopup.h"
#include "WebConfirmation.h"
-#include "ZoomList.h"
-#include "TabList.h"
#include "BookmarksManager.h"
-#include "Settings.h"
-#include "HistoryList.h"
-#include "NetworkErrorHandler.h"
-#include "CustomPopup.h"
#include "Config.h"
+#include "ViewManager.h"
namespace tizen_browser{
namespace base_ui{
void destroyUI();
private:
+ // setup functions
void createActions();
void connectActions();
+ void loadUIServices();
+ void connectUISignals();
+ void loadModelServices();
+ void initModelServices();
+ void initUIServices();
+ void connectModelSignals();
+ void restoreLastSession();
+ Evas_Object* createWebLayout(Evas_Object* parent);
+ Evas_Object* createErrorLayout(Evas_Object* parent);
- void backEnable(bool enable);
void forwardEnable(bool enable);
void stopEnable(bool enable);
void reloadEnable(bool enable);
- void addBookmarkEnable(bool enable);
- void removeBookmarkEnable(bool enable);
- void zoomEnable(bool enable);
-
- void settingsButtonEnable(bool enable);
void loadFinished();
void progressChanged(double progress);
void bookmarkAdded();
void bookmarkDeleted();
- bool isHomePageActive();
- void switchViewToHomePage();
- void updateBrowserView();
- void updateWebView();
- void updateURIBarView();
+ void showQuickAccess();
+ void switchViewToQuickAccess();
+ void switchViewToWebPage();
void updateView();
- void openNewTab(const std::string &uri);
+ void openNewTab(const std::string &uri, bool desktopMode = true);
void switchToTab(const tizen_browser::basic_webengine::TabId& tabId);
- void newTabClicked(const std::string &);
+ void newTabClicked();
void tabClicked(const tizen_browser::basic_webengine::TabId& tabId);
+ void closeTabsClicked(const tizen_browser::basic_webengine::TabId& tabId);
void tabCreated();
+ bool checkIfCreate();
void tabClosed(const tizen_browser::basic_webengine::TabId& id);
- void bookmarkCheck();
std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > getBookmarks(int folder_id = -1);
- std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > getBookmarkFolders(int folder_id);
std::shared_ptr<services::HistoryItemVector> getHistory();
std::shared_ptr<services::HistoryItemVector> getMostVisitedItems();
+
+ //UI signal handling functions
void onBookmarkAdded(std::shared_ptr<tizen_browser::services::BookmarkItem> bookmarkItem);
void onBookmarkClicked(std::shared_ptr<tizen_browser::services::BookmarkItem> bookmarkItem);
- void onBookmarkDeleteClicked(std::shared_ptr<tizen_browser::services::BookmarkItem> bookmarkItem);
void onBookmarkRemoved(const std::string& uri);
- void onHistoryAdded(std::shared_ptr<tizen_browser::services::HistoryItem> historyItem);
void onHistoryRemoved(const std::string& uri);
- void onHistoryClicked(std::shared_ptr<tizen_browser::services::HistoryItem> historyItem);
- void onClearHistoryClicked(const std::string&);
+ void onOpenURLInNewTab(std::shared_ptr<tizen_browser::services::HistoryItem> historyItem, bool desktopMode);
+ void onMostVisitedTileClicked(std::shared_ptr<tizen_browser::services::HistoryItem> historyItem, int itemsNumber);
+ void onClearHistoryClicked();
- void onMostVisitedClicked(const std::string&);
- void onBookmarkButtonClicked(const std::string&);
- void onBookmarkManagerButtonClicked(const std::string&);
+ void onMostVisitedClicked();
+ void onBookmarkButtonClicked();
void handleConfirmationRequest(basic_webengine::WebConfirmationPtr webConfirmation);
void authPopupButtonClicked(PopupButtons button, std::shared_ptr<PopupData> popupData);
void onActionTriggered(const Action& action);
-
- void loadThemes();
-
void setwvIMEStatus(bool status);
- sharedAction m_back;
- sharedAction m_forward;
- sharedAction m_stopLoading;
- sharedAction m_reload;
- sharedAction m_bookmark;
- sharedAction m_unbookmark;
- sharedAction m_tab;
- sharedAction m_share;
- sharedAction m_zoom_in;
- sharedAction m_showMoreMenu;
sharedAction m_showBookmarkManagerUI;
- sharedAction m_settingPointerMode;
sharedAction m_settingPrivateBrowsing;
- sharedAction m_settingDeleteHistory;
- sharedAction m_settingDeleteData;
- sharedAction m_settingDeleteFavorite;
- sharedAction m_mostvisited;
- sharedAction m_bookmarksvisited;
- sharedAction m_bookmarks_manager_Add_NewFolder;
- sharedAction m_bookmarks_manager_BookmarkBar;
- sharedAction m_bookmarks_manager_Folder1;
- sharedAction m_bookmarks_manager_Folder2;
- sharedAction m_bookmarks_manager_Folder3;
/**
* \brief filters URL before it is passed to WebEngine.
* For filtered addresses we need to hide real URI so the user would be confused.
* and this is a back function that checks if address emited from browser should be changed.
*/
- void webEngineURLChanged(const std::string& url);
+ void webEngineURLChanged(const std::string url);
void onmostHistoryvisitedClicked();
void onBookmarkvisitedClicked();
- /**
+ /**
+ * @brief Check if the current page exists as a bookmark.
+ *
+ */
+ bool checkBookmark();
+ /**
* @brief Adds current page to bookmarks.
*
*/
void deleteBookmark(void);
/**
- * \brief shows Zoom showZoomMenu
+ * @brief show Zoom Menu
*/
- void showZoomMenu();
-
- void zoomLevelChanged(int zoom_level);
-
- void showHistory();
- void hideHistory();
- void AddBookmarkPopup(std::string& str);
- void AddNewFolderPopup(std::string& str);
- void addBookmarkFolders();
+ void showZoomUI();
+ void closeZoomUI();
+ void setZoomFactor(int level);
+ void scrollView(const int& dx, const int& dy);
- void newFolderBookmarkManager(const char* title, int by_user);
- void newFolderMoreMenu(const char* title, int by_user);
void showTabUI();
- void closeTabUI(const std::string& str);
+ void closeTabUI();
void showMoreMenu();
- void closeMoreMenu(const std::string& str);
- void showHistoryUI(const std::string& str);
- void closeHistoryUI(const std::string&);
- void showMainUI();
- void hideMainUI();
- void showURIBar();
- void hideURIBar();
- void hideWebView();
- void hideSettingsMenu();
- void showSettingsUI(const std::string&);
- void closeSettingsUI(const std::string&);
-
- void showProgressBar();
- void hideProgressBar();
-
- void closeBookmarkManagerMenu(std::string& str);
- void updateBookmarkManagerGenGrid(int folder_id);
- void showBookmarkManagerMenu();
-
+ void closeMoreMenu();
+ void switchToMobileMode();
+ void switchToDesktopMode();
+ void showHistoryUI();
+ void closeHistoryUI();
+ void showSettingsUI();
+ void closeSettingsUI();
+ void closeBookmarkManagerUI();
+ void showBookmarkManagerUI();
void showPopup(Evas_Object *content, char* btn1_text, char* btn2_text);
void closeTab();
void closeTab(const tizen_browser::basic_webengine::TabId& id);
- void settingsPointerModeSwitch(bool newState);
void settingsPrivateModeSwitch(bool newState);
- void settingsDeleteData();
- void settingsDeleteFavorite();
void settingsDeleteSelectedData(const std::string& str);
- void settingsResetMostVisited(const std::string& str);
- void settingsResetBrowser(const std::string& str);
- void onDeleteSelectedDataButton(PopupButtons button, std::shared_ptr<PopupData> popupData);
- void onDeleteMostVisitedButton(PopupButtons button, std::shared_ptr<PopupData> popupData);
+ void settingsResetMostVisited();
+ void settingsResetBrowser();
+ void onDeleteSelectedDataButton(const std::string &dataText);
+ void onDeleteMostVisitedButton(std::shared_ptr<PopupData> popupData);
void onResetBrowserButton(PopupButtons button, std::shared_ptr<PopupData> popupData);
- void onDeleteDataButton(PopupButtons button, std::shared_ptr<PopupData> popupData);
- void onDeleteFavoriteButton(PopupButtons button, std::shared_ptr<PopupData> popupData);
void tabLimitPopupButtonClicked(PopupButtons button, std::shared_ptr< PopupData > /*popupData*/);
- void openLinkFromPopup(const std::string &);
- void disableHistoryButton(bool flag);
-
- void onNetworkError();
- void onNetworkConnected();
- void onNetErrorButtonPressed(PopupButtons, std::shared_ptr<PopupData>);
+ int tabsCount();
void onReturnPressed(MenuButton *m);
void onBackPressed();
- boost::signals2::signal<void ()> hidePopup;
+ void searchWebPage(std::string &text, int flags);
std::string edjePath(const std::string &);
- Evas_Object *m_mainLayout;
- Evas_Object *m_progressBar;
Evas_Object *m_popup;
- Evas_Object *m_entry;
- Evas_Object *m_errorLayout;
- CustomPopup *m_ownPopup;
- SimpleScroller *m_scroller;
+ std::shared_ptr<WebPageUI> m_webPageUI;
std::shared_ptr<basic_webengine::AbstractWebEngine<Evas_Object>> m_webEngine;
- std::shared_ptr<tizen_browser::base_ui::SimpleURI> m_simpleURI;
- std::shared_ptr<ButtonBar> leftButtonBar;
- std::shared_ptr<ButtonBar> webviewbar;
-
- std::shared_ptr<ButtonBar> rightButtonBar;
- std::shared_ptr<tizen_browser::interfaces::AbstractFavoriteService> m_favoriteService;
- std::shared_ptr<tizen_browser::services::HistoryService> m_historyService;
- std::shared_ptr<tizen_browser::base_ui::MoreMenuUI> m_moreMenuUI;
- std::shared_ptr<tizen_browser::base_ui::BookmarkManagerUI> m_bookmarkManagerUI;
- std::shared_ptr<tizen_browser::base_ui::MainUI> m_mainUI;
- std::shared_ptr<tizen_browser::base_ui::HistoryUI> m_historyUI;
- std::shared_ptr<tizen_browser::base_ui::SettingsUI> m_settingsUI;
- std::shared_ptr<tizen_browser::base_ui::TabUI> m_tabUI;
- std::shared_ptr<tizen_browser::base_ui::ZoomList> m_zoomList;
- std::shared_ptr<tizen_browser::base_ui::TabList> m_tabList;
- std::shared_ptr<tizen_browser::services::PlatformInputManager> m_platformInputManager;
- std::shared_ptr<tizen_browser::services::SessionStorage> m_sessionService;
- tizen_browser::Session::Session m_currentSession;
+ std::shared_ptr<interfaces::AbstractFavoriteService> m_favoriteService;
+ std::shared_ptr<services::HistoryService> m_historyService;
+ std::shared_ptr<MoreMenuUI> m_moreMenuUI;
+ std::shared_ptr<BookmarkManagerUI> m_bookmarkManagerUI;
+ std::shared_ptr<QuickAccess> m_quickAccess;
+ std::shared_ptr<HistoryUI> m_historyUI;
+ std::shared_ptr<SettingsUI> m_settingsUI;
+ std::shared_ptr<TabUI> m_tabUI;
+ std::shared_ptr<services::PlatformInputManager> m_platformInputManager;
+ std::shared_ptr<services::SessionStorage> m_sessionService;
+ Session::Session m_currentSession;
+ std::shared_ptr<tizen_browser::base_ui::ZoomUI> m_zoomUI;
std::shared_ptr<BookmarksManager> m_bookmarks_manager;
- std::shared_ptr<Settings> m_settings;
- std::shared_ptr<HistoryList> m_historyList;
- std::shared_ptr<WebTitleBar> webTitleBar;
bool m_initialised;
- bool m_isHomePageActive;
- zoom_type m_currentZoom;
int m_tabLimit;
int m_favoritesLimit;
bool m_wvIMEStatus;
- int m_curr_folder_id;
+
+ //helper object used to view management
+ ViewManager* m_viewManager;
+
// This context object is used to implicitly init internal ewk data used by opengl to create the first and
// consecutive webviews in the application, otherwise we would encounter a crash after creating
// the first web view
Ewk_Context *m_ewkContext;
-
- std::vector<std::shared_ptr<tizen_browser::services::HistoryItem>> items_vector;
- std::unique_ptr<tizen_browser::basic_ui::NetworkErrorHandler> m_netErrorHandler;
- SimplePopup* m_networkErrorPopup;
-
- void searchWebPage(std::string &text, int flags);
- static void favicon_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
-
};
}