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>
30 namespace Internal DALI_INTERNAL
35 * @addtogroup dali-toolkit-controls-image-view
41 * @brief ImageView is a class for displaying an Image.
43 class DALI_IMPORT_API ImageView : public Control
47 * @brief The start and end property ranges for this control.
51 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
52 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
56 * @brief An enumeration of properties belonging to the ImageView class.
62 RESOURCE_URL = PROPERTY_START_INDEX, ///< name "resource-url", @see SetImage(), type string
69 * @brief Create an uninitialized ImageView.
74 * @brief Create an initialized ImageView.
76 * @return A handle to a newly allocated Dali ImageView.
78 static ImageView New();
81 * @brief Create an initialized ImageView from an Image.
83 * If the handle is empty, ImageView will display nothing
84 * @param[in] image The Image to display.
85 * @return A handle to a newly allocated ImageView.
87 static ImageView New( Image image );
90 * @brief Create an initialized ImageView from an Image resource url
92 * If the string is empty, ImageView will display nothing
93 * @param[in] url The url of the image resource to display.
94 * @return A handle to a newly allocated ImageView.
96 static ImageView New( const std::string& url );
101 * This is non-virtual since derived Handle types must not contain data or virtual methods.
106 * @brief Copy constructor.
108 * @param[in] imageView ImageView to copy. The copied ImageView will point at the same implementation
110 ImageView( const ImageView& imageView );
113 * @brief Assignment operator.
115 * @param[in] imageView The ImageView to assign from.
116 * @return The updated ImageView.
118 ImageView& operator=( const ImageView& imageView );
121 * @brief Downcast an Object handle to ImageView.
123 * If handle points to a ImageView the downcast produces valid
124 * handle. If not the returned handle is left uninitialized.
126 * @param[in] handle Handle to an object
127 * @return handle to a ImageView or an uninitialized handle
129 static ImageView DownCast( BaseHandle handle );
132 * @brief Sets this ImageView from an Image
134 * If the handle is empty, ImageView will display nothing
135 * @param[in] image The Image to display.
137 void SetImage( Image image );
140 * @brief Gets the Image
142 * @return The Image currently set to this ImageView
144 Image GetImage() const;
146 public: // Not intended for application developers
149 * @brief Creates a handle using the Toolkit::Internal implementation.
151 * @param[in] implementation The ImageView implementation.
153 DALI_INTERNAL ImageView( Internal::ImageView& implementation );
156 * @brief Allows the creation of this ImageView from an Internal::CustomActor pointer.
158 * @param[in] internal A pointer to the internal CustomActor.
160 DALI_INTERNAL ImageView( Dali::Internal::CustomActor* internal );
167 } // namespace Toolkit
171 #endif // __DALI_TOOLKIT_IMAGE_VIEW_H__