bundle
glib-2.0
gio-2.0
+ capi-system-info
)
FOREACH(flag ${pkgs_CFLAGS})
* @section MINICONTROL_VIEWER_MODULE_OVERVIEW Overview
* It provides functions for displaying EFL socket window.
*/
+
+/**
+ * @section CAPI_MINICONTROL_MODULE_FEATURE Related Features
+ * This API is related with the following features:\n
+ * - http://tizen.org/feature/minicontrol\n
+ * It is recommended to design feature related codes in your application for reliability.\n
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tizen-studio/native-tools/configuring-your-app/manifest-text-editor#feature"><b>Feature Element</b>.</a>
+ */
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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 __MINICONTROL_PRIVATE_H__
+#define __MINICONTROL_PRIVATE_H__
+
+#include <system_info.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define MINICONTROL_FEATURE "http://tizen.org/feature/minicontrol"
+#define CHECK_MINICONTROL_FEATURE() \
+ do { \
+ bool is_supported = false; \
+ if (!system_info_get_platform_bool(MINICONTROL_FEATURE, &is_supported)) { \
+ if (is_supported == false) { \
+ LOGE("[%s] feature is disabled", MINICONTROL_FEATURE); \
+ return MINICONTROL_ERROR_NOT_SUPPORTED; \
+ } \
+ } \
+ } while (0)
+
+#define CHECK_MINICONTROL_FEATURE_RET_NULL() \
+ do { \
+ bool is_supported = false; \
+ if (!system_info_get_platform_bool(MINICONTROL_FEATURE, &is_supported)) { \
+ if (is_supported == false) { \
+ LOGE("[%s] feature is disabled", MINICONTROL_FEATURE); \
+ set_last_result(MINICONTROL_ERROR_NOT_SUPPORTED); \
+ return NULL; \
+ } \
+ } \
+ } while (0)
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __MINICONTROL_PRIVATE_H__ */
+
/**
* @brief Creates a window for minicontrol.
* @since_tizen 2.4
+ * @remarks The specific error code can be obtained using the gat_last_result() method. Error codes are described in Exception section.
* @param[in] name Name of minicontrol socket window
* @param[in] target_viewer Target viewer for minicontrol. You can select multiple viewers by using bitwise OR operator
* @param[in] callback A callback function for events originated by minicontrol viewer
- * @return Evas object of socket window. @c NULL failed to create, get_last_result() will return reason of failure
+ * @return Evas object of minicontrol. NULL on error
+ * @exception #MINICONTROL_ERROR_NONE Success
+ * @exception #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
+ * @exception #MINICONTROL_ERROR_ELM_FAILURE Some error occurred when creating a minicontrol window
+ * @exception #MINICONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ * @exception #MINICONTROL_ERROR_NOT_SUPPORTED Not supported
* @see #minicontrol_target_viewer_e
* @see #minicontrol_event_cb
+ * @see get_last_result()
*/
Evas_Object *minicontrol_create_window(const char *name, minicontrol_target_viewer_e target_viewer, minicontrol_event_cb callback);
* @return #MINICONTROL_ERROR_NONE on success,
* otherwise an error code on failure
* @retval #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #MINICONTROL_ERROR_NOT_SUPPORTED Not supported
* @see #minicontrol_provider_event_e
* @see #minicontrol_create_window
*/
/**
* @brief Adds minicontrol named as "minicontrol_name" to a given parent evas object and returns it.
* @since_tizen 2.4
+ * @remarks The specific error code can be obtained using the gat_last_result() method. Error codes are described in Exception section.
* @param[in] parent Minicontrol object will be added to this parent evas object
* @param[in] minicontrol_name Name of minicontrol
- * @return Evas object of minicontrol. @c NULL failed to add, get_last_result() will return reason of failure
+ * @return Evas object of minicontrol. NULL on error
+ * @exception #MINICONTROL_ERROR_NONE Success
+ * @exception #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
+ * @exception #MINICONTROL_ERROR_ELM_FAILURE Some error occurred when creating a minicontrol window
+ * @exception #MINICONTROL_ERROR_NOT_SUPPORTED Not supported
+ * @see get_last_result()
*/
Evas_Object *minicontrol_viewer_add(Evas_Object *parent, const char *minicontrol_name);
* @return #MINICONTROL_ERROR_NONE on success,
* otherwise an error code on failure
* @retval #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #MINICONTROL_ERROR_NOT_SUPPORTED Not supported
* @see #minicontrol_viewer_event_e
*/
int minicontrol_viewer_send_event(const char *minicontrol_name, minicontrol_viewer_event_e event, bundle *event_arg);
* @retval #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
* @retval #MINICONTROL_ERROR_IPC_FAILURE IPC failure
* @retval #MINICONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MINICONTROL_ERROR_NOT_SUPPORTED Not supported
* @see #minicontrol_viewer_unset_event_cb
* @see #minicontrol_viewer_event_cb
*/
* @since_tizen 2.4
* @return #MINICONTROL_ERROR_NONE if success,
* other value if failure
+ * @retval #MINICONTROL_ERROR_NOT_SUPPORTED Not supported
* @see #minicontrol_viewer_set_event_cb
*/
int minicontrol_viewer_unset_event_cb(void);
BuildRequires: pkgconfig(ecore-evas)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: cmake
Requires(post): /sbin/ldconfig
requires(postun): /sbin/ldconfig
#include "minicontrol-provider.h"
#include "minicontrol-provider-internal.h"
#include "minicontrol-log.h"
+#include "minicontrol-private.h"
#define MINICTRL_PRIORITY_SUFFIX_TOP "__minicontrol_top"
#define MINICTRL_PRIORITY_SUFFIX_LOW "__minicontrol_low"
char *name_inter;
struct _minicontrol_provider *pd;
+ CHECK_MINICONTROL_FEATURE_RET_NULL();
+
if (!name) {
ERR("invalid parameter");
set_last_result(MINICONTROL_ERROR_INVALID_PARAMETER);
pd->event_callback = event_callback;
INFO("new minicontrol created - %s", pd->name);
+ set_last_result(MINICONTROL_ERROR_NONE);
return win;
}
struct _minicontrol_provider *pd;
int ret = MINICONTROL_ERROR_NONE;
+ CHECK_MINICONTROL_FEATURE();
+
if (!minicontrol) {
ERR("minicontrol is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
char *name_inter = NULL;
struct _minicontrol_provider *pd;
+ CHECK_MINICONTROL_FEATURE_RET_NULL();
+
INFO("minicontrol_win_add [%s]", name);
if (!name) {
struct _minicontrol_provider *pd;
minicontrol_event_e event;
+ CHECK_MINICONTROL_FEATURE();
+
if (!minicontrol) {
ERR("minicontrol is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
#include "minicontrol-viewer.h"
#include "minicontrol-viewer-internal.h"
#include "minicontrol-log.h"
+#include "minicontrol-private.h"
#define MINICTRL_PLUG_DATA_KEY "__minictrl_plug_name"
{
int ret = MINICONTROL_ERROR_NONE;
+ CHECK_MINICONTROL_FEATURE();
+
if (minicontrol_name == NULL) {
ERR("appid is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
minictrl_sig_handle *event_sh;
struct _minicontrol_viewer *minicontrol_viewer_h;
+ CHECK_MINICONTROL_FEATURE();
+
if (!callback) {
ERR("MINICONTROL_ERROR_INVALID_PARAMETER");
return MINICONTROL_ERROR_INVALID_PARAMETER;
EXPORT_API int minicontrol_viewer_unset_event_cb(void)
{
+ CHECK_MINICONTROL_FEATURE();
+
if (!g_minicontrol_viewer_h)
return MINICONTROL_ERROR_NONE;
Evas_Object *plug_img = NULL;
Ecore_Evas *ee = NULL;
+ CHECK_MINICONTROL_FEATURE_RET_NULL();
+
if (parent == NULL || minicontrol_name == NULL) {
ERR("invalid parameter");
set_last_result(MINICONTROL_ERROR_INVALID_PARAMETER);
evas_object_event_callback_add(plug, EVAS_CALLBACK_DEL,
_minictrl_plug_del, ee);
+ set_last_result(MINICONTROL_ERROR_NONE);
return plug;
}
EXPORT_API Evas_Object *minicontrol_viewer_image_object_get(
const Evas_Object *obj)
{
+ CHECK_MINICONTROL_FEATURE_RET_NULL();
+
return elm_plug_image_object_get(obj);
}
/* LCOV_EXCL_STOP */
bundle *event_arg_bundle;
char bundle_value_buffer[BUNDLE_BUFFER_LENGTH];
+ CHECK_MINICONTROL_FEATURE();
+
if (minicontrol_name == NULL) {
ERR("appid is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;