Changed 'virtual' function override declarations to 'override'.
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / linux / callback-manager-ecore.h
1 #ifndef DALI_ECORE_CALLBACK_MANAGER_H
2 #define DALI_ECORE_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 EcoreCallbackManager : public CallbackManager
43 {
44
45 public:
46
47     /**
48      * @brief constructor
49      */
50     EcoreCallbackManager();
51
52     /**
53      * @brief destructor
54      */
55     ~EcoreCallbackManager()
56     {
57     }
58
59     /**
60      * @copydoc CallbackManager::AddIdleCallback()
61      */
62     bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue ) override;
63
64     /**
65      * @copydoc CallbackManager::RemoveIdleCallback()
66      */
67     void RemoveIdleCallback( CallbackBase* callback ) override;
68
69     /**
70      * @copydoc CallbackManager::ProcessIdle()
71      */
72     bool ProcessIdle() override;
73
74     /**
75      * @copydoc CallbackManager::ProcessIdle()
76      */
77     void ClearIdleCallbacks() override;
78
79     /**
80      * @copydoc CallbackManager::AddIdleEntererCallback()
81      */
82     bool AddIdleEntererCallback( CallbackBase* callback ) override;
83
84     /**
85      * @copydoc CallbackManager::RemoveIdleEntererCallback()
86      */
87     void RemoveIdleEntererCallback( CallbackBase* callback ) override;
88
89     /**
90      * @copydoc CallbackManager::Start()
91      */
92     void Start() override;
93
94     /**
95      * @copydoc CallbackManager::Stop()
96      */
97     void Stop() override;
98
99 private:
100
101     /**
102      * @brief Remove all idle call backs that are pending
103      * Called by Stop()
104      * Always called from the main thread
105      */
106     void RemoveAllCallbacks();
107
108     /**
109      * @brief Removes a single call back from the container
110      * Always called from main thread
111      * @param callbackData callback data
112      */
113     void RemoveCallbackFromContainer(CallbackData *callbackData);
114
115     /**
116      * @brief Remove a standard call back from ecore
117      * Always called from main thread
118      * @param callbackData callback data
119      */
120     void RemoveStandardCallback(CallbackData *callbackData);
121
122
123     typedef std::list<CallbackData *>  CallbackList;
124
125     bool                           mRunning;            ///< flag is set to true if when running
126     CallbackList                   mCallbackContainer;  ///< container of live idle callbacks
127 };
128
129 } // namespace Adaptor
130
131 } // namespace Internal
132
133 } // namespace Dali
134
135 #endif // DALI_ECORE_CALLBACK_MANAGER_H