License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / slp / resource-loader / resource-bitmap-requester.h
1 #ifndef __DALI_SLP_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
2 #define __DALI_SLP_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 #include "resource-requester-base.h"
22 #include "resource-thread-image.h"
23 #include "resource-thread-distance-field.h"
24
25 namespace Dali
26 {
27 namespace SlpPlatform
28 {
29
30 /**
31  * Class to own request threads and manage resource requests for bitmaps
32  */
33 class ResourceBitmapRequester : public ResourceRequesterBase
34 {
35 public:
36   /**
37    * Constructor
38    * @param[in] resourceLoader The resource loader with which to communicate results
39    */
40   ResourceBitmapRequester( ResourceLoader& resourceLoader );
41
42   /**
43    * Destructor
44    */
45   virtual ~ResourceBitmapRequester();
46
47   /**
48    * @copydoc ResourceRequester::Pause()
49    */
50   virtual void Pause();
51
52   /**
53    * @copydoc ResourceRequester::Resume()
54    */
55   virtual void Resume();
56
57   /**
58    * @copydoc ResourceRequester::LoadResource()
59    */
60   virtual void LoadResource( Integration::ResourceRequest& request );
61
62   /**
63    * @copydoc ResourceRequester::LoadFurtherResources()
64    */
65   virtual Integration::LoadStatus LoadFurtherResources( Integration::ResourceRequest& request, LoadedResource partialResource );
66
67   /**
68    * @copydoc ResourceRequester::SaveResource()
69    */
70   virtual void SaveResource(const Integration::ResourceRequest& request );
71
72   /**
73    * @copydoc ResourceRequester::CancelLoad()
74    */
75   virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
76
77   /**
78    * @copydoc ResourceLoader::LoadResourceSynchronously()
79    */
80   Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
81
82   /**
83    * @copydoc PlatformAbstraction::GetClosestImageSize()
84    */
85   void GetClosestImageSize( const std::string& filename,
86                             const ImageAttributes& attributes,
87                             Vector2 &closestSize );
88
89   /**
90    * @copydoc PlatformAbstraction::GetClosestImageSize()
91    */
92   void GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
93                             const ImageAttributes& attributes,
94                             Vector2 &closestSize );
95
96
97 protected:
98   ResourceThreadImage*          mThreadImage;           ///< Image loader thread object
99   ResourceThreadDistanceField*  mThreadDistanceField;   ///< Distance field generator thread.
100 };
101
102 } // SlpPlatform
103 } // Dali
104
105 #endif // __DALI_SLP_PLATFORM_RESOURCE_BITMAP_REQUESTER_H__