1 #ifndef __DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H__
2 #define __DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_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/devel-api/rendering/renderer.h>
25 #include <dali-toolkit/public-api/controls/control-impl.h>
26 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
38 class ImageView : public Control
43 * Construct a new ImageView.
48 * A reference counted object may only be deleted by calling Unreference()
54 * Create a new ImageView.
55 * @return A smart-pointer to the newly allocated ImageView.
57 static Toolkit::ImageView New();
60 * @copydoc Dali::Toolkit::SetImage( Image image )
62 void SetImage( Image image );
65 * @copydoc Dali::Toolkit::Image GetImage() const
67 Image GetImage() const;
71 * Called when a property of an object of this type is set.
72 * @param[in] object The object whose property is set.
73 * @param[in] index The property index.
74 * @param[in] value The new property value.
76 static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
79 * Called to retrieve a property of an object of this type.
80 * @param[in] object The object whose property is to be retrieved.
81 * @param[in] index The property index.
82 * @return The current value of the property.
84 static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
86 private: // From Control
89 * @copydoc Toolkit::Control::OnRelayout()
91 virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
94 * @copydoc Toolkit::Control::OnStageConnect()
96 virtual void OnStageConnection( int depth );
99 * @copydoc Toolkit::Control::GetNaturalSize
101 virtual Vector3 GetNaturalSize();
104 * @copydoc Toolkit::Control::GetHeightForWidth()
106 virtual float GetHeightForWidth( float width );
109 * @copydoc Toolkit::Control::GetWidthForHeight()
111 virtual float GetWidthForHeight( float height );
115 * Attaches mImage member to the renderer, creating the renderers, samplers, meshes and materials if needed
117 * @pre mImage has been initialised
128 std::string mImageUrl;
131 } // namespace Internal
133 // Helpers for public-api forwarding methods
134 inline Toolkit::Internal::ImageView& GetImpl( Toolkit::ImageView& obj )
136 DALI_ASSERT_ALWAYS(obj);
137 Dali::RefObject& handle = obj.GetImplementation();
138 return static_cast<Toolkit::Internal::ImageView&>(handle);
141 inline const Toolkit::Internal::ImageView& GetImpl( const Toolkit::ImageView& obj )
143 DALI_ASSERT_ALWAYS(obj);
144 const Dali::RefObject& handle = obj.GetImplementation();
145 return static_cast<const Toolkit::Internal::ImageView&>(handle);
148 } // namespace Toolkit
152 #endif // __DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H__