From: SukHyung, Kang Date: Tue, 12 Mar 2019 08:17:32 +0000 (+0900) Subject: Add parent item for TextItem and EntryItem X-Git-Tag: accepted/tizen/unified/20190327.160606~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F201304%2F1;p=platform%2Fcore%2Fapi%2Fnotification.git Add parent item for TextItem and EntryItem Change-Id: I9c458e3f0efab8a25d2ed0f9feeda3282ec5429f Signed-off-by: SukHyung, Kang --- diff --git a/notification-ex/entry_item.cc b/notification-ex/entry_item.cc index 143a311..31c4caf 100644 --- a/notification-ex/entry_item.cc +++ b/notification-ex/entry_item.cc @@ -33,15 +33,16 @@ namespace notification { namespace item { -EntryItem::EntryItem(std::string id, std::shared_ptr action) - : AbstractItem(id, AbstractItem::Type::Entry), impl_(new Impl()) { +EntryItem::EntryItem(std::shared_ptr action) + : AbstractItem(AbstractItem::Type::Entry), impl_(new Impl(this)) { } -EntryItem::EntryItem(std::shared_ptr action) - : AbstractItem(AbstractItem::Type::Entry), impl_(new Impl()) { +EntryItem::EntryItem(std::string id, std::shared_ptr action) + : AbstractItem(id, AbstractItem::Type::Entry), impl_(new Impl(this)) { } -EntryItem::Impl::Impl() { +EntryItem::Impl::Impl(EntryItem* parent) + : parent_(parent) { LOGI("EntryItem created"); } diff --git a/notification-ex/entry_item_implementation.h b/notification-ex/entry_item_implementation.h index ecfe724..4af69cc 100644 --- a/notification-ex/entry_item_implementation.h +++ b/notification-ex/entry_item_implementation.h @@ -30,11 +30,12 @@ class EntryItem::Impl { virtual ~Impl(); private: - Impl(); + Impl(EntryItem* parent); private: friend class EntryItem; + EntryItem* parent_; std::string text_; int limit_ = 160; }; diff --git a/notification-ex/text_item.cc b/notification-ex/text_item.cc index d883782..cced868 100644 --- a/notification-ex/text_item.cc +++ b/notification-ex/text_item.cc @@ -34,11 +34,12 @@ namespace notification { namespace item { TextItem::TextItem(std::string id, std::string text, std::string hyperlink, std::shared_ptr action) - : AbstractItem(id, AbstractItem::Type::Text), impl_(new Impl(text, hyperlink)) { + : AbstractItem(id, AbstractItem::Type::Text), + impl_(new Impl(this, text, hyperlink)) { } -TextItem::Impl::Impl(std::string text, std::string hyperlink) - : text_(text), hyperlink_(hyperlink) { +TextItem::Impl::Impl(TextItem* parent, std::string text, std::string hyperlink) + : parent_(parent), text_(text), hyperlink_(hyperlink) { LOGI("TextItem created"); } diff --git a/notification-ex/text_item_implementation.h b/notification-ex/text_item_implementation.h index 48eb92b..ee0e567 100644 --- a/notification-ex/text_item_implementation.h +++ b/notification-ex/text_item_implementation.h @@ -30,11 +30,12 @@ class TextItem::Impl { virtual ~Impl(); private: - Impl(std::string text, std::string hyperlink); + Impl(TextItem* parent, std::string text, std::string hyperlink); private: friend class TextItem; + TextItem* parent_; std::string text_; std::string hyperlink_; };