Update notification-ex event callback siganture 27/201827/1
authorhyunho <hhstark.kang@samsung.com>
Wed, 20 Mar 2019 02:45:52 +0000 (11:45 +0900)
committerhyunho <hhstark.kang@samsung.com>
Wed, 20 Mar 2019 02:45:52 +0000 (11:45 +0900)
Change-Id: Ibebfaedfb4257d988c1eacf6f048fd4bae4df9e3
Signed-off-by: hyunho <hhstark.kang@samsung.com>
src/notification_ex_service.cc

index 121fd9d..c1ae959 100644 (file)
@@ -31,6 +31,7 @@
 #include <notification-ex/dbus_connection_manager.h>
 #include <notification-ex/button_item.h>
 #include <notification-ex/ex_util.h>
+#include <notification-ex/ievent_info_internal.h>
 
 #include "debug.h"
 #include "notification_ex_service.h"
@@ -44,11 +45,11 @@ class DPMFacade {
     : reporter_(move(reporter)), manager_(move(manager)) {
    }
 
-   void DelegateReporterEvent(const EventInfo& info, shared_ptr<item::AbstractItem> item) {
+   void DelegateReporterEvent(const IEventInfo& info, shared_ptr<item::AbstractItem> item) {
      reporter_->SendEvent(info, item);
    }
 
-   void DelegateManagerEvent(const EventInfo& info, shared_ptr<item::AbstractItem> noti) {
+   void DelegateManagerEvent(const IEventInfo& info, shared_ptr<item::AbstractItem> noti) {
      manager_->SendEvent(info, noti);
    }
 
@@ -60,7 +61,7 @@ static DPMFacade* facade_;
 
 class DPMReporter : public Reporter {
  protected:
-  void OnEvent(const EventInfo& info,
+  void OnEvent(const IEventInfo& info,
       list<shared_ptr<item::AbstractItem>> noti_list) override {
     LOGI("Event received (%d) !!", (int)info.GetEventType());
     for (auto& i : noti_list) {
@@ -71,8 +72,9 @@ class DPMReporter : public Reporter {
     }
   }
 
-  list<shared_ptr<item::AbstractItem>> OnRequestEvent(const EventInfo& info) override {
+  list<shared_ptr<item::AbstractItem>> OnRequestEvent(const IEventInfo& info) override {
     DBG("Get report !!! %s", info.GetItemId().c_str());
+    DBG("Get !!! uid(%d)", (int)(((const IEventInfoInternal&)info).GetUid()));
     list<shared_ptr<item::AbstractItem>> ret {
       make_shared<item::ButtonItem>(info.GetItemId().c_str(), "title")
     };
@@ -88,7 +90,7 @@ class DPMReporter : public Reporter {
 
 class DPMManager : public Manager {
  protected:
-  void OnAdd(const EventInfo& info,
+  void OnAdd(const IEventInfo& info,
       list<shared_ptr<item::AbstractItem>> addedItem) override {
     DBG("Add !!!");
     //TODO: store it to DB
@@ -96,19 +98,19 @@ class DPMManager : public Manager {
       facade_->DelegateReporterEvent(info, i);
   }
 
-  void OnUpdate(const EventInfo& info,
+  void OnUpdate(const IEventInfo& info,
       shared_ptr<item::AbstractItem> updatedItem) override {
     DBG("Update !!!");
     facade_->DelegateReporterEvent(info, updatedItem);
   }
 
-  void OnDelete(const EventInfo& info,
+  void OnDelete(const IEventInfo& info,
       shared_ptr<item::AbstractItem> deletedItem) override {
     DBG("Delete !!!");
     facade_->DelegateReporterEvent(info, deletedItem);
   }
 
-  list<shared_ptr<item::AbstractItem>> OnRequestEvent(const EventInfo& info) override {
+  list<shared_ptr<item::AbstractItem>> OnRequestEvent(const IEventInfo& info) override {
     DBG("Get !!! %s", info.GetItemId().c_str());
     //TODO: Get it from DB
     list<shared_ptr<item::AbstractItem>> ret {