Merge "Fix build warning based on GCC-9" into tizen
[platform/core/api/notification.git] / notification-ex / image_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_IMAGE_ITEM_H_
18 #define NOTIFICATION_EX_IMAGE_ITEM_H_
19
20 #include <string>
21 #include <memory>
22 #include <list>
23 #include <map>
24
25 #include "notification-ex/abstract_item.h"
26
27 namespace notification {
28 namespace item {
29
30 /**
31  * @brief The class for ImageItem type notification.
32  * @details The class to make the notification with image.
33  * @since_tizen 5.5
34  */
35 class EXPORT_API ImageItem : public AbstractItem {
36  public:
37   /**
38    * @brief Constructor
39    * @since_tizen 5.5
40    * @param[in] image_path The image path of ImageItem
41    * @param[in] action The action for ImageItem
42    */
43   ImageItem(std::string image_path,
44     std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
45
46   /**
47    * @brief Constructor
48    * @since_tizen 5.5
49    * @param[in] id The ImageItem id
50    * @param[in] image_path The image path of ImageItem
51    * @param[in] action The action for ImageItem
52    */
53   ImageItem(std::string id, std::string image_path,
54     std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
55
56   /**
57    * @brief Destructor
58    * @since_tizen 5.5
59    */
60   virtual ~ImageItem();
61
62   /**
63    * @brief Gets the type of ImageItem.
64    * @since_tizen 5.5
65    * @return AbstractItem::Type::Image
66    */
67   int GetType() const override;
68
69   /**
70    * @brief Serialize the data of ImageItem.
71    * @since_tizen 5.5
72    * @return Bundle type data
73    */
74   tizen_base::Bundle Serialize() const override;
75
76   /**
77    * @brief Deserialize the serialized data.
78    * @since_tizen 5.5
79    * @param[in] b The serialized Bundle data
80    */
81   void Deserialize(tizen_base::Bundle b) override;
82
83   /**
84    * @brief Checks the item type exist in this notification.
85    * @since_tizen 5.5
86    * @param[in] type notification item type
87    * @return true if the item type exists
88    */
89   bool IsItemTypeExist(int type) override;
90
91   /**
92    * @brief Gets the path of image.
93    * @since_tizen 5.5
94    * @return The path of image
95    */
96   std::string GetImagePath() const;
97
98   /**
99    * @brief Gets the path of shared file location.
100    * @since_tizen 5.5
101    * @return The list of shared path.
102    */
103   std::list<std::string> GetSharedPath() const override;
104
105   /**
106    * @brief Sets the shared file path to original file path.
107    * @since_tizen 5.5
108    */
109   void SetSharedPath() override;
110
111   std::list<std::map<std::string, std::string>> GetPathMapList(void) const override;
112
113  private:
114   class Impl;
115   std::unique_ptr<Impl> impl_;
116   void UpdatePrivatePath();
117 };  //class ImageItem
118
119 }  // namespace item
120 }  // namespace notification
121 #endif  // NOTIFICATION_EX_IMAGE_ITEM_H_