1 #ifndef DALI_TOOLKIT_IMAGE_URL_H
2 #define DALI_TOOLKIT_IMAGE_URL_H
5 * Copyright (c) 2021 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/public-api/rendering/texture.h>
25 #include <dali-toolkit/public-api/dali-toolkit-common.h>
31 namespace Internal DALI_INTERNAL
36 * @brief ImageUrl can be used to wrap an external buffer.
38 * An instance of ImageUrl can be created from Image::GenerateUrl().
39 * Application can get url from ImageUrl.
40 * When application does not use this anymore, the destructor of the ImageUrl is called.
41 * At this time, the buffer is deleted from the texture manager.
43 class DALI_TOOLKIT_API ImageUrl : public BaseHandle
47 * Default Constructor.
48 * Resulting URL is not valid
58 * @brief Create an initialized ImageUrl.
60 * @param[in] texture The texture url is got from external buffer.
61 * @return A handle to a newly allocated Dali resource.
63 static ImageUrl New(Texture& texture);
66 * @brief Downcast an Object handle to ImageUrl handle.
68 * If handle points to a ImageUrl object the downcast produces valid
69 * handle. If not the returned handle is left uninitialized.
71 * @param[in] handle to An object.
72 * @return handle to a ImageUrl object or an uninitialized handle.
74 static ImageUrl DownCast(BaseHandle handle);
78 * @param[in] url The url to copy
80 ImageUrl(const ImageUrl& url);
84 * @param[in] url The url to copy
86 ImageUrl& operator=(const ImageUrl& url);
89 * @brief Move constructor.
90 * @param[in] rhs A reference to the moved handle
92 ImageUrl(ImageUrl&& rhs);
95 * @brief Move assignment operator.
96 * @param[in] rhs A reference to the moved handle
97 * @return A reference to this handle
99 ImageUrl& operator=(ImageUrl&& rhs);
103 * @return Returns url's string
105 const std::string& GetUrl() const;
107 public: // Not intended for application developers
110 * @brief This constructor is used by New() methods.
112 * @param[in] internal A pointer to a newly allocated Dali resource.
114 explicit DALI_INTERNAL ImageUrl(Toolkit::Internal::ImageUrl* internal);
118 } // namespace Toolkit
122 #endif /* DALI_TOOLKIT_IMAGE_URL_H */