[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / internal / loader / model-loader-impl.h
1 #ifndef DALI_SCENE3D_LOADER_MODEL_LOADER_IMPL_H
2 #define DALI_SCENE3D_LOADER_MODEL_LOADER_IMPL_H
3 /*
4  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 // INTERNAL INCLUDES
21 #include <dali-scene3d/public-api/api.h>
22 #include <dali-scene3d/public-api/loader/load-result.h>
23 #include <dali-scene3d/public-api/loader/model-loader.h>
24 #include <dali-scene3d/public-api/loader/resource-bundle.h>
25
26 // EXTERNAL INCLUDES
27 #include <string>
28
29 namespace Dali
30 {
31 namespace Scene3D
32 {
33 namespace Loader
34 {
35 namespace Internal
36 {
37 class ModelLoaderImpl
38 {
39 public:
40   ModelLoaderImpl() = default;
41
42   /**
43    * @brief Set InputParameter.
44    * Thie method store only a pointer of InputParameter.
45    * The object of InputParameter should not be deleted until it is no longer used.
46    * @param[in] inputParameter Input parameters those can be used for model loading.
47    */
48   void SetInputParameter(Dali::Scene3D::Loader::ModelLoader::InputParameter& inputParameter)
49   {
50     mInputParameter = &inputParameter;
51   }
52
53   /**
54    * @brief Request to load model from url.
55    * @param[in] url model file url.
56    * @param[out] result loaded model data.
57    * @return True if model loading is successfully finished.
58    */
59   virtual bool LoadModel(const std::string& url, Dali::Scene3D::Loader::LoadResult& result) = 0;
60
61 protected:
62   Dali::Scene3D::Loader::ModelLoader::InputParameter* mInputParameter{nullptr};
63 };
64 } // namespace Internal
65 } // namespace Loader
66 } // namespace Scene3D
67 } // namespace Dali
68
69 #endif // DALI_SCENE3D_LOADER_MODEL_LOADER_IMPL_H