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