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_
25 #include "notification-ex/abstract_item.h"
27 namespace notification {
31 * @brief The class for GroupItem type notification.
32 * @details The class to make the group of notifications.
35 class EXPORT_API GroupItem : public AbstractItem {
40 * @param[in] action The action for GroupItem
42 GroupItem(std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
47 * @param[in] id The GroupItem id
48 * @param[in] action The action for GroupItem
50 GroupItem(std::string id,
51 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
61 * @brief Serialize the data of GroupItem.
63 * @return Bundle type data
65 tizen_base::Bundle Serialize() const override;
68 * @brief Deserialize the serialized data.
70 * @param[in] b The serialized Bundle data
72 void Deserialize(tizen_base::Bundle b) override;
75 * @brief Finds the AbstractItem using by notification item id.
77 * @param[in] id notification item id
78 * @return AbstractItem object
80 AbstractItem& FindByID(std::string id) override;
83 * @brief Finds the AbstractItem using by main type.
85 * @param[in] type The main type
86 * @return AbstractItem object
88 AbstractItem& FindByMainType(MainType type) override;
91 * @brief Checks the item type exist in this notification.
93 * @param[in] type notification item type
94 * @return true if the item type exists
96 bool IsItemTypeExist(int type) override;
99 * @brief Gets the type of GroupItem.
101 * @return AbstractItem::Type::Group
103 int GetType() const override;
106 * @brief Gets the path of shared file location.
108 * @return The list of shared path.
110 std::list<std::string> GetSharedPath() const override;
113 * @brief Sets the shared file path to original file path.
116 void SetSharedPath() override;
119 * @brief Gets the paths of shared file location.
121 * @return The list of private path and original path.
123 std::list<std::map<std::string, std::string>> GetPathMapList() const override;
126 * @brief Sets the vertical state.
127 * @details The vertical state is true, the children of GroupItem are associated vertically.
128 * And if it is false, the children are associated horizontally.
130 * @param[in] The vertical state
132 void SetDirection(bool vertical);
135 * @brief Gets whether the vertical state is true or not.
137 * @return true if vertical is true, or false
142 * @brief Gets app label data of GroupItem.
144 * @return The app label data
146 std::string GetAppLabel();
149 * @brief Sets app label data of GroupItem.
151 * @return The app label data
153 void SetAppLabel(std::string label);
156 * @brief Adds child notification item.
158 * @param[in] AbstractItem object
160 void AddChild(std::shared_ptr<AbstractItem> child);
163 * @brief Removes child notification item.
165 * @param[in] The notification id
167 void RemoveChild(std::string itemId);
170 * @brief Removes children.
173 void RemoveChildren();
176 * @brief Gets the list of children item of GroupItem.
178 * @return The list of AbstractItem
180 std::list<std::shared_ptr<AbstractItem>> GetChildren();
184 std::unique_ptr<Impl> impl_;
188 } // namespace notification
190 #endif // NOTIFICATION_EX_GROUP_ITEM_H_