2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FIo_FileEventDispatcher.h
19 * @brief This is the header file for the _FileEventDispatcher class.
21 * This header file contains the declarations of the _FileEventDispatcher class.
24 #ifndef _FIO_INTERNAL_FILE_EVENT_DISPATCHER_H_
25 #define _FIO_INTERNAL_FILE_EVENT_DISPATCHER_H_
29 #include <FBaseInteger.h>
30 #include <FBaseString.h>
31 #include <FBaseColHashMap.h>
33 namespace Tizen { namespace Io
36 class _FileEventManagerImpl;
39 : public Tizen::Base::Object
43 : pFileEventManagerImpl(null)
46 virtual ~_FileEventInfo(void)
49 _FileEventManagerImpl* pFileEventManagerImpl;
50 Tizen::Base::String path;
53 class _FileEventDispatcher
54 : public Tizen::Base::Object
58 result SendEvent(void);
60 int GetInotifyFd(void)
65 result AddFileEventInfo(Tizen::Base::Integer* pWatchDescription, _FileEventInfo* pFileEventInfo);
67 _FileEventInfo* GetFileEventInfo(Tizen::Base::Integer& watchDescription);
69 void RemoveFileEventInfo(Tizen::Base::Integer& watchDescription);
71 static _FileEventDispatcher* GetInstance(void);
74 _FileEventDispatcher(void);
76 result Construct(void);
78 virtual ~_FileEventDispatcher(void);
80 _FileEventDispatcher(const _FileEventDispatcher& rhs);
82 _FileEventDispatcher& operator =(const _FileEventDispatcher& rhs);
84 static void InitSingleton(void);
86 static void DestroySingleton(void);
88 static gboolean OnFileEventOccurred(GIOChannel* source, GIOCondition condition, gpointer data);
91 static _FileEventDispatcher* __pFileEventDispatcherInstance;
92 Tizen::Base::Collection::HashMap* __pWatchList;
95 GIOChannel* __pGIOChannel;
97 }; // _FileEventDispatcher
101 #endif // _FIO_INTERNAL_FILE_EVENT_DISPATCHER_H_