1 #ifndef __DALI_INTERNAL_ACTOR_GESTURE_DATA_H__
2 #define __DALI_INTERNAL_ACTOR_GESTURE_DATA_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 <dali/internal/event/events/gesture-detector-impl.h>
31 * Holds gesture specific data for an Actor
33 class ActorGestureData
43 * Non-virtual Destructor
48 * Adds a gesture detector to the data so that the owning actor is aware that it requires this
50 * @param[in] detector The detector being added.
51 * @note A raw pointer to the detector is stored, so the detector MUST remove itself when it is
52 * destroyed using RemoveGestureDetector()
54 void AddGestureDetector( GestureDetector& detector );
57 * Removes a previously added gesture detector from the data. If no more gesture detectors of
58 * this type are registered then the actor owning this data will no longer be hit-tested for that
60 * @param[in] detector The detector to remove.
62 void RemoveGestureDetector( GestureDetector& detector );
65 * Queries whether the actor requires the gesture type.
66 * @param[in] type The gesture type.
67 * @return true if the gesture is required, false otherwise.
69 inline bool IsGestureRequred( Gesture::Type type ) const
71 return type & gesturesRequired;
75 * Retrieve a reference to the detectors for the given type.
76 * @param[in] type The container type required
77 * @pre Ensure IsGestureRequired() is used to check if the container is actually available.
79 GestureDetectorContainer& GetGestureDetectorContainer( Gesture::Type type );
84 * Helper to retrieve the appropriate container type.
85 * @param[in] type The container type required.
87 inline GestureDetectorContainer*& GetContainerPtr( Gesture::Type type );
91 Gesture::Type gesturesRequired; ///< Stores which gestures are required
93 GestureDetectorContainer* panDetectors; ///< Pointer to a container of pan-detectors
94 GestureDetectorContainer* pinchDetectors; ///< Pointer to a container of pinch-detectors
95 GestureDetectorContainer* longPressDetectors; ///< Pointer to a container of long-press-detectors
96 GestureDetectorContainer* tapDetectors; ///< Pointer to a container of tap-detectors
99 } // namespace Internal
103 #endif // __DALI_INTERNAL_ACTOR_GESTURE_DATA_H__