remove (unnecessarily) exported signal and action names
[platform/core/uifw/dali-core.git] / dali / public-api / images / resource-image.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/images/resource-image.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/images/image-attributes.h>
23 #include <dali/public-api/math/vector2.h>
24 #include <dali/internal/event/images/resource-image-impl.h>
25 #include <dali/internal/event/common/thread-local-storage.h>
26 #include <dali/integration-api/platform-abstraction.h>
27
28 namespace Dali
29 {
30
31 Vector2 ResourceImage::GetImageSize( const std::string& url )
32 {
33   Vector2 size;
34   Internal::ThreadLocalStorage::Get().GetPlatformAbstraction().GetClosestImageSize( url, ImageAttributes::DEFAULT_ATTRIBUTES, size );
35   return size;
36 }
37
38 ResourceImage::ResourceImage()
39 {
40 }
41
42 ResourceImage::ResourceImage(Internal::ResourceImage* internal) : Image(internal)
43 {
44 }
45
46 ResourceImage::~ResourceImage()
47 {
48 }
49
50 ResourceImage::ResourceImage( const ResourceImage& handle )
51 : Image(handle)
52 {
53 }
54
55 ResourceImage& ResourceImage::operator=( const ResourceImage& rhs )
56 {
57   BaseHandle::operator=(rhs);
58   return *this;
59 }
60
61 ResourceImage ResourceImage::New( const std::string& url )
62 {
63   Internal::ResourceImagePtr internal = Internal::ResourceImage::New( url,
64                                                          Dali::ImageAttributes::DEFAULT_ATTRIBUTES );
65   return ResourceImage(internal.Get());
66 }
67
68 ResourceImage ResourceImage::New( const std::string& url, LoadPolicy loadPol, ReleasePolicy releasePol )
69 {
70   Internal::ResourceImagePtr internal = Internal::ResourceImage::New( url,
71                                                          Dali::ImageAttributes::DEFAULT_ATTRIBUTES,
72                                                          loadPol, releasePol );
73   return ResourceImage(internal.Get());
74 }
75
76 ResourceImage ResourceImage::New( const std::string& url, const ImageAttributes& attributes )
77 {
78   Internal::ResourceImagePtr internal = Internal::ResourceImage::New( url, attributes );
79   return ResourceImage(internal.Get());
80 }
81
82 ResourceImage ResourceImage::New( const std::string& url, const ImageAttributes& attributes, LoadPolicy loadPol, ReleasePolicy releasePol )
83 {
84   Internal::ResourceImagePtr internal = Internal::ResourceImage::New( url, attributes, loadPol, releasePol );
85   return ResourceImage(internal.Get());
86 }
87
88 ResourceImage ResourceImage::DownCast( BaseHandle handle )
89 {
90   return ResourceImage( dynamic_cast<Dali::Internal::ResourceImage*>(handle.GetObjectPtr()) );
91 }
92
93 ResourceImage::LoadPolicy ResourceImage::GetLoadPolicy() const
94 {
95   return GetImplementation(*this).GetLoadPolicy();
96 }
97
98 LoadingState ResourceImage::GetLoadingState() const
99 {
100   return GetImplementation(*this).GetLoadingState();
101 }
102
103 std::string ResourceImage::GetUrl() const
104 {
105   return GetImplementation(*this).GetUrl();
106 }
107
108 void ResourceImage::Reload()
109 {
110   GetImplementation(*this).Reload();
111 }
112
113 ImageAttributes ResourceImage::GetAttributes() const
114 {
115   return GetImplementation(*this).GetAttributes();
116 }
117
118 ResourceImage::ResourceImageSignal& ResourceImage::LoadingFinishedSignal()
119 {
120   return GetImplementation(*this).LoadingFinishedSignal();
121 }
122
123 } // namespace Dali