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 tizen_base::Bundle Serialize() const override;
64 * @brief Deserialize the serialized data.
66 * @param[in] b The serialized Bundle data
68 void Deserialize(tizen_base::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 Finds the AbstractItem using by main type.
81 * @param[in] type The main type
82 * @return AbstractItem object
84 AbstractItem& FindByMainType(MainType type) override;
87 * @brief Checks the item type exist in this notification.
89 * @param[in] type notification item type
90 * @return true if the item type exists
92 bool IsItemTypeExist(int type) override;
95 * @brief Gets the type of IconTextItem.
97 * @return AbstractItem::Type::IconText
99 int GetType() const override;
102 * @brief Gets the IconItem of IconTextItem.
104 * @return The IconItem object
106 IconItem& GetIconItem() const;
109 * @brief Gets the TextItem of IconTextItem.
111 * @return The TextItem object
113 TextItem& GetTextItem() const;
117 std::unique_ptr<Impl> impl_;
118 }; // class IconTextItem
121 } // namespace notification
122 #endif // NOTIFICATION_EX_ICON_TEXT_ITEM_H_