2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <boost/signals2/signal.hpp>
24 #include "BasicUI/Action.h"
25 #include "BrowserImage.h"
29 namespace tizen_browser {
41 void init(Evas_Object* parent);
42 Evas_Object* getContent();
45 void changeUri(const std::string&);
46 boost::signals2::signal<void (const std::string&)> uriChanged;
49 boost::signals2::signal<void ()> uriEntryEditingChanged;
50 // uri edition change (by a user)
51 boost::signals2::signal<void (const std::shared_ptr<std::string>)> uriEntryEditingChangedByUser;
53 void setFavIcon(std::shared_ptr<tizen_browser::tools::BrowserImage> favicon);
54 void setCurrentFavIcon();
57 void setPageTitle(const std::string& title);
58 void setURI(const std::string& uri);
60 IconType getCurrentIconTyep();
62 * \brief Adds Action to URI bar.
64 * All Actions will be displayed before URI entry.
66 void AddAction(sharedAction action);
69 * \brief returns list of stored actions
71 std::list<sharedAction> actions() const;
74 * \brief Sets Focus to URI entry.
79 * @brief Remove focus form URI
84 * @brief check if URI is focused
86 bool hasFocus() const;
88 void setDisabled(bool disabled);
89 void editingCanceled();
92 static void activated(void* data, Evas_Object* obj, void* event_info);
93 static void aborted(void* data, Evas_Object* obj, void* event_info);
94 static void preeditChange(void* data, Evas_Object* obj, void* event_info);
95 static void focused(void* data, Evas_Object* obj, void* event_info);
96 static void unfocused(void* data, Evas_Object* obj, void* event_info);
98 void editingCompleted();
99 void selectWholeText();
100 void setUrlGuideText(const char* txt) const;
103 * \brief Rewrites URI to support search and prefixing http:// if needed
105 std::string rewriteURI(const std::string& url);
107 static void _fixed_entry_key_down_handler(void* data, Evas* e, Evas_Object* obj, void* event_info);
108 static void _uri_entry_btn_clicked(void* data, Evas_Object* obj, void* event_info);
109 static void _uri_entry_clicked(void* data, Evas_Object* obj, void* event_info);
110 static void _uri_entry_editing_changed(void* data, Evas_Object* obj, void* event_info);
111 static void _uri_entry_editing_changed_user(void* data, Evas_Object* obj, void* event_info);
113 static void focusedBtn(void* data, Evas_Object* obj, void* event_info);
114 static void unfocusedBtn(void* data, Evas_Object* obj, void* event_info);
117 Evas_Object* m_parent;
118 IconType m_currentIconType;
119 std::list<sharedAction> m_actions;
120 Evas_Object* m_entry;
121 Evas_Object* m_favicon;
122 Evas_Object* m_entry_layout;
123 Evas_Object* m_entryBtn;
124 bool m_entrySelectedAllFirst;
125 std::string m_oryginalEntryText;
126 std::string m_pageTitle;
128 bool m_searchTextEntered;