Fix wrong log value
[platform/core/api/notification.git] / notification-ex / text_item.cc
index cced868..b25cdbe 100644 (file)
 #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 id, std::string text, std::string hyperlink,
-      std::shared_ptr<AbstractAction> action)
-  : AbstractItem(id, AbstractItem::Type::Text),
-  impl_(new Impl(this, text, hyperlink)) {
+    std::shared_ptr<AbstractAction> action)
+    : AbstractItem(id, action), impl_(new Impl(this, text, hyperlink)) {
 }
 
 TextItem::Impl::Impl(TextItem* parent, std::string text, std::string hyperlink)
-  : parent_(parent), text_(text), hyperlink_(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();
 
@@ -65,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 FactoryManager::GetInst().GetNullItem();
+bool TextItem::IsItemTypeExist(int type) {
+  if (GetType() == type)
+    return true;
+  return false;
 }
 
 void TextItem::SetContents(std::string contents) {
@@ -84,4 +89,4 @@ std::string TextItem::GetHyperLink() const {
 }
 
 }  // namespace item
-}  // namespace notification
\ No newline at end of file
+}  // namespace notification