2 * Copyright (c) 2015 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.
17 #include <Elementary.h>
18 #include "UrlHistoryList.h"
19 #include "GenlistManager.h"
21 #include "BrowserLogger.h"
23 namespace tizen_browser
28 UrlHistoryList::UrlHistoryList() :
31 m_edjFilePath = EDJE_DIR;
32 m_edjFilePath.append("MainUI/UrlHistoryList.edj");
33 m_widgetListManager = make_shared<services::GenlistManager>();
36 UrlHistoryList::~UrlHistoryList()
40 void UrlHistoryList::show()
44 evas_object_show(m_layout);
48 Evas_Object* UrlHistoryList::getLayout()
53 void UrlHistoryList::createLayout(Evas_Object* parentLayout)
55 m_layout = elm_layout_add(parentLayout);
56 elm_layout_file_set(m_layout, m_edjFilePath.c_str(), "url_history_list");
58 Evas_Object* widgetList = m_widgetListManager->createWidget(m_layout);
61 void UrlHistoryList::onURLEntryEdit(const string& editedUrl,
62 shared_ptr<services::HistoryItemVector> matchedEntries)
64 Evas_Object* widgetList = m_widgetListManager->getWidget();
65 if (matchedEntries->size() == 0)
67 m_widgetListManager->hideWidget();
71 elm_object_part_content_set(m_layout, "list_swallow", widgetList);
72 m_widgetListManager->showWidget(editedUrl, matchedEntries);
73 evas_object_show(widgetList);
77 void UrlHistoryList::onMouseClick()
79 m_widgetListManager->onMouseClick();
82 }/* namespace base_ui */
83 } /* namespace tizen_browser */