1 #ifndef __DALI_SLP_PLATFORM_RESOURCE_REQUESTER_BASE_H__
2 #define __DALI_SLP_PLATFORM_RESOURCE_REQUESTER_BASE_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
20 #include <platform-abstractions/slp/resource-loader/resource-loader.h>
21 #include <dali/integration-api/resource-request.h>
22 #include <dali/integration-api/resource-cache.h>
28 class ResourceRequest;
35 * Base class to handle resource requests
37 class ResourceRequesterBase
42 * @param[in] resourceLoader The resource loader with which to communicate results
44 ResourceRequesterBase( ResourceLoader& resourceLoader );
49 virtual ~ResourceRequesterBase();
52 * Pause starting new work on background threads, but keep that work queued.
54 virtual void Pause() = 0;
57 * Resume processing tasks on background threads.
59 virtual void Resume() = 0;
63 * @param[in] request The resource request
65 virtual void LoadResource( Integration::ResourceRequest& request ) = 0;
68 * Load a resource synchronously.
69 * @param[in] type The type of resource
70 * @param[in] path The path to the resource
71 * @return A pointer to the resource
73 virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& type, const std::string& path ) = 0;
76 * Load more resources (for partial loading)
77 * @param[in] request The initial load request
78 * @param[in] partialResource The resources loaded by the last request
79 * @return LOADING or PARTIALLY_LOADED if more resources to come, COMPLETELY_LOADED if complete
81 virtual Integration::LoadStatus LoadFurtherResources( Integration::ResourceRequest& request, LoadedResource partialResource ) = 0;
85 * @param[in] request The initial save request
87 virtual void SaveResource(const Integration::ResourceRequest& request ) = 0;
90 * Cancal load requests
91 * @param[in] id The request id of the loading request
92 * @param[in] typeId The resource type id of the loading request
94 virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId) = 0;
97 ResourceLoader& mResourceLoader; ///< The resource loader to which to send results
101 * Undefined default constructor
103 ResourceRequesterBase();
106 * Undefined Copy constructor
108 ResourceRequesterBase(const ResourceRequesterBase& rhs );
111 * Undefined Assignment operator
113 ResourceRequesterBase& operator=(const ResourceRequesterBase& rhs );
119 #endif // __DALI_SLP_PLATFORM_RESOURCE_REQUESTER_BASE_H__