Merge "Revert "Use tizen_base::Bundle"" into tizen
[platform/core/api/notification.git] / notification-ex / icon_text_item.h
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef NOTIFICATION_EX_ICON_TEXT_ITEM_H_
18 #define NOTIFICATION_EX_ICON_TEXT_ITEM_H_
19
20 #include <string>
21 #include <memory>
22 #include <list>
23
24 #include "notification-ex/abstract_item.h"
25 #include "notification-ex/icon_item.h"
26 #include "notification-ex/text_item.h"
27
28 namespace notification {
29 namespace item {
30
31 /**
32  * @brief The class for IconTextItem type notification.
33  * @details The class to make the notification with icon and text.
34  * @since_tizen 5.5
35  */
36 class EXPORT_API IconTextItem : public AbstractItem {
37  public:
38   /**
39    * @brief Constructor
40    * @since_tizen 5.5
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
45    */
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>({}));
49
50   /**
51    * @brief Destructor
52    * @since_tizen 5.5
53    */
54   virtual ~IconTextItem();
55
56   /**
57    * @brief Serialize the data of IconTextItem.
58    * @since_tizen 5.5
59    * @return Bundle type data
60    */
61   Bundle Serialize() const override;
62
63   /**
64    * @brief Deserialize the serialized data.
65    * @since_tizen 5.5
66    * @param[in] b The serialized Bundle data
67    */
68   void Deserialize(Bundle b) override;
69
70   /**
71    * @brief Finds the AbstractItem using by notification item id.
72    * @since_tizen 5.5
73    * @param[in] id notification item id
74    * @return AbstractItem object
75    */
76   AbstractItem& FindByID(std::string id) override;
77
78   /**
79    * @brief Gets the type of IconTextItem.
80    * @since_tizen 5.5
81    * @return AbstractItem::Type::IconText
82    */
83   int GetType() const override;
84
85   /**
86    * @brief Gets the IconItem of IconTextItem.
87    * @since_tizen 5.5
88    * @return The IconItem object
89    */
90   IconItem& GetIconItem() const;
91
92   /**
93    * @brief Gets the TextItem of IconTextItem.
94    * @since_tizen 5.5
95    * @return The TextItem object
96    */
97   TextItem& GetTextItem() const;
98
99  private:
100   class Impl;
101   std::unique_ptr<Impl> impl_;
102 };  // class IconTextItem
103
104 }  // namespace item
105 }  // namespace notification
106 #endif  // NOTIFICATION_EX_ICON_TEXT_ITEM_H_