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_PROGRESS_ITEM_H_
18 #define NOTIFICATION_EX_PROGRESS_ITEM_H_
24 #include "notification-ex/abstract_item.h"
26 namespace notification {
30 * @brief The class for ProgressItem type notification.
34 class EXPORT_API ProgressItem : public AbstractItem {
39 * @param[in] min The minimum value of ProgressItem
40 * @param[in] current The current value ProgressItem
41 * @param[in] max The maximum value of ProgressItem
42 * @param[in] action The action for ProgressItem
44 ProgressItem(float min, float current, float max,
45 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
50 * @param[in] id The ProgressItem id
51 * @param[in] min The minimum value of ProgressItem
52 * @param[in] current The current value ProgressItem
53 * @param[in] max The maximum value of ProgressItem
54 * @param[in] action The action for ProgressItem
56 ProgressItem(std::string id, float min, float current, float max,
57 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
63 virtual ~ProgressItem();
74 * @brief Serialize the data of ProgressItem.
76 * @return Bundle type data
78 virtual tizen_base::Bundle Serialize() const override;
81 * @brief Deserialize the serialized data.
83 * @param[in] b The serialized Bundle data
85 virtual void Deserialize(tizen_base::Bundle b) override;
88 * @brief Finds the AbstractItem using by notification item id.
90 * @param[in] id notification item id
91 * @return AbstractItem object
93 virtual AbstractItem& FindByID(std::string id) override;
96 * @brief Checks the item type exist in this notification.
98 * @param[in] type notification item type
99 * @return true if the item type exists
101 bool IsItemTypeExist(int type) override;
104 * @brief Gets the type of ProgressItem.
106 * @return AbstractItem::Type::Progress
108 int GetType() const override;
111 * @brief Gets the current value of progress.
113 * @return The current value of progress
115 float GetCurrent() const;
118 * @brief Sets the current value of progress.
120 * @param[in] current The current value of progress
122 void SetCurrent(float current);
125 * @brief Gets the minimum value of progress.
127 * @return The minimum value of progress
129 float GetMin() const;
132 * @brief Gets the maximum value of progress.
134 * @return The maximum value of progress
136 float GetMax() const;
139 * @brief Sets the type of progress.
141 * @param[in] type The type of progress
143 void SetProgressType(ProgressItem::Type type);
146 * @brief Gets the type of progress.
148 * @return The type of progress
150 Type GetProgressType() const;
153 * @brief Sets the default unit of progress.
154 * @details the unit is valid when the progress type is default.
156 * @param[in] unit The unit of progress
158 void SetDefaultUnit(std::string unit);
161 * @brief Gets the default unit of progress.
162 * @details the unit is valid when the progress type is default.
164 * @return The type of progress
166 std::string GetDefaultUnit() const;
170 std::unique_ptr<Impl> impl_;
174 } // namespace notification
176 #endif // NOTIFICATION_EX_PROGRESS_ITEM_H_