2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef NOTIFICATION_EX_FACTORY_MANAGER_H_
18 #define NOTIFICATION_EX_FACTORY_MANAGER_H_
24 #include "notification-ex/iitem_factory.h"
25 #include "notification-ex/iaction_factory.h"
27 namespace notification {
31 * @brief The class for FactoryManager.
32 * @details The class to manage creation of action and item.
35 class EXPORT_API FactoryManager {
38 * @brief Gets the instance of FactoryManager
40 * @return The FactoryManager instance
42 static FactoryManager& GetInst();
45 * @brief Resgisters the IItemFactory
47 * @param[in] factory The IItemFactory for noitfication item
49 void RegisterFactory(std::unique_ptr<IItemFactory> factory);
52 * @brief Registers the IActionFactory
54 * @param[in] factory The IActionFactory for noitfication action
56 void RegisterFactory(std::unique_ptr<IActionFactory> factory);
59 * @brief Creates the notification item from type.
61 * @return AbstractItem object
63 std::unique_ptr<AbstractItem> CreateItem(int type);
66 * @brief Creates the notification action from type.
68 * @return AbstractAction object
70 std::unique_ptr<AbstractAction> CreateAction(int type);
73 * @brief Gets NullItem
75 * @return NullItem object
77 AbstractItem& GetNullItem();
83 std::unique_ptr<IItemFactory> item_factory_;
84 std::unique_ptr<IActionFactory> action_factory_;
88 } // namespace notification
90 #endif // NOTIFICATION_EX_FACTORY_MANAGER_H_