#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"
: 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);
}
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) {
}
}
- 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")
};
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
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 {