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)
39 HistoryItem::HistoryItem(const std::string & url)
43 , m_favIcon(std::make_shared<tizen_browser::tools::BrowserImage>())
48 HistoryItem::HistoryItem(const HistoryItem& source)
50 , m_title(source.m_title)
51 , m_lastVisit(source.m_lastVisit)
52 , m_favIcon(source.m_favIcon)
53 , m_visitCounter(source.m_visitCounter)
58 HistoryItem::~HistoryItem()
63 HistoryItem & HistoryItem::operator=(HistoryItem && other) throw()
66 m_url = std::move(other.m_url);
67 m_title = std::move(other.m_title);
68 m_visitDate = std::move(other.m_visitDate);
69 m_visitCounter = std::move(other.m_visitCounter);
70 m_favIcon = std::move(other.m_favIcon);
75 bool HistoryItem::operator==(const HistoryItem& other)
77 return (m_url == other.m_url);
80 bool HistoryItem::operator!=(const HistoryItem& other)
82 return (m_url != other.m_url);
85 void HistoryItem::setUrl(const std::string & url)
90 std::string HistoryItem::getUrl()
95 void HistoryItem::setTitle(const std::string & title)
100 std::string HistoryItem::getTitle() const
105 // void HistoryItem::setVisitDate(boost::gregorian::date visitDate)
107 // m_visitDate = visitDate;
110 // boost::gregorian::date HistoryItem::getVisitDate()
112 // return m_visitDate;
115 void HistoryItem::setLastVisit(boost::posix_time::ptime visitDate)
117 m_lastVisit = visitDate;
120 boost::posix_time::ptime HistoryItem::getLastVisit() const
125 void HistoryItem::setVisitCounter(int visitCounter)
127 m_visitCounter = visitCounter;
130 int HistoryItem::getVisitCounter()
132 return m_visitCounter;
135 void HistoryItem::setFavIcon(std::shared_ptr<tizen_browser::tools::BrowserImage> favIcon)
140 std::shared_ptr<tizen_browser::tools::BrowserImage> HistoryItem::getFavIcon()
145 void HistoryItem::setThumbnail(std::shared_ptr<tizen_browser::tools::BrowserImage> thumbnail)
147 m_thumbnail = thumbnail;
150 std::shared_ptr<tizen_browser::tools::BrowserImage> HistoryItem::getThumbnail() const
156 void HistoryItem::setUriFavicon(const std::string & uri) {
160 std::string HistoryItem::getUriFavicon() {