Changed 'virtual' function override declarations to 'override'.
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / android / callback-manager-android.h
1 #ifndef __DALI_ANDROID_CALLBACK_MANAGER_H__
2 #define __DALI_ANDROID_CALLBACK_MANAGER_H__
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <list>
23
24 // INTERNAL INCLUDES
25 #include <dali/internal/system/common/callback-manager.h>
26
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 namespace Adaptor
35 {
36
37 struct CallbackData;
38
39 /**
40  * Ecore interface to install call backs in the applications main loop.
41  */
42 class AndroidCallbackManager : public CallbackManager
43 {
44
45 public:
46
47     /**
48      * @brief constructor
49      */
50     AndroidCallbackManager();
51
52     /**
53      * @brief destructor
54      */
55     ~AndroidCallbackManager() = default;
56
57     /**
58      * @copydoc CallbackManager::AddIdleCallback()
59      */
60     bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue ) override;
61
62     /**
63      * @copydoc CallbackManager::RemoveIdleCallback()
64      */
65     void RemoveIdleCallback( CallbackBase* callback ) override;
66
67     /**
68      * @copydoc CallbackManager::ProcessIdle()
69      */
70     bool ProcessIdle() override;
71
72     /**
73      * @copydoc CallbackManager::ProcessIdle()
74      */
75     void ClearIdleCallbacks() override;
76
77     /**
78      * @copydoc CallbackManager::AddIdleEntererCallback()
79      */
80     bool AddIdleEntererCallback( CallbackBase* callback ) override;
81
82     /**
83      * @copydoc CallbackManager::RemoveIdleEntererCallback()
84      */
85     void RemoveIdleEntererCallback( CallbackBase* callback ) override;
86
87     /**
88      * @copydoc CallbackManager::Start()
89      */
90     void Start() override;
91
92     /**
93      * @copydoc CallbackManager::Stop()
94      */
95     void Stop() override;
96
97 private:
98
99     /**
100      * @brief Remove all idle call backs that are pending
101      * Called by Stop()
102      * Always called from the main thread
103      */
104     void RemoveAllCallbacks();
105
106     /**
107      * @brief Removes a single call back from the container
108      * Always called from main thread
109      * @param callbackData callback data
110      */
111     void RemoveCallbackFromContainer(CallbackData *callbackData);
112
113     /**
114      * @brief Remove a standard call back from ecore
115      * Always called from main thread
116      * @param callbackData callback data
117      */
118     void RemoveStandardCallback(CallbackData *callbackData);
119
120
121     typedef std::list<CallbackData *>  CallbackList;
122
123     bool                           mRunning;            ///< flag is set to true if when running
124     CallbackList                   mCallbackContainer;  ///< container of live idle callbacks
125 };
126
127 } // namespace Adaptor
128
129 } // namespace Internal
130
131 } // namespace Dali
132
133 #endif // __DALI_ANDROID_CALLBACK_MANAGER_H__