Merge branch 'tizen' into tizen_5.5
[platform/core/api/notification.git] / notification-ex / input_selector_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_INPUT_SELECTOR_ITEM_H_
18 #define NOTIFICATION_EX_INPUT_SELECTOR_ITEM_H_
19
20 #include <string>
21 #include <memory>
22 #include <list>
23
24 #include "notification-ex/abstract_item.h"
25
26 namespace notification {
27 namespace item {
28
29 /**
30  * @brief The class for InputSelectorItem type notification.
31  * @details The class to make the notification with selector.
32  * @since_tizen 5.5
33  */
34 class EXPORT_API InputSelectorItem : public AbstractItem {
35  public:
36   /**
37    * @brief Constructor
38    * @since_tizen 5.5
39    * @param[in] action The action for InputSelectorItem
40    */
41   InputSelectorItem(std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
42
43   /**
44    * @brief Constructor
45    * @since_tizen 5.5
46    * @param[in] id The InputSelectorItem id
47    * @param[in] action The action for InputSelectorItem
48    */
49   InputSelectorItem(std::string id,
50       std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
51
52   /**
53    * @brief Destructor
54    * @since_tizen 5.5
55    */
56   virtual ~InputSelectorItem();
57
58  public:
59   /**
60    * @brief Serialize the data of InputSelectorItem.
61    * @since_tizen 5.5
62    * @return Bundle type data
63    */
64   tizen_base::Bundle Serialize() const override;
65
66   /**
67    * @brief Deserialize the serialized data.
68    * @since_tizen 5.5
69    * @param[in] b The serialized Bundle data
70    */
71   void Deserialize(tizen_base::Bundle b) override;
72
73   /**
74    * @brief Checks the item type exist in this notification.
75    * @since_tizen 5.5
76    * @param[in] type notification item type
77    * @return true if the item type exists
78    */
79   bool IsItemTypeExist(int type) override;
80
81   /**
82    * @brief Gets the type of InputSelectorItem.
83    * @since_tizen 5.5
84    * @return AbstractItem::Type::InputSelector
85    */
86   int GetType() const override;
87
88   /**
89    * @brief Gets the contents of InputSelectorItem.
90    * @since_tizen 5.5
91    * @return The list of string
92    */
93   std::list<std::string> GetContents() const;
94
95   /**
96    * @brief Sets the contents of InputSelectorItem.
97    * @since_tizen 5.5
98    * @param[in] contents The list of string
99    */
100   void SetContents(std::list<std::string> contents);
101
102  private:
103   class Impl;
104   std::unique_ptr<Impl> impl_;
105 };
106
107 }  // namespace item
108 }  // namespace notification
109
110 #endif  // NOTIFICATION_EX_INPUT_SELECTOR_ITEM_H_