1 #ifndef __DALI_TOOLKIT_IMAGE_VIEW_H__
2 #define __DALI_TOOLKIT_IMAGE_VIEW_H__
5 * Copyright (c) 2015 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-toolkit/public-api/controls/control.h>
25 #include <dali/devel-api/rendering/renderer.h>
33 namespace Internal DALI_INTERNAL
40 * @brief ImageView is a class for displaying an Image.
42 class DALI_IMPORT_API ImageView : public Control
46 * @brief The start and end property ranges for this control.
50 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
51 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
55 * @brief An enumeration of properties belonging to the ImageView class.
61 RESOURCE_URL = PROPERTY_START_INDEX, ///< name "resource-url", @see SetImage(), type string
68 * @brief Create an uninitialized ImageView.
73 * @brief Create an initialized ImageView.
75 * @return A handle to a newly allocated Dali ImageView.
77 static ImageView New();
80 * @brief Create an initialized ImageView from an Image.
82 * If the handle is empty, ImageView will display nothing
83 * @param[in] image The Image to display.
84 * @return A handle to a newly allocated ImageView.
86 static ImageView New( Image image );
89 * @brief Create an initialized ImageView from an Image resource url
91 * If the string is empty, ImageView will display nothing
92 * @param[in] url The url of the image resource to display.
93 * @return A handle to a newly allocated ImageView.
95 static ImageView New( const std::string& url );
100 * This is non-virtual since derived Handle types must not contain data or virtual methods.
105 * @brief Copy constructor.
107 * @param[in] imageView ImageView to copy. The copied ImageView will point at the same implementation
109 ImageView( const ImageView& imageView );
112 * @brief Assignment operator.
114 * @param[in] imageView The ImageView to assign from.
115 * @return The updated ImageView.
117 ImageView& operator=( const ImageView& imageView );
120 * @brief Downcast an Object handle to ImageView.
122 * If handle points to a ImageView the downcast produces valid
123 * handle. If not the returned handle is left uninitialized.
125 * @param[in] handle Handle to an object
126 * @return handle to a ImageView or an uninitialized handle
128 static ImageView DownCast( BaseHandle handle );
131 * @brief Sets this ImageView from an Image
133 * If the handle is empty, ImageView will display nothing
134 * @param[in] image The Image to display.
136 void SetImage( Image image );
139 * @brief Gets the Image
141 * @return The Image currently set to this ImageView
143 Image GetImage() const;
145 public: // Not intended for application developers
148 * @brief Creates a handle using the Toolkit::Internal implementation.
150 * @param[in] implementation The ImageView implementation.
152 DALI_INTERNAL ImageView( Internal::ImageView& implementation );
155 * @brief Allows the creation of this ImageView from an Internal::CustomActor pointer.
157 * @param[in] internal A pointer to the internal CustomActor.
159 DALI_INTERNAL ImageView( Dali::Internal::CustomActor* internal );
163 } // namespace Toolkit
167 #endif // __DALI_TOOLKIT_IMAGE_VIEW_H__