Fix the boiler plate codes
[platform/framework/native/appfw.git] / src / io / inc / FIo_FileEventManagerImpl.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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  * @file        FIo_FileEventManagerImpl.h
19  * @brief       This is the header file for the %_FileEventManagerImpl class.
20  *
21  * This header file contains the declarations of the %_FileEventManagerImpl class.
22  */
23
24 #ifndef _FIO_INTERNAL_FILE_EVENT_MANAGER_IMPL_H_
25 #define _FIO_INTERNAL_FILE_EVENT_MANAGER_IMPL_H_
26
27 #include <glib.h>
28
29 #include <FBaseObject.h>
30 #include <FBaseColHashMap.h>
31 #include <FOspConfig.h>
32 #include <FBaseRtEvent.h>
33
34 namespace Tizen { namespace Base
35 {
36 class String;
37 }}
38
39 namespace Tizen { namespace Io
40 {
41
42 class FileEventManager;
43 class IFileEventListener;
44
45 class _OSP_EXPORT_ _FileEventManagerImpl
46         : public Tizen::Base::Object
47 {
48
49 public:
50         _FileEventManagerImpl(void);
51
52         virtual ~_FileEventManagerImpl(void);
53
54         result Construct(IFileEventListener& listener);
55
56         result AddPath(const Tizen::Base::String& path, unsigned long eventsToMonitor);
57
58         result RemovePath(const Tizen::Base::String& path);
59
60         result SendEvent(void);
61
62         static _FileEventManagerImpl* GetInstance(FileEventManager& fileEventManager);
63
64         static const _FileEventManagerImpl* GetInstance(const FileEventManager& fileEventManager);
65
66 private:
67         _FileEventManagerImpl(const _FileEventManagerImpl& source);
68
69         _FileEventManagerImpl& operator =(const _FileEventManagerImpl& source);
70
71         Tizen::Base::String GetRegisteredPath(int fd);
72
73         static gboolean OnFileEventOccured(GIOChannel* source, GIOCondition condition, gpointer data);
74
75         Tizen::Base::Collection::HashMap* __pMonitorFileList;
76         Tizen::Base::Runtime::Event* __pEvent;
77         int __inotifyFd;
78         GSource* __pGSource;
79         GIOChannel* __pGIOChannel;
80
81         friend class FileEventManager;
82
83 }; // _FileEventManagerImpl
84
85 }} // Tizen::Io
86
87 #endif //_FIO_INTERNAL_FILE_EVENT_MANAGER_IMPL_H_
88