merge with master
[platform/framework/web/wrt-plugins-common.git] / src / modules / tizen / DEPRACATED / Telephony / LogManager.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  * @file        LogManager.h
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.2
20  */
21
22 #ifndef _SLP20__LOG_MANAGER_H_
23 #define _SLP20__LOG_MANAGER_H_
24
25 #include <vector>
26 #include <dpl/mutex.h>
27 #include <dpl/shared_ptr.h>
28 #include <API/Telephony/ILogManager.h>
29 #include <API/Telephony/LogEntry.h>
30 #include <API/Telephony/LogFilter.h>
31 #include <API/Telephony/IEventGetNumberOfLogs.h>
32 #include <API/Telephony/IEventFindLogEntries.h>
33 #include <API/Telephony/IEventDeleteLogEntry.h>
34 #include <API/Telephony/IEventClearLogs.h>
35
36 namespace WrtPlugins {
37 namespace Platform {
38 class LogManager : public Api::ILogManager
39 {
40   public:
41     LogManager();
42     virtual ~LogManager();
43
44   protected:
45     virtual void                OnRequestReceived(
46         const Api::IEventGetNumberOfLogsPtr &event);
47     virtual void                OnRequestReceived(
48         const Api::IEventFindLogEntriesPtr &event);
49     virtual void                OnRequestReceived(
50         const Api::IEventDeleteLogEntryPtr &event);
51     virtual void                OnRequestReceived(
52         const Api::IEventClearLogPtr &event);
53     int                         getNumberOfLogsInternal(
54         const Api::LogFilterPtr &filter);
55     std::vector<Api::LogEntryPtr> findLogEntriesInternal(
56         const Api::LogFilterPtr &filter,
57         const int minIndex = -1,
58         const int maxIndex = -1);
59     void                        deleteLogEntryInternal(int id) const;
60     void                        clearLogInternal(
61         const Api::LogFilterPtr &filter);
62     static int m_instanceCount;
63     DPL::Mutex m_constructorMutex;
64 };
65
66 typedef DPL::SharedPtr<LogManager> LogManagerPtr;
67 }
68 }
69
70 #endif /* _SLP20__LOG_MANAGER_H_ */