Release version 0.5.85
[platform/core/api/notification.git] / notification-ex / checkbox_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_CHECKBOX_ITEM_H_
18 #define NOTIFICATION_EX_CHECKBOX_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 CheckBoxItem type notification.
31  * @details The class to make the notification with checkbox.
32  * @since_tizen 5.5
33  */
34 class EXPORT_API CheckBoxItem : public AbstractItem {
35  public:
36   /**
37    * @brief Constructor
38    * @since_tizen 5.5
39    * @param[in] id The CheckBoxItem id
40    * @param[in] title The title of CheckBoxItem
41    * @param[in] checked The check state of CheckBoxItem
42    * @param[in] action The action for ChatMessageItem
43    */
44   CheckBoxItem(std::string id, std::string title, bool checked = false,
45     std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
46
47   /**
48    * @brief Deserialize
49    * @since_tizen 5.5
50    */
51   virtual ~CheckBoxItem();
52
53   /**
54    * @brief Serialize the data of CheckBoxItem.
55    * @since_tizen 5.5
56    * @return Bundle type data
57    */
58   tizen_base::Bundle Serialize() const override;
59
60   /**
61    * @brief Deserialize the serialized data.
62    * @since_tizen 5.5
63    * @param[in] b The serialized Bundle data
64    */
65   void Deserialize(tizen_base::Bundle b) override;
66
67   /**
68    * @brief Checks the item type exist in this notification.
69    * @since_tizen 5.5
70    * @param[in] type notification item type
71    * @return true if the item type exists
72    */
73   bool IsItemTypeExist(int type) override;
74
75   /**
76    * @brief Gets the type of CheckBoxItem.
77    * @since_tizen 5.5
78    * @return AbstractItem::Type::CheckBox
79    */
80   int GetType() const override;
81
82   /**
83    * @brief Gets the title of CheckBoxItem.
84    * @since_tizen 5.5
85    * @return The title of CheckBoxItem
86    */
87   std::string GetTitle() const;
88
89   /**
90    * @brief Gets the check state of CheckBoxItem.
91    * @since_tizen 5.5
92    * @return true if checked, or false
93    */
94   bool IsChecked() const;
95
96   /**
97    * @brief Gets the check state of CheckBoxItem.
98    * @since_tizen 5.5
99    * @param[in] checked the check state
100    */
101   void SetChecked(bool checked);
102
103 private:
104   class Impl;
105   std::unique_ptr<Impl> impl_;
106 };  // class CheckBoxItem
107
108 }  // namespace item
109 }  // namespace notification
110 #endif  // NOTIFICATION_EX_CHECKBOX_ITEM_H_