#define ABSTRACT_ITEM_ACTION_KEY "__ABSTRACT_ITEM_ACTION_KEY__"
#define ABSTRACT_ITEM_HIDE_VIEWER_KEY "__ABSTRACT_ITEM_HIDE_VIEWER_KEY__"
#define ABSTRACT_ITEM_TRUE "TRUE"
+#define ABSTRACT_ITEM_ONGOING_KEY "__ABSTRACT_ITEM_ONGOING_KEY__"
using namespace std;
namespace notification {
b.Add(ABSTRACT_ITEM_VISIBLE_KEY, to_string((int)impl_->visible_));
b.Add(ABSTRACT_ITEM_ENABLE_KEY, to_string((int)impl_->enable_));
b.Add(ABSTRACT_ITEM_POLICY_KEY, to_string((int)impl_->policy_));
+ b.Add(ABSTRACT_ITEM_ONGOING_KEY, to_string((int)impl_->ongoing_));
if (impl_->receiver_group_list_.size() != 0) {
vector<string> arr;
string policy_str = b.GetString(ABSTRACT_ITEM_POLICY_KEY);
impl_->policy_ = static_cast<Policy>(stoi(policy_str));
-
impl_->visible_ = static_cast<bool>(stoi(b.GetString(ABSTRACT_ITEM_VISIBLE_KEY)));
-
impl_->enable_ = static_cast<bool>(stoi(b.GetString(ABSTRACT_ITEM_ENABLE_KEY)));
+ impl_->ongoing_ = static_cast<bool>(stoi(b.GetString(ABSTRACT_ITEM_ONGOING_KEY)));
vector<string> receiver_group = b.GetStringArray(ABSTRACT_ITEM_RECEIVER_GROUP_KEY);
if (receiver_group.size() != 0) {
impl_->tag_ = tag;
}
+void AbstractItem::SetOnGoingState(bool ongoing) {
+ impl_->ongoing_ = ongoing;
+}
+
+bool AbstractItem::GetOnGoingState() const {
+ return impl_->ongoing_;
+}
+
} // namespace item
} // namespace notification
*/
void SetTag(std::string tag);
+ /**
+ * @brief Sets the ongoing state of notification item.
+ * @since_tizen 5.5
+ * @param[in] ongoing The ongoing state of notification item
+ */
+ void SetOnGoingState(bool ongoing);
+
+ /**
+ * @brief Gets the ongoing state of notification item.
+ * @since_tizen 5.5
+ * @return The ongoing state of notification item
+ */
+ bool GetOnGoingState() const;
+
private:
class Impl;
std::unique_ptr<Impl> impl_;
led->SetOffPeriod(20);
item.SetLEDInfo(led);
+ item.SetOnGoingState(true);
/* Deserialize */
Bundle b = item.Serialize();
app_control_get_app_id(ac->GetAppControl(), &app_id);
ASSERT_STREQ(app_id, "new_appid_1");
+ ASSERT_EQ(gen_test->GetOnGoingState(), true);
}
TEST_F(AbstractItemTest, SerializeDeserialize2) {
ASSERT_FALSE(std::static_pointer_cast<IItemInfoInternal>(item.GetInfo())->CanReceive(ReceiverGroup::Popup));
}
+TEST_F(AbstractItemTest, SetGetOnGoingState) {
+ TestItem item("test_id");
+
+ ASSERT_EQ(item.GetOnGoingState(), false);
+
+ item.SetOnGoingState(true);
+
+ ASSERT_EQ(item.GetOnGoingState(), true);
+}
+
} // namespace
\ No newline at end of file