1 #ifndef DALI_TOOLKIT_INTERNAL_IMAGE_URL_H
2 #define DALI_TOOLKIT_INTERNAL_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/object/base-object.h>
23 #include <dali/public-api/adaptor-framework/encoded-image-buffer.h>
27 #include <dali-toolkit/public-api/image-loader/image-url.h>
36 using ImageUrlPtr = IntrusivePtr<ImageUrl>;
38 class ImageUrl : public BaseObject
44 ImageUrl(Texture& texture);
49 ImageUrl(const EncodedImageBuffer& encodedImageBuffer);
52 * @copydoc Dali::Toolkit::ImageUrl::New
54 static ImageUrlPtr New(Texture& texture);
57 * @copydoc Dali::Toolkit::ImageUrl::New
59 static ImageUrlPtr New(const EncodedImageBuffer& encodedImageBuffer);
62 * @copydoc Dali::Toolkit::ImageUrl::GetUrl
64 const std::string& GetUrl() const;
68 * @brief A reference counted object may only be deleted by calling Unreference()
74 ImageUrl(const ImageUrl&);
77 ImageUrl& operator=(const ImageUrl& rhs);
83 } // namespace Internal
84 } // namespace Toolkit
86 // Helpers for public-api forwarding methods
88 inline Toolkit::Internal::ImageUrl& GetImpl(Dali::Toolkit::ImageUrl& imageUrl)
90 DALI_ASSERT_ALWAYS(imageUrl && "ImageUrl handle is empty");
92 BaseObject& handle = imageUrl.GetBaseObject();
94 return static_cast<Toolkit::Internal::ImageUrl&>(handle);
97 inline const Toolkit::Internal::ImageUrl& GetImpl(const Dali::Toolkit::ImageUrl& imageUrl)
99 DALI_ASSERT_ALWAYS(imageUrl && "ImageUrl handle is empty");
101 const BaseObject& handle = imageUrl.GetBaseObject();
103 return static_cast<const Toolkit::Internal::ImageUrl&>(handle);
106 } // End of namespace Dali
108 #endif // DALI_TOOLKIT_INTERNAL_IMAGE_URL_H