#include <Evas.h>
-//#include <EWebKit2.h>
-//#include <ewk_chromium.h>
-
#include "AbstractMainWindow.h"
#include "AbstractService.h"
#include "AbstractFavoriteService.h"
#include "service_macros.h"
// components
+#include "WebPageUI.h"
#include "AbstractWebEngine.h"
-#include "BookmarksUI.h"
-#include "ButtonBar.h"
-#include "FavoriteService.h"
+#include "MoreMenuUI.h"
+#include "HistoryUI.h"
+#include "SettingsUI.h"
+#include "QuickAccess.h"
+#include "TabUI.h"
+#include "ZoomUI.h"
#include "HistoryService.h"
-#include "SimpleURI.h"
-#include "SimpleScroller.h"
-#include "WebTitleBar.h"
+#include "BookmarkManagerUI.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 "Settings.h"
-#include "HistoryList.h"
-#include "SearchBox.h"
-#include "NetworkErrorHandler.h"
-#include "CustomPopup.h"
+#include "BookmarksManager.h"
#include "Config.h"
+#include "ViewManager.h"
namespace tizen_browser{
namespace base_ui{
m_window = std::shared_ptr<Evas_Object>(rawPtr, evas_object_del);
}
-
-
class BROWSER_EXPORT SimpleUI : public AbstractMainWindow<Evas_Object>
{
public:
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 switchViewToBrowser();
- void updateBrowserView();
+ 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();
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();
+ std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > getBookmarks(int folder_id = -1);
+ 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 onHistoryRemoved(const std::string& uri);
+ 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();
+ void onBookmarkButtonClicked();
+
void handleConfirmationRequest(basic_webengine::WebConfirmationPtr webConfirmation);
void authPopupButtonClicked(PopupButtons button, std::shared_ptr<PopupData> popupData);
void onActionTriggered(const Action& action);
+ void setwvIMEStatus(bool status);
- void loadThemes();
-
-
-
- sharedAction m_back;
- sharedAction m_forward;
- sharedAction m_stopLoading;
- sharedAction m_reload;
- sharedAction m_bookmark;
- sharedAction m_unbookmark;
- sharedAction m_tab;
- sharedAction m_history;
- sharedAction m_zoom_in;
- sharedAction m_showSettingsPopup;
- sharedAction m_settingPointerMode;
+ sharedAction m_showBookmarkManagerUI;
sharedAction m_settingPrivateBrowsing;
- sharedAction m_settingDeleteHistory;
- sharedAction m_settingDeleteData;
- sharedAction m_settingDeleteFavorite;
/**
* \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 addToBookmarks(void);
-
+ void addToBookmarks(int);
/**
* @brief Remove current page from bookmarks
*
void deleteBookmark(void);
/**
- * \brief shows Zoom showZoomMenu
+ * @brief show Zoom Menu
*/
- void showZoomMenu();
-
- void zoomLevelChanged(int zoom_level);
-
- void showHistory();
- void hideHistory();
-
- /**
- * \brief shows Tab showTabMenu
- */
- void showTabMenu();
-
- void showSettingsMenu();
- void hideSettingsMenu();
-
- void showSearchBox();
- void hideSearchBox();
-
- void showProgressBar();
- void hideProgressBar();
-
-
+ void showZoomUI();
+ void closeZoomUI();
+ void setZoomFactor(int level);
+ void scrollView(const int& dx, const int& dy);
+
+ void showTabUI();
+ void closeTabUI();
+ void showMoreMenu();
+ 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 settingsDeleteHistory();
- void settingsDeleteData();
- void settingsDeleteFavorite();
- void onDeleteHistoryButton(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 settingsDeleteSelectedData(const std::string& str);
+ 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 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_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> 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::BookmarksUI> m_bookmarksUI;
- 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::base_ui::SearchBox> m_searchBox;
- 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<Settings> m_settings;
- std::shared_ptr<HistoryList> m_historyList;
- std::shared_ptr<WebTitleBar> webTitleBar;
+ 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;
bool m_initialised;
- zoom_type m_currentZoom;
int m_tabLimit;
int m_favoritesLimit;
+ bool m_wvIMEStatus;
- 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);
+ //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;
};
}