include/dpl/wrt-dao-ro/plugin_dao_read_only.h
include/dpl/wrt-dao-ro/property_dao_read_only.h
include/dpl/wrt-dao-ro/widget_config.h
- include/dpl/wrt-dao-ro/vconf_config.h
include/dpl/wrt-dao-ro/widget_dao_read_only.h
include/dpl/wrt-dao-ro/wrt_db_types.h
include/dpl/wrt-dao-ro/WrtDatabase.h
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to set web database usage")
}
-void WidgetDAO::setFileSystemUsage(const SettingsType value)
-{
- SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
- {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
-
- ScopedTransaction transaction(&WrtDatabase::interface());
- if (!isWidgetInstalled(getHandle())) {
- ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist,
- "Cannot find widget. Handle: " << getHandle());
- }
-
- WidgetSecuritySettings::Row row;
- row.Set_file_system_usage(value);
-
- WRT_DB_UPDATE(update, WidgetSecuritySettings, &WrtDatabase::interface())
- update->Where(Equals<WidgetSecuritySettings::app_id>(getHandle()));
- update->Values(row);
- update->Execute();
-
- transaction.Commit();
- }
- SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to set filesystem usage")
-}
-
void WidgetDAO::registerWidget(
const TizenAppId & tzAppId,
const WidgetRegisterInfo &widgetRegInfo,
row.Set_geolocation_usage(SETTINGS_TYPE_ON);
row.Set_web_notification_usage(SETTINGS_TYPE_ON);
row.Set_web_database_usage(SETTINGS_TYPE_ON);
- row.Set_file_system_usage(SETTINGS_TYPE_ON);
DO_INSERT(row, WidgetSecuritySettings)
}
return static_cast<SettingsType>(*result);
}
-SettingsType WidgetDAOReadOnly::getFileSystemUsage(void) const
-{
- WidgetSecuritySettingsRow row =
- getWidgetSecuritySettingsRow(m_widgetHandle);
- DPL::OptionalInt result = row.Get_file_system_usage();
- return static_cast<SettingsType>(*result);
-}
-
DPL::OptionalString WidgetDAOReadOnly::getWidgetInstalledPath() const
{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
+++ /dev/null
-/*
- * Copyright (c) 2011 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.
- */
-/**
- * @file vconf_config.h
- * @author Jihoon Chung (jihoon.chung@samsung.com)
- * @version 1.0
- * @brief Implementation file for vconf key config.
- */
-#ifndef SRC_DOMAIN_VCONF_CONFIG_H
-#define SRC_DOMAIN_VCONF_CONFIG_H
-
-#include <string>
-#include <dpl/string.h>
-
-#include <dpl/wrt-dao-ro/global_config.h>
-#include <dpl/wrt-dao-ro/path_builder.h>
-
-namespace WrtDB {
-namespace VconfConfig {
-inline std::string GetVconfKeyRootPath(DPL::String tzPkgId)
-{
- return PathBuilder()
- .Append(GlobalConfig::GetVconfKeyPrefixPath())
- .Append(DPL::ToUTF8String(tzPkgId))
- .GetFullPath();
-}
-
-inline std::string GetVconfKeyPopupUsage(DPL::String tzPkgId)
-{
- return PathBuilder()
- .Append(GlobalConfig::GetVconfKeyPrefixPath())
- .Append(DPL::ToUTF8String(tzPkgId))
- .Concat(GlobalConfig::GetVconfKeyPopupUsagePath())
- .GetFullPath();
-}
-
-inline std::string GetVconfKeyGeolocationUsage(DPL::String tzPkgId)
-{
- return PathBuilder()
- .Append(GlobalConfig::GetVconfKeyPrefixPath())
- .Append(DPL::ToUTF8String(tzPkgId))
- .Concat(GlobalConfig::GetVconfKeyGeolocationUsagePath())
- .GetFullPath();
-}
-
-inline std::string GetVconfKeyWebNotificationUsage(DPL::String tzPkgId)
-{
- return PathBuilder()
- .Append(GlobalConfig::GetVconfKeyPrefixPath())
- .Append(DPL::ToUTF8String(tzPkgId))
- .Concat(GlobalConfig::GetVconfKeyWebNotificationUsagePath())
- .GetFullPath();
-}
-
-inline std::string GetVconfKeyMemorySavingMode(DPL::String tzPkgId)
-{
- return PathBuilder()
- .Append(GlobalConfig::GetVconfKeyPrefixPath())
- .Append(DPL::ToUTF8String(tzPkgId))
- .Concat(GlobalConfig::GetVconfKeyMemorySavingModePath())
- .GetFullPath();
-}
-
-inline std::string GetVconfKeyWebDatabaseUsage(DPL::String tzPkgId)
-{
- return PathBuilder()
- .Append(GlobalConfig::GetVconfKeyPrefixPath())
- .Append(DPL::ToUTF8String(tzPkgId))
- .Concat(GlobalConfig::GetVconfKeyWebDatabaseUsagePath())
- .GetFullPath();
-}
-} // namespace VconfConfig
-} // namespace WrtDB
-
-#endif
SettingsType getGeolocationUsage() const;
SettingsType getWebNotificationUsage() const;
SettingsType getWebDatabaseUsage() const;
- SettingsType getFileSystemUsage() const;
/**
* This method returns widget's installed path
void setGeolocationUsage(const SettingsType value);
void setWebNotificationUsage(const SettingsType value);
void setWebDatabaseUsage(const SettingsType value);
- void setFileSystemUsage(const SettingsType value);
private:
//Methods used during widget registering
COLUMN_NOT_NULL(geolocation_usage, INT, DEFAULT 1)
COLUMN_NOT_NULL(web_notification_usage, INT, DEFAULT 1)
COLUMN_NOT_NULL(web_database_usage, INT, DEFAULT 1)
- COLUMN_NOT_NULL(file_system_usage, INT, DEFAULT 1)
TABLE_CONSTRAINTS(
FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
)