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.
17 #include "HistoryItem.h"
19 namespace tizen_browser
24 HistoryItem::HistoryItem(HistoryItem && other) throw()
26 *this = std::move(other);
29 HistoryItem::HistoryItem(const std::string & url,
30 const std::string & title,
31 std::shared_ptr<tizen_browser::tools::BrowserImage> image)
38 HistoryItem::HistoryItem(const std::string & url)
42 , m_favIcon(std::make_shared<tizen_browser::tools::BrowserImage>())
47 HistoryItem::HistoryItem(const HistoryItem& source)
49 , m_title(source.m_title)
50 , m_lastVisit(source.m_lastVisit)
51 , m_favIcon(source.m_favIcon)
52 , m_visitCounter(source.m_visitCounter)
57 HistoryItem::~HistoryItem()
62 HistoryItem & HistoryItem::operator=(HistoryItem && other) throw()
65 m_url = std::move(other.m_url);
66 m_title = std::move(other.m_title);
67 m_visitDate = std::move(other.m_visitDate);
68 m_visitCounter = std::move(other.m_visitCounter);
69 m_favIcon = std::move(other.m_favIcon);
74 bool HistoryItem::operator==(const HistoryItem& other)
76 return (m_url == other.m_url);
79 bool HistoryItem::operator!=(const HistoryItem& other)
81 return (m_url != other.m_url);
84 void HistoryItem::setUrl(const std::string & url)
89 std::string HistoryItem::getUrl()
94 void HistoryItem::setTitle(const std::string & title)
99 std::string HistoryItem::getTitle() const
104 // void HistoryItem::setVisitDate(boost::gregorian::date visitDate)
106 // m_visitDate = visitDate;
109 // boost::gregorian::date HistoryItem::getVisitDate()
111 // return m_visitDate;
114 void HistoryItem::setLastVisit(boost::posix_time::ptime visitDate)
116 m_lastVisit = visitDate;
119 boost::posix_time::ptime HistoryItem::getLastVisit() const
124 void HistoryItem::setVisitCounter(int visitCounter)
126 m_visitCounter = visitCounter;
129 int HistoryItem::getVisitCounter()
131 return m_visitCounter;
134 void HistoryItem::setFavIcon(std::shared_ptr<tizen_browser::tools::BrowserImage> favIcon)
139 std::shared_ptr<tizen_browser::tools::BrowserImage> HistoryItem::getFavIcon()
144 void HistoryItem::setUriFavicon(const std::string & uri) {
148 std::string HistoryItem::getUriFavicon() {