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 tizen_base::Bundle Serialize() const override;
81 * @brief Deserialize the serialized data.
83 * @param[in] b The serialized Bundle data
85 void Deserialize(tizen_base::Bundle b) override;
88 * @brief Checks the item type exist in this notification.
90 * @param[in] type notification item type
91 * @return true if the item type exists
93 bool IsItemTypeExist(int type) override;
96 * @brief Gets the type of ProgressItem.
98 * @return AbstractItem::Type::Progress
100 int GetType() const override;
103 * @brief Gets the current value of progress.
105 * @return The current value of progress
107 float GetCurrent() const;
110 * @brief Sets the current value of progress.
112 * @param[in] current The current value of progress
114 void SetCurrent(float current);
117 * @brief Gets the minimum value of progress.
119 * @return The minimum value of progress
121 float GetMin() const;
124 * @brief Gets the maximum value of progress.
126 * @return The maximum value of progress
128 float GetMax() const;
131 * @brief Sets the type of progress.
133 * @param[in] type The type of progress
135 void SetProgressType(ProgressItem::Type type);
138 * @brief Gets the type of progress.
140 * @return The type of progress
142 Type GetProgressType() const;
145 * @brief Sets the default unit of progress.
146 * @details the unit is valid when the progress type is default.
148 * @param[in] unit The unit of progress
150 void SetDefaultUnit(std::string unit);
153 * @brief Gets the default unit of progress.
154 * @details the unit is valid when the progress type is default.
156 * @return The type of progress
158 std::string GetDefaultUnit() const;
162 std::unique_ptr<Impl> impl_;
166 } // namespace notification
168 #endif // NOTIFICATION_EX_PROGRESS_ITEM_H_