9a7b9887b752427aa33f68169f053883f41aa70b
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Call / CallHistory.h
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 #ifndef TIZENAPIS_PLATFORM_CALLHISTORY_H_
19 #define TIZENAPIS_PLATFORM_CALLHISTORY_H_
20
21 #include <dpl/shared_ptr.h>
22 #include <dpl/noncopyable.h>
23
24 #include <API/Call/ICallHistory.h>
25 #include <API/Call/CallHistoryFactory.h>
26 #include <API/Call/EventFindCallHistory.h>
27 #include <API/Call/EventRemoveBatch.h>
28 #include <API/Call/CallHistoryEntryProperties.h>
29 #include "CallHistoryQuery.h"
30
31 namespace TizenApis {
32 namespace Platform {
33 namespace Call {
34
35 class CallHistory : public Api::Call::ICallHistory
36 {
37 public:
38         CallHistory();
39         ~CallHistory();
40
41         void find(const Api::Call::EventFindCallHistoryPtr& event);
42         bool remove(const unsigned long entryId);
43         void removeBatch(const Api::Call::EventRemoveBatchPtr& event);
44
45 private:
46         bool convertCallHistory(callhistory_query_s *query_log, Api::Call::CallHistoryEntryListPtr &callEntries);
47         bool executeQuery(std::string &query, Api::Call::CallHistoryEntryListPtr &callEntries);
48         std::string convertAttrName(std::string &name);
49         std::string makeQuerySortMode(Api::Tizen::SortModeArrayPtr attr);
50
51 protected:
52         void OnRequestReceived(const Api::Call::EventFindCallHistoryPtr& event);
53         void OnRequestReceived(const Api::Call::EventRemoveBatchPtr& event);
54 };
55
56 }
57 }
58 }
59
60 #endif