2 // Copyright (c) 2012 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 FBaseRt_EventPendingOperationManager.h
19 * @brief This is the header file of __EventPendingOperationManager class.
22 #ifndef _FRT_INTERNAL_EVENT_PENDING_OPERATION_MANAGER_H_
23 #define _FRT_INTERNAL_EVENT_PENDING_OPERATION_MANAGER_H_
26 #include <FBaseObject.h>
27 #include <FBaseColLinkedList.h>
30 namespace Tizen { namespace Base { namespace Runtime
34 // forward declaration
39 enum EventPendingOperationType
41 EVENT_OPERATION_REMOVE_FILTER,
42 EVENT_OPERATION_ADD_FILTER,
43 EVENT_OPERATION_REMOVE_LISTENER,
44 EVENT_OPERATION_ADD_LISTENER,
50 // @class _EventPendingOperationManager
51 // This class manages the pending operation of the Event class.
52 // Pending operations are the collection related operations because the collection does not permit
53 // the add/remove operation when it is traversing.
55 // Event class makes an add/remove filter/listener a pending operations while they are executed in the filter or the listener.
57 class _EventPendingOperationManager
58 : public Tizen::Base::Object
62 * Is a default constructor.
64 _EventPendingOperationManager(void);
67 * This methods completes the pending operation to add filters.
69 * @param[in] pFilter The pointer of filters to add.
70 * @return The error code.
71 * @exception E_SUCCESS
73 result AddFilter(const IEventFilter& filter);
77 * This methods completes the pending operation to remove filters.
79 * @param[in] pFilter The pointer of filters to remove.
80 * @return The error code.
81 * @exception E_SUCCESS
83 result RemoveFilter(const IEventFilter& filter);
87 * This methods completes the pending operation to add listeners.
89 * @param[in] pListener The pointer of listeners to add.
90 * @return The error code.
91 * @exception E_SUCCESS
93 result AddListener(const IEventListener& listener);
97 * This methods completes the pending operation to remove listeners.
99 * @param[in] pListener The pointer of listeners to remove.
100 * @return The error code.
101 * @exception E_SUCCESS
103 result RemoveListener(const IEventListener& listener);
107 class _EventPendingOperation
108 : public Tizen::Base::Object
111 _EventPendingOperation(void)
112 : opType(EVENT_OPERATION_ADD_LISTENER)
119 virtual ~_EventPendingOperation(void)
124 EventPendingOperationType opType;
125 const IEventFilter* pFilter;
126 const IEventListener* pListener;
129 Tizen::Base::Collection::LinkedList __operations;
133 } } } // Tizen::Runtime
135 #endif // _FRT_INTERNAL_EVENT_PENDING_OPERATION_MANAGER_H_