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_TIME_ITEM_H_
18 #define NOTIFICATION_EX_TIME_ITEM_H_
26 #include "notification-ex/abstract_item.h"
28 namespace notification {
32 * @brief The class for TimeItem type notification.
33 * @details The class to make the notification with time.
36 class EXPORT_API TimeItem : public AbstractItem {
41 * @param[in] action The action for TimeItem
44 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
49 * @param[in] time The time data of TimeItem
50 * @param[in] action The action for TimeItem
53 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
58 * @param[in] id The TimeItem id
59 * @param[in] time The time data of TimeItem
60 * @param[in] action The action for TimeItem
62 TimeItem(std::string id, time_t time,
63 std::shared_ptr<AbstractAction> action = std::shared_ptr<AbstractAction>({}));
72 * @brief Gets the type of TimeItem.
74 * @return AbstractItem::Type::Time
76 int GetType() const override;
79 * @brief Serialize the data of TimeItem.
81 * @return Bundle type data
83 tizen_base::Bundle Serialize() const override;
86 * @brief Deserialize the serialized data.
88 * @param[in] b The serialized Bundle data
90 void Deserialize(tizen_base::Bundle b) override;
93 * @brief Checks the item type exist in this notification.
95 * @param[in] type notification item type
96 * @return true if the item type exists
98 bool IsItemTypeExist(int type) override;
101 * @brief Gets the time state of TimeItem.
103 * @return The time state of TimeItem.
105 time_t GetTime() const;
106 void SetTime(time_t time);
110 std::unique_ptr<Impl> impl_;
114 } // namespace notification
115 #endif // NOTIFICATION_EX_TIME_ITEM_H_