content_handler.cc
csp_handler.cc
ime_handler.cc
+ lightuser_handler.cc
metadata_handler.cc
navigation_handler.cc
permissions_handler.cc
const char kTizenCategoryKey[] = "widget.category";
// Service
const char kTizenServiceKey[] = "widget.service";
+// Lightuser
+const char kTizenLightUserKey[] = "widget.lightuser";
// launch_screen
const char kLaunchScreenKey[] = "widget.launch_screen";
extern const char kLaunchScreenKey[];
extern const char kTizenTrustAnchorKey[];
extern const char kVideoSplashScreenKey[];
+extern const char kTizenLightUserKey[];
} // namespace application_widget_keys
const std::vector<std::string> GetElementsWithDifferentAttributeLength();
--- /dev/null
+// Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt_manifest_handlers/lightuser_handler.h"
+
+#include "manifest_parser/values.h"
+
+namespace wgt {
+namespace parse {
+
+namespace {
+
+const char kLightUserKey[] = "manifest.lightuser";
+const char kLightUserSwitchModeKey[] = "@switch-mode";
+
+void ParseLightUserAndStore(
+ const parser::DictionaryValue& lightuser_dict,
+ LightUserInfo* lightuser) {
+ std::string switch_mode;
+ lightuser_dict.GetString(kLightUserSwitchModeKey, &switch_mode);
+ lightuser->set_switch_mode(switch_mode);
+}
+
+} // namespace
+
+bool LightUserHandler::Parse(
+ const parser::Manifest& manifest,
+ std::shared_ptr<parser::ManifestData>* output,
+ std::string* /*error*/) {
+ std::shared_ptr<LightUserInfo> lightuser(new LightUserInfo());
+
+ auto items = parser::GetOneOrMany(manifest.value(), kLightUserKey, "");
+ if (items.empty())
+ return true;
+
+ ParseLightUserAndStore(*items[0], lightuser.get());
+
+ *output = std::static_pointer_cast<parser::ManifestData>(lightuser);
+ return true;
+}
+
+std::string LightUserInfo::Key() {
+ return kLightUserKey;
+}
+
+std::string LightUserHandler::Key() const {
+ return kLightUserKey;
+}
+
+} // namespace parse
+} // namespace wgt
--- /dev/null
+// Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_MANIFEST_HANDLERS_LIGHTUSER_HANDLER_H_
+#define WGT_MANIFEST_HANDLERS_LIGHTUSER_HANDLER_H_
+
+#include <memory>
+#include <string>
+
+#include "manifest_parser/manifest_handler.h"
+
+namespace wgt {
+namespace parse {
+
+class LightUserInfo : public parser::ManifestData {
+ public:
+ /**
+ * @brief key
+ * @param key string
+ */
+ static std::string Key();
+ /**
+ * @brief set_switch_mode sets switch_mode
+ * @param switch_mode
+ */
+ void set_switch_mode(std::string switch_mode) {
+ switch_mode_ = std::move(switch_mode);
+ }
+ /**
+ * @brief switch_mode
+ * @return switch_mode string
+ */
+ const std::string& switch_mode() const {
+ return switch_mode_;
+ }
+
+ private:
+ std::string switch_mode_;
+};
+
+/**
+ * @brief The LightUserHandler class
+ *
+ * Handler of tizen-manifest.xml for xml elements:
+ * <lightuser>
+ */
+class LightUserHandler : public parser::ManifestHandler {
+ public:
+ bool Parse(
+ const parser::Manifest& manifest,
+ std::shared_ptr<parser::ManifestData>* output,
+ std::string* error) override;
+ std::string Key() const override;
+};
+
+} // namespace parse
+} // namespace wgt
+
+#endif // WGT_MANIFEST_HANDLERS_LIGHTUSER_HANDLER_H_