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
37 * @brief ImageView is a class for displaying an Image.
39 class DALI_IMPORT_API ImageView : public Control
43 * @brief The start and end property ranges for this control.
47 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
48 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
52 * @brief An enumeration of properties belonging to the ImageView class.
58 RESOURCE_URL = PROPERTY_START_INDEX, ///< name "resource-url", @see SetImage(), type string
65 * @brief Create an uninitialized ImageView.
70 * @brief Create an initialized ImageView.
72 * @return A handle to a newly allocated Dali ImageView.
74 static ImageView New();
77 * @brief Create an initialized ImageView from an Image.
79 * If the handle is empty, ImageView will display nothing
80 * @param[in] image The Image to display.
81 * @return A handle to a newly allocated ImageView.
83 static ImageView New( Image image );
86 * @brief Create an initialized ImageView from an Image resource url
88 * If the string is empty, ImageView will display nothing
89 * @param[in] url The url of the image resource to display.
90 * @return A handle to a newly allocated ImageView.
92 static ImageView New( const std::string& url );
97 * This is non-virtual since derived Handle types must not contain data or virtual methods.
102 * @brief Copy constructor.
104 * @param[in] imageView ImageView to copy. The copied ImageView will point at the same implementation
106 ImageView( const ImageView& imageView );
109 * @brief Assignment operator.
111 * @param[in] imageView The ImageView to assign from.
112 * @return The updated ImageView.
114 ImageView& operator=( const ImageView& imageView );
117 * @brief Downcast an Object handle to ImageView.
119 * If handle points to a ImageView the downcast produces valid
120 * handle. If not the returned handle is left uninitialized.
122 * @param[in] handle Handle to an object
123 * @return handle to a ImageView or an uninitialized handle
125 static ImageView DownCast( BaseHandle handle );
128 * @brief Sets this ImageView from an Image
130 * If the handle is empty, ImageView will display nothing
131 * @param[in] image The Image to display.
133 void SetImage( Image image );
136 * @brief Gets the Image
138 * @return The Image currently set to this ImageView
140 Image GetImage() const;
142 public: // Not intended for application developers
145 * @brief Creates a handle using the Toolkit::Internal implementation.
147 * @param[in] implementation The ImageView implementation.
149 DALI_INTERNAL ImageView( Internal::ImageView& implementation );
152 * @brief Allows the creation of this ImageView from an Internal::CustomActor pointer.
154 * @param[in] internal A pointer to the internal CustomActor.
156 DALI_INTERNAL ImageView( Dali::Internal::CustomActor* internal );
160 } // namespace Toolkit
164 #endif // __DALI_TOOLKIT_IMAGE_VIEW_H__