--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__
+#define __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int noti_ex_item_free_string_list(char** list, int count);
+int noti_ex_item_group_remove_children(noti_ex_item_h handle);
+int noti_ex_item_time_set_time(noti_ex_item_h handle,
+ time_t time);
+
+int noti_ex_style_set_geometry(
+ noti_ex_style_h handle, noti_ex_geometry_h geometry);
+int noti_ex_style_set_color(
+ noti_ex_style_h handle, noti_ex_color_h color);
+int noti_ex_style_set_padding(noti_ex_style_h handle,
+ noti_ex_padding_h padding);
+
+int noti_ex_led_info_set_color(
+ noti_ex_led_info_h handle, noti_ex_color_h color);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ */
\ No newline at end of file
#include "api/notification_ex_text.h"
#include "api/notification_ex_time.h"
#include "api/notification_ex_visibility_action.h"
+#include "api/notification_ex_visibility_action.h"
+#include "api/notification_ex_internal.h"
#include "notification-ex/reporter.h"
#include "notification-ex/app_control_action.h"
#include "notification-ex/button_item.h"
return NOTI_EX_ERROR_NONE;
}
+
+extern "C" EXPORT_API int noti_ex_style_set_padding(noti_ex_style_h handle,
+ noti_ex_padding_h padding) {
+ if (handle == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ shared_ptr<Style>* p = static_cast<shared_ptr<Style>*>(handle);
+ if (padding == nullptr) {
+ (*p)->SetPadding(nullptr);
+ return NOTI_EX_ERROR_NONE;
+ }
+
+ shared_ptr<Padding>* padd = static_cast<shared_ptr<Padding>*>(padding);
+ (*p)->SetPadding(*padd);
+
+ return NOTI_EX_ERROR_NONE;
+}
+
extern "C" EXPORT_API int noti_ex_style_get_color(noti_ex_style_h handle,
noti_ex_color_h *color) {
if (handle == nullptr || color == nullptr) {
return NOTI_EX_ERROR_NONE;
}
+extern "C" EXPORT_API int noti_ex_style_set_color(
+ noti_ex_style_h handle, noti_ex_color_h color) {
+ if (handle == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ shared_ptr<Style>* p = static_cast<shared_ptr<Style>*>(handle);
+ if (color == nullptr) {
+ (*p)->SetColor(nullptr);
+ return NOTI_EX_ERROR_NONE;
+ }
+
+ shared_ptr<Color>* col = static_cast<shared_ptr<Color>*>(color);
+ (*p)->SetColor(*col);
+
+ return NOTI_EX_ERROR_NONE;
+}
+
extern "C" EXPORT_API int noti_ex_style_get_geometry(noti_ex_style_h handle,
noti_ex_geometry_h *geometry) {
if (handle == nullptr || geometry == nullptr) {
return NOTI_EX_ERROR_NONE;
}
+extern "C" EXPORT_API int noti_ex_style_set_geometry(
+ noti_ex_style_h handle, noti_ex_geometry_h geometry) {
+ if (handle == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ shared_ptr<Style>* p = static_cast<shared_ptr<Style>*>(handle);
+ if (geometry == nullptr) {
+ (*p)->SetGeometry(nullptr);
+ return NOTI_EX_ERROR_NONE;
+ }
+
+ shared_ptr<Geometry>* geo = static_cast<shared_ptr<Geometry>*>(geometry);
+ (*p)->SetGeometry(*geo);
+
+ return NOTI_EX_ERROR_NONE;
+}
+
extern "C" EXPORT_API int noti_ex_style_get_background_image(
noti_ex_style_h handle, char** background_image) {
if (handle == nullptr || background_image == nullptr) {
return NOTI_EX_ERROR_NONE;
}
+extern "C" EXPORT_API int noti_ex_led_info_set_color(
+ noti_ex_led_info_h handle, noti_ex_color_h color) {
+ if (handle == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ shared_ptr<LEDInfo>* p = static_cast<shared_ptr<LEDInfo>*>(handle);
+ if (color == nullptr) {
+ (*p)->SetColor(nullptr);
+ return NOTI_EX_ERROR_NONE;
+ }
+
+ shared_ptr<Color>* col = static_cast<shared_ptr<Color>*>(color);
+ (*p)->SetColor(*col);
+
+ return NOTI_EX_ERROR_NONE;
+}
+
extern "C" EXPORT_API int noti_ex_action_destroy(noti_ex_action_h handle) {
if (handle == nullptr) {
LOGE("Invalid parameter");
}
Handle* p = static_cast<Handle*>(handle);
+ if (led == nullptr) {
+ p->Get()->SetLEDInfo(nullptr);
+ return NOTI_EX_ERROR_NONE;
+ }
shared_ptr<LEDInfo>* led_ptr =
reinterpret_cast<shared_ptr<LEDInfo>*>(led);
p->Get()->SetLEDInfo(*led_ptr);
return NOTI_EX_ERROR_NONE;
}
+extern "C" EXPORT_API int noti_ex_item_time_set_time(noti_ex_item_h handle,
+ time_t time) {
+ if (handle == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+ Handle* h = static_cast<Handle*>(handle);
+ if (!h->IsValidType(AbstractItem::Time)) {
+ LOGE("Invalid handle type");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+ TimeItem* p = static_cast<TimeItem*>(h->Get());
+ p->SetTime(time);
+
+ return NOTI_EX_ERROR_NONE;
+}
+
extern "C" EXPORT_API int noti_ex_action_visibility_create(
noti_ex_action_h *handle, const char *extra) {
if (handle == nullptr) {
return NOTI_EX_ERROR_NONE;
}
+
+extern "C" EXPORT_API int noti_ex_item_free_string_list(char** list, int count) {
+ if (list == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ LOGI("Free strings (%d)", count);
+ for (int i = 0; i < count; i++)
+ free(list[i]);
+ free(list);
+
+ return NOTI_EX_ERROR_NONE;
+}
+
+extern "C" EXPORT_API int noti_ex_item_group_remove_children(noti_ex_item_h handle) {
+ if (handle == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+ Handle* h = static_cast<Handle*>(handle);
+ if (!h->IsValidType(AbstractItem::Group)) {
+ LOGE("Invalid handle type");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+ GroupItem* p = static_cast<GroupItem*>(h->Get());
+ p->RemoveChildren();
+
+ return NOTI_EX_ERROR_NONE;
+}