Merge "Revert "Fix N_SE-46938 for tz list."" into devel_3.0_main
[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 <FBaseObject.h>
28 #include <FBaseColHashMap.h>
29 #include <FBaseRt_Event.h>
30
31 namespace Tizen { namespace Base
32 {
33 class String;
34 }}
35
36 namespace Tizen { namespace Io
37 {
38
39 class FileEventManager;
40 class IFileEventListener;
41
42 class _OSP_EXPORT_ _FileEventManagerImpl
43         : public Tizen::Base::Object
44 {
45
46 public:
47         _FileEventManagerImpl(void);
48
49         virtual ~_FileEventManagerImpl(void);
50
51         result Construct(IFileEventListener& listener);
52
53         result AddPath(const Tizen::Base::String& path, unsigned long eventsToMonitor);
54
55         result RemovePath(const Tizen::Base::String& path);
56
57         Tizen::Base::Runtime::_Event* GetEvent(void) const
58         {
59                 return __pEvent;
60         }
61
62         static _FileEventManagerImpl* GetInstance(FileEventManager& fileEventManager);
63
64         static const _FileEventManagerImpl* GetInstance(const FileEventManager& fileEventManager);
65
66 private:
67         _FileEventManagerImpl(const _FileEventManagerImpl& rhs);
68
69         _FileEventManagerImpl& operator =(const _FileEventManagerImpl& rhs);
70
71 private:
72         Tizen::Base::Collection::HashMap* __pWatchList;
73         Tizen::Base::Runtime::_Event* __pEvent;
74         int __inotifyFd;
75
76         friend class FileEventManager;
77
78 }; // _FileEventManagerImpl
79
80 }} // Tizen::Io
81
82 #endif //_FIO_INTERNAL_FILE_EVENT_MANAGER_IMPL_H_
83