From: Piotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics Date: Wed, 24 Jun 2020 05:58:41 +0000 (+0200) Subject: [Metadata] Created template of module X-Git-Tag: submit/tizen/20200708.105445~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef27294aeddb6ffc1a959d42f732183cbe63fc75;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Metadata] Created template of module [ACR] https://code.sec.samsung.net/jira/browse/TWDAPI-265 [verification] Code compiles and module is visible in Web application. Change-Id: Ic4697a0e5af8dc6a4204a7fd5947f1cdadc8c477 --- diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index 8a54a264..e0f9ec4c 100644 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -51,6 +51,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_common_feature_media_key_support 0 %define tizen_common_feature_message_port_support 1 %define tizen_common_feature_messaging_support 0 +%define tizen_common_feature_metadata_support 1 %define tizen_common_feature_nbs_support 0 %define tizen_common_feature_nfc_support 0 %define tizen_common_feature_nfc_emulation_support 0 @@ -114,6 +115,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_mobile_feature_media_key_support 1 %define tizen_mobile_feature_message_port_support 1 %define tizen_mobile_feature_messaging_support 1 +%define tizen_mobile_feature_metadata_support 1 %define tizen_mobile_feature_nfc_support 0 %define tizen_mobile_feature_nfc_emulation_support 0 %define tizen_mobile_feature_notification_support 1 @@ -223,6 +225,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_wearable_feature_media_key_support 1 %define tizen_wearable_feature_message_port_support 1 %define tizen_wearable_feature_messaging_support 0 +%define tizen_wearable_feature_metadata_support 1 %define tizen_wearable_feature_nfc_support 1 %define tizen_wearable_feature_nfc_emulation_support 0 %define tizen_wearable_feature_notification_support 1 @@ -303,6 +306,7 @@ Source0: %{name}-%{version}.tar.gz %define tizen_tv_feature_media_key_support 0 %define tizen_tv_feature_message_port_support 1 %define tizen_tv_feature_messaging_support 0 +%define tizen_tv_feature_metadata_support 1 %define tizen_tv_feature_nbs_support 0 %define tizen_tv_feature_nfc_support 0 %define tizen_tv_feature_nfc_emulation_support 0 @@ -722,6 +726,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobi GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_mobile_feature_metadata_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}" @@ -729,6 +734,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_f GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_mobile_feature_ppm_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}" #GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}" @@ -745,7 +751,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_voicecontrol_support=%{?tizen_mobile_feature_voicecontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_mobile_feature_ppm_support}" ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp @@ -812,6 +817,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobi GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_mobile_feature_metadata_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}" @@ -819,6 +825,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_f GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_mobile_feature_ppm_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}" #GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}" @@ -835,7 +842,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_voicecontrol_support=%{?tizen_mobile_feature_voicecontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_mobile_feature_ppm_support}" ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp @@ -890,6 +896,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wear GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_wearable_feature_metadata_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}" @@ -897,6 +904,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_wearable_feature_ppm_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}" #GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}" @@ -913,7 +921,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearab GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_voicecontrol_support=%{?tizen_wearable_feature_voicecontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_wearable_feature_ppm_support}" ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp @@ -975,6 +982,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wear GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_wearable_feature_metadata_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}" @@ -982,6 +990,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_wearable_feature_ppm_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}" #GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}" @@ -998,7 +1007,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearab GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_voicecontrol_support=%{?tizen_wearable_feature_voicecontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_wearable_feature_ppm_support}" ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp @@ -1053,6 +1061,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_tv_f GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_tv_feature_media_key_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_tv_feature_message_port_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_tv_feature_messaging_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_tv_feature_metadata_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_tv_feature_nbs_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_tv_feature_nfc_emulation_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_tv_feature_nfc_support}" @@ -1060,6 +1069,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_tv_featu GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_tv_feature_package_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_tv_feature_player_util_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_tv_feature_power_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_tv_feature_ppm_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_tv_feature_preference_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_tv_feature_push_support}" #GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_tv_feature_sap_support}" @@ -1076,7 +1086,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_tv_fea GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_tv_feature_wi_fi_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_tv_feature_tvinputdevice_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_voicecontrol_support=%{?tizen_tv_feature_voicecontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_tv_feature_ppm_support}" ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp @@ -1129,6 +1138,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_comm GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_common_feature_media_key_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_common_feature_message_port_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_common_feature_messaging_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_metadata_support=%{?tizen_common_feature_metadata_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_common_feature_nbs_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_common_feature_nfc_emulation_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_common_feature_nfc_support}" @@ -1136,6 +1146,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_common_f GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_common_feature_package_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_common_feature_player_util_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_common_feature_power_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_common_feature_ppm_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_common_feature_preference_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_common_feature_push_support}" #GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_common_feature_sap_support}" @@ -1152,7 +1163,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_common GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_common_feature_wi_fi_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_common_feature_tvinputdevice_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_voicecontrol_support=%{?tizen_common_feature_voicecontrol_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ppm_support=%{?tizen_common_feature_ppm_support}" ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp diff --git a/src/metadata/metadata.gyp b/src/metadata/metadata.gyp new file mode 100644 index 00000000..e46da548 --- /dev/null +++ b/src/metadata/metadata.gyp @@ -0,0 +1,33 @@ +{ + 'includes':[ + '../common/common.gypi', + ], + 'targets': [ + { + 'target_name': 'tizen_metadata', + 'type': 'loadable_module', + 'dependencies': [ + '../common/common.gyp:tizen_common', + ], + 'sources': [ + 'metadata_api.js', + 'metadata_extension.cc', + 'metadata_extension.h', + 'metadata_instance.cc', + 'metadata_instance.h', + ], + 'includes': [ + '../common/pkg-config.gypi', + ], + 'conditions': [ + ['tizen == 1', { + 'variables': { + 'packages': [ + 'capi-media-metadata-extractor', + ] + }, + }], + ], + }, + ], +} \ No newline at end of file diff --git a/src/metadata/metadata_api.js b/src/metadata/metadata_api.js new file mode 100755 index 00000000..9d08ad85 --- /dev/null +++ b/src/metadata/metadata_api.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2020 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. + */ + +var privUtils_ = xwalk.utils; +var validator_ = privUtils_.validator; +var converter_ = privUtils_.converter; +var types_ = validator_.Types; +var T_ = privUtils_.type; +var native_ = new xwalk.utils.NativeManager(extension); + +function MetadataManager() {} + +MetadataManager.prototype.createFileHandle = function() { + // TODO + throw new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR, 'Not implemented yet'); +}; + +function MetadataFileHandle() { + // TODO +} + +// Exports +exports = new MetadataManager(); diff --git a/src/metadata/metadata_extension.cc b/src/metadata/metadata_extension.cc new file mode 100644 index 00000000..9d210b75 --- /dev/null +++ b/src/metadata/metadata_extension.cc @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "metadata/metadata_extension.h" +#include "metadata/metadata_instance.h" + +// This will be generated from *_api.js +extern const char kSource_metadata_api[]; + +common::Extension* CreateExtension() { + return new MetadataExtension; +} + +MetadataExtension::MetadataExtension() { + SetExtensionName("tizen.metadata"); + SetJavaScriptAPI(kSource_metadata_api); +} + +MetadataExtension::~MetadataExtension() { +} + +common::Instance* MetadataExtension::CreateInstance() { + return new extension::metadata::MetadataInstance(); +} diff --git a/src/metadata/metadata_extension.h b/src/metadata/metadata_extension.h new file mode 100644 index 00000000..29535f68 --- /dev/null +++ b/src/metadata/metadata_extension.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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 METADATA_METADATA_EXTENSION_H__ +#define METADATA_METADATA_EXTENSION_H__ + +#include "common/extension.h" + +class MetadataExtension : public common::Extension { + public: + MetadataExtension(); + virtual ~MetadataExtension(); + + private: + virtual common::Instance* CreateInstance(); +}; + +#endif // METADATA_METADATA_EXTENSION_H__ diff --git a/src/metadata/metadata_instance.cc b/src/metadata/metadata_instance.cc new file mode 100644 index 00000000..efae2d10 --- /dev/null +++ b/src/metadata/metadata_instance.cc @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "metadata/metadata_instance.h" + +#include "common/logger.h" +#include "common/picojson.h" +#include "common/platform_exception.h" +#include "common/tools.h" + +namespace extension { +namespace metadata { + +using namespace common; + +MetadataInstance::MetadataInstance() { + ScopeLogger(); + using std::placeholders::_1; + using std::placeholders::_2; + +#define REGISTER_METHOD(M) RegisterSyncHandler(#M, std::bind(&MetadataInstance::M, this, _1, _2)) + + REGISTER_METHOD(MetadataManagerCreateFileHandle); + REGISTER_METHOD(MetadataFileHandleGet); + REGISTER_METHOD(MetadataFileHandleRelease); +#undef REGISTER_METHOD +} + +MetadataInstance::~MetadataInstance() { + ScopeLogger(); +} + +void MetadataInstance::MetadataManagerCreateFileHandle(const picojson::value& args, picojson::object& out) { + ScopeLogger(); + + LogAndReportError(PlatformResult(ErrorCode::NOT_SUPPORTED_ERR, "Not implemented yet"), &out); +} + +void MetadataInstance::MetadataFileHandleGet(const picojson::value& args, picojson::object& out) { + ScopeLogger(); + + LogAndReportError(PlatformResult(ErrorCode::NOT_SUPPORTED_ERR, "Not implemented yet"), &out); +} + +void MetadataInstance::MetadataFileHandleRelease(const picojson::value& args, picojson::object& out) { + ScopeLogger(); + + LogAndReportError(PlatformResult(ErrorCode::NOT_SUPPORTED_ERR, "Not implemented yet"), &out); +} + +} // namespace metadata +} // namespace extension diff --git a/src/metadata/metadata_instance.h b/src/metadata/metadata_instance.h new file mode 100644 index 00000000..26d06136 --- /dev/null +++ b/src/metadata/metadata_instance.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 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 METADATA_METADATA_INSTANCE_H_ +#define METADATA_METADATA_INSTANCE_H_ + +#include "common/extension.h" + +namespace extension { +namespace metadata { + +class MetadataInstance : public common::ParsedInstance { + public: + MetadataInstance(); + virtual ~MetadataInstance(); + + private: + void MetadataManagerCreateFileHandle(const picojson::value& args, picojson::object& out); + void MetadataFileHandleGet(const picojson::value& args, picojson::object& out); + void MetadataFileHandleRelease(const picojson::value& args, picojson::object& out); + +}; + +} // namespace metadata +} // namespace extension + +#endif // METADATA_METADATA_INSTANCE_H_ diff --git a/src/tizen-wrt.gyp b/src/tizen-wrt.gyp index f3e10034..9517163c 100755 --- a/src/tizen-wrt.gyp +++ b/src/tizen-wrt.gyp @@ -344,6 +344,13 @@ ], }, ], + [ + 'tizen_feature_metadata_support==1', { + 'dependencies': [ + 'metadata/metadata.gyp:*', + ], + }, + ], ], # end conditions }, ], # end targets