1 #ifndef DALI_ADAPTOR_COMMON_ADDON_MANAGER
2 #define DALI_ADAPTOR_COMMON_ADDON_MANAGER
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/integration-api/addon-manager.h>
32 class AddOnManager : public Dali::Integration::AddOnManager
37 * @param impl Pointer to the platform specific implementation
39 explicit AddOnManager(Internal::AddOnManager* impl);
44 ~AddOnManager() override;
47 * @brief Registers a dispatch table for new AddOn. Dispatch table contains essential
48 * functions that will be called by the AddOnManager. It also includes lifecycle
50 * @param[in] dispatchTable Valid pointer to the DispatchTable object
52 void RegisterAddOnDispatchTable(const AddOnDispatchTable* dispatchTable) override;
55 * @brief Retrieves list of all the extensions available
56 * @return List of AddOn names
58 std::vector<std::string> EnumerateAddOns() override;
61 * @brief Returns AddOnInfo structure for specified extension name
62 * @param[in] name Name of extension
63 * @param[out]] info Output reference
64 * @return True on success, False if extension info cannot be retrieved
66 bool GetAddOnInfo(const std::string& name, AddOnInfo& info) override;
69 * @brief Loads and initialises specified extensions
71 * @param[in] extensionNames Array of extension names
72 * @return vector of initialised extension handles
74 std::vector<AddOnLibrary> LoadAddOns(const std::vector<std::string>& addonNames) override;
77 * @brief Returns addon global function pointer
78 * @param[in] addonHandle Addon handle
79 * @param[in] procName Name of the function to retrieve
80 * @return Pointer to the function or null if function doesn't exist
82 void* GetGlobalProc(const Dali::AddOnLibrary& addonHandle, const char* procName) override;
85 * @brief Returns addon instance function pointer
86 * @param[in] addonHandle Addon handle
87 * @param[in] procName Name of the function to retrieve
88 * @return Pointer to the function or null if function doesn't exist
90 void* GetInstanceProc(const Dali::AddOnLibrary& addonHandle, const char* procName) override;
93 * @brief Lifecycle pause function
95 void Pause() override;
98 * @brief Lifecycle resume function
100 void Resume() override;
103 * @brief Lifecycle start function
105 void Start() override;
108 * @brief Lifecycle stop function
110 void Stop() override;
113 std::unique_ptr<Internal::AddOnManager> mImpl; /// Implementation of the AddOnManager
115 } // namespace Adaptor
118 #endif // DALI_ADAPTOR_COMMON_ADDON_MANAGER