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_GROUP_ITEM_H_
18 #define NOTIFICATION_EX_GROUP_ITEM_H_
24 #include "notification-ex/abstract_item.h"
26 namespace notification {
30 * @brief The class for GroupItem type notification.
31 * @details The class to make the group of notifications.
34 class EXPORT_API GroupItem : public AbstractItem {
39 * @param[in] action The action for GroupItem
41 GroupItem(std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
46 * @param[in] id The GroupItem id
47 * @param[in] action The action for GroupItem
49 GroupItem(std::string id,
50 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
60 * @brief Serialize the data of GroupItem.
62 * @return Bundle type data
64 tizen_base::Bundle Serialize() const override;
67 * @brief Deserialize the serialized data.
69 * @param[in] b The serialized Bundle data
71 void Deserialize(tizen_base::Bundle b) override;
74 * @brief Finds the AbstractItem using by notification item id.
76 * @param[in] id notification item id
77 * @return AbstractItem object
79 AbstractItem& FindByID(std::string id) override;
82 * @brief Finds the AbstractItem using by main type.
84 * @param[in] type The main type
85 * @return AbstractItem object
87 AbstractItem& FindByMainType(MainType type) override;
90 * @brief Checks the item type exist in this notification.
92 * @param[in] type notification item type
93 * @return true if the item type exists
95 bool IsItemTypeExist(int type) override;
98 * @brief Gets the type of GroupItem.
100 * @return AbstractItem::Type::Group
102 int GetType() const override;
105 * @brief Gets the path of shared file location.
107 * @return The list of shared path.
109 std::list<std::string> GetSharedPath() const override;
112 * @brief Sets the vertical state.
113 * @details The vertical state is true, the children of GroupItem are associated vertically.
114 * And if it is false, the children are associated horizontally.
116 * @param[in] The vertical state
118 void SetDirection(bool vertical);
121 * @brief Gets whether the vertical state is true or not.
123 * @return true if vertical is true, or false
128 * @brief Gets app label data of GroupItem.
130 * @return The app label data
132 std::string GetAppLabel();
135 * @brief Sets app label data of GroupItem.
137 * @return The app label data
139 void SetAppLabel(std::string label);
142 * @brief Adds child notification item.
144 * @param[in] AbstractItem object
146 void AddChild(std::shared_ptr<AbstractItem> child);
149 * @brief Removes child notification item.
151 * @param[in] The notification id
153 void RemoveChild(std::string itemId);
156 * @brief Gets the list of children item of GroupItem.
158 * @return The list of AbstractItem
160 std::list<std::shared_ptr<AbstractItem>> GetChildren();
164 std::unique_ptr<Impl> impl_;
168 } // namespace notification
170 #endif // NOTIFICATION_EX_GROUP_ITEM_H_