int noti_ex_item_button_set_image(noti_ex_item_h handle, const char *path);
int noti_ex_item_button_get_image(noti_ex_item_h handle, char **path);
+int noti_ex_item_button_set_contents(noti_ex_item_h handle, const char *contents);
+int noti_ex_item_button_get_contents(noti_ex_item_h handle, char **contents);
int noti_ex_reporter_find_by_channel(noti_ex_reporter_h handle,
const char *channel, noti_ex_item_h **noti_list, int *count);
#define LOG_TAG "NOTIFICATION_EX"
#define BUTTON_TITLE_KEY "__BUTTON_TITLE_KEY__"
#define BUTTON_IMAGE_KEY "__BUTTON_IMAGE_KEY__"
+#define BUTTON_CONTENTS_KEY "__BUTTON_CONTENTS_KEY__"
using namespace std;
using namespace tizen_base;
b.Add(BUTTON_TITLE_KEY, impl_->title_);
if (!impl_->img_path_.empty())
b.Add(BUTTON_IMAGE_KEY, impl_->img_path_);
+ if (!impl_->contents_.empty())
+ b.Add(BUTTON_CONTENTS_KEY, impl_->contents_);
return b;
}
AbstractItem::Deserialize(b);
impl_->title_ = b.GetString(BUTTON_TITLE_KEY);
impl_->img_path_ = b.GetString(BUTTON_IMAGE_KEY);
+ impl_->contents_ = b.GetString(BUTTON_CONTENTS_KEY);
}
bool ButtonItem::IsItemTypeExist(int type) {
return impl_->img_path_;
}
+void ButtonItem::SetContents(std::string contents) {
+ impl_->contents_ = contents;
+}
+
+std::string ButtonItem::GetContents() const {
+ return impl_->contents_;
+}
+
} // namespace item
} // namespace notification
*/
void SetImgPath(std::string path);
+ /**
+ * @brief Gets the contents of ButtonItem.
+ * @since_tizen 5.5
+ * @return The contents string
+ */
+ std::string GetContents() const;
+
+ /**
+ * @brief Sets the contents of ButtonItem.
+ * @since_tizen 5.5
+ * @param[in] contents The contents string
+ */
+ void SetContents(std::string contents);
+
private:
class Impl;
std::unique_ptr<Impl> impl_;
std::string title_;
std::string img_path_;
+ std::string contents_;
ButtonItem* parent_;
};
return NOTI_EX_ERROR_NONE;
}
+extern "C" EXPORT_API int noti_ex_item_button_set_contents(
+ noti_ex_item_h handle, const char *contents) {
+ if (handle == nullptr || contents == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ Handle* h = static_cast<Handle*>(handle);
+ if (!h->IsValidType(AbstractItem::Button)) {
+ LOGE("Invalid handle type");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ ButtonItem* p = static_cast<ButtonItem*>(h->Get());
+ p->SetContents(std::string(contents));
+
+ return NOTI_EX_ERROR_NONE;
+}
+
+extern "C" EXPORT_API int noti_ex_item_button_get_contents(
+ noti_ex_item_h handle, char **contents) {
+ if (handle == nullptr || contents == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ Handle* h = static_cast<Handle*>(handle);
+ if (!h->IsValidType(AbstractItem::Button)) {
+ LOGE("Invalid handle type");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ ButtonItem* p = static_cast<ButtonItem*>(h->Get());
+ if (!p->GetContents().empty())
+ *contents = strdup(p->GetContents().c_str());
+ else
+ *contents = nullptr;
+
+ return NOTI_EX_ERROR_NONE;
+}
+
extern "C" EXPORT_API int noti_ex_item_chat_message_create(
noti_ex_item_h *handle, const char *id, noti_ex_item_h name,
noti_ex_item_h text, noti_ex_item_h image, noti_ex_item_h time,