X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=notification-ex%2Ftext_item.cc;h=b25cdbe2a86706344846969282fedef3ca8ecc18;hb=refs%2Fheads%2Ftizen;hp=64b07739122f770f7b942171bcf3c094f87def47;hpb=7ce27d9bda8cd08f1cb24606f8350ab0af4e93fd;p=platform%2Fcore%2Fapi%2Fnotification.git diff --git a/notification-ex/text_item.cc b/notification-ex/text_item.cc index 64b0773..b25cdbe 100644 --- a/notification-ex/text_item.cc +++ b/notification-ex/text_item.cc @@ -20,7 +20,7 @@ #include "notification-ex/text_item.h" #include "notification-ex/text_item_implementation.h" -#include "notification-ex/item_factory.h" +#include "notification-ex/factory_manager.h" #ifdef LOG_TAG #undef LOG_TAG @@ -30,26 +30,28 @@ #define TEXT_CONTENTS_KEY "__TEXT_CONTENTS_KEY__" #define TEXT_HYPERLINK_KEY "__TEXT_HYPERLINK_KEY__" +using namespace tizen_base; + namespace notification { namespace item { -TextItem::TextItem(std::string text, std::shared_ptr action) - : AbstractItem(AbstractItem::Type::Text), impl_(new Impl(text)) { -} - -TextItem::TextItem(std::string id, std::string text, - std::shared_ptr action) - : AbstractItem(id, AbstractItem::Type::Text), impl_(new Impl(text)) { +TextItem::TextItem(std::string id, std::string text, std::string hyperlink, + std::shared_ptr action) + : AbstractItem(id, action), impl_(new Impl(this, text, hyperlink)) { } -TextItem::Impl::Impl(std::string text) - : text_(text) { +TextItem::Impl::Impl(TextItem* parent, std::string text, std::string hyperlink) + : parent_(parent), text_(text), hyperlink_(hyperlink) { LOGI("TextItem created"); } TextItem::~TextItem() = default; TextItem::Impl::~Impl() = default; -Bundle TextItem::Serialize() { +int TextItem::GetType() const { + return AbstractItem::Text; +} + +Bundle TextItem::Serialize() const { Bundle b; b = AbstractItem::Serialize(); @@ -68,10 +70,10 @@ void TextItem::Deserialize(Bundle b) { impl_->hyperlink_ = b.GetString(TEXT_HYPERLINK_KEY); } -AbstractItem& TextItem::FindByID(std::string id) { - if (GetId() == id) - return *this; - return ItemFactory::GetNullItem(); +bool TextItem::IsItemTypeExist(int type) { + if (GetType() == type) + return true; + return false; } void TextItem::SetContents(std::string contents) { @@ -87,4 +89,4 @@ std::string TextItem::GetHyperLink() const { } } // namespace item -} // namespace notification \ No newline at end of file +} // namespace notification