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 is a class for wrapping url that is get from external buffer.
37 * An instance of ImageUrl can be created from GenerateUrl().
38 * Application can get the ImageUrl at this time and use it by getting url from ImageUrl.
39 * When application does not use this anymore, the destructor of the ImageUrl is called.
40 * At this time, the buffer is deleted from the texture manager.
42 class DALI_TOOLKIT_API ImageUrl : public BaseHandle
46 * Default Constructor.
47 * Resulting URL is not valid
57 * @brief Create an initialized ImageUrl.
59 * @param[in] texture The texture url is got from external buffer.
60 * @return A handle to a newly allocated Dali resource.
62 static ImageUrl New(Texture& texture);
65 * @brief Downcast an Object handle to ImageUrl handle.
67 * If handle points to a ImageUrl object the downcast produces valid
68 * handle. If not the returned handle is left uninitialized.
70 * @param[in] handle to An object.
71 * @return handle to a ImageUrl object or an uninitialized handle.
73 static ImageUrl DownCast(BaseHandle handle);
77 * @param[in] url The url to copy
79 ImageUrl(const ImageUrl& url);
83 * @param[in] url The url to copy
85 ImageUrl& operator=(const ImageUrl& url);
88 * @brief Move constructor.
89 * @param[in] rhs A reference to the moved handle
91 ImageUrl(ImageUrl&& rhs);
94 * @brief Move assignment operator.
95 * @param[in] rhs A reference to the moved handle
96 * @return A reference to this handle
98 ImageUrl& operator=(ImageUrl&& rhs);
102 * @return Returns url's string
104 const std::string& GetUrl() const;
106 public: // Not intended for application developers
109 * @brief This constructor is used by New() methods.
111 * @param[in] internal A pointer to a newly allocated Dali resource.
113 explicit DALI_INTERNAL ImageUrl(Toolkit::Internal::ImageUrl* internal);
117 } // namespace Toolkit
121 #endif /* DALI_TOOLKIT_IMAGE_URL_H */