2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "theme/loader/theme_info.h"
24 ThemeInfo::ThemeInfo(const tizen_base::Bundle& bundle) {
25 bundle_ = tizen_base::Bundle(bundle);
28 std::string ThemeInfo::GetId() const {
29 return bundle_.GetString("id");
32 std::string ThemeInfo::GetPkgid() const {
33 return bundle_.GetString("pkgid");
36 uid_t ThemeInfo::GetUid() const {
37 std::string uid_str = bundle_.GetString("uid");
38 return std::stoi(uid_str);
41 std::string ThemeInfo::GetVersion() const {
42 return bundle_.GetString("version");
45 std::string ThemeInfo::GetToolVersion() const {
46 return bundle_.GetString("tool_version");
49 std::string ThemeInfo::GetTitle() const {
50 return bundle_.GetString("title");
53 std::string ThemeInfo::GetResolution() const {
54 return bundle_.GetString("resolution");
57 std::string ThemeInfo::GetPreview() const {
58 return bundle_.GetString("preview");
61 std::string ThemeInfo::GetDescription() const {
62 return bundle_.GetString("description");
65 std::string ThemeInfo::GetString(const std::string& key) const {
66 return bundle_.GetString(key);
69 std::vector<std::string> ThemeInfo::GetStringArray(
70 const std::string& key) const {
71 std::vector<std::string> v = bundle_.GetStringArray(key);
75 int ThemeInfo::GetInt(const std::string& key) const {
76 int val = std::stoi(bundle_.GetString(key));
80 float ThemeInfo::GetFloat(const std::string& key) const {
81 float val = std::stof(bundle_.GetString(key));
85 bool ThemeInfo::GetBool(const std::string& key) const {
86 if (bundle_.GetString(key).compare("true") == 0)
92 tizen_base::Bundle ThemeInfo::Serialize() const {