#include "notification-ex/entry_item.h"
#include "notification-ex/entry_item_implementation.h"
-#include "notification-ex/item_factory.h"
+#include "notification-ex/factory_manager.h"
#ifdef LOG_TAG
#undef LOG_TAG
#define ENTRY_TEXT_KEY "__ENTRY_TEXT_KEY__"
#define ENTRY_LIMIT_KEY "__ENTRY_LIMIT_KEY__"
+using namespace tizen_base;
+
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(action), 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, action), impl_(new Impl(this)) {
}
-EntryItem::Impl::Impl() {
+EntryItem::Impl::Impl(EntryItem* parent)
+ : parent_(parent) {
LOGI("EntryItem created");
}
EntryItem::~EntryItem() = default;
EntryItem::Impl::~Impl() = default;
-Bundle EntryItem::Serialize() {
+int EntryItem::GetType() const {
+ return AbstractItem::Entry;
+}
+
+Bundle EntryItem::Serialize() const {
Bundle b;
b = AbstractItem::Serialize();
impl_->limit_ = std::stoi(b.GetString(ENTRY_LIMIT_KEY));
}
-AbstractItem& EntryItem::FindByID(std::string id) {
- if (GetId() == id)
- return *this;
- return ItemFactory::GetNullItem();
+bool EntryItem::IsItemTypeExist(int type) {
+ if (GetType() == type)
+ return true;
+ return false;
}
std::string EntryItem::GetText() const {