Use c-style string when webview loads contents.
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / resource-bundle.h
index 75c0c45..fe386ca 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE3D_LOADERERERERER_RESOURCE_BUNDLE_H_
 #define DALI_SCENE3D_LOADERERERERER_RESOURCE_BUNDLE_H_
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-// INTERNAL
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/rendering/shader.h>
+#include <dali/public-api/rendering/texture-set.h>
+#include <functional>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali-scene3d/public-api/loader/buffer-definition.h>
 #include <dali-scene3d/public-api/loader/environment-definition.h>
 #include <dali-scene3d/public-api/loader/material-definition.h>
 #include <dali-scene3d/public-api/loader/mesh-definition.h>
 #include <dali-scene3d/public-api/loader/shader-definition.h>
 #include <dali-scene3d/public-api/loader/skeleton-definition.h>
-#include <dali-scene3d/public-api/loader/buffer-definition.h>
-
-// EXTERNAL
-#include <functional>
-#include <memory>
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/rendering/shader.h>
-#include <dali/public-api/rendering/texture-set.h>
 
-namespace Dali
-{
-namespace Scene3D
-{
-namespace Loader
+namespace Dali::Scene3D::Loader
 {
 /*
  * @brief The types of resources that .dli may define.
@@ -83,7 +79,7 @@ public:
 
   using PathProvider = std::function<std::string(ResourceType::Value)>;
 
-  ResourceBundle() = default;
+  ResourceBundle();
 
   ResourceBundle(const ResourceBundle&) = delete;
   ResourceBundle& operator=(const ResourceBundle&) = delete;
@@ -103,7 +99,7 @@ public:
    *  count of materials therein, it will calculate the reference count of
    *  environment maps.
    */
-  void CountEnvironmentReferences(ResourceRefCounts& refCounts) const;
+  void CountEnvironmentReferences();
 
   /**
    * @brief Performs the loading of all resources based on their respective
@@ -111,14 +107,12 @@ public:
    * loaded unless we already have a handle to them (OR the ForceReload option was specified).
    * Any handles we have to resources that come in with a zero ref count will be reset,
    * UNLESS the KeepUnused option was specified.
-   * @param[in] refCounts Reference Count that denote how many the resource is used.
    * @param[in] pathProvider path provider for resource data.
    * @param[in] options Option to load resource
    * @note This method creates DALi objects like Dali::Texture, Dali::Geometry, etc.
    */
-  void LoadResources(const ResourceRefCounts& refCounts,
-                     PathProvider             pathProvider,
-                     Options::Type            options = Options::None);
+  void LoadResources(PathProvider  pathProvider,
+                     Options::Type options = Options::None);
 
   /**
    * @brief Loads of all resources based on their respective
@@ -127,29 +121,26 @@ public:
    * Any handles we have to resources that come in with a zero ref count will be reset,
    * UNLESS the KeepUnused option was specified.
    * @note This method don't create any of DALi objects.
-   * @param[in] refCounts Reference Count that denote how many the resource is used.
    * @param[in] pathProvider path provider for resource data.
    * @param[in] options Option to load resource
    * @note This method only loads raw data from resource file, and
    * doesn't create any of DALi objects. GenerateResources() method is required to be called
    * after this method to create DALi objects.
    */
-  void LoadRawResources(const ResourceRefCounts& refCounts,
-                        PathProvider             pathProvider,
-                        Options::Type            options = Options::None);
+  void LoadRawResources(PathProvider  pathProvider,
+                        Options::Type options = Options::None);
 
   /**
    * @brief Generates DALi objects from already loaded Raw Resources.
-   * @param[in] refCounts Reference Count that denote how many the resource is used.
    * @param[in] options Option to load resource
    * @note This method generates DALi objects from raw data that is already
    * loaded by LoadRawResources method. Therefore, LoadRawResources should be called first
    * before this method is called.
    */
-  void GenerateResources(const ResourceRefCounts& refCounts,
-                         Options::Type            options = Options::None);
+  void GenerateResources(Options::Type options = Options::None);
 
 public: // DATA
+  ResourceRefCounts             mReferenceCounts;
   EnvironmentDefinition::Vector mEnvironmentMaps;
   ShaderDefinition::Vector      mShaders;
   MeshDefinition::Vector        mMeshes;
@@ -157,10 +148,14 @@ public: // DATA
 
   SkeletonDefinition::Vector mSkeletons;
   BufferDefinition::Vector   mBuffers;
+
+  bool mRawResourcesLoading;
+  bool mResourcesGenerating;
+
+  bool mRawResourcesLoaded;
+  bool mResourcesGenerated;
 };
 
-} // namespace Loader
-} // namespace Scene3D
-} // namespace Dali
+} // namespace Dali::Scene3D::Loader
 
 #endif //DALI_SCENE3D_LOADERERERERER_RESOURCE_BUNDLE_H_