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 143a311d86c333fab9200245fde0ba9d5b572c2e..31c4caf1138a43f7180676482e03c8c05b6aa3d3 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 ecfe724a8c468758880583a35fa7a8909a5a68a9..4af69cc5fa03f38f0b3d8bc439083bdd7fc7b836 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 d8837828c6d039a9ef6cc43f97d32944a8807789..cced8681f00057f11eff5497059a2d9fe5fc7cb2 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 48eb92bc4526586b150ff997f23faf1428bc1267..ee0e5675552e0f877f52cf52dbfa4d0a3ff91d32 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_;
 };