Fixed Nabi Issues, Changes for tizen-service implementation and DB Changes
[apps/osp/Internet.git] / src / IntHistory.cpp
1 //
2
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 //!Internet
19 /*@file: IntHistory.cpp
20  *@brief: Used to define History
21  */
22
23 #include "IntHistoryData.h"
24
25 using namespace Tizen::App;
26 using namespace Tizen::Base;
27 using namespace Tizen::Base::Collection;
28 using namespace Tizen::Base::Utility;
29 using namespace Tizen::Content;
30 using namespace Tizen::Graphics;
31 using namespace Tizen::Io;
32 using namespace Tizen::System;
33 using namespace Tizen::Locales;
34 using namespace Tizen::Media;
35 using namespace Tizen::Ui;
36 using namespace Tizen::Ui::Controls;
37
38 History::History(void)
39         : __historyId("")
40         , __historyTitle("")
41         , __historyUrl("")
42         , __iconPath("")
43         ,__bookmarkId(L"")
44         ,__faviconId(L"")
45     , __visitedCount(0)
46         , __pThumbnail(null)
47     , __thumbnailPath("")
48 {
49         AppLog("History::History(void)");
50         __visitedTime.SetValue(0,0,0);
51 }
52
53 History::History(const History& hs)
54 {
55         AppLog("History::History(const History& hs)");
56         __historyId = hs.__historyId;
57         __historyTitle = hs.__historyTitle;
58         __historyUrl = hs.__historyUrl;
59 }
60
61 History::~History(void)
62 {
63         if(__pThumbnail != null)
64         {
65                 delete __pThumbnail; //TODO To get this reviewed
66         }
67         AppLog("History::~History()");
68 }
69
70 History&
71 History::operator =(const History& rhs)
72 {
73         if (this != &rhs)
74         {
75                 __historyId = rhs.__historyId;
76                 __historyTitle = rhs.__historyTitle;
77                 __historyUrl = rhs.__historyUrl;
78         }
79         return *this;
80 }
81
82 String
83 History::GetHistoryId(void) const
84 {
85         return __historyId;
86 }
87
88 String
89 History::GetHistoryTitle(void) const
90 {
91         return __historyTitle;
92 }
93
94 String
95 History::GetHistoryUrl(void) const
96 {
97         return __historyUrl;
98 }
99
100 DateTime
101 History::GetVisitedTime(void) const
102 {
103         return __visitedTime;
104 }
105
106 String
107 History::GetHistoryIconPath(void) const
108 {
109         return __iconPath;
110 }
111
112 String
113 History::GetFaviconId(void) const
114 {
115         return __faviconId;
116 }
117
118 String
119 History::GetBookmarkId(void) const
120 {
121         return __bookmarkId;
122 }
123
124 int
125 History::GetVisitedCount(void) const
126 {
127         return __visitedCount;
128 }
129
130 Bitmap*
131 History::GetThumbnail(void) const
132 {
133         return __pThumbnail;
134 }
135
136 String
137 History::GetThumbnailPath(void) const
138 {
139         return __thumbnailPath;
140 }
141
142 void
143 History::SetHistoryId(const String& strHistoryId)
144 {
145         __historyId = strHistoryId;
146         return;
147 }
148
149 void
150 History::SetHistoryTitle(String& strHistoryTitle)
151 {
152         strHistoryTitle.Trim();
153         __historyTitle = strHistoryTitle;
154         return;
155 }
156
157 void
158 History::SetHistoryUrl(const String& strHistoryUrl)
159 {
160         __historyUrl = strHistoryUrl;
161         return;
162 }
163
164 void
165 History::SetVisitedTime(const DateTime& strVisitedTime)
166 {
167         __visitedTime = strVisitedTime;
168         return;
169 }
170
171 void
172 History::SetIconPath(const String& strFilePath)
173 {
174         __iconPath = strFilePath;
175         return;
176 }
177
178 void
179 History::SetFaviconId(const String& strFaviconId)
180 {
181         __faviconId = strFaviconId;
182 }
183
184 void
185 History::SetBookmarkId(const String& bookmarkId)
186 {
187         __bookmarkId = bookmarkId;
188 }
189
190 void
191 History::SetVisitedCount(int& visitedCount)
192 {
193         __visitedCount = visitedCount;
194 }
195
196 void
197 History::SetThumbnail(Bitmap* thumbnail)
198 {
199         //TODO To get this reviewed
200         if(__pThumbnail != thumbnail && __pThumbnail != null) {
201                 delete __pThumbnail;
202         }
203         __pThumbnail = thumbnail;
204 }
205
206 void
207 History::SetThumbnailPath(String& thumbnailPath)
208 {
209         __thumbnailPath = thumbnailPath;
210 }