Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Call / CallHistoryEntry.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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. 
15  */
16
17
18 #include "CallHistoryEntry.h"
19
20 #include <Commons/Exception.h>
21 #include <dpl/shared_ptr.h>
22 #include <dpl/log/log.h>
23 #include <calllog.h>
24
25 using namespace TizenApis::Api::Tizen;
26 using namespace TizenApis::Api::Call;
27 using namespace WrtDeviceApis;
28 using namespace WrtDeviceApis::Commons;
29 using namespace DPL;
30
31 namespace TizenApis {
32 namespace Platform {
33 namespace Call {
34
35 CallHistoryEntry::CallHistoryEntry()
36 {
37         if (calllog_connect() == CALLLOG_ERROR_NONE) {
38                 LogDebug("Successful to connect Call history DB ");
39         } else {
40                 LogDebug("Failed to connect Call history DB ");
41         }
42 }
43
44 CallHistoryEntry::~CallHistoryEntry()
45 {
46         if (calllog_disconnect() == CALLLOG_ERROR_NONE) {
47                 LogDebug("Successful to disconnect Call history DB ");
48         } else {
49                 LogDebug("Failed to disconnect Call history DB ");
50         }
51 }
52
53 void CallHistoryEntry::setMarkSeen(const unsigned long entryId)
54 {
55         calllog_update_missed_unchecked_to_checked_to_db(entryId);
56 }
57
58 }
59 }
60 }
61