1 #ifndef DALI_WIN_CALLBACK_MANAGER_H
2 #define DALI_WIN_CALLBACK_MANAGER_H
5 * Copyright (c) 2019 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.
25 #include <dali/internal/system/common/callback-manager.h>
36 * @brief LibUV callback manager used to install call backs in the applications main loop.
37 * The manager keeps track of all callbacks, so that if Stop() is called it can remove them.
39 class WinCallbackManager : public CallbackManager
52 ~WinCallbackManager(){}
55 * @copydoc CallbackManager::AddIdleCallback()
57 bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue ) override;
60 * @copydoc CallbackManager::RemoveIdleCallback()
62 void RemoveIdleCallback( CallbackBase* callback ) override;
65 * @copydoc CallbackManager::ProcessIdle()
67 bool ProcessIdle() override;
70 * @copydoc CallbackManager::ClearIdleCallbacks()
72 void ClearIdleCallbacks() override;
75 * @brief Adds a @p callback to be run when entering an idle state.
76 * @note Must be called from the main thread only.
78 * A callback of the following type should be used:
82 * This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback.
84 * @param[in] callback custom callback function.
86 * @return true on success
88 bool AddIdleEntererCallback( CallbackBase* callback ) override;
91 * @brief Removes a previously added the idle enterer callback.
92 * @note Must be called from main thread only.
94 * Does nothing if the @p callback doesn't exist.
96 * @param[in] callback The callback to be removed.
98 void RemoveIdleEntererCallback( CallbackBase* callback ) override;
101 * @copydoc CallbackManager::Start()
103 void Start() override;
106 * @copydoc CallbackManager::Stop()
108 void Stop() override;
111 std::set<CallbackBase*> mCallbacks;
112 bool mRunning; ///< flag is set to true if when running
115 } // namespace Adaptor
117 } // namespace Internal
121 #endif // DALI_WIN_CALLBACK_MANAGER_H