1 #ifndef __DALI_ECORE_CALLBACK_MANAGER_H__
2 #define __DALI_ECORE_CALLBACK_MANAGER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <boost/thread.hpp>
26 #include <callback-manager.h>
41 * Ecore interface to install call backs in the applications main loop.
43 class EcoreCallbackManager : public CallbackManager
51 EcoreCallbackManager();
56 ~EcoreCallbackManager()
61 * @copydoc CallbackManager::AddCallback()
63 virtual bool AddCallback(CallbackBase* callback, Priority priority);
66 * @copydoc CallbackManager::AddEventCallback()
68 virtual bool AddEventCallback(CallbackBase* callback, int type, EventControl control);
71 * @copydoc CallbackManager::Start()
76 * @copydoc CallbackManager::Stop()
81 * Remove all call backs
82 * Always called from the main thread
84 void RemoveAllCallbacksFromMainThread();
89 * Deletes any expired callbacks in the callback container
91 void RefreshContainer();
94 * Removes a single call back from the container
95 * Always called from main thread
96 * @param callbackData callback data
98 void RemoveCallbackFromContainer(CallbackData *callbackData);
101 * Remove a standard call back from ecore
102 * Always called from main thread
103 * @param callbackData callback data
105 void RemoveStandardCallback(CallbackData *callbackData);
108 * Remove an event handler from ecore
109 * Always called from main thread
110 * @param callbackData callback data
112 void RemoveEventCallback(CallbackData *callbackData);
116 typedef std::list<CallbackData *> CallbackList;
118 bool mRunning; ///< flag is set to true if when running
119 CallbackList mCallbackContainer; ///< container of live callbacks
120 boost::mutex mMutex; ///< protect access to shared data
123 } // namespace Adaptor
125 } // namespace Internal
129 #endif // __DALI_ECORE_CALLBACK_MANAGER_H__