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_ICON_TEXT_ITEM_H_
18 #define NOTIFICATION_EX_ICON_TEXT_ITEM_H_
24 #include "notification-ex/abstract_item.h"
25 #include "notification-ex/icon_item.h"
26 #include "notification-ex/text_item.h"
28 namespace notification {
32 * @brief The class for IconTextItem type notification.
33 * @details The class to make the notification with icon and text.
36 class EXPORT_API IconTextItem : public AbstractItem {
41 * @param[in] id The IconTextItem id
42 * @param[in] icon The icon of IconTextItem
43 * @param[in] text The text of IconTextItem
44 * @param[in] action The action for IconTextItem
46 IconTextItem(std::string id, std::shared_ptr<IconItem> icon,
47 std::shared_ptr<TextItem> text,
48 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
54 virtual ~IconTextItem();
57 * @brief Serialize the data of IconTextItem.
59 * @return Bundle type data
61 Bundle Serialize() const override;
64 * @brief Deserialize the serialized data.
66 * @param[in] b The serialized Bundle data
68 void Deserialize(Bundle b) override;
71 * @brief Finds the AbstractItem using by notification item id.
73 * @param[in] id notification item id
74 * @return AbstractItem object
76 AbstractItem& FindByID(std::string id) override;
79 * @brief Checks the item type exist in this notification.
81 * @param[in] type notification item type
82 * @return true if the item type exists
84 bool IsItemTypeExist(int type) override;
87 * @brief Gets the type of IconTextItem.
89 * @return AbstractItem::Type::IconText
91 int GetType() const override;
94 * @brief Gets the IconItem of IconTextItem.
96 * @return The IconItem object
98 IconItem& GetIconItem() const;
101 * @brief Gets the TextItem of IconTextItem.
103 * @return The TextItem object
105 TextItem& GetTextItem() const;
109 std::unique_ptr<Impl> impl_;
110 }; // class IconTextItem
113 } // namespace notification
114 #endif // NOTIFICATION_EX_ICON_TEXT_ITEM_H_