1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_GESTURE_PROPERTIES_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_GESTURE_PROPERTIES_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/public-api/object/property-types.h>
22 #include <dali/internal/common/buffer-index.h>
23 #include <dali/internal/event/common/property-input-impl.h>
35 * A template for a read only properties used by Gestures.
38 class GestureProperty : public PropertyInputImpl
43 * Create a read-only gesture property.
44 * @param [in] initialValue The initial value of the property.
46 GestureProperty( const T& initialValue )
47 : mValue( initialValue ),
48 mInputChanged( false )
53 * Create a read-only gesture property.
57 mInputChanged( false )
64 virtual ~GestureProperty()
69 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
71 virtual Dali::Property::Type GetType() const
73 return Dali::PropertyTypes::Get< T >();
77 * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
79 virtual bool IsClean() const
81 return !InputChanged();
85 * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
87 virtual bool InputInitialized() const
89 // A constraint cannot use the property until it has been inherited (at least once).
94 * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
95 * @note A constraint can only receive the inherited property from the previous frame.
97 virtual bool InputChanged() const
103 * Set the property value.
104 * @param[in] value The new property value.
106 void Set(const T& value)
109 mInputChanged = true;
113 * Get the property value.
114 * @return The property value.
124 GestureProperty(const GestureProperty& property);
127 GestureProperty& operator=(const GestureProperty& rhs);
131 T mValue; ///< The property value
132 bool mInputChanged:1; ///< Whether the property has been modified
136 * A read only Vector2 property used by Gestures.
138 class GesturePropertyVector2 : public GestureProperty< Vector2 >
143 * Virtual destructor.
145 virtual ~GesturePropertyVector2()
150 * @copydoc Dali::PropertyInput::GetVector2()
152 virtual const Vector2& GetVector2( BufferIndex bufferIndex ) const
158 } // namespace SceneGraph
160 } // namespace Internal
164 #endif // __DALI_INTERNAL_SCENE_GRAPH_GESTURE_PROPERTIES_H__