Add parent item for TextItem and EntryItem 04/201304/1
authorSukHyung, Kang <shine.kang@samsung.com>
Tue, 12 Mar 2019 08:17:32 +0000 (17:17 +0900)
committerSukHyung, Kang <shine.kang@samsung.com>
Tue, 12 Mar 2019 08:17:32 +0000 (17:17 +0900)
Change-Id: I9c458e3f0efab8a25d2ed0f9feeda3282ec5429f
Signed-off-by: SukHyung, Kang <shine.kang@samsung.com>
notification-ex/entry_item.cc
notification-ex/entry_item_implementation.h
notification-ex/text_item.cc
notification-ex/text_item_implementation.h

index 143a311..31c4caf 100644 (file)
 namespace notification {
 namespace item {
 
-EntryItem::EntryItem(std::string id, std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, AbstractItem::Type::Entry), impl_(new Impl()) {
+EntryItem::EntryItem(std::shared_ptr<AbstractAction> action)
+  : AbstractItem(AbstractItem::Type::Entry), impl_(new Impl(this)) {
 }
 
-EntryItem::EntryItem(std::shared_ptr<AbstractAction> action)
-  : AbstractItem(AbstractItem::Type::Entry), impl_(new Impl()) {
+EntryItem::EntryItem(std::string id, std::shared_ptr<AbstractAction> action)
+  : AbstractItem(id, AbstractItem::Type::Entry), impl_(new Impl(this)) {
 }
 
-EntryItem::Impl::Impl() {
+EntryItem::Impl::Impl(EntryItem* parent)
+  : parent_(parent) {
   LOGI("EntryItem created");
 }
 
index ecfe724..4af69cc 100644 (file)
@@ -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;
 };
index d883782..cced868 100644 (file)
@@ -34,11 +34,12 @@ namespace notification {
 namespace item {
 TextItem::TextItem(std::string id, std::string text, std::string hyperlink,
       std::shared_ptr<AbstractAction> 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");
 }
 
index 48eb92b..ee0e567 100644 (file)
@@ -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_;
 };