#include "notification-ex/image_item.h"
#include "notification-ex/image_item_implementation.h"
-#include "notification-ex/item_factory.h"
+#include "notification-ex/factory_manager.h"
#include "notification-ex/exception.h"
#ifdef LOG_TAG
#define LOG_TAG "NOTIFICATION_EX"
#define IMAGE_PATH_KEY "__IMAGE_PATH_KEY__"
+using namespace tizen_base;
+
namespace notification {
namespace item {
-ImageItem::ImageItem(std::string imagePath,
- std::shared_ptr<AbstractAction> action)
- : AbstractItem(AbstractItem::Image, action), impl_(new Impl(this, imagePath)) {
+ImageItem::ImageItem(std::string image_path,
+ std::shared_ptr<AbstractAction> action)
+ : AbstractItem(action), impl_(new Impl(this, image_path)) {
}
-ImageItem::ImageItem(std::string id, std::string imagePath,
- std::shared_ptr<AbstractAction> action)
- : AbstractItem(id, AbstractItem::Image, action), impl_(new Impl(this, imagePath)) {
+ImageItem::ImageItem(std::string id, std::string image_path,
+ std::shared_ptr<AbstractAction> action)
+ : AbstractItem(id, action), impl_(new Impl(this, image_path)) {
}
-ImageItem::Impl::Impl(ImageItem* parent, std::string imagePath)
- : parent_(parent), imagePath_(imagePath) {
+ImageItem::Impl::Impl(ImageItem* parent, std::string image_path)
+ : parent_(parent), image_path_(image_path) {
LOGI("ImageItem impl created");
}
-Bundle ImageItem::Serialize() {
+int ImageItem::GetType() const {
+ return AbstractItem::Image;
+}
+
+Bundle ImageItem::Serialize() const {
Bundle b;
b = AbstractItem::Serialize();
- b.Add(IMAGE_PATH_KEY, impl_->imagePath_);
+ b.Add(IMAGE_PATH_KEY, impl_->image_path_);
return b;
}
void ImageItem::Deserialize(Bundle b) {
AbstractItem::Deserialize(b);
-
- impl_->imagePath_ = b.GetString(IMAGE_PATH_KEY);
+ impl_->image_path_ = b.GetString(IMAGE_PATH_KEY);
}
-AbstractItem& ImageItem::FindByID(std::string id) {
- if (GetId() == id)
- return *this;
-
- return ItemFactory::GetNullItem();
+bool ImageItem::IsItemTypeExist(int type) {
+ if (GetType() == type)
+ return true;
+ return false;
}
std::string ImageItem::GetImagePath() const {
- return impl_->imagePath_;
+ return impl_->image_path_;
}
ImageItem::~ImageItem() = default;
ImageItem::Impl::~Impl() = default;
-
} // namespace item
} // namespace notification