[dali_1.2.39] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / integration-api / resource-declarations.h
1 #ifndef __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__
2 #define __DALI_INTEGRATION_RESOURCE_DECLARATIONS_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 namespace Dali
22 {
23
24 namespace Integration
25 {
26
27 /**
28  * @brief Used to identify a resource loading operation.
29  *
30  * These unique ResourceId values can be used to identify a resource loading
31  * transaction in core-adaptor communication.
32  * A resource transaction is asynchronous and many can be in-flight
33  * concurrently.
34  * A ResourceId allows the core to track a resource transaction over its
35  * lifetime and match an asynchronous completion notification to the
36  * corresponding load request or to cancel the operation early.
37  *
38  * A resource transaction begins with a call to PlatformAbstraction::LoadResource()
39  * Later asynchronous status notifications obtained by polling
40  * PlatformAbstraction::GetResources() can be mapped to corresponding
41  * LoadResource() invocations using the ResourceId value.
42  * It is the core's responsibility to ensure that each invocation of
43  * PlatformAbstraction::LoadResource() passes in a Request object with a unique
44  * integer ResourceId.
45  *
46  * @sa Dali::Integration::PlatformAbstraction::LoadResource
47  * Dali::Integration::PlatformAbstraction::GetResources
48  * Dali::Integration::ResourceCache
49  */
50 typedef unsigned int ResourceId;
51 const ResourceId InvalidResourceId = (ResourceId)-1;
52
53 /**
54  * Used to inform the current loading status
55  */
56 enum LoadStatus
57 {
58   RESOURCE_LOADING,            ///< There are missing resources, being loaded
59   RESOURCE_PARTIALLY_LOADED,   ///< Enough resource has been loaded to start low quality rendering
60   RESOURCE_COMPLETELY_LOADED,  ///< The resource has been completely loaded
61 };
62
63 } // namespace Integration
64
65 } // namespace Dali
66
67 #endif // __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__