From 7bdbefb63facfdcc785efa5ebe0ab1cd7943d790 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 25 Jul 2023 16:08:13 +0400 Subject: [PATCH 01/60] feat: add stub for security snap-in --- .gear/gpui.spec | 1 + src/plugins/CMakeLists.txt | 1 + src/plugins/security/CMakeLists.txt | 57 ++++++++++++++++++ src/plugins/security/schemas/CMakeLists.txt | 0 src/plugins/security/securityplugin.cpp | 40 +++++++++++++ src/plugins/security/securitysnapin.cpp | 65 +++++++++++++++++++++ src/plugins/security/securitysnapin.h | 52 +++++++++++++++++ 7 files changed, 216 insertions(+) create mode 100644 src/plugins/security/CMakeLists.txt create mode 100644 src/plugins/security/schemas/CMakeLists.txt create mode 100644 src/plugins/security/securityplugin.cpp create mode 100644 src/plugins/security/securitysnapin.cpp create mode 100644 src/plugins/security/securitysnapin.h diff --git a/.gear/gpui.spec b/.gear/gpui.spec index 0c3dc9e5e..4f9bbf414 100644 --- a/.gear/gpui.spec +++ b/.gear/gpui.spec @@ -97,6 +97,7 @@ LD_PRELOAD=%buildroot%_libdir/gpui/plugins/libadministrative-templates-plugin.so %_libdir/gpui/plugins/libspol-plugin.so %_libdir/gpui/plugins/libpol-plugin.so %_libdir/gpui/plugins/libscripts-plugin.so +%_libdir/gpui/plugins/libsecurity-plugin.so %_libdir/gpui/plugins/libsmb-storage-plugin.so diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 46c90129c..3d9d00de9 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -26,5 +26,6 @@ add_subdirectory(pol) add_subdirectory(preferences) add_subdirectory(reg) add_subdirectory(scripts) +add_subdirectory(security) add_subdirectory(spol) add_subdirectory(storage) diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt new file mode 100644 index 000000000..2dba8e373 --- /dev/null +++ b/src/plugins/security/CMakeLists.txt @@ -0,0 +1,57 @@ +find_package(Qt5 COMPONENTS Widgets Qml LinguistTools REQUIRED) + +find_package(GPUI COMPONENTS core io REQUIRED) + +set(PLUGIN_NAME security-plugin) +set(PLUGIN_STATIC_LIBRARY security_static) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +include_directories(${CMAKE_SOURCE_DIR}/src) + +add_subdirectory(schemas) + +set(HEADERS +) + +set(SOURCES +) + +set(UI_FORMS +) + +set(PLUGIN_HEADERS + securitysnapin.h +) + +set(PLUGIN_SOURCES + securityplugin.cpp + securitysnapin.cpp +) + +file(GLOB_RECURSE TS_FILES ${CMAKE_CURRENT_SOURCE_DIR} *.ts) + +set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}) + +add_translation(QM_FILES ${TS_FILES}) + +add_translation_resource(RESOURCES_SRC "security" ${QM_FILES}) + +qt5_add_resources(LIB_RESOURCES ${RESOURCES_SRC} ${ICON_RESOURCES}) + +set(PLUGIN_SOURCES ${PLUGIN_SOURCES} ${PLUGIN_HEADERS}) + +set(SOURCES ${SOURCES} ${HEADERS} ${UI_FORMS}) + +add_library(${PLUGIN_STATIC_LIBRARY} STATIC ${SOURCES}) +target_link_libraries(${PLUGIN_STATIC_LIBRARY} Qt5::Core Qt5::Widgets) +target_link_libraries(${PLUGIN_STATIC_LIBRARY} ${GPUI_LIBRARIES}) + +target_link_libraries(${PLUGIN_STATIC_LIBRARY} static_xsd_library) +target_link_libraries(${PLUGIN_STATIC_LIBRARY} xerces-c) + +add_gpui_plugin(${PLUGIN_NAME} ${PLUGIN_SOURCES} ${LIB_RESOURCES}) +target_link_libraries(${PLUGIN_NAME} ${PLUGIN_STATIC_LIBRARY}) diff --git a/src/plugins/security/schemas/CMakeLists.txt b/src/plugins/security/schemas/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/src/plugins/security/securityplugin.cpp b/src/plugins/security/securityplugin.cpp new file mode 100644 index 000000000..f7f9f3059 --- /dev/null +++ b/src/plugins/security/securityplugin.cpp @@ -0,0 +1,40 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "core/plugin.h" + +#include "securitysnapin.h" + +#include "core/isnapin.h" + +namespace gpui +{ +class SecurityPlugin : public Plugin +{ +public: + SecurityPlugin() + : gpui::Plugin("SecuritySnapIn") + { + GPUI_REGISTER_PLUGIN_CLASS(typeid(::gpui::ISnapIn).name(), SecuritySnapIn); + } +}; +} // namespace gpui + +GPUI_EXPORT_PLUGIN(security, ::gpui::SecurityPlugin) diff --git a/src/plugins/security/securitysnapin.cpp b/src/plugins/security/securitysnapin.cpp new file mode 100644 index 000000000..e79d0df91 --- /dev/null +++ b/src/plugins/security/securitysnapin.cpp @@ -0,0 +1,65 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "securitysnapin.h" + +namespace gpui +{ +class SecuritySnapInPrivate +{ +public: +}; + +SecuritySnapIn::SecuritySnapIn() + : AbstractSnapIn("ISnapIn", + "SecuritySnapIn", + "Snap-in for security management.", + {1, 0, 0}, + "GPL-2.0", + "Copyright (C) 2023 BaseALT Ltd. ") + , d(new SecuritySnapInPrivate()) +{ +} + +void SecuritySnapIn::onInitialize(QMainWindow *mainWindow) +{ + Q_UNUSED(mainWindow); +} + +void SecuritySnapIn::onShutdown() +{ +} + +void SecuritySnapIn::onDataLoad(const std::string &policyPath, const std::string &locale) +{ + Q_UNUSED(policyPath); + Q_UNUSED(locale); +} + +void SecuritySnapIn::onDataSave() +{ +} + +void SecuritySnapIn::onRetranslateUI(const std::string &locale) +{ + Q_UNUSED(locale); +} + +} diff --git a/src/plugins/security/securitysnapin.h b/src/plugins/security/securitysnapin.h new file mode 100644 index 000000000..26f1c303c --- /dev/null +++ b/src/plugins/security/securitysnapin.h @@ -0,0 +1,52 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef GPUI_SECURITY_SNAPIN_H +#define GPUI_SECURITY_SNAPIN_H + +#include "core/abstractsnapin.h" + +namespace gpui +{ + +class SecuritySnapInPrivate; + +class SecuritySnapIn final : public AbstractSnapIn +{ +public: + SecuritySnapIn(); + + void onInitialize(QMainWindow *mainWindow) override; + + void onShutdown() override; + + void onDataLoad(const std::string &policyPath, const std::string &locale) override; + + void onDataSave() override; + + void onRetranslateUI(const std::string &locale) override; + +private: + std::unique_ptr d; +}; + +} // namespace gpui + +#endif//GPUI_SECURITY_SNAPIN_H From cff45968ac1b3b4b7b7feeaa070e9b923ae6b80d Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 25 Jul 2023 16:28:03 +0400 Subject: [PATCH 02/60] feat: add empty schemas --- .gitignore | 2 + src/plugins/security/CMakeLists.txt | 4 +- src/plugins/security/schema/CMakeLists.txt | 9 ++ src/plugins/security/schema/basetypes.xsd | 104 ++++++++++++++++++ .../schema/securitydefinitionfiles.xsd | 3 + .../security/schema/securitydefinitions.xsd | 4 + src/plugins/security/schemas/CMakeLists.txt | 0 7 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 src/plugins/security/schema/CMakeLists.txt create mode 100644 src/plugins/security/schema/basetypes.xsd create mode 100644 src/plugins/security/schema/securitydefinitionfiles.xsd create mode 100644 src/plugins/security/schema/securitydefinitions.xsd delete mode 100644 src/plugins/security/schemas/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 7d527cca2..d67416102 100644 --- a/.gitignore +++ b/.gitignore @@ -86,5 +86,7 @@ src/plugins/cmtl/schema/*.cpp src/plugins/cmtl/schema/*.h src/plugins/cmtx/schema/*.cpp src/plugins/cmtx/schema/*.h +src/plugins/security/schema/*.cpp +src/plugins/security/schema/*.h *.translations.qrc src/core/version.h diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt index 2dba8e373..af89019f5 100644 --- a/src/plugins/security/CMakeLists.txt +++ b/src/plugins/security/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_AUTOUIC ON) include_directories(${CMAKE_SOURCE_DIR}/src) -add_subdirectory(schemas) +add_subdirectory(schema) set(HEADERS ) @@ -50,7 +50,7 @@ add_library(${PLUGIN_STATIC_LIBRARY} STATIC ${SOURCES}) target_link_libraries(${PLUGIN_STATIC_LIBRARY} Qt5::Core Qt5::Widgets) target_link_libraries(${PLUGIN_STATIC_LIBRARY} ${GPUI_LIBRARIES}) -target_link_libraries(${PLUGIN_STATIC_LIBRARY} static_xsd_library) +target_link_libraries(${PLUGIN_STATIC_LIBRARY} security_static_xsd_library) target_link_libraries(${PLUGIN_STATIC_LIBRARY} xerces-c) add_gpui_plugin(${PLUGIN_NAME} ${PLUGIN_SOURCES} ${LIB_RESOURCES}) diff --git a/src/plugins/security/schema/CMakeLists.txt b/src/plugins/security/schema/CMakeLists.txt new file mode 100644 index 000000000..9f865e35f --- /dev/null +++ b/src/plugins/security/schema/CMakeLists.txt @@ -0,0 +1,9 @@ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + +set(XSD_FILES + "${CMAKE_CURRENT_SOURCE_DIR}/basetypes.xsd" + "${CMAKE_CURRENT_SOURCE_DIR}/securitydefinitions.xsd" + "${CMAKE_CURRENT_SOURCE_DIR}/securitydefinitionfiles.xsd" +) + +add_xsd_library(security_static_xsd_library ${XSD_FILES}) diff --git a/src/plugins/security/schema/basetypes.xsd b/src/plugins/security/schema/basetypes.xsd new file mode 100644 index 000000000..b25b908ed --- /dev/null +++ b/src/plugins/security/schema/basetypes.xsd @@ -0,0 +1,104 @@ + + + + + A standard {12345678-1234-1234-1234-123456789abcd} style guid string. + + + + + + + + + + + + + + + A reference to a localized string in the localized string section/table. + + + + + + + + + A reference to a policy presentation in the localized presentation section/table. + + + + + + + + + A localized string id (used in the localized string section/table). + + + + + + + + + + + + + + + + The base type for all defined type names, e.g. categories. + + + + + + + + + The base type for all references to defined types, e.g. categories. + + + + + + + + + A localized string + + + + + + + + + + + A valid registry key path (without reference to local system or user hive). + + + + + + + A valid registry value +name. + + + + + + + A valid file name (without a file path). + + + + + + diff --git a/src/plugins/security/schema/securitydefinitionfiles.xsd b/src/plugins/security/schema/securitydefinitionfiles.xsd new file mode 100644 index 000000000..acff348b6 --- /dev/null +++ b/src/plugins/security/schema/securitydefinitionfiles.xsd @@ -0,0 +1,3 @@ + + + diff --git a/src/plugins/security/schema/securitydefinitions.xsd b/src/plugins/security/schema/securitydefinitions.xsd new file mode 100644 index 000000000..d8b6b4ef6 --- /dev/null +++ b/src/plugins/security/schema/securitydefinitions.xsd @@ -0,0 +1,4 @@ + + + + diff --git a/src/plugins/security/schemas/CMakeLists.txt b/src/plugins/security/schemas/CMakeLists.txt deleted file mode 100644 index e69de29bb..000000000 From c5304666dbf310de4231df48e74e0894167b879b Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:21:46 +0400 Subject: [PATCH 03/60] feat: add security xsd schema --- src/plugins/security/schema/security.xsd | 382 +++++++++++++++++++++++ 1 file changed, 382 insertions(+) create mode 100644 src/plugins/security/schema/security.xsd diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd new file mode 100644 index 000000000..8dd81a92e --- /dev/null +++ b/src/plugins/security/schema/security.xsd @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + Describes a choice element in a policy with associated values for the true and false cases. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Describes a multi line text element in a policy. + + + + + + + + Describes a single line text element in a policy. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An enumeration of the 3 possible types a security definition can belong to. + + + + + + + + + + A grouping of security definitions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Root presentation element. + + + + + + + + + + + + Represents a checkbox display element.\nCan be associated with a BooleanElement. + + + + + + + + + + + + + + + Represents a text box with or without a spin control for entering decimal numbers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a combobox display element with default/suggested entries. + + + + + + + + + + + + + + + Represents a textbox display element with default entry. + + + + + + + + + + + + + Represents a dropdown list display element. + + + + + Represents a textbox display element with default entry. + + + + + + + + + Represents a listbox display element. + + + + + Represents a comment display element. + + + + + + + + + + + Represents a security descriptor editor display element. + + + + + + + + + + Represents a LDAP search dialog display element.\nCan be associated with a TextElement. + + + + + + + + + + + + + Represents a radio button display element.\nCan be associated with a BooleanElement. + + + + + + + + + + A standard {12345678-1234-1234-1234-123456789abcd} style guid string. + + + + + + + + + + + Represents a text box with or without a spin control for entering long decimal numbers. + + + + + + + + + + From 70992c4ac694f17294d2a0529769314003f368c6 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 1 Aug 2023 14:39:15 +0400 Subject: [PATCH 04/60] feat: update security schema --- src/plugins/security/schema/CMakeLists.txt | 1 + src/plugins/security/schema/security.xsd | 97 ++++++++++------------ 2 files changed, 47 insertions(+), 51 deletions(-) mode change 100644 => 100755 src/plugins/security/schema/security.xsd diff --git a/src/plugins/security/schema/CMakeLists.txt b/src/plugins/security/schema/CMakeLists.txt index 9f865e35f..93d5b7815 100644 --- a/src/plugins/security/schema/CMakeLists.txt +++ b/src/plugins/security/schema/CMakeLists.txt @@ -4,6 +4,7 @@ set(XSD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/basetypes.xsd" "${CMAKE_CURRENT_SOURCE_DIR}/securitydefinitions.xsd" "${CMAKE_CURRENT_SOURCE_DIR}/securitydefinitionfiles.xsd" + "${CMAKE_CURRENT_SOURCE_DIR}/security.xsd" ) add_xsd_library(security_static_xsd_library ${XSD_FILES}) diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd old mode 100644 new mode 100755 index 8dd81a92e..d7ee393ac --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -82,12 +82,12 @@ - - - - - - + + + + + + @@ -95,11 +95,6 @@ - - - - - @@ -111,6 +106,9 @@ + + + A grouping of security definitions. @@ -118,14 +116,11 @@ + - - - - @@ -134,23 +129,21 @@ - - - - - - - + + + + + - - - - - - - + + + + + + + @@ -167,21 +160,21 @@ - - + + - + - + @@ -235,34 +228,36 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + From 087ef1cde1c5b00f54f8ef02a29103f43557b1c5 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:21:38 +0400 Subject: [PATCH 05/60] feat: add sdml and sdmx plugin files --- .gear/gpui.spec | 2 ++ src/plugins/CMakeLists.txt | 2 ++ src/plugins/sdml/CMakeLists.txt | 23 ++++++++++++++++ src/plugins/sdml/sdmlformat.cpp | 47 +++++++++++++++++++++++++++++++++ src/plugins/sdml/sdmlformat.h | 42 +++++++++++++++++++++++++++++ src/plugins/sdml/sdmlplugin.cpp | 38 ++++++++++++++++++++++++++ src/plugins/sdmx/CMakeLists.txt | 23 ++++++++++++++++ src/plugins/sdmx/sdmxformat.cpp | 47 +++++++++++++++++++++++++++++++++ src/plugins/sdmx/sdmxformat.h | 42 +++++++++++++++++++++++++++++ src/plugins/sdmx/sdmxplugin.cpp | 38 ++++++++++++++++++++++++++ 10 files changed, 304 insertions(+) create mode 100644 src/plugins/sdml/CMakeLists.txt create mode 100644 src/plugins/sdml/sdmlformat.cpp create mode 100644 src/plugins/sdml/sdmlformat.h create mode 100644 src/plugins/sdml/sdmlplugin.cpp create mode 100644 src/plugins/sdmx/CMakeLists.txt create mode 100644 src/plugins/sdmx/sdmxformat.cpp create mode 100644 src/plugins/sdmx/sdmxformat.h create mode 100644 src/plugins/sdmx/sdmxplugin.cpp diff --git a/.gear/gpui.spec b/.gear/gpui.spec index 4f9bbf414..4fccb0d2c 100644 --- a/.gear/gpui.spec +++ b/.gear/gpui.spec @@ -96,6 +96,8 @@ LD_PRELOAD=%buildroot%_libdir/gpui/plugins/libadministrative-templates-plugin.so %_libdir/gpui/plugins/libreg-plugin.so %_libdir/gpui/plugins/libspol-plugin.so %_libdir/gpui/plugins/libpol-plugin.so +%_libdir/gpui/plugins/libsdml-plugin.so +%_libdir/gpui/plugins/libsdmx-plugin.so %_libdir/gpui/plugins/libscripts-plugin.so %_libdir/gpui/plugins/libsecurity-plugin.so diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 3d9d00de9..0151e13ee 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -25,6 +25,8 @@ add_subdirectory(ini) add_subdirectory(pol) add_subdirectory(preferences) add_subdirectory(reg) +add_subdirectory(sdml) +add_subdirectory(sdmx) add_subdirectory(scripts) add_subdirectory(security) add_subdirectory(spol) diff --git a/src/plugins/sdml/CMakeLists.txt b/src/plugins/sdml/CMakeLists.txt new file mode 100644 index 000000000..452a27ffb --- /dev/null +++ b/src/plugins/sdml/CMakeLists.txt @@ -0,0 +1,23 @@ +find_package(GPUI COMPONENTS core io REQUIRED) +include_directories(${GPUI_INCLUDE_DIRS}) + +find_package(Qt5 COMPONENTS Core REQUIRED) + +set(PLUGIN_NAME "sdml-plugin") + +set(HEADERS + sdmlformat.h +) + +set(SOURCES + sdmlformat.cpp + sdmlplugin.cpp +) + +set(SOURCES ${SOURCES} ${HEADERS}) + +add_gpui_plugin(${PLUGIN_NAME} ${SOURCES}) +target_link_libraries(${PLUGIN_NAME} Qt5::Core) +target_link_libraries(${PLUGIN_NAME} ${GPUI_LIBRARIES}) +target_link_libraries(${PLUGIN_NAME} xerces-c) +target_link_libraries(${PLUGIN_NAME}) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp new file mode 100644 index 000000000..ab3c132d4 --- /dev/null +++ b/src/plugins/sdml/sdmlformat.cpp @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "sdmlformat.h" + +namespace gpui +{ + +SdmlFormat::SdmlFormat() + : io::PolicyFileFormat("sdml") +{ +} + +bool SdmlFormat::read(std::istream &input, io::PolicyResourcesFile *file) +{ + Q_UNUSED(input); + Q_UNUSED(file); + + return false; +} + +bool SdmlFormat::write(std::ostream &output, io::PolicyResourcesFile *file) +{ + Q_UNUSED(output); + Q_UNUSED(file); + + return false; +} + +} diff --git a/src/plugins/sdml/sdmlformat.h b/src/plugins/sdml/sdmlformat.h new file mode 100644 index 000000000..f9a3c3be6 --- /dev/null +++ b/src/plugins/sdml/sdmlformat.h @@ -0,0 +1,42 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef GPUI_SDML_FORMAT_H +#define GPUI_SDML_FORMAT_H + +#include "../../../src/core/common.h" + +#include "../../../src/io/policyfileformat.h" +#include "../../../src/io/policyresourcesfile.h" + +namespace gpui +{ +class GPUI_SYMBOL_EXPORT SdmlFormat : public io::PolicyFileFormat +{ +public: + SdmlFormat(); + + bool read(std::istream &input, io::PolicyResourcesFile *file) override; + + bool write(std::ostream &output, io::PolicyResourcesFile *file) override; +}; +} // namespace gpui + +#endif // GPUI_SDML_FORMAT_H diff --git a/src/plugins/sdml/sdmlplugin.cpp b/src/plugins/sdml/sdmlplugin.cpp new file mode 100644 index 000000000..c35ed4797 --- /dev/null +++ b/src/plugins/sdml/sdmlplugin.cpp @@ -0,0 +1,38 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "../../core/plugin.h" + +#include "sdmlformat.h" + +namespace gpui +{ +class SdmlPlugin : public Plugin +{ +public: + SdmlPlugin() + : Plugin("sdml") + { + GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmlPlugin); + } +}; +} // namespace gpui + +GPUI_EXPORT_PLUGIN(adml, gpui::SdmlPlugin) diff --git a/src/plugins/sdmx/CMakeLists.txt b/src/plugins/sdmx/CMakeLists.txt new file mode 100644 index 000000000..7a1f283ad --- /dev/null +++ b/src/plugins/sdmx/CMakeLists.txt @@ -0,0 +1,23 @@ +find_package(GPUI COMPONENTS core io REQUIRED) +include_directories(${GPUI_INCLUDE_DIRS}) + +find_package(Qt5 COMPONENTS Core REQUIRED) + +set(PLUGIN_NAME "sdmx-plugin") + +set(HEADERS + sdmxformat.h +) + +set(SOURCES + sdmxformat.cpp + sdmxplugin.cpp +) + +set(SOURCES ${SOURCES} ${HEADERS}) + +add_gpui_plugin(${PLUGIN_NAME} ${SOURCES}) +target_link_libraries(${PLUGIN_NAME} Qt5::Core) +target_link_libraries(${PLUGIN_NAME} ${GPUI_LIBRARIES}) +target_link_libraries(${PLUGIN_NAME} xerces-c) +target_link_libraries(${PLUGIN_NAME}) diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp new file mode 100644 index 000000000..7cad398a0 --- /dev/null +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "sdmxformat.h" + +namespace gpui +{ + +SdmxFormat::SdmxFormat() + : io::PolicyFileFormat("sdmx") +{ +} + +bool SdmxFormat::read(std::istream &input, io::PolicyResourcesFile *file) +{ + Q_UNUSED(input); + Q_UNUSED(file); + + return false; +} + +bool SdmxFormat::write(std::ostream &output, io::PolicyResourcesFile *file) +{ + Q_UNUSED(output); + Q_UNUSED(file); + + return false; +} + +} diff --git a/src/plugins/sdmx/sdmxformat.h b/src/plugins/sdmx/sdmxformat.h new file mode 100644 index 000000000..38e7ba23c --- /dev/null +++ b/src/plugins/sdmx/sdmxformat.h @@ -0,0 +1,42 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef GPUI_SDMX_FORMAT_H +#define GPUI_SDMX_FORMAT_H + +#include "../../../src/core/common.h" + +#include "../../../src/io/policyfileformat.h" +#include "../../../src/io/policyresourcesfile.h" + +namespace gpui +{ +class GPUI_SYMBOL_EXPORT SdmxFormat : public io::PolicyFileFormat +{ +public: + SdmxFormat(); + + bool read(std::istream &input, io::PolicyResourcesFile *file) override; + + bool write(std::ostream &output, io::PolicyResourcesFile *file) override; +}; +} // namespace gpui + +#endif // GPUI_SDMX_FORMAT_H diff --git a/src/plugins/sdmx/sdmxplugin.cpp b/src/plugins/sdmx/sdmxplugin.cpp new file mode 100644 index 000000000..bdf2735fb --- /dev/null +++ b/src/plugins/sdmx/sdmxplugin.cpp @@ -0,0 +1,38 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "../../core/plugin.h" + +#include "sdmxformat.h" + +namespace gpui +{ +class SdmxPlugin : public Plugin +{ +public: + SdmxPlugin() + : Plugin("sdmx") + { + GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmxPlugin); + } +}; +} // namespace gpui + +GPUI_EXPORT_PLUGIN(adml, gpui::SdmxPlugin) From f4857353611d7c78f6d0a9a7ceb618d829e0541b Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:18:19 +0400 Subject: [PATCH 06/60] feat: add generated code to repository --- src/plugins/security/model/BooleanElement.cpp | 39 ++++++ src/plugins/security/model/BooleanElement.h | 52 ++++++++ src/plugins/security/model/Category.cpp | 39 ++++++ src/plugins/security/model/Category.h | 85 +++++++++++++ .../security/model/CategoryReference.cpp | 39 ++++++ .../security/model/CategoryReference.h | 58 +++++++++ src/plugins/security/model/CheckBox.cpp | 39 ++++++ src/plugins/security/model/CheckBox.h | 58 +++++++++ src/plugins/security/model/ComboBox.cpp | 39 ++++++ src/plugins/security/model/ComboBox.h | 73 +++++++++++ src/plugins/security/model/Comment.cpp | 39 ++++++ src/plugins/security/model/Comment.h | 65 ++++++++++ src/plugins/security/model/DataElement.cpp | 39 ++++++ src/plugins/security/model/DataElement.h | 58 +++++++++ .../security/model/DataElementContent.cpp | 39 ++++++ .../security/model/DataElementContent.h | 64 ++++++++++ src/plugins/security/model/DecimalElement.cpp | 39 ++++++ src/plugins/security/model/DecimalElement.h | 78 ++++++++++++ src/plugins/security/model/DecimalTextBox.cpp | 39 ++++++ src/plugins/security/model/DecimalTextBox.h | 68 ++++++++++ src/plugins/security/model/DecimalType.cpp | 39 ++++++ src/plugins/security/model/DecimalType.h | 56 +++++++++ src/plugins/security/model/DropdownList.cpp | 39 ++++++ src/plugins/security/model/DropdownList.h | 50 ++++++++ .../security/model/EnumerationElement.cpp | 39 ++++++ .../security/model/EnumerationElement.h | 58 +++++++++ src/plugins/security/model/GroupBox.cpp | 39 ++++++ src/plugins/security/model/GroupBox.h | 79 ++++++++++++ .../security/model/LdapSearchDialog.cpp | 39 ++++++ src/plugins/security/model/LdapSearchDialog.h | 75 +++++++++++ src/plugins/security/model/ListBox.cpp | 39 ++++++ src/plugins/security/model/ListBox.h | 50 ++++++++ src/plugins/security/model/ListElement.cpp | 39 ++++++ src/plugins/security/model/ListElement.h | 73 +++++++++++ .../security/model/LongDecimalElement.cpp | 39 ++++++ .../security/model/LongDecimalElement.h | 78 ++++++++++++ .../security/model/LongDecimalTextBox.cpp | 39 ++++++ .../security/model/LongDecimalTextBox.h | 68 ++++++++++ .../security/model/LongDecimalType.cpp | 39 ++++++ src/plugins/security/model/LongDecimalType.h | 56 +++++++++ src/plugins/security/model/MultiTextBox.cpp | 39 ++++++ src/plugins/security/model/MultiTextBox.h | 61 +++++++++ .../security/model/MultiTextElement.cpp | 39 ++++++ src/plugins/security/model/MultiTextElement.h | 52 ++++++++ src/plugins/security/model/Pkg_security.h | 48 +++++++ .../security/model/PresentationElements.cpp | 39 ++++++ .../security/model/PresentationElements.h | 113 +++++++++++++++++ src/plugins/security/model/RadioButton.cpp | 39 ++++++ src/plugins/security/model/RadioButton.h | 58 +++++++++ .../security/model/SecurityDefinition.cpp | 39 ++++++ .../security/model/SecurityDefinition.h | 118 ++++++++++++++++++ .../security/model/SecurityDefinitions.cpp | 39 ++++++ .../security/model/SecurityDefinitions.h | 68 ++++++++++ .../model/SecurityDescriptorEditor.cpp | 39 ++++++ .../security/model/SecurityDescriptorEditor.h | 58 +++++++++ .../security/model/SecurityElement.cpp | 39 ++++++ src/plugins/security/model/SecurityElement.h | 68 ++++++++++ .../security/model/SecurityElements.cpp | 39 ++++++ src/plugins/security/model/SecurityElements.h | 94 ++++++++++++++ src/plugins/security/model/SecurityItem.cpp | 39 ++++++ src/plugins/security/model/SecurityItem.h | 70 +++++++++++ .../security/model/SecurityPresentation.cpp | 39 ++++++ .../security/model/SecurityPresentation.h | 68 ++++++++++ src/plugins/security/model/SecurityValue.cpp | 39 ++++++ src/plugins/security/model/SecurityValue.h | 69 ++++++++++ .../security/model/SecurityValueList.cpp | 39 ++++++ .../security/model/SecurityValueList.h | 63 ++++++++++ src/plugins/security/model/TextBox.cpp | 39 ++++++ src/plugins/security/model/TextBox.h | 65 ++++++++++ src/plugins/security/model/TextElement.cpp | 39 ++++++ src/plugins/security/model/TextElement.h | 68 ++++++++++ 71 files changed, 3808 insertions(+) create mode 100644 src/plugins/security/model/BooleanElement.cpp create mode 100644 src/plugins/security/model/BooleanElement.h create mode 100644 src/plugins/security/model/Category.cpp create mode 100644 src/plugins/security/model/Category.h create mode 100644 src/plugins/security/model/CategoryReference.cpp create mode 100644 src/plugins/security/model/CategoryReference.h create mode 100644 src/plugins/security/model/CheckBox.cpp create mode 100644 src/plugins/security/model/CheckBox.h create mode 100644 src/plugins/security/model/ComboBox.cpp create mode 100644 src/plugins/security/model/ComboBox.h create mode 100644 src/plugins/security/model/Comment.cpp create mode 100644 src/plugins/security/model/Comment.h create mode 100644 src/plugins/security/model/DataElement.cpp create mode 100644 src/plugins/security/model/DataElement.h create mode 100644 src/plugins/security/model/DataElementContent.cpp create mode 100644 src/plugins/security/model/DataElementContent.h create mode 100644 src/plugins/security/model/DecimalElement.cpp create mode 100644 src/plugins/security/model/DecimalElement.h create mode 100644 src/plugins/security/model/DecimalTextBox.cpp create mode 100644 src/plugins/security/model/DecimalTextBox.h create mode 100644 src/plugins/security/model/DecimalType.cpp create mode 100644 src/plugins/security/model/DecimalType.h create mode 100644 src/plugins/security/model/DropdownList.cpp create mode 100644 src/plugins/security/model/DropdownList.h create mode 100644 src/plugins/security/model/EnumerationElement.cpp create mode 100644 src/plugins/security/model/EnumerationElement.h create mode 100644 src/plugins/security/model/GroupBox.cpp create mode 100644 src/plugins/security/model/GroupBox.h create mode 100644 src/plugins/security/model/LdapSearchDialog.cpp create mode 100644 src/plugins/security/model/LdapSearchDialog.h create mode 100644 src/plugins/security/model/ListBox.cpp create mode 100644 src/plugins/security/model/ListBox.h create mode 100644 src/plugins/security/model/ListElement.cpp create mode 100644 src/plugins/security/model/ListElement.h create mode 100644 src/plugins/security/model/LongDecimalElement.cpp create mode 100644 src/plugins/security/model/LongDecimalElement.h create mode 100644 src/plugins/security/model/LongDecimalTextBox.cpp create mode 100644 src/plugins/security/model/LongDecimalTextBox.h create mode 100644 src/plugins/security/model/LongDecimalType.cpp create mode 100644 src/plugins/security/model/LongDecimalType.h create mode 100644 src/plugins/security/model/MultiTextBox.cpp create mode 100644 src/plugins/security/model/MultiTextBox.h create mode 100644 src/plugins/security/model/MultiTextElement.cpp create mode 100644 src/plugins/security/model/MultiTextElement.h create mode 100644 src/plugins/security/model/Pkg_security.h create mode 100644 src/plugins/security/model/PresentationElements.cpp create mode 100644 src/plugins/security/model/PresentationElements.h create mode 100644 src/plugins/security/model/RadioButton.cpp create mode 100644 src/plugins/security/model/RadioButton.h create mode 100644 src/plugins/security/model/SecurityDefinition.cpp create mode 100644 src/plugins/security/model/SecurityDefinition.h create mode 100644 src/plugins/security/model/SecurityDefinitions.cpp create mode 100644 src/plugins/security/model/SecurityDefinitions.h create mode 100644 src/plugins/security/model/SecurityDescriptorEditor.cpp create mode 100644 src/plugins/security/model/SecurityDescriptorEditor.h create mode 100644 src/plugins/security/model/SecurityElement.cpp create mode 100644 src/plugins/security/model/SecurityElement.h create mode 100644 src/plugins/security/model/SecurityElements.cpp create mode 100644 src/plugins/security/model/SecurityElements.h create mode 100644 src/plugins/security/model/SecurityItem.cpp create mode 100644 src/plugins/security/model/SecurityItem.h create mode 100644 src/plugins/security/model/SecurityPresentation.cpp create mode 100644 src/plugins/security/model/SecurityPresentation.h create mode 100644 src/plugins/security/model/SecurityValue.cpp create mode 100644 src/plugins/security/model/SecurityValue.h create mode 100644 src/plugins/security/model/SecurityValueList.cpp create mode 100644 src/plugins/security/model/SecurityValueList.h create mode 100644 src/plugins/security/model/TextBox.cpp create mode 100644 src/plugins/security/model/TextBox.h create mode 100644 src/plugins/security/model/TextElement.cpp create mode 100644 src/plugins/security/model/TextElement.h diff --git a/src/plugins/security/model/BooleanElement.cpp b/src/plugins/security/model/BooleanElement.cpp new file mode 100644 index 000000000..7c8d904f4 --- /dev/null +++ b/src/plugins/security/model/BooleanElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_BooleanElement_BODY + +/************************************************************ + BooleanElement class body + ************************************************************/ + +// include associated header file +#include "security/BooleanElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of BooleanElement class body + ************************************************************/ diff --git a/src/plugins/security/model/BooleanElement.h b/src/plugins/security/model/BooleanElement.h new file mode 100644 index 000000000..751f9d427 --- /dev/null +++ b/src/plugins/security/model/BooleanElement.h @@ -0,0 +1,52 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_BOOLEANELEMENT_H +#define SECURITY_BOOLEANELEMENT_H + +/************************************************************ + BooleanElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityElement.h" + +namespace security { + +/************************************************************/ +/** + * Describes a choice element in a policy with associated values for the true and false cases. + */ +class BooleanElement: public SecurityElement { + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of BooleanElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/Category.cpp b/src/plugins/security/model/Category.cpp new file mode 100644 index 000000000..9556ecf4d --- /dev/null +++ b/src/plugins/security/model/Category.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_Category_BODY + +/************************************************************ + Category class body + ************************************************************/ + +// include associated header file +#include "security/Category.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of Category class body + ************************************************************/ diff --git a/src/plugins/security/model/Category.h b/src/plugins/security/model/Category.h new file mode 100644 index 000000000..cca3097bc --- /dev/null +++ b/src/plugins/security/model/Category.h @@ -0,0 +1,85 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_CATEGORY_H +#define SECURITY_CATEGORY_H + +/************************************************************ + Category class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/CategoryReference.h" + +#include + +namespace security { + +/************************************************************/ +/** + * A grouping of security definitions. + */ +class Category { +public: + + /** + * + */ + std::string name; + + /** + * + */ + std::string displayName; + + /** + * + */ + std::string keywords[]; + + /** + * + */ + std::string seeAlso[]; + + /** + * + */ + std::string explainText; + + /** + * + */ + CategoryReference parentCategory; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of Category class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/CategoryReference.cpp b/src/plugins/security/model/CategoryReference.cpp new file mode 100644 index 000000000..6ebe10686 --- /dev/null +++ b/src/plugins/security/model/CategoryReference.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_CategoryReference_BODY + +/************************************************************ + CategoryReference class body + ************************************************************/ + +// include associated header file +#include "security/CategoryReference.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of CategoryReference class body + ************************************************************/ diff --git a/src/plugins/security/model/CategoryReference.h b/src/plugins/security/model/CategoryReference.h new file mode 100644 index 000000000..71c83bea7 --- /dev/null +++ b/src/plugins/security/model/CategoryReference.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_CATEGORYREFERENCE_H +#define SECURITY_CATEGORYREFERENCE_H + +/************************************************************ + CategoryReference class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include + +namespace security { + +/************************************************************/ +/** + * + */ +class CategoryReference { +public: + + /** + * + */ + std::string ref; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of CategoryReference class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/CheckBox.cpp b/src/plugins/security/model/CheckBox.cpp new file mode 100644 index 000000000..7f5413038 --- /dev/null +++ b/src/plugins/security/model/CheckBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_CheckBox_BODY + +/************************************************************ + CheckBox class body + ************************************************************/ + +// include associated header file +#include "security/CheckBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of CheckBox class body + ************************************************************/ diff --git a/src/plugins/security/model/CheckBox.h b/src/plugins/security/model/CheckBox.h new file mode 100644 index 000000000..3cf8375b7 --- /dev/null +++ b/src/plugins/security/model/CheckBox.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_CHECKBOX_H +#define SECURITY_CHECKBOX_H + +/************************************************************ + CheckBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElementContent.h" + +namespace security { + +/************************************************************/ +/** + * Represents a checkbox display element.\nCan be associated with a BooleanElement. + */ +class CheckBox: public DataElementContent { +public: + + /** + * + */ + bool defaultChecked; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of CheckBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/ComboBox.cpp b/src/plugins/security/model/ComboBox.cpp new file mode 100644 index 000000000..0fc7730df --- /dev/null +++ b/src/plugins/security/model/ComboBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_ComboBox_BODY + +/************************************************************ + ComboBox class body + ************************************************************/ + +// include associated header file +#include "security/ComboBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of ComboBox class body + ************************************************************/ diff --git a/src/plugins/security/model/ComboBox.h b/src/plugins/security/model/ComboBox.h new file mode 100644 index 000000000..8bc5341db --- /dev/null +++ b/src/plugins/security/model/ComboBox.h @@ -0,0 +1,73 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_COMBOBOX_H +#define SECURITY_COMBOBOX_H + +/************************************************************ + ComboBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElementContent.h" + +namespace security { + +/************************************************************/ +/** + * Represents a combobox display element with default/suggested entries. + */ +class ComboBox: public DataElementContent { +public: + + /** + * + */ + std::string label; + + /** + * + */ + std::string default; + + /** + * + */ + std::string suggestion[]; + + /** + * + */ + bool noSort; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of ComboBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/Comment.cpp b/src/plugins/security/model/Comment.cpp new file mode 100644 index 000000000..404a33a38 --- /dev/null +++ b/src/plugins/security/model/Comment.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_Comment_BODY + +/************************************************************ + Comment class body + ************************************************************/ + +// include associated header file +#include "security/Comment.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of Comment class body + ************************************************************/ diff --git a/src/plugins/security/model/Comment.h b/src/plugins/security/model/Comment.h new file mode 100644 index 000000000..7e6d1feb0 --- /dev/null +++ b/src/plugins/security/model/Comment.h @@ -0,0 +1,65 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_COMMENT_H +#define SECURITY_COMMENT_H + +/************************************************************ + Comment class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElement.h" + +#include + +namespace security { + +/************************************************************/ +/** + * Represents a comment display element. + */ +class Comment: public DataElement { +public: + + /** + * + */ + std::string text; + + /** + * + */ + std::string image; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of Comment class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/DataElement.cpp b/src/plugins/security/model/DataElement.cpp new file mode 100644 index 000000000..c0a90cf72 --- /dev/null +++ b/src/plugins/security/model/DataElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_DataElement_BODY + +/************************************************************ + DataElement class body + ************************************************************/ + +// include associated header file +#include "security/DataElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of DataElement class body + ************************************************************/ diff --git a/src/plugins/security/model/DataElement.h b/src/plugins/security/model/DataElement.h new file mode 100644 index 000000000..a88a87702 --- /dev/null +++ b/src/plugins/security/model/DataElement.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_DATAELEMENT_H +#define SECURITY_DATAELEMENT_H + +/************************************************************ + DataElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include + +namespace security { + +/************************************************************/ +/** + * + */ +class DataElement { +public: + + /** + * + */ + std::string refId; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of DataElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/DataElementContent.cpp b/src/plugins/security/model/DataElementContent.cpp new file mode 100644 index 000000000..5ed0f8f9d --- /dev/null +++ b/src/plugins/security/model/DataElementContent.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_DataElementContent_BODY + +/************************************************************ + DataElementContent class body + ************************************************************/ + +// include associated header file +#include "security/DataElementContent.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of DataElementContent class body + ************************************************************/ diff --git a/src/plugins/security/model/DataElementContent.h b/src/plugins/security/model/DataElementContent.h new file mode 100644 index 000000000..6caa84bd6 --- /dev/null +++ b/src/plugins/security/model/DataElementContent.h @@ -0,0 +1,64 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_DATAELEMENTCONTENT_H +#define SECURITY_DATAELEMENTCONTENT_H + +/************************************************************ + DataElementContent class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include + +namespace security { + +class DataElementContent { +public: + + /** + * + */ + std::string value; + + /** + * + */ + std::string refId; + + /** + * + */ + std::string postfix; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of DataElementContent class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/DecimalElement.cpp b/src/plugins/security/model/DecimalElement.cpp new file mode 100644 index 000000000..75cc7147e --- /dev/null +++ b/src/plugins/security/model/DecimalElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_DecimalElement_BODY + +/************************************************************ + DecimalElement class body + ************************************************************/ + +// include associated header file +#include "security/DecimalElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of DecimalElement class body + ************************************************************/ diff --git a/src/plugins/security/model/DecimalElement.h b/src/plugins/security/model/DecimalElement.h new file mode 100644 index 000000000..ad2b3bb58 --- /dev/null +++ b/src/plugins/security/model/DecimalElement.h @@ -0,0 +1,78 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_DECIMALELEMENT_H +#define SECURITY_DECIMALELEMENT_H + +/************************************************************ + DecimalElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityElement.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class DecimalElement: public SecurityElement { +public: + + /** + * + */ + bool required = false; + + /** + * + */ + bool soft = false; + + /** + * + */ + bool storeAsText = false; + + /** + * + */ + unsigned int minValue; + + /** + * + */ + unsigned int maxValue; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of DecimalElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/DecimalTextBox.cpp b/src/plugins/security/model/DecimalTextBox.cpp new file mode 100644 index 000000000..d30894cb3 --- /dev/null +++ b/src/plugins/security/model/DecimalTextBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_DecimalTextBox_BODY + +/************************************************************ + DecimalTextBox class body + ************************************************************/ + +// include associated header file +#include "security/DecimalTextBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of DecimalTextBox class body + ************************************************************/ diff --git a/src/plugins/security/model/DecimalTextBox.h b/src/plugins/security/model/DecimalTextBox.h new file mode 100644 index 000000000..c9e162afd --- /dev/null +++ b/src/plugins/security/model/DecimalTextBox.h @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_DECIMALTEXTBOX_H +#define SECURITY_DECIMALTEXTBOX_H + +/************************************************************ + DecimalTextBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElementContent.h" + +namespace security { + +/************************************************************/ +/** + * Represents a text box with or without a spin control for entering decimal numbers. + */ +class DecimalTextBox: public DataElementContent { +public: + + /** + * + */ + unsigned int defaultValue; + + /** + * + */ + bool spinBox; + + /** + * + */ + unsigned int spinStep; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of DecimalTextBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/DecimalType.cpp b/src/plugins/security/model/DecimalType.cpp new file mode 100644 index 000000000..722d4575e --- /dev/null +++ b/src/plugins/security/model/DecimalType.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_DecimalType_BODY + +/************************************************************ + DecimalType class body + ************************************************************/ + +// include associated header file +#include "security/DecimalType.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of DecimalType class body + ************************************************************/ diff --git a/src/plugins/security/model/DecimalType.h b/src/plugins/security/model/DecimalType.h new file mode 100644 index 000000000..9916bc9cb --- /dev/null +++ b/src/plugins/security/model/DecimalType.h @@ -0,0 +1,56 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_DECIMALTYPE_H +#define SECURITY_DECIMALTYPE_H + +/************************************************************ + DecimalType class header + ************************************************************/ + +#include "security/Pkg_security.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class DecimalType { +public: + + /** + * + */ + unsigned int value; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of DecimalType class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/DropdownList.cpp b/src/plugins/security/model/DropdownList.cpp new file mode 100644 index 000000000..8e994e727 --- /dev/null +++ b/src/plugins/security/model/DropdownList.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_DropdownList_BODY + +/************************************************************ + DropdownList class body + ************************************************************/ + +// include associated header file +#include "security/DropdownList.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of DropdownList class body + ************************************************************/ diff --git a/src/plugins/security/model/DropdownList.h b/src/plugins/security/model/DropdownList.h new file mode 100644 index 000000000..1e2882d8e --- /dev/null +++ b/src/plugins/security/model/DropdownList.h @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_DROPDOWNLIST_H +#define SECURITY_DROPDOWNLIST_H + +/************************************************************ + DropdownList class header + ************************************************************/ + +#include "security/Pkg_security.h" + +namespace security { + +/************************************************************/ +/** + * Represents a dropdown list display element. + */ +class DropdownList { + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of DropdownList class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/EnumerationElement.cpp b/src/plugins/security/model/EnumerationElement.cpp new file mode 100644 index 000000000..15cf228bf --- /dev/null +++ b/src/plugins/security/model/EnumerationElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_EnumerationElement_BODY + +/************************************************************ + EnumerationElement class body + ************************************************************/ + +// include associated header file +#include "security/EnumerationElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of EnumerationElement class body + ************************************************************/ diff --git a/src/plugins/security/model/EnumerationElement.h b/src/plugins/security/model/EnumerationElement.h new file mode 100644 index 000000000..6fe1c4d46 --- /dev/null +++ b/src/plugins/security/model/EnumerationElement.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_ENUMERATIONELEMENT_H +#define SECURITY_ENUMERATIONELEMENT_H + +/************************************************************ + EnumerationElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityElement.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class EnumerationElement: public SecurityElement { +public: + + /** + * + */ + bool required = false; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of EnumerationElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/GroupBox.cpp b/src/plugins/security/model/GroupBox.cpp new file mode 100644 index 000000000..10ad7fa5c --- /dev/null +++ b/src/plugins/security/model/GroupBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_GroupBox_BODY + +/************************************************************ + GroupBox class body + ************************************************************/ + +// include associated header file +#include "security/GroupBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of GroupBox class body + ************************************************************/ diff --git a/src/plugins/security/model/GroupBox.h b/src/plugins/security/model/GroupBox.h new file mode 100644 index 000000000..caff83f96 --- /dev/null +++ b/src/plugins/security/model/GroupBox.h @@ -0,0 +1,79 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_GROUPBOX_H +#define SECURITY_GROUPBOX_H + +/************************************************************ + GroupBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElementContent.h" +#include "security/PresentationElements.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class GroupBox: public DataElementContent { +public: + + /** + * + */ + bool hasCheckBox; + + /** + * + */ + bool defaultChecked; + + /** + * + */ + PresentationElements elements; + + /** + * + */ + std::string label; + + /** + * + */ + bool hasBorder; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of GroupBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/LdapSearchDialog.cpp b/src/plugins/security/model/LdapSearchDialog.cpp new file mode 100644 index 000000000..3bd9bc220 --- /dev/null +++ b/src/plugins/security/model/LdapSearchDialog.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_LdapSearchDialog_BODY + +/************************************************************ + LdapSearchDialog class body + ************************************************************/ + +// include associated header file +#include "security/LdapSearchDialog.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of LdapSearchDialog class body + ************************************************************/ diff --git a/src/plugins/security/model/LdapSearchDialog.h b/src/plugins/security/model/LdapSearchDialog.h new file mode 100644 index 000000000..8a37d55a7 --- /dev/null +++ b/src/plugins/security/model/LdapSearchDialog.h @@ -0,0 +1,75 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_LDAPSEARCHDIALOG_H +#define SECURITY_LDAPSEARCHDIALOG_H + +/************************************************************ + LdapSearchDialog class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElementContent.h" + +#include + +namespace security { + +/************************************************************/ +/** + * Represents a LDAP search dialog display element.\nCan be associated with a TextElement. + */ +class LdapSearchDialog: public DataElementContent { +public: + + /** + * + */ + std::string dn; + + /** + * + */ + std::string filter; + + /** + * + */ + std::string addLabel; + + /** + * + */ + std::string removeLabel; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of LdapSearchDialog class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/ListBox.cpp b/src/plugins/security/model/ListBox.cpp new file mode 100644 index 000000000..c1d2a3b31 --- /dev/null +++ b/src/plugins/security/model/ListBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_ListBox_BODY + +/************************************************************ + ListBox class body + ************************************************************/ + +// include associated header file +#include "security/ListBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of ListBox class body + ************************************************************/ diff --git a/src/plugins/security/model/ListBox.h b/src/plugins/security/model/ListBox.h new file mode 100644 index 000000000..9c7f60ab1 --- /dev/null +++ b/src/plugins/security/model/ListBox.h @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_LISTBOX_H +#define SECURITY_LISTBOX_H + +/************************************************************ + ListBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +namespace security { + +/************************************************************/ +/** + * Represents a listbox display element. + */ +class ListBox { + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of ListBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/ListElement.cpp b/src/plugins/security/model/ListElement.cpp new file mode 100644 index 000000000..e8f473177 --- /dev/null +++ b/src/plugins/security/model/ListElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_ListElement_BODY + +/************************************************************ + ListElement class body + ************************************************************/ + +// include associated header file +#include "security/ListElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of ListElement class body + ************************************************************/ diff --git a/src/plugins/security/model/ListElement.h b/src/plugins/security/model/ListElement.h new file mode 100644 index 000000000..24814e80c --- /dev/null +++ b/src/plugins/security/model/ListElement.h @@ -0,0 +1,73 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_LISTELEMENT_H +#define SECURITY_LISTELEMENT_H + +/************************************************************ + ListElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityElement.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class ListElement: public SecurityElement { +public: + + /** + * + */ + std::string valuePrefix; + + /** + * + */ + bool additive; + + /** + * + */ + bool expandable; + + /** + * + */ + bool explicitValue; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of ListElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/LongDecimalElement.cpp b/src/plugins/security/model/LongDecimalElement.cpp new file mode 100644 index 000000000..9d7a1f042 --- /dev/null +++ b/src/plugins/security/model/LongDecimalElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_LongDecimalElement_BODY + +/************************************************************ + LongDecimalElement class body + ************************************************************/ + +// include associated header file +#include "security/LongDecimalElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of LongDecimalElement class body + ************************************************************/ diff --git a/src/plugins/security/model/LongDecimalElement.h b/src/plugins/security/model/LongDecimalElement.h new file mode 100644 index 000000000..948eb5a94 --- /dev/null +++ b/src/plugins/security/model/LongDecimalElement.h @@ -0,0 +1,78 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_LONGDECIMALELEMENT_H +#define SECURITY_LONGDECIMALELEMENT_H + +/************************************************************ + LongDecimalElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityElement.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class LongDecimalElement: public SecurityElement { +public: + + /** + * + */ + bool required = false; + + /** + * + */ + bool soft = false; + + /** + * + */ + bool storeAsText = false; + + /** + * + */ + unsigned long long minValue; + + /** + * + */ + unsigned long long maxValue; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of LongDecimalElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/LongDecimalTextBox.cpp b/src/plugins/security/model/LongDecimalTextBox.cpp new file mode 100644 index 000000000..6c4a8575f --- /dev/null +++ b/src/plugins/security/model/LongDecimalTextBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_LongDecimalTextBox_BODY + +/************************************************************ + LongDecimalTextBox class body + ************************************************************/ + +// include associated header file +#include "security/LongDecimalTextBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of LongDecimalTextBox class body + ************************************************************/ diff --git a/src/plugins/security/model/LongDecimalTextBox.h b/src/plugins/security/model/LongDecimalTextBox.h new file mode 100644 index 000000000..da7e76f39 --- /dev/null +++ b/src/plugins/security/model/LongDecimalTextBox.h @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_LONGDECIMALTEXTBOX_H +#define SECURITY_LONGDECIMALTEXTBOX_H + +/************************************************************ + LongDecimalTextBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElementContent.h" + +namespace security { + +/************************************************************/ +/** + * Represents a text box with or without a spin control for entering long decimal numbers. + */ +class LongDecimalTextBox: public DataElementContent { +public: + + /** + * + */ + unsigned long long defaultValue; + + /** + * + */ + bool spinBox; + + /** + * + */ + unsigned long long spinStep; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of LongDecimalTextBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/LongDecimalType.cpp b/src/plugins/security/model/LongDecimalType.cpp new file mode 100644 index 000000000..e7ee16f74 --- /dev/null +++ b/src/plugins/security/model/LongDecimalType.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_LongDecimalType_BODY + +/************************************************************ + LongDecimalType class body + ************************************************************/ + +// include associated header file +#include "security/LongDecimalType.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of LongDecimalType class body + ************************************************************/ diff --git a/src/plugins/security/model/LongDecimalType.h b/src/plugins/security/model/LongDecimalType.h new file mode 100644 index 000000000..c340f4d63 --- /dev/null +++ b/src/plugins/security/model/LongDecimalType.h @@ -0,0 +1,56 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_LONGDECIMALTYPE_H +#define SECURITY_LONGDECIMALTYPE_H + +/************************************************************ + LongDecimalType class header + ************************************************************/ + +#include "security/Pkg_security.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class LongDecimalType { +public: + + /** + * + */ + unsigned long long value; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of LongDecimalType class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/MultiTextBox.cpp b/src/plugins/security/model/MultiTextBox.cpp new file mode 100644 index 000000000..fb288632e --- /dev/null +++ b/src/plugins/security/model/MultiTextBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_MultiTextBox_BODY + +/************************************************************ + MultiTextBox class body + ************************************************************/ + +// include associated header file +#include "security/MultiTextBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of MultiTextBox class body + ************************************************************/ diff --git a/src/plugins/security/model/MultiTextBox.h b/src/plugins/security/model/MultiTextBox.h new file mode 100644 index 000000000..eb0d21f28 --- /dev/null +++ b/src/plugins/security/model/MultiTextBox.h @@ -0,0 +1,61 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_MULTITEXTBOX_H +#define SECURITY_MULTITEXTBOX_H + +/************************************************************ + MultiTextBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +namespace security { + +/************************************************************/ +/** + * Represents a textbox display element with default entry. + */ +class MultiTextBox { +public: + + /** + * + */ + std::string label; + + /** + * + */ + std::string defaultValue; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of MultiTextBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/MultiTextElement.cpp b/src/plugins/security/model/MultiTextElement.cpp new file mode 100644 index 000000000..42aa97035 --- /dev/null +++ b/src/plugins/security/model/MultiTextElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_MultiTextElement_BODY + +/************************************************************ + MultiTextElement class body + ************************************************************/ + +// include associated header file +#include "security/MultiTextElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of MultiTextElement class body + ************************************************************/ diff --git a/src/plugins/security/model/MultiTextElement.h b/src/plugins/security/model/MultiTextElement.h new file mode 100644 index 000000000..7fc57f16c --- /dev/null +++ b/src/plugins/security/model/MultiTextElement.h @@ -0,0 +1,52 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_MULTITEXTELEMENT_H +#define SECURITY_MULTITEXTELEMENT_H + +/************************************************************ + MultiTextElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityElement.h" + +namespace security { + +/************************************************************/ +/** + * Describes a multi line text element in a policy. + */ +class MultiTextElement: public SecurityElement { + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of MultiTextElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/Pkg_security.h b/src/plugins/security/model/Pkg_security.h new file mode 100644 index 000000000..c626bbe26 --- /dev/null +++ b/src/plugins/security/model/Pkg_security.h @@ -0,0 +1,48 @@ +#ifndef PKG_SECURITY +#define PKG_SECURITY + +/************************************************************ + Pkg_security package header + ************************************************************/ + +#ifndef _IN_ +#define _IN_ +#endif +#ifndef _OUT_ +#define _OUT_ +#endif +#ifndef _INOUT_ +#define _INOUT_ +#endif + +/* Package dependency header include */ + +namespace security { + +// Types defined within the package + +/** + * An enumeration of the 3 possible types a security definition can belong to. + */ +enum class SecurityType { + /** + * + */ + Machine = 1, + /** + * + */ + User = 0, + /** + * + */ + Both +}; + +} // of namespace security + +/************************************************************ + End of Pkg_security package header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/PresentationElements.cpp b/src/plugins/security/model/PresentationElements.cpp new file mode 100644 index 000000000..52818bfc1 --- /dev/null +++ b/src/plugins/security/model/PresentationElements.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_PresentationElements_BODY + +/************************************************************ + PresentationElements class body + ************************************************************/ + +// include associated header file +#include "security/PresentationElements.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of PresentationElements class body + ************************************************************/ diff --git a/src/plugins/security/model/PresentationElements.h b/src/plugins/security/model/PresentationElements.h new file mode 100644 index 000000000..c5471c927 --- /dev/null +++ b/src/plugins/security/model/PresentationElements.h @@ -0,0 +1,113 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_PRESENTATIONELEMENTS_H +#define SECURITY_PRESENTATIONELEMENTS_H + +/************************************************************ + PresentationElements class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "EcorePrimitiveTypes/Pkg_EcorePrimitiveTypes.h" +#include "security/CheckBox.h" +#include "security/ComboBox.h" +#include "security/Comment.h" +#include "security/DecimalTextBox.h" +#include "security/DropdownList.h" +#include "security/GroupBox.h" +#include "security/ListBox.h" +#include "security/LongDecimalTextBox.h" +#include "security/MultiTextBox.h" +#include "security/TextBox.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class PresentationElements { +public: + + /** + * + */ + DecimalTextBox decimalTextBox[]; + + /** + * + */ + TextBox textBox[]; + + /** + * + */ + CheckBox checkBox[]; + + /** + * + */ + ComboBox comboBox[]; + + /** + * + */ + DropdownList dropdownList[]; + + /** + * + */ + LongDecimalTextBox longDecimalTextBox[]; + + /** + * + */ + MultiTextBox multiTextBox[]; + + /** + * + */ + GroupBox groupBox[]; + + /** + * + */ + ListBox listBox[]; + + /** + * + */ + Comment comment[]; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of PresentationElements class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/RadioButton.cpp b/src/plugins/security/model/RadioButton.cpp new file mode 100644 index 000000000..7dd2fae37 --- /dev/null +++ b/src/plugins/security/model/RadioButton.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_RadioButton_BODY + +/************************************************************ + RadioButton class body + ************************************************************/ + +// include associated header file +#include "security/RadioButton.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of RadioButton class body + ************************************************************/ diff --git a/src/plugins/security/model/RadioButton.h b/src/plugins/security/model/RadioButton.h new file mode 100644 index 000000000..844817611 --- /dev/null +++ b/src/plugins/security/model/RadioButton.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_RADIOBUTTON_H +#define SECURITY_RADIOBUTTON_H + +/************************************************************ + RadioButton class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElement.h" + +namespace security { + +/************************************************************/ +/** + * Represents a radio button display element.\nCan be associated with a BooleanElement. + */ +class RadioButton: public DataElement { +public: + + /** + * + */ + bool defaultChecked; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of RadioButton class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityDefinition.cpp b/src/plugins/security/model/SecurityDefinition.cpp new file mode 100644 index 000000000..338606f8a --- /dev/null +++ b/src/plugins/security/model/SecurityDefinition.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityDefinition_BODY + +/************************************************************ + SecurityDefinition class body + ************************************************************/ + +// include associated header file +#include "security/SecurityDefinition.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityDefinition class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityDefinition.h b/src/plugins/security/model/SecurityDefinition.h new file mode 100644 index 000000000..d6765468d --- /dev/null +++ b/src/plugins/security/model/SecurityDefinition.h @@ -0,0 +1,118 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYDEFINITION_H +#define SECURITY_SECURITYDEFINITION_H + +/************************************************************ + SecurityDefinition class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/CategoryReference.h" +#include "security/SecurityElements.h" +#include "security/SecurityValue.h" +#include "security/SecurityValueList.h" + +#include + +namespace security { + +/************************************************************/ +/** + * + */ +class SecurityDefinition { +public: + + /** + * + */ + std::string name; + + /** + * + */ + std::string displayName; + + /** + * + */ + std::string explainText; + + /** + * + */ + std::string sectionName; + + /** + * + */ + std::string propertyName; + + /** + * + */ + SecurityType securityType; + + /** + * + */ + CategoryReference parentCategory; + + /** + * + */ + SecurityElements elements; + + /** + * + */ + SecurityValue enabledValue; + + /** + * + */ + SecurityValue disabledValue; + + /** + * + */ + SecurityValueList enabledList; + + /** + * + */ + SecurityValueList disabledList; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityDefinition class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityDefinitions.cpp b/src/plugins/security/model/SecurityDefinitions.cpp new file mode 100644 index 000000000..252eccf5f --- /dev/null +++ b/src/plugins/security/model/SecurityDefinitions.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityDefinitions_BODY + +/************************************************************ + SecurityDefinitions class body + ************************************************************/ + +// include associated header file +#include "security/SecurityDefinitions.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityDefinitions class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityDefinitions.h b/src/plugins/security/model/SecurityDefinitions.h new file mode 100644 index 000000000..648827ae0 --- /dev/null +++ b/src/plugins/security/model/SecurityDefinitions.h @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYDEFINITIONS_H +#define SECURITY_SECURITYDEFINITIONS_H + +/************************************************************ + SecurityDefinitions class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityDefinition.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class SecurityDefinitions { +public: + + /** + * + */ + std::string revision; + + /** + * + */ + std::string schemaVersion; + + /** + * + */ + SecurityDefinition security[]; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityDefinitions class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityDescriptorEditor.cpp b/src/plugins/security/model/SecurityDescriptorEditor.cpp new file mode 100644 index 000000000..80c9232a7 --- /dev/null +++ b/src/plugins/security/model/SecurityDescriptorEditor.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityDescriptorEditor_BODY + +/************************************************************ + SecurityDescriptorEditor class body + ************************************************************/ + +// include associated header file +#include "security/SecurityDescriptorEditor.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityDescriptorEditor class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityDescriptorEditor.h b/src/plugins/security/model/SecurityDescriptorEditor.h new file mode 100644 index 000000000..9c456fdc2 --- /dev/null +++ b/src/plugins/security/model/SecurityDescriptorEditor.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYDESCRIPTOREDITOR_H +#define SECURITY_SECURITYDESCRIPTOREDITOR_H + +/************************************************************ + SecurityDescriptorEditor class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElement.h" + +namespace security { + +/************************************************************/ +/** + * Represents a security descriptor editor display element. + */ +class SecurityDescriptorEditor: public DataElement { +public: + + /** + * + */ + std::string label; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityDescriptorEditor class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityElement.cpp b/src/plugins/security/model/SecurityElement.cpp new file mode 100644 index 000000000..62a1a1571 --- /dev/null +++ b/src/plugins/security/model/SecurityElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityElement_BODY + +/************************************************************ + SecurityElement class body + ************************************************************/ + +// include associated header file +#include "security/SecurityElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityElement class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityElement.h b/src/plugins/security/model/SecurityElement.h new file mode 100644 index 000000000..07f6d073c --- /dev/null +++ b/src/plugins/security/model/SecurityElement.h @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYELEMENT_H +#define SECURITY_SECURITYELEMENT_H + +/************************************************************ + SecurityElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include + +namespace security { + +/************************************************************/ +/** + * + */ +class SecurityElement { +public: + + /** + * + */ + std::string refId; + + /** + * + */ + std::string clientExtension; + + /** + * + */ + std::string propertyName; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityElement class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityElements.cpp b/src/plugins/security/model/SecurityElements.cpp new file mode 100644 index 000000000..055866cc3 --- /dev/null +++ b/src/plugins/security/model/SecurityElements.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityElements_BODY + +/************************************************************ + SecurityElements class body + ************************************************************/ + +// include associated header file +#include "security/SecurityElements.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityElements class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityElements.h b/src/plugins/security/model/SecurityElements.h new file mode 100644 index 000000000..6f80bd99a --- /dev/null +++ b/src/plugins/security/model/SecurityElements.h @@ -0,0 +1,94 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYELEMENTS_H +#define SECURITY_SECURITYELEMENTS_H + +/************************************************************ + SecurityElements class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "EcorePrimitiveTypes/Pkg_EcorePrimitiveTypes.h" +#include "security/BooleanElement.h" +#include "security/DecimalElement.h" +#include "security/EnumerationElement.h" +#include "security/ListElement.h" +#include "security/LongDecimalElement.h" +#include "security/MultiTextElement.h" +#include "security/TextElement.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class SecurityElements { +public: + + /** + * + */ + BooleanElement bool[]; + + /** + * + */ + DecimalElement decimal[]; + + /** + * + */ + TextElement text[]; + + /** + * + */ + EnumerationElement enum[]; + + /** + * + */ + ListElement list[]; + + /** + * + */ + LongDecimalElement longDecimal[]; + + /** + * + */ + MultiTextElement multiText[]; +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityElements class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityItem.cpp b/src/plugins/security/model/SecurityItem.cpp new file mode 100644 index 000000000..3c36acc71 --- /dev/null +++ b/src/plugins/security/model/SecurityItem.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityItem_BODY + +/************************************************************ + SecurityItem class body + ************************************************************/ + +// include associated header file +#include "security/SecurityItem.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityItem class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityItem.h b/src/plugins/security/model/SecurityItem.h new file mode 100644 index 000000000..95a27926e --- /dev/null +++ b/src/plugins/security/model/SecurityItem.h @@ -0,0 +1,70 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYITEM_H +#define SECURITY_SECURITYITEM_H + +/************************************************************ + SecurityItem class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityValue.h" + +#include + +namespace security { + +/************************************************************/ +/** + * + */ +class SecurityItem { +public: + + /** + * + */ + std::string sectionName; + + /** + * + */ + std::string propertyName; + + /** + * + */ + SecurityValue value; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityItem class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityPresentation.cpp b/src/plugins/security/model/SecurityPresentation.cpp new file mode 100644 index 000000000..d332ef280 --- /dev/null +++ b/src/plugins/security/model/SecurityPresentation.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityPresentation_BODY + +/************************************************************ + SecurityPresentation class body + ************************************************************/ + +// include associated header file +#include "security/SecurityPresentation.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityPresentation class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityPresentation.h b/src/plugins/security/model/SecurityPresentation.h new file mode 100644 index 000000000..e530e0008 --- /dev/null +++ b/src/plugins/security/model/SecurityPresentation.h @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYPRESENTATION_H +#define SECURITY_SECURITYPRESENTATION_H + +/************************************************************ + SecurityPresentation class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/PresentationElements.h" + +namespace security { + +/************************************************************/ +/** + * Root presentation element. + */ +class SecurityPresentation: public PresentationElements { +public: + + /** + * + */ + std::string id; + + /** + * + */ + std::string text; + + /** + * + */ + std::string icon; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityPresentation class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityValue.cpp b/src/plugins/security/model/SecurityValue.cpp new file mode 100644 index 000000000..69332e27f --- /dev/null +++ b/src/plugins/security/model/SecurityValue.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityValue_BODY + +/************************************************************ + SecurityValue class body + ************************************************************/ + +// include associated header file +#include "security/SecurityValue.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityValue class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityValue.h b/src/plugins/security/model/SecurityValue.h new file mode 100644 index 000000000..c37f14958 --- /dev/null +++ b/src/plugins/security/model/SecurityValue.h @@ -0,0 +1,69 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYVALUE_H +#define SECURITY_SECURITYVALUE_H + +/************************************************************ + SecurityValue class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DecimalType.h" +#include "security/LongDecimalType.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class SecurityValue { +public: + + /** + * + */ + DecimalType decimal; + + /** + * + */ + LongDecimalType longDecimal; + + /** + * + */ + SecurityType std::string; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityValue class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/SecurityValueList.cpp b/src/plugins/security/model/SecurityValueList.cpp new file mode 100644 index 000000000..ec322d3f3 --- /dev/null +++ b/src/plugins/security/model/SecurityValueList.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_SecurityValueList_BODY + +/************************************************************ + SecurityValueList class body + ************************************************************/ + +// include associated header file +#include "security/SecurityValueList.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of SecurityValueList class body + ************************************************************/ diff --git a/src/plugins/security/model/SecurityValueList.h b/src/plugins/security/model/SecurityValueList.h new file mode 100644 index 000000000..2fa483b93 --- /dev/null +++ b/src/plugins/security/model/SecurityValueList.h @@ -0,0 +1,63 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_SECURITYVALUELIST_H +#define SECURITY_SECURITYVALUELIST_H + +/************************************************************ + SecurityValueList class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityValue.h" + +namespace security { + +/************************************************************/ +/** + * + */ +class SecurityValueList { +public: + + /** + * + */ + SecurityValue item[]; + + /** + * + */ + std::string defaultString; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of SecurityValueList class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/TextBox.cpp b/src/plugins/security/model/TextBox.cpp new file mode 100644 index 000000000..3d8c1ec05 --- /dev/null +++ b/src/plugins/security/model/TextBox.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_TextBox_BODY + +/************************************************************ + TextBox class body + ************************************************************/ + +// include associated header file +#include "security/TextBox.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of TextBox class body + ************************************************************/ diff --git a/src/plugins/security/model/TextBox.h b/src/plugins/security/model/TextBox.h new file mode 100644 index 000000000..f95628d7b --- /dev/null +++ b/src/plugins/security/model/TextBox.h @@ -0,0 +1,65 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_TEXTBOX_H +#define SECURITY_TEXTBOX_H + +/************************************************************ + TextBox class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/DataElementContent.h" + +#include + +namespace security { + +/************************************************************/ +/** + * Represents a textbox display element with default entry. + */ +class TextBox: public DataElementContent { +public: + + /** + * + */ + std::string label; + + /** + * + */ + std::string defaultValue; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of TextBox class header + ************************************************************/ + +#endif diff --git a/src/plugins/security/model/TextElement.cpp b/src/plugins/security/model/TextElement.cpp new file mode 100644 index 000000000..82df0a8f7 --- /dev/null +++ b/src/plugins/security/model/TextElement.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#define security_TextElement_BODY + +/************************************************************ + TextElement class body + ************************************************************/ + +// include associated header file +#include "security/TextElement.h" + +// Derived includes directives + +namespace security { + +// static attributes (if any) + +}// of namespace security + +/************************************************************ + End of TextElement class body + ************************************************************/ diff --git a/src/plugins/security/model/TextElement.h b/src/plugins/security/model/TextElement.h new file mode 100644 index 000000000..801a588c2 --- /dev/null +++ b/src/plugins/security/model/TextElement.h @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ +#ifndef SECURITY_TEXTELEMENT_H +#define SECURITY_TEXTELEMENT_H + +/************************************************************ + TextElement class header + ************************************************************/ + +#include "security/Pkg_security.h" + +#include "security/SecurityElement.h" + +namespace security { + +/************************************************************/ +/** + * Describes a single line text element in a policy. + */ +class TextElement: public SecurityElement { +public: + + /** + * + */ + bool required = false; + + /** + * + */ + unsigned int maxLength = 1024; + + /** + * + */ + bool soft = false; + +}; +/************************************************************/ +/* External declarations (package visibility) */ +/************************************************************/ + +/* Inline functions */ + +} // of namespace security + +/************************************************************ + End of TextElement class header + ************************************************************/ + +#endif From ba01c02de73b82250ceadfdf08e8c490b0f7d8bb Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 3 Aug 2023 16:24:39 +0400 Subject: [PATCH 07/60] chore: refactor security elements --- src/plugins/security/CMakeLists.txt | 35 ++++++ src/plugins/security/model/BooleanElement.h | 52 -------- src/plugins/security/model/CheckBox.h | 58 --------- src/plugins/security/model/ComboBox.h | 73 ----------- src/plugins/security/model/Comment.h | 65 ---------- src/plugins/security/model/DataElement.cpp | 39 ------ .../security/model/DataElementContent.cpp | 39 ------ .../security/model/DataElementContent.h | 64 ---------- src/plugins/security/model/DecimalElement.cpp | 39 ------ src/plugins/security/model/DecimalElement.h | 78 ------------ src/plugins/security/model/DecimalTextBox.cpp | 39 ------ src/plugins/security/model/DecimalTextBox.h | 68 ---------- src/plugins/security/model/DecimalType.cpp | 39 ------ src/plugins/security/model/DecimalType.h | 56 --------- src/plugins/security/model/DropdownList.cpp | 39 ------ src/plugins/security/model/DropdownList.h | 50 -------- .../security/model/EnumerationElement.cpp | 39 ------ .../security/model/EnumerationElement.h | 58 --------- src/plugins/security/model/GroupBox.cpp | 39 ------ .../security/model/LdapSearchDialog.cpp | 39 ------ src/plugins/security/model/LdapSearchDialog.h | 75 ----------- src/plugins/security/model/ListElement.cpp | 39 ------ src/plugins/security/model/ListElement.h | 73 ----------- .../security/model/LongDecimalElement.cpp | 39 ------ .../security/model/LongDecimalElement.h | 78 ------------ .../security/model/LongDecimalTextBox.cpp | 39 ------ .../security/model/LongDecimalTextBox.h | 68 ---------- .../security/model/LongDecimalType.cpp | 39 ------ src/plugins/security/model/LongDecimalType.h | 56 --------- src/plugins/security/model/MultiTextBox.cpp | 39 ------ src/plugins/security/model/MultiTextBox.h | 61 --------- .../security/model/MultiTextElement.cpp | 39 ------ src/plugins/security/model/MultiTextElement.h | 52 -------- src/plugins/security/model/Pkg_security.h | 48 ------- .../security/model/PresentationElements.cpp | 39 ------ .../security/model/PresentationElements.h | 113 ----------------- src/plugins/security/model/RadioButton.cpp | 39 ------ src/plugins/security/model/RadioButton.h | 58 --------- .../security/model/SecurityDefinition.cpp | 39 ------ .../security/model/SecurityDefinition.h | 118 ------------------ .../security/model/SecurityDefinitions.cpp | 39 ------ .../security/model/SecurityDefinitions.h | 68 ---------- .../model/SecurityDescriptorEditor.cpp | 39 ------ .../security/model/SecurityDescriptorEditor.h | 58 --------- .../security/model/SecurityElement.cpp | 39 ------ src/plugins/security/model/SecurityElement.h | 68 ---------- .../security/model/SecurityElements.cpp | 39 ------ src/plugins/security/model/SecurityElements.h | 94 -------------- src/plugins/security/model/SecurityItem.cpp | 39 ------ .../security/model/SecurityPresentation.cpp | 39 ------ .../security/model/SecurityPresentation.h | 68 ---------- src/plugins/security/model/SecurityValue.cpp | 39 ------ src/plugins/security/model/SecurityValue.h | 69 ---------- .../security/model/SecurityValueList.cpp | 39 ------ .../security/model/SecurityValueList.h | 63 ---------- src/plugins/security/model/TextBox.h | 65 ---------- src/plugins/security/model/TextElement.cpp | 39 ------ src/plugins/security/model/TextElement.h | 68 ---------- src/plugins/security/model/booleanelement.h | 39 ++++++ .../security/model/{Category.h => category.h} | 96 +++++++------- .../model/{Category.cpp => checkbox.h} | 37 ++++-- .../model/{CategoryReference.h => combobox.h} | 60 +++++---- src/plugins/security/model/comment.h | 58 +++++++++ .../model/{ListBox.cpp => dataelement.h} | 37 ++++-- .../security/model/dataelementcontent.h | 59 +++++++++ src/plugins/security/model/decimalelement.h | 66 ++++++++++ src/plugins/security/model/decimaltextbox.h | 61 +++++++++ .../model/{TextBox.cpp => decimaltype.h} | 32 +++-- .../model/{ComboBox.cpp => dropdownlist.h} | 28 +++-- .../security/model/enumerationelement.h | 46 +++++++ .../security/model/{GroupBox.h => groupbox.h} | 78 ++++++------ .../{DataElement.h => ldapsearchdialog.h} | 58 +++++---- src/plugins/security/model/listbox.h | 44 +++++++ src/plugins/security/model/listelement.h | 62 +++++++++ .../model/{ListBox.h => longdecimalelement.h} | 59 +++++---- .../security/model/longdecimaltextbox.h | 60 +++++++++ src/plugins/security/model/longdecimaltype.h | 46 +++++++ .../{CategoryReference.cpp => multitextbox.h} | 41 ++++-- src/plugins/security/model/multitextelement.h | 41 ++++++ .../security/model/presentationelements.h | 103 +++++++++++++++ src/plugins/security/model/radiobutton.h | 47 +++++++ src/plugins/security/model/security.h | 31 +++++ .../security/model/securitydefinition.h | 107 ++++++++++++++++ .../security/model/securitydefinitions.h | 60 +++++++++ ...heckBox.cpp => securitydescriptoreditor.h} | 33 +++-- src/plugins/security/model/securityelement.h | 58 +++++++++ .../{SecurityItem.h => securityelements.h} | 83 +++++++----- src/plugins/security/model/securityitem.h | 61 +++++++++ .../security/model/securitypresentation.h | 58 +++++++++ .../model/{Comment.cpp => securityvalue.h} | 27 ++-- ...BooleanElement.cpp => securityvaluelist.h} | 38 ++++-- src/plugins/security/model/textbox.h | 54 ++++++++ src/plugins/security/model/textelement.h | 59 +++++++++ 93 files changed, 1659 insertions(+), 3399 deletions(-) delete mode 100644 src/plugins/security/model/BooleanElement.h delete mode 100644 src/plugins/security/model/CheckBox.h delete mode 100644 src/plugins/security/model/ComboBox.h delete mode 100644 src/plugins/security/model/Comment.h delete mode 100644 src/plugins/security/model/DataElement.cpp delete mode 100644 src/plugins/security/model/DataElementContent.cpp delete mode 100644 src/plugins/security/model/DataElementContent.h delete mode 100644 src/plugins/security/model/DecimalElement.cpp delete mode 100644 src/plugins/security/model/DecimalElement.h delete mode 100644 src/plugins/security/model/DecimalTextBox.cpp delete mode 100644 src/plugins/security/model/DecimalTextBox.h delete mode 100644 src/plugins/security/model/DecimalType.cpp delete mode 100644 src/plugins/security/model/DecimalType.h delete mode 100644 src/plugins/security/model/DropdownList.cpp delete mode 100644 src/plugins/security/model/DropdownList.h delete mode 100644 src/plugins/security/model/EnumerationElement.cpp delete mode 100644 src/plugins/security/model/EnumerationElement.h delete mode 100644 src/plugins/security/model/GroupBox.cpp delete mode 100644 src/plugins/security/model/LdapSearchDialog.cpp delete mode 100644 src/plugins/security/model/LdapSearchDialog.h delete mode 100644 src/plugins/security/model/ListElement.cpp delete mode 100644 src/plugins/security/model/ListElement.h delete mode 100644 src/plugins/security/model/LongDecimalElement.cpp delete mode 100644 src/plugins/security/model/LongDecimalElement.h delete mode 100644 src/plugins/security/model/LongDecimalTextBox.cpp delete mode 100644 src/plugins/security/model/LongDecimalTextBox.h delete mode 100644 src/plugins/security/model/LongDecimalType.cpp delete mode 100644 src/plugins/security/model/LongDecimalType.h delete mode 100644 src/plugins/security/model/MultiTextBox.cpp delete mode 100644 src/plugins/security/model/MultiTextBox.h delete mode 100644 src/plugins/security/model/MultiTextElement.cpp delete mode 100644 src/plugins/security/model/MultiTextElement.h delete mode 100644 src/plugins/security/model/Pkg_security.h delete mode 100644 src/plugins/security/model/PresentationElements.cpp delete mode 100644 src/plugins/security/model/PresentationElements.h delete mode 100644 src/plugins/security/model/RadioButton.cpp delete mode 100644 src/plugins/security/model/RadioButton.h delete mode 100644 src/plugins/security/model/SecurityDefinition.cpp delete mode 100644 src/plugins/security/model/SecurityDefinition.h delete mode 100644 src/plugins/security/model/SecurityDefinitions.cpp delete mode 100644 src/plugins/security/model/SecurityDefinitions.h delete mode 100644 src/plugins/security/model/SecurityDescriptorEditor.cpp delete mode 100644 src/plugins/security/model/SecurityDescriptorEditor.h delete mode 100644 src/plugins/security/model/SecurityElement.cpp delete mode 100644 src/plugins/security/model/SecurityElement.h delete mode 100644 src/plugins/security/model/SecurityElements.cpp delete mode 100644 src/plugins/security/model/SecurityElements.h delete mode 100644 src/plugins/security/model/SecurityItem.cpp delete mode 100644 src/plugins/security/model/SecurityPresentation.cpp delete mode 100644 src/plugins/security/model/SecurityPresentation.h delete mode 100644 src/plugins/security/model/SecurityValue.cpp delete mode 100644 src/plugins/security/model/SecurityValue.h delete mode 100644 src/plugins/security/model/SecurityValueList.cpp delete mode 100644 src/plugins/security/model/SecurityValueList.h delete mode 100644 src/plugins/security/model/TextBox.h delete mode 100644 src/plugins/security/model/TextElement.cpp delete mode 100644 src/plugins/security/model/TextElement.h create mode 100644 src/plugins/security/model/booleanelement.h rename src/plugins/security/model/{Category.h => category.h} (52%) rename src/plugins/security/model/{Category.cpp => checkbox.h} (66%) rename src/plugins/security/model/{CategoryReference.h => combobox.h} (54%) create mode 100644 src/plugins/security/model/comment.h rename src/plugins/security/model/{ListBox.cpp => dataelement.h} (67%) create mode 100644 src/plugins/security/model/dataelementcontent.h create mode 100644 src/plugins/security/model/decimalelement.h create mode 100644 src/plugins/security/model/decimaltextbox.h rename src/plugins/security/model/{TextBox.cpp => decimaltype.h} (67%) rename src/plugins/security/model/{ComboBox.cpp => dropdownlist.h} (67%) create mode 100644 src/plugins/security/model/enumerationelement.h rename src/plugins/security/model/{GroupBox.h => groupbox.h} (53%) rename src/plugins/security/model/{DataElement.h => ldapsearchdialog.h} (57%) create mode 100644 src/plugins/security/model/listbox.h create mode 100644 src/plugins/security/model/listelement.h rename src/plugins/security/model/{ListBox.h => longdecimalelement.h} (57%) create mode 100644 src/plugins/security/model/longdecimaltextbox.h create mode 100644 src/plugins/security/model/longdecimaltype.h rename src/plugins/security/model/{CategoryReference.cpp => multitextbox.h} (65%) create mode 100644 src/plugins/security/model/multitextelement.h create mode 100644 src/plugins/security/model/presentationelements.h create mode 100644 src/plugins/security/model/radiobutton.h create mode 100644 src/plugins/security/model/security.h create mode 100644 src/plugins/security/model/securitydefinition.h create mode 100644 src/plugins/security/model/securitydefinitions.h rename src/plugins/security/model/{CheckBox.cpp => securitydescriptoreditor.h} (67%) create mode 100644 src/plugins/security/model/securityelement.h rename src/plugins/security/model/{SecurityItem.h => securityelements.h} (51%) create mode 100644 src/plugins/security/model/securityitem.h create mode 100644 src/plugins/security/model/securitypresentation.h rename src/plugins/security/model/{Comment.cpp => securityvalue.h} (69%) rename src/plugins/security/model/{BooleanElement.cpp => securityvaluelist.h} (66%) create mode 100644 src/plugins/security/model/textbox.h create mode 100644 src/plugins/security/model/textelement.h diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt index af89019f5..48ef74fa4 100644 --- a/src/plugins/security/CMakeLists.txt +++ b/src/plugins/security/CMakeLists.txt @@ -15,6 +15,41 @@ include_directories(${CMAKE_SOURCE_DIR}/src) add_subdirectory(schema) set(HEADERS + model/booleanelement.h + model/category.h + model/checkbox.h + model/combobox.h + model/comment.h + model/dataelementcontent.h + model/dataelement.h + model/decimalelement.h + model/decimaltextbox.h + model/decimaltype.h + model/dropdownlist.h + model/enumerationelement.h + model/groupbox.h + model/ldapsearchdialog.h + model/listbox.h + model/listelement.h + model/longdecimalelement.h + model/longdecimaltextbox.h + model/longdecimaltype.h + model/multitextbox.h + model/multitextelement.h + model/presentationelements.h + model/radiobutton.h + model/security.h + model/securitydefinition.h + model/securitydefinitions.h + model/securitydescriptoreditor.h + model/securityelement.h + model/securityelements.h + model/securityitem.h + model/securitypresentation.h + model/securityvalue.h + model/securityvaluelist.h + model/textbox.h + model/textelement.h ) set(SOURCES diff --git a/src/plugins/security/model/BooleanElement.h b/src/plugins/security/model/BooleanElement.h deleted file mode 100644 index 751f9d427..000000000 --- a/src/plugins/security/model/BooleanElement.h +++ /dev/null @@ -1,52 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_BOOLEANELEMENT_H -#define SECURITY_BOOLEANELEMENT_H - -/************************************************************ - BooleanElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityElement.h" - -namespace security { - -/************************************************************/ -/** - * Describes a choice element in a policy with associated values for the true and false cases. - */ -class BooleanElement: public SecurityElement { - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of BooleanElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/CheckBox.h b/src/plugins/security/model/CheckBox.h deleted file mode 100644 index 3cf8375b7..000000000 --- a/src/plugins/security/model/CheckBox.h +++ /dev/null @@ -1,58 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_CHECKBOX_H -#define SECURITY_CHECKBOX_H - -/************************************************************ - CheckBox class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElementContent.h" - -namespace security { - -/************************************************************/ -/** - * Represents a checkbox display element.\nCan be associated with a BooleanElement. - */ -class CheckBox: public DataElementContent { -public: - - /** - * - */ - bool defaultChecked; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of CheckBox class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/ComboBox.h b/src/plugins/security/model/ComboBox.h deleted file mode 100644 index 8bc5341db..000000000 --- a/src/plugins/security/model/ComboBox.h +++ /dev/null @@ -1,73 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_COMBOBOX_H -#define SECURITY_COMBOBOX_H - -/************************************************************ - ComboBox class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElementContent.h" - -namespace security { - -/************************************************************/ -/** - * Represents a combobox display element with default/suggested entries. - */ -class ComboBox: public DataElementContent { -public: - - /** - * - */ - std::string label; - - /** - * - */ - std::string default; - - /** - * - */ - std::string suggestion[]; - - /** - * - */ - bool noSort; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of ComboBox class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/Comment.h b/src/plugins/security/model/Comment.h deleted file mode 100644 index 7e6d1feb0..000000000 --- a/src/plugins/security/model/Comment.h +++ /dev/null @@ -1,65 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_COMMENT_H -#define SECURITY_COMMENT_H - -/************************************************************ - Comment class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElement.h" - -#include - -namespace security { - -/************************************************************/ -/** - * Represents a comment display element. - */ -class Comment: public DataElement { -public: - - /** - * - */ - std::string text; - - /** - * - */ - std::string image; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of Comment class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/DataElement.cpp b/src/plugins/security/model/DataElement.cpp deleted file mode 100644 index c0a90cf72..000000000 --- a/src/plugins/security/model/DataElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_DataElement_BODY - -/************************************************************ - DataElement class body - ************************************************************/ - -// include associated header file -#include "security/DataElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of DataElement class body - ************************************************************/ diff --git a/src/plugins/security/model/DataElementContent.cpp b/src/plugins/security/model/DataElementContent.cpp deleted file mode 100644 index 5ed0f8f9d..000000000 --- a/src/plugins/security/model/DataElementContent.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_DataElementContent_BODY - -/************************************************************ - DataElementContent class body - ************************************************************/ - -// include associated header file -#include "security/DataElementContent.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of DataElementContent class body - ************************************************************/ diff --git a/src/plugins/security/model/DataElementContent.h b/src/plugins/security/model/DataElementContent.h deleted file mode 100644 index 6caa84bd6..000000000 --- a/src/plugins/security/model/DataElementContent.h +++ /dev/null @@ -1,64 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_DATAELEMENTCONTENT_H -#define SECURITY_DATAELEMENTCONTENT_H - -/************************************************************ - DataElementContent class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include - -namespace security { - -class DataElementContent { -public: - - /** - * - */ - std::string value; - - /** - * - */ - std::string refId; - - /** - * - */ - std::string postfix; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of DataElementContent class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/DecimalElement.cpp b/src/plugins/security/model/DecimalElement.cpp deleted file mode 100644 index 75cc7147e..000000000 --- a/src/plugins/security/model/DecimalElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_DecimalElement_BODY - -/************************************************************ - DecimalElement class body - ************************************************************/ - -// include associated header file -#include "security/DecimalElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of DecimalElement class body - ************************************************************/ diff --git a/src/plugins/security/model/DecimalElement.h b/src/plugins/security/model/DecimalElement.h deleted file mode 100644 index ad2b3bb58..000000000 --- a/src/plugins/security/model/DecimalElement.h +++ /dev/null @@ -1,78 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_DECIMALELEMENT_H -#define SECURITY_DECIMALELEMENT_H - -/************************************************************ - DecimalElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityElement.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class DecimalElement: public SecurityElement { -public: - - /** - * - */ - bool required = false; - - /** - * - */ - bool soft = false; - - /** - * - */ - bool storeAsText = false; - - /** - * - */ - unsigned int minValue; - - /** - * - */ - unsigned int maxValue; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of DecimalElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/DecimalTextBox.cpp b/src/plugins/security/model/DecimalTextBox.cpp deleted file mode 100644 index d30894cb3..000000000 --- a/src/plugins/security/model/DecimalTextBox.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_DecimalTextBox_BODY - -/************************************************************ - DecimalTextBox class body - ************************************************************/ - -// include associated header file -#include "security/DecimalTextBox.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of DecimalTextBox class body - ************************************************************/ diff --git a/src/plugins/security/model/DecimalTextBox.h b/src/plugins/security/model/DecimalTextBox.h deleted file mode 100644 index c9e162afd..000000000 --- a/src/plugins/security/model/DecimalTextBox.h +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_DECIMALTEXTBOX_H -#define SECURITY_DECIMALTEXTBOX_H - -/************************************************************ - DecimalTextBox class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElementContent.h" - -namespace security { - -/************************************************************/ -/** - * Represents a text box with or without a spin control for entering decimal numbers. - */ -class DecimalTextBox: public DataElementContent { -public: - - /** - * - */ - unsigned int defaultValue; - - /** - * - */ - bool spinBox; - - /** - * - */ - unsigned int spinStep; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of DecimalTextBox class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/DecimalType.cpp b/src/plugins/security/model/DecimalType.cpp deleted file mode 100644 index 722d4575e..000000000 --- a/src/plugins/security/model/DecimalType.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_DecimalType_BODY - -/************************************************************ - DecimalType class body - ************************************************************/ - -// include associated header file -#include "security/DecimalType.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of DecimalType class body - ************************************************************/ diff --git a/src/plugins/security/model/DecimalType.h b/src/plugins/security/model/DecimalType.h deleted file mode 100644 index 9916bc9cb..000000000 --- a/src/plugins/security/model/DecimalType.h +++ /dev/null @@ -1,56 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_DECIMALTYPE_H -#define SECURITY_DECIMALTYPE_H - -/************************************************************ - DecimalType class header - ************************************************************/ - -#include "security/Pkg_security.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class DecimalType { -public: - - /** - * - */ - unsigned int value; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of DecimalType class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/DropdownList.cpp b/src/plugins/security/model/DropdownList.cpp deleted file mode 100644 index 8e994e727..000000000 --- a/src/plugins/security/model/DropdownList.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_DropdownList_BODY - -/************************************************************ - DropdownList class body - ************************************************************/ - -// include associated header file -#include "security/DropdownList.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of DropdownList class body - ************************************************************/ diff --git a/src/plugins/security/model/DropdownList.h b/src/plugins/security/model/DropdownList.h deleted file mode 100644 index 1e2882d8e..000000000 --- a/src/plugins/security/model/DropdownList.h +++ /dev/null @@ -1,50 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_DROPDOWNLIST_H -#define SECURITY_DROPDOWNLIST_H - -/************************************************************ - DropdownList class header - ************************************************************/ - -#include "security/Pkg_security.h" - -namespace security { - -/************************************************************/ -/** - * Represents a dropdown list display element. - */ -class DropdownList { - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of DropdownList class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/EnumerationElement.cpp b/src/plugins/security/model/EnumerationElement.cpp deleted file mode 100644 index 15cf228bf..000000000 --- a/src/plugins/security/model/EnumerationElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_EnumerationElement_BODY - -/************************************************************ - EnumerationElement class body - ************************************************************/ - -// include associated header file -#include "security/EnumerationElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of EnumerationElement class body - ************************************************************/ diff --git a/src/plugins/security/model/EnumerationElement.h b/src/plugins/security/model/EnumerationElement.h deleted file mode 100644 index 6fe1c4d46..000000000 --- a/src/plugins/security/model/EnumerationElement.h +++ /dev/null @@ -1,58 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_ENUMERATIONELEMENT_H -#define SECURITY_ENUMERATIONELEMENT_H - -/************************************************************ - EnumerationElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityElement.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class EnumerationElement: public SecurityElement { -public: - - /** - * - */ - bool required = false; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of EnumerationElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/GroupBox.cpp b/src/plugins/security/model/GroupBox.cpp deleted file mode 100644 index 10ad7fa5c..000000000 --- a/src/plugins/security/model/GroupBox.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_GroupBox_BODY - -/************************************************************ - GroupBox class body - ************************************************************/ - -// include associated header file -#include "security/GroupBox.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of GroupBox class body - ************************************************************/ diff --git a/src/plugins/security/model/LdapSearchDialog.cpp b/src/plugins/security/model/LdapSearchDialog.cpp deleted file mode 100644 index 3bd9bc220..000000000 --- a/src/plugins/security/model/LdapSearchDialog.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_LdapSearchDialog_BODY - -/************************************************************ - LdapSearchDialog class body - ************************************************************/ - -// include associated header file -#include "security/LdapSearchDialog.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of LdapSearchDialog class body - ************************************************************/ diff --git a/src/plugins/security/model/LdapSearchDialog.h b/src/plugins/security/model/LdapSearchDialog.h deleted file mode 100644 index 8a37d55a7..000000000 --- a/src/plugins/security/model/LdapSearchDialog.h +++ /dev/null @@ -1,75 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_LDAPSEARCHDIALOG_H -#define SECURITY_LDAPSEARCHDIALOG_H - -/************************************************************ - LdapSearchDialog class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElementContent.h" - -#include - -namespace security { - -/************************************************************/ -/** - * Represents a LDAP search dialog display element.\nCan be associated with a TextElement. - */ -class LdapSearchDialog: public DataElementContent { -public: - - /** - * - */ - std::string dn; - - /** - * - */ - std::string filter; - - /** - * - */ - std::string addLabel; - - /** - * - */ - std::string removeLabel; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of LdapSearchDialog class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/ListElement.cpp b/src/plugins/security/model/ListElement.cpp deleted file mode 100644 index e8f473177..000000000 --- a/src/plugins/security/model/ListElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_ListElement_BODY - -/************************************************************ - ListElement class body - ************************************************************/ - -// include associated header file -#include "security/ListElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of ListElement class body - ************************************************************/ diff --git a/src/plugins/security/model/ListElement.h b/src/plugins/security/model/ListElement.h deleted file mode 100644 index 24814e80c..000000000 --- a/src/plugins/security/model/ListElement.h +++ /dev/null @@ -1,73 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_LISTELEMENT_H -#define SECURITY_LISTELEMENT_H - -/************************************************************ - ListElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityElement.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class ListElement: public SecurityElement { -public: - - /** - * - */ - std::string valuePrefix; - - /** - * - */ - bool additive; - - /** - * - */ - bool expandable; - - /** - * - */ - bool explicitValue; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of ListElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/LongDecimalElement.cpp b/src/plugins/security/model/LongDecimalElement.cpp deleted file mode 100644 index 9d7a1f042..000000000 --- a/src/plugins/security/model/LongDecimalElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_LongDecimalElement_BODY - -/************************************************************ - LongDecimalElement class body - ************************************************************/ - -// include associated header file -#include "security/LongDecimalElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of LongDecimalElement class body - ************************************************************/ diff --git a/src/plugins/security/model/LongDecimalElement.h b/src/plugins/security/model/LongDecimalElement.h deleted file mode 100644 index 948eb5a94..000000000 --- a/src/plugins/security/model/LongDecimalElement.h +++ /dev/null @@ -1,78 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_LONGDECIMALELEMENT_H -#define SECURITY_LONGDECIMALELEMENT_H - -/************************************************************ - LongDecimalElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityElement.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class LongDecimalElement: public SecurityElement { -public: - - /** - * - */ - bool required = false; - - /** - * - */ - bool soft = false; - - /** - * - */ - bool storeAsText = false; - - /** - * - */ - unsigned long long minValue; - - /** - * - */ - unsigned long long maxValue; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of LongDecimalElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/LongDecimalTextBox.cpp b/src/plugins/security/model/LongDecimalTextBox.cpp deleted file mode 100644 index 6c4a8575f..000000000 --- a/src/plugins/security/model/LongDecimalTextBox.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_LongDecimalTextBox_BODY - -/************************************************************ - LongDecimalTextBox class body - ************************************************************/ - -// include associated header file -#include "security/LongDecimalTextBox.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of LongDecimalTextBox class body - ************************************************************/ diff --git a/src/plugins/security/model/LongDecimalTextBox.h b/src/plugins/security/model/LongDecimalTextBox.h deleted file mode 100644 index da7e76f39..000000000 --- a/src/plugins/security/model/LongDecimalTextBox.h +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_LONGDECIMALTEXTBOX_H -#define SECURITY_LONGDECIMALTEXTBOX_H - -/************************************************************ - LongDecimalTextBox class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElementContent.h" - -namespace security { - -/************************************************************/ -/** - * Represents a text box with or without a spin control for entering long decimal numbers. - */ -class LongDecimalTextBox: public DataElementContent { -public: - - /** - * - */ - unsigned long long defaultValue; - - /** - * - */ - bool spinBox; - - /** - * - */ - unsigned long long spinStep; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of LongDecimalTextBox class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/LongDecimalType.cpp b/src/plugins/security/model/LongDecimalType.cpp deleted file mode 100644 index e7ee16f74..000000000 --- a/src/plugins/security/model/LongDecimalType.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_LongDecimalType_BODY - -/************************************************************ - LongDecimalType class body - ************************************************************/ - -// include associated header file -#include "security/LongDecimalType.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of LongDecimalType class body - ************************************************************/ diff --git a/src/plugins/security/model/LongDecimalType.h b/src/plugins/security/model/LongDecimalType.h deleted file mode 100644 index c340f4d63..000000000 --- a/src/plugins/security/model/LongDecimalType.h +++ /dev/null @@ -1,56 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_LONGDECIMALTYPE_H -#define SECURITY_LONGDECIMALTYPE_H - -/************************************************************ - LongDecimalType class header - ************************************************************/ - -#include "security/Pkg_security.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class LongDecimalType { -public: - - /** - * - */ - unsigned long long value; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of LongDecimalType class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/MultiTextBox.cpp b/src/plugins/security/model/MultiTextBox.cpp deleted file mode 100644 index fb288632e..000000000 --- a/src/plugins/security/model/MultiTextBox.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_MultiTextBox_BODY - -/************************************************************ - MultiTextBox class body - ************************************************************/ - -// include associated header file -#include "security/MultiTextBox.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of MultiTextBox class body - ************************************************************/ diff --git a/src/plugins/security/model/MultiTextBox.h b/src/plugins/security/model/MultiTextBox.h deleted file mode 100644 index eb0d21f28..000000000 --- a/src/plugins/security/model/MultiTextBox.h +++ /dev/null @@ -1,61 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_MULTITEXTBOX_H -#define SECURITY_MULTITEXTBOX_H - -/************************************************************ - MultiTextBox class header - ************************************************************/ - -#include "security/Pkg_security.h" - -namespace security { - -/************************************************************/ -/** - * Represents a textbox display element with default entry. - */ -class MultiTextBox { -public: - - /** - * - */ - std::string label; - - /** - * - */ - std::string defaultValue; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of MultiTextBox class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/MultiTextElement.cpp b/src/plugins/security/model/MultiTextElement.cpp deleted file mode 100644 index 42aa97035..000000000 --- a/src/plugins/security/model/MultiTextElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_MultiTextElement_BODY - -/************************************************************ - MultiTextElement class body - ************************************************************/ - -// include associated header file -#include "security/MultiTextElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of MultiTextElement class body - ************************************************************/ diff --git a/src/plugins/security/model/MultiTextElement.h b/src/plugins/security/model/MultiTextElement.h deleted file mode 100644 index 7fc57f16c..000000000 --- a/src/plugins/security/model/MultiTextElement.h +++ /dev/null @@ -1,52 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_MULTITEXTELEMENT_H -#define SECURITY_MULTITEXTELEMENT_H - -/************************************************************ - MultiTextElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityElement.h" - -namespace security { - -/************************************************************/ -/** - * Describes a multi line text element in a policy. - */ -class MultiTextElement: public SecurityElement { - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of MultiTextElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/Pkg_security.h b/src/plugins/security/model/Pkg_security.h deleted file mode 100644 index c626bbe26..000000000 --- a/src/plugins/security/model/Pkg_security.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef PKG_SECURITY -#define PKG_SECURITY - -/************************************************************ - Pkg_security package header - ************************************************************/ - -#ifndef _IN_ -#define _IN_ -#endif -#ifndef _OUT_ -#define _OUT_ -#endif -#ifndef _INOUT_ -#define _INOUT_ -#endif - -/* Package dependency header include */ - -namespace security { - -// Types defined within the package - -/** - * An enumeration of the 3 possible types a security definition can belong to. - */ -enum class SecurityType { - /** - * - */ - Machine = 1, - /** - * - */ - User = 0, - /** - * - */ - Both -}; - -} // of namespace security - -/************************************************************ - End of Pkg_security package header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/PresentationElements.cpp b/src/plugins/security/model/PresentationElements.cpp deleted file mode 100644 index 52818bfc1..000000000 --- a/src/plugins/security/model/PresentationElements.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_PresentationElements_BODY - -/************************************************************ - PresentationElements class body - ************************************************************/ - -// include associated header file -#include "security/PresentationElements.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of PresentationElements class body - ************************************************************/ diff --git a/src/plugins/security/model/PresentationElements.h b/src/plugins/security/model/PresentationElements.h deleted file mode 100644 index c5471c927..000000000 --- a/src/plugins/security/model/PresentationElements.h +++ /dev/null @@ -1,113 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_PRESENTATIONELEMENTS_H -#define SECURITY_PRESENTATIONELEMENTS_H - -/************************************************************ - PresentationElements class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "EcorePrimitiveTypes/Pkg_EcorePrimitiveTypes.h" -#include "security/CheckBox.h" -#include "security/ComboBox.h" -#include "security/Comment.h" -#include "security/DecimalTextBox.h" -#include "security/DropdownList.h" -#include "security/GroupBox.h" -#include "security/ListBox.h" -#include "security/LongDecimalTextBox.h" -#include "security/MultiTextBox.h" -#include "security/TextBox.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class PresentationElements { -public: - - /** - * - */ - DecimalTextBox decimalTextBox[]; - - /** - * - */ - TextBox textBox[]; - - /** - * - */ - CheckBox checkBox[]; - - /** - * - */ - ComboBox comboBox[]; - - /** - * - */ - DropdownList dropdownList[]; - - /** - * - */ - LongDecimalTextBox longDecimalTextBox[]; - - /** - * - */ - MultiTextBox multiTextBox[]; - - /** - * - */ - GroupBox groupBox[]; - - /** - * - */ - ListBox listBox[]; - - /** - * - */ - Comment comment[]; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of PresentationElements class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/RadioButton.cpp b/src/plugins/security/model/RadioButton.cpp deleted file mode 100644 index 7dd2fae37..000000000 --- a/src/plugins/security/model/RadioButton.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_RadioButton_BODY - -/************************************************************ - RadioButton class body - ************************************************************/ - -// include associated header file -#include "security/RadioButton.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of RadioButton class body - ************************************************************/ diff --git a/src/plugins/security/model/RadioButton.h b/src/plugins/security/model/RadioButton.h deleted file mode 100644 index 844817611..000000000 --- a/src/plugins/security/model/RadioButton.h +++ /dev/null @@ -1,58 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_RADIOBUTTON_H -#define SECURITY_RADIOBUTTON_H - -/************************************************************ - RadioButton class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElement.h" - -namespace security { - -/************************************************************/ -/** - * Represents a radio button display element.\nCan be associated with a BooleanElement. - */ -class RadioButton: public DataElement { -public: - - /** - * - */ - bool defaultChecked; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of RadioButton class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityDefinition.cpp b/src/plugins/security/model/SecurityDefinition.cpp deleted file mode 100644 index 338606f8a..000000000 --- a/src/plugins/security/model/SecurityDefinition.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityDefinition_BODY - -/************************************************************ - SecurityDefinition class body - ************************************************************/ - -// include associated header file -#include "security/SecurityDefinition.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityDefinition class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityDefinition.h b/src/plugins/security/model/SecurityDefinition.h deleted file mode 100644 index d6765468d..000000000 --- a/src/plugins/security/model/SecurityDefinition.h +++ /dev/null @@ -1,118 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYDEFINITION_H -#define SECURITY_SECURITYDEFINITION_H - -/************************************************************ - SecurityDefinition class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/CategoryReference.h" -#include "security/SecurityElements.h" -#include "security/SecurityValue.h" -#include "security/SecurityValueList.h" - -#include - -namespace security { - -/************************************************************/ -/** - * - */ -class SecurityDefinition { -public: - - /** - * - */ - std::string name; - - /** - * - */ - std::string displayName; - - /** - * - */ - std::string explainText; - - /** - * - */ - std::string sectionName; - - /** - * - */ - std::string propertyName; - - /** - * - */ - SecurityType securityType; - - /** - * - */ - CategoryReference parentCategory; - - /** - * - */ - SecurityElements elements; - - /** - * - */ - SecurityValue enabledValue; - - /** - * - */ - SecurityValue disabledValue; - - /** - * - */ - SecurityValueList enabledList; - - /** - * - */ - SecurityValueList disabledList; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityDefinition class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityDefinitions.cpp b/src/plugins/security/model/SecurityDefinitions.cpp deleted file mode 100644 index 252eccf5f..000000000 --- a/src/plugins/security/model/SecurityDefinitions.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityDefinitions_BODY - -/************************************************************ - SecurityDefinitions class body - ************************************************************/ - -// include associated header file -#include "security/SecurityDefinitions.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityDefinitions class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityDefinitions.h b/src/plugins/security/model/SecurityDefinitions.h deleted file mode 100644 index 648827ae0..000000000 --- a/src/plugins/security/model/SecurityDefinitions.h +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYDEFINITIONS_H -#define SECURITY_SECURITYDEFINITIONS_H - -/************************************************************ - SecurityDefinitions class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityDefinition.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class SecurityDefinitions { -public: - - /** - * - */ - std::string revision; - - /** - * - */ - std::string schemaVersion; - - /** - * - */ - SecurityDefinition security[]; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityDefinitions class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityDescriptorEditor.cpp b/src/plugins/security/model/SecurityDescriptorEditor.cpp deleted file mode 100644 index 80c9232a7..000000000 --- a/src/plugins/security/model/SecurityDescriptorEditor.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityDescriptorEditor_BODY - -/************************************************************ - SecurityDescriptorEditor class body - ************************************************************/ - -// include associated header file -#include "security/SecurityDescriptorEditor.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityDescriptorEditor class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityDescriptorEditor.h b/src/plugins/security/model/SecurityDescriptorEditor.h deleted file mode 100644 index 9c456fdc2..000000000 --- a/src/plugins/security/model/SecurityDescriptorEditor.h +++ /dev/null @@ -1,58 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYDESCRIPTOREDITOR_H -#define SECURITY_SECURITYDESCRIPTOREDITOR_H - -/************************************************************ - SecurityDescriptorEditor class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElement.h" - -namespace security { - -/************************************************************/ -/** - * Represents a security descriptor editor display element. - */ -class SecurityDescriptorEditor: public DataElement { -public: - - /** - * - */ - std::string label; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityDescriptorEditor class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityElement.cpp b/src/plugins/security/model/SecurityElement.cpp deleted file mode 100644 index 62a1a1571..000000000 --- a/src/plugins/security/model/SecurityElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityElement_BODY - -/************************************************************ - SecurityElement class body - ************************************************************/ - -// include associated header file -#include "security/SecurityElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityElement class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityElement.h b/src/plugins/security/model/SecurityElement.h deleted file mode 100644 index 07f6d073c..000000000 --- a/src/plugins/security/model/SecurityElement.h +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYELEMENT_H -#define SECURITY_SECURITYELEMENT_H - -/************************************************************ - SecurityElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include - -namespace security { - -/************************************************************/ -/** - * - */ -class SecurityElement { -public: - - /** - * - */ - std::string refId; - - /** - * - */ - std::string clientExtension; - - /** - * - */ - std::string propertyName; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityElements.cpp b/src/plugins/security/model/SecurityElements.cpp deleted file mode 100644 index 055866cc3..000000000 --- a/src/plugins/security/model/SecurityElements.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityElements_BODY - -/************************************************************ - SecurityElements class body - ************************************************************/ - -// include associated header file -#include "security/SecurityElements.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityElements class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityElements.h b/src/plugins/security/model/SecurityElements.h deleted file mode 100644 index 6f80bd99a..000000000 --- a/src/plugins/security/model/SecurityElements.h +++ /dev/null @@ -1,94 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYELEMENTS_H -#define SECURITY_SECURITYELEMENTS_H - -/************************************************************ - SecurityElements class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "EcorePrimitiveTypes/Pkg_EcorePrimitiveTypes.h" -#include "security/BooleanElement.h" -#include "security/DecimalElement.h" -#include "security/EnumerationElement.h" -#include "security/ListElement.h" -#include "security/LongDecimalElement.h" -#include "security/MultiTextElement.h" -#include "security/TextElement.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class SecurityElements { -public: - - /** - * - */ - BooleanElement bool[]; - - /** - * - */ - DecimalElement decimal[]; - - /** - * - */ - TextElement text[]; - - /** - * - */ - EnumerationElement enum[]; - - /** - * - */ - ListElement list[]; - - /** - * - */ - LongDecimalElement longDecimal[]; - - /** - * - */ - MultiTextElement multiText[]; -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityElements class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityItem.cpp b/src/plugins/security/model/SecurityItem.cpp deleted file mode 100644 index 3c36acc71..000000000 --- a/src/plugins/security/model/SecurityItem.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityItem_BODY - -/************************************************************ - SecurityItem class body - ************************************************************/ - -// include associated header file -#include "security/SecurityItem.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityItem class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityPresentation.cpp b/src/plugins/security/model/SecurityPresentation.cpp deleted file mode 100644 index d332ef280..000000000 --- a/src/plugins/security/model/SecurityPresentation.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityPresentation_BODY - -/************************************************************ - SecurityPresentation class body - ************************************************************/ - -// include associated header file -#include "security/SecurityPresentation.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityPresentation class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityPresentation.h b/src/plugins/security/model/SecurityPresentation.h deleted file mode 100644 index e530e0008..000000000 --- a/src/plugins/security/model/SecurityPresentation.h +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYPRESENTATION_H -#define SECURITY_SECURITYPRESENTATION_H - -/************************************************************ - SecurityPresentation class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/PresentationElements.h" - -namespace security { - -/************************************************************/ -/** - * Root presentation element. - */ -class SecurityPresentation: public PresentationElements { -public: - - /** - * - */ - std::string id; - - /** - * - */ - std::string text; - - /** - * - */ - std::string icon; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityPresentation class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityValue.cpp b/src/plugins/security/model/SecurityValue.cpp deleted file mode 100644 index 69332e27f..000000000 --- a/src/plugins/security/model/SecurityValue.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityValue_BODY - -/************************************************************ - SecurityValue class body - ************************************************************/ - -// include associated header file -#include "security/SecurityValue.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityValue class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityValue.h b/src/plugins/security/model/SecurityValue.h deleted file mode 100644 index c37f14958..000000000 --- a/src/plugins/security/model/SecurityValue.h +++ /dev/null @@ -1,69 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYVALUE_H -#define SECURITY_SECURITYVALUE_H - -/************************************************************ - SecurityValue class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DecimalType.h" -#include "security/LongDecimalType.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class SecurityValue { -public: - - /** - * - */ - DecimalType decimal; - - /** - * - */ - LongDecimalType longDecimal; - - /** - * - */ - SecurityType std::string; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityValue class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/SecurityValueList.cpp b/src/plugins/security/model/SecurityValueList.cpp deleted file mode 100644 index ec322d3f3..000000000 --- a/src/plugins/security/model/SecurityValueList.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_SecurityValueList_BODY - -/************************************************************ - SecurityValueList class body - ************************************************************/ - -// include associated header file -#include "security/SecurityValueList.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of SecurityValueList class body - ************************************************************/ diff --git a/src/plugins/security/model/SecurityValueList.h b/src/plugins/security/model/SecurityValueList.h deleted file mode 100644 index 2fa483b93..000000000 --- a/src/plugins/security/model/SecurityValueList.h +++ /dev/null @@ -1,63 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYVALUELIST_H -#define SECURITY_SECURITYVALUELIST_H - -/************************************************************ - SecurityValueList class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityValue.h" - -namespace security { - -/************************************************************/ -/** - * - */ -class SecurityValueList { -public: - - /** - * - */ - SecurityValue item[]; - - /** - * - */ - std::string defaultString; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of SecurityValueList class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/TextBox.h b/src/plugins/security/model/TextBox.h deleted file mode 100644 index f95628d7b..000000000 --- a/src/plugins/security/model/TextBox.h +++ /dev/null @@ -1,65 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_TEXTBOX_H -#define SECURITY_TEXTBOX_H - -/************************************************************ - TextBox class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/DataElementContent.h" - -#include - -namespace security { - -/************************************************************/ -/** - * Represents a textbox display element with default entry. - */ -class TextBox: public DataElementContent { -public: - - /** - * - */ - std::string label; - - /** - * - */ - std::string defaultValue; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of TextBox class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/TextElement.cpp b/src/plugins/security/model/TextElement.cpp deleted file mode 100644 index 82df0a8f7..000000000 --- a/src/plugins/security/model/TextElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#define security_TextElement_BODY - -/************************************************************ - TextElement class body - ************************************************************/ - -// include associated header file -#include "security/TextElement.h" - -// Derived includes directives - -namespace security { - -// static attributes (if any) - -}// of namespace security - -/************************************************************ - End of TextElement class body - ************************************************************/ diff --git a/src/plugins/security/model/TextElement.h b/src/plugins/security/model/TextElement.h deleted file mode 100644 index 801a588c2..000000000 --- a/src/plugins/security/model/TextElement.h +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************************************************************** - ** - ** Copyright (C) 2023 BaseALT Ltd. - ** - ** This program is free software; you can redistribute it and/or - ** modify it under the terms of the GNU General Public License - ** as published by the Free Software Foundation; either version 2 - ** of the License, or (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program; if not, write to the Free Software - ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ** - ***********************************************************************************************************************/ -#ifndef SECURITY_TEXTELEMENT_H -#define SECURITY_TEXTELEMENT_H - -/************************************************************ - TextElement class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/SecurityElement.h" - -namespace security { - -/************************************************************/ -/** - * Describes a single line text element in a policy. - */ -class TextElement: public SecurityElement { -public: - - /** - * - */ - bool required = false; - - /** - * - */ - unsigned int maxLength = 1024; - - /** - * - */ - bool soft = false; - -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ - -} // of namespace security - -/************************************************************ - End of TextElement class header - ************************************************************/ - -#endif diff --git a/src/plugins/security/model/booleanelement.h b/src/plugins/security/model/booleanelement.h new file mode 100644 index 000000000..c32322dad --- /dev/null +++ b/src/plugins/security/model/booleanelement.h @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_BOOLEAN_ELEMENT_H +#define SECURITY_BOOLEAN_ELEMENT_H + +#include "securityelement.h" + +namespace security +{ + +/*! + * \class BooleanElement + * \brief Describes a choice element in a policy with associated values for the true and false cases. + */ +class BooleanElement: public SecurityElement +{ +}; + +} // of namespace security + +#endif // SECURITY_BOOLEAN_ELEMENT_H diff --git a/src/plugins/security/model/Category.h b/src/plugins/security/model/category.h similarity index 52% rename from src/plugins/security/model/Category.h rename to src/plugins/security/model/category.h index cca3097bc..9a42883d8 100644 --- a/src/plugins/security/model/Category.h +++ b/src/plugins/security/model/category.h @@ -17,69 +17,59 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ + #ifndef SECURITY_CATEGORY_H #define SECURITY_CATEGORY_H -/************************************************************ - Category class header - ************************************************************/ - -#include "security/Pkg_security.h" - -#include "security/CategoryReference.h" +#include "security.h" #include +#include -namespace security { +namespace security +{ -/************************************************************/ -/** - * A grouping of security definitions. +/*! + * \class Category + * \brief A grouping of security definitions. + * + * \ingroup model + * \ingroup presentation */ -class Category { +class Category +{ public: - - /** - * - */ - std::string name; - - /** - * - */ - std::string displayName; - - /** - * - */ - std::string keywords[]; - - /** - * - */ - std::string seeAlso[]; - - /** - * - */ - std::string explainText; - - /** - * - */ - CategoryReference parentCategory; - + /*! + * \brief name Specifies a logical name to use for a specific supported application and revision. + */ + std::string name{}; + + /*! + * \brief displayName The reference to the category text string located in the string table of the .sdml file. + */ + std::string displayName{}; + + /*! + * \brief keywords Contains index words that could be used to search for elements. + */ + std::vector keywords{}; + + /*! + * \brief seeAlso Reference to another element that may be related. + */ + std::vector seeAlso{}; + + /*! + * \brief explainText Explain or Help text associated with a specific category. + */ + std::string explainText{}; + + /*! + * \brief parentCategory Reference to parent of the current category. + */ + std::string parentCategory{}; }; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ } // of namespace security -/************************************************************ - End of Category class header - ************************************************************/ - -#endif +#endif // SECURITY_CATEGORY_H diff --git a/src/plugins/security/model/Category.cpp b/src/plugins/security/model/checkbox.h similarity index 66% rename from src/plugins/security/model/Category.cpp rename to src/plugins/security/model/checkbox.h index 9556ecf4d..3e939c2b0 100644 --- a/src/plugins/security/model/Category.cpp +++ b/src/plugins/security/model/checkbox.h @@ -17,23 +17,34 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_Category_BODY -/************************************************************ - Category class body - ************************************************************/ +#ifndef SECURITY_CHECKBOX_H +#define SECURITY_CHECKBOX_H -// include associated header file -#include "security/Category.h" +#include "security.h" -// Derived includes directives +#include "dataelementcontent.h" -namespace security { +namespace security +{ -// static attributes (if any) +/*! + * \class CheckBox + * \brief Represents a checkbox display element.\nCan be associated with a BooleanElement. + * + * \ingroup security + * \ingroup presentation + */ +class CheckBox: public DataElementContent +{ +public: -}// of namespace security + /*! + * \brief If checkbox should be initially checked upon creation. + */ + bool defaultChecked { false }; +}; -/************************************************************ - End of Category class body - ************************************************************/ +} // of namespace security + +#endif // SECURITY_CHECKBOX_H diff --git a/src/plugins/security/model/CategoryReference.h b/src/plugins/security/model/combobox.h similarity index 54% rename from src/plugins/security/model/CategoryReference.h rename to src/plugins/security/model/combobox.h index 71c83bea7..1f5ab558a 100644 --- a/src/plugins/security/model/CategoryReference.h +++ b/src/plugins/security/model/combobox.h @@ -17,42 +17,52 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#ifndef SECURITY_CATEGORYREFERENCE_H -#define SECURITY_CATEGORYREFERENCE_H -/************************************************************ - CategoryReference class header - ************************************************************/ +#ifndef SECURITY_COMBOBOX_H +#define SECURITY_COMBOBOX_H -#include "security/Pkg_security.h" +#include "security.h" + +#include "dataelementcontent.h" #include +#include -namespace security { +namespace security +{ -/************************************************************/ -/** - * +/*! + \class ComboBox + * \brief Represents a combobox display element with default/suggested entries. + * + * \ingroup security + * \ingroup presentation */ -class CategoryReference { +class ComboBox: public DataElementContent +{ public: + /*! + * \brief label Text associated with the input box to provide prompt text. + */ + std::string label {}; - /** - * - */ - std::string ref; + /*! + * \brief defaultValue Specifies a default value. This can be used for either string or numeric data. + */ + std::string defaultValue {}; -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ + /*! + * \brief suggestions A suggested value to be placed in the drop-down list. + * Multiple suggestion elements result in multiple suggestions. + */ + std::string suggestion {}; -/* Inline functions */ + /*! + * \brief noSort If elements should be sorted. + */ + bool noSort { false }; +}; } // of namespace security -/************************************************************ - End of CategoryReference class header - ************************************************************/ - -#endif +#endif // SECURITY_COMBOBOX_H diff --git a/src/plugins/security/model/comment.h b/src/plugins/security/model/comment.h new file mode 100644 index 000000000..56164317f --- /dev/null +++ b/src/plugins/security/model/comment.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_COMMENT_H +#define SECURITY_COMMENT_H + +#include "security.h" + +#include "dataelement.h" + +#include + +namespace security +{ + +/*! + * \class Comment + * \brief Represents a comment display element. + * + * \ingroup security + * \ingroup presentation + */ +class Comment: public DataElement +{ +public: + + /*! + * \brief text Text of the comment. + */ + std::string text; + + /*! + * \brief image Image that can be incorporated into comment. + */ + std::string image; + +}; + +} // of namespace security + +#endif // SECURITY_COMMENT_H diff --git a/src/plugins/security/model/ListBox.cpp b/src/plugins/security/model/dataelement.h similarity index 67% rename from src/plugins/security/model/ListBox.cpp rename to src/plugins/security/model/dataelement.h index c1d2a3b31..ebff6bfd5 100644 --- a/src/plugins/security/model/ListBox.cpp +++ b/src/plugins/security/model/dataelement.h @@ -17,23 +17,34 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_ListBox_BODY -/************************************************************ - ListBox class body - ************************************************************/ +#ifndef SECURITY_DATA_ELEMENT_H +#define SECURITY_DATA_ELEMENT_H -// include associated header file -#include "security/ListBox.h" +#include "security.h" -// Derived includes directives +#include -namespace security { +namespace security +{ -// static attributes (if any) +/*! + * \class DataElement + * \brief Represents base of simple graphical elements. + * + * \ingroup security + * \ingroup presentation + */ +class DataElement +{ +public: -}// of namespace security + /*! + * \brief refId A reference Id. + */ + std::string refId {}; +}; -/************************************************************ - End of ListBox class body - ************************************************************/ +} // of namespace security + +#endif // SECURITY_DATA_ELEMENT_H diff --git a/src/plugins/security/model/dataelementcontent.h b/src/plugins/security/model/dataelementcontent.h new file mode 100644 index 000000000..4bfec1d78 --- /dev/null +++ b/src/plugins/security/model/dataelementcontent.h @@ -0,0 +1,59 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_DATA_ELEMENT_CONTENT_H +#define SECURITY_DATA_ELEMENT_CONTENT_H + +#include "security.h" + +#include + +namespace security +{ + +/*! + \class DataElementContent + * \brief The DataElementContent class base class for graphical element such as combobox or radio-button. + * + * \ingroup security + * \ingroup presentation + */ +class DataElementContent +{ +public: + /*! + * \brief value An initial value of graphical element. + */ + std::string value; + + /*! + * \brief refId A reference Id. + */ + std::string refId; + + /*! + * \brief postfix A description that follows graphical element. + */ + std::string postfix; +}; + +} // of namespace security + +#endif // SECURITY_DATA_ELEMENT_CONTENT_H diff --git a/src/plugins/security/model/decimalelement.h b/src/plugins/security/model/decimalelement.h new file mode 100644 index 000000000..ea67c8542 --- /dev/null +++ b/src/plugins/security/model/decimalelement.h @@ -0,0 +1,66 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_DECIMAL_ELEMENT_H +#define SECURITY_DECIMAL_ELEMENT_H + +#include "security.h" + +#include "securityelement.h" + +namespace security +{ + +/*! + * \brief The DecimalElement class + */ +class DecimalElement: public SecurityElement +{ +public: + + /*! + * + */ + bool required { false }; + + /*! + * + */ + bool soft { false }; + + /*! + * + */ + bool storeAsText { false }; + + /*! + * + */ + uint32_t minValue { std::numeric_limits::min() }; + + /*! + * + */ + uint32_t maxValue { std::numeric_limits::max() }; +}; + +} // of namespace security + +#endif // SECURITY_DECIMAL_ELEMENT_H diff --git a/src/plugins/security/model/decimaltextbox.h b/src/plugins/security/model/decimaltextbox.h new file mode 100644 index 000000000..8c1f01ab9 --- /dev/null +++ b/src/plugins/security/model/decimaltextbox.h @@ -0,0 +1,61 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_DECIMAL_TEXTBOX_H +#define SECURITY_DECIMAL_TEXTBOX_H + +#include "security.h" + +#include "dataelementcontent.h" + +namespace security +{ + +/*! + * \class DecimalTextBox + * \brief Represents a text box with or without a spin control for entering decimal numbers. + * + * \ingroup security + * \ingroup presentation + */ +class DecimalTextBox: public DataElementContent +{ +public: + + /*! + * \brief defaultValue + */ + uint32_t defaultValue {0}; + + /*! + * \brief spinBox + */ + bool spinBox { false }; + + /*! + * \brief spinStep + */ + uint32_t spinStep {1}; + +}; + +} // of namespace security + +#endif // SECURITY_DECIMAL_TEXTBOX_H diff --git a/src/plugins/security/model/TextBox.cpp b/src/plugins/security/model/decimaltype.h similarity index 67% rename from src/plugins/security/model/TextBox.cpp rename to src/plugins/security/model/decimaltype.h index 3d8c1ec05..a62f50359 100644 --- a/src/plugins/security/model/TextBox.cpp +++ b/src/plugins/security/model/decimaltype.h @@ -17,23 +17,29 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_TextBox_BODY -/************************************************************ - TextBox class body - ************************************************************/ +#ifndef SECURITY_DECIMALTYPE_H +#define SECURITY_DECIMALTYPE_H -// include associated header file -#include "security/TextBox.h" +#include "security.h" -// Derived includes directives +#include -namespace security { +namespace security +{ -// static attributes (if any) +/*! + * \brief The DecimalType class + */ +class DecimalType { +public: -}// of namespace security + /** + * + */ + uint32_t value {0}; +}; -/************************************************************ - End of TextBox class body - ************************************************************/ +} // of namespace security + +#endif // SECURITY_DECIMALTYPE_H diff --git a/src/plugins/security/model/ComboBox.cpp b/src/plugins/security/model/dropdownlist.h similarity index 67% rename from src/plugins/security/model/ComboBox.cpp rename to src/plugins/security/model/dropdownlist.h index 0fc7730df..f4c421668 100644 --- a/src/plugins/security/model/ComboBox.cpp +++ b/src/plugins/security/model/dropdownlist.h @@ -17,23 +17,25 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_ComboBox_BODY -/************************************************************ - ComboBox class body - ************************************************************/ +#ifndef SECURITY_DROPDOWNLIST_H +#define SECURITY_DROPDOWNLIST_H -// include associated header file -#include "security/ComboBox.h" +#include "security.h" -// Derived includes directives +#include "dataelementcontent.h" -namespace security { +namespace security +{ -// static attributes (if any) +/*! + * \class DropdownList + * \brief Represents a dropdown list display element. + */ +class DropdownList : public DataElementContent +{ +}; -}// of namespace security +} // of namespace security -/************************************************************ - End of ComboBox class body - ************************************************************/ +#endif // SECURITY_DROPDOWNLIST_H diff --git a/src/plugins/security/model/enumerationelement.h b/src/plugins/security/model/enumerationelement.h new file mode 100644 index 000000000..0e3871645 --- /dev/null +++ b/src/plugins/security/model/enumerationelement.h @@ -0,0 +1,46 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_ENUMERATION_ELEMENT_H +#define SECURITY_ENUMERATION_ELEMENT_H + +#include "security.h" + +#include "securityelement.h" + +namespace security +{ + +/*! + * \class EnumerationElement + * \brief The EnumerationElement class + */ +class EnumerationElement: public SecurityElement +{ +public: + /*! + * \brief required + */ + bool required { false }; +}; + +} // of namespace security + +#endif // SECURITY_ENUMERATION_ELEMENT_H diff --git a/src/plugins/security/model/GroupBox.h b/src/plugins/security/model/groupbox.h similarity index 53% rename from src/plugins/security/model/GroupBox.h rename to src/plugins/security/model/groupbox.h index caff83f96..a0c4de535 100644 --- a/src/plugins/security/model/GroupBox.h +++ b/src/plugins/security/model/groupbox.h @@ -17,63 +17,57 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ + #ifndef SECURITY_GROUPBOX_H #define SECURITY_GROUPBOX_H -/************************************************************ - GroupBox class header - ************************************************************/ +#include "security.h" -#include "security/Pkg_security.h" +#include "dataelementcontent.h" +#include "presentationelements.h" -#include "security/DataElementContent.h" -#include "security/PresentationElements.h" +#include -namespace security { +namespace security +{ -/************************************************************/ -/** - * +/*! + * \class GroupBox + * \brief The GroupBox class are used to provide an identifiable grouping for other graphical elements. + * + * \ingroup security + * \ingroup presentation */ -class GroupBox: public DataElementContent { +class GroupBox: public DataElementContent +{ public: - /** - * - */ - bool hasCheckBox; - - /** - * - */ - bool defaultChecked; + /*! + * \brief hasCheckBox If group box has checkbox. + */ + bool hasCheckBox { false }; - /** - * - */ - PresentationElements elements; + /*! + * \brief defaultChecked If group box's check box is checked. + */ + bool defaultChecked { false }; - /** - * - */ - std::string label; + /*! + * \brief elements Content of the group box. + */ + std::unique_ptr elements{}; - /** - * - */ - bool hasBorder; + /*! + * \brief label Description of the group box. + */ + std::string label{}; + /*! + * \brief hasBorder If group box is flat or it has border. + */ + bool hasBorder { false }; }; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ - -/* Inline functions */ } // of namespace security -/************************************************************ - End of GroupBox class header - ************************************************************/ - -#endif +#endif // SECURITY_GROUPBOX_H diff --git a/src/plugins/security/model/DataElement.h b/src/plugins/security/model/ldapsearchdialog.h similarity index 57% rename from src/plugins/security/model/DataElement.h rename to src/plugins/security/model/ldapsearchdialog.h index a88a87702..328d157c4 100644 --- a/src/plugins/security/model/DataElement.h +++ b/src/plugins/security/model/ldapsearchdialog.h @@ -17,42 +17,50 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#ifndef SECURITY_DATAELEMENT_H -#define SECURITY_DATAELEMENT_H -/************************************************************ - DataElement class header - ************************************************************/ +#ifndef SECURITY_LDAP_SEARCH_DIALOG_H +#define SECURITY_LDAP_SEARCH_DIALOG_H -#include "security/Pkg_security.h" +#include "security.h" + +#include "dataelementcontent.h" #include -namespace security { +namespace security +{ -/************************************************************/ -/** - * +/*! + * \class LdapSearchDialog + * \brief Represents a LDAP search dialog display element.\nCan be associated with a TextElement. + * + * \ingroup security + * \ingroup presentation */ -class DataElement { +class LdapSearchDialog: public DataElementContent +{ public: + /*! + * \brief dn Base DN for elements to search. + */ + std::string dn{}; - /** - * - */ - std::string refId; + /*! + * \brief filter LDAP search filter. + */ + std::string filter{}; -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ + /*! + * \brief addLabel Label for add button. + */ + std::string addLabel{}; -/* Inline functions */ + /*! + * \brief removeLabel Label for remove button. + */ + std::string removeLabel{}; +}; } // of namespace security -/************************************************************ - End of DataElement class header - ************************************************************/ - -#endif +#endif // SECURITY_LDAP_SEARCH_DIALOG_H diff --git a/src/plugins/security/model/listbox.h b/src/plugins/security/model/listbox.h new file mode 100644 index 000000000..333a3dbe4 --- /dev/null +++ b/src/plugins/security/model/listbox.h @@ -0,0 +1,44 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_LISTBOX_H +#define SECURITY_LISTBOX_H + +#include "security.h" + +#include "dataelementcontent.h" + +namespace security +{ + +/*! + * \class ListBox + * \brief Represents a listbox display element. + * + * \ingroup security + * \ingroup presentation + */ +class ListBox : DataElementContent +{ +}; + +} // of namespace security + +#endif // SECURITY_LISTBOX_H diff --git a/src/plugins/security/model/listelement.h b/src/plugins/security/model/listelement.h new file mode 100644 index 000000000..f16e1652c --- /dev/null +++ b/src/plugins/security/model/listelement.h @@ -0,0 +1,62 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_LIST_ELEMENT_H +#define SECURITY_LIST_ELEMENT_H + +#include "security.h" + +#include "securityelement.h" + +namespace security +{ + +/*! + * \class ListElement + * \brief The ListElement class + */ +class ListElement: public SecurityElement +{ +public: + + /*! + * \brief valuePrefix + */ + std::string valuePrefix{}; + + /*! + * \brief additive + */ + bool additive { false }; + + /*! + * \brief expandable + */ + bool expandable { false }; + + /*! + * \brief explicitValue + */ + bool explicitValue { false }; +}; + +} // of namespace security + +#endif // SECURITY_LIST_ELEMENT_H diff --git a/src/plugins/security/model/ListBox.h b/src/plugins/security/model/longdecimalelement.h similarity index 57% rename from src/plugins/security/model/ListBox.h rename to src/plugins/security/model/longdecimalelement.h index 9c7f60ab1..cedd67ac9 100644 --- a/src/plugins/security/model/ListBox.h +++ b/src/plugins/security/model/longdecimalelement.h @@ -17,34 +17,51 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#ifndef SECURITY_LISTBOX_H -#define SECURITY_LISTBOX_H -/************************************************************ - ListBox class header - ************************************************************/ +#ifndef SECURITY_LONG_DECIMAL_ELEMENT_H +#define SECURITY_LONG_DECIMAL_ELEMENT_H -#include "security/Pkg_security.h" +#include "security.h" -namespace security { +#include "securityelement.h" -/************************************************************/ -/** - * Represents a listbox display element. +namespace security +{ + +/*! + * \class LongDecimalElement + * \brief The LongDecimalElement class */ -class ListBox { +class LongDecimalElement: public SecurityElement +{ +public: -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ + /*! + * \brief required + */ + bool required { false }; -/* Inline functions */ + /*! + * \brief sorf + */ + bool soft { false }; -} // of namespace security + /*! + * \brief storeAsText + */ + bool storeAsText { false }; + + /*! + * \brief minValue + */ + uint64_t minValue { std::numeric_limits::min() }; -/************************************************************ - End of ListBox class header - ************************************************************/ + /** + * \brief maxValue + */ + uint64_t maxValue { std::numeric_limits::max() }; +}; + +} // of namespace security -#endif +#endif // SECURITY_LONG_DECIMAL_ELEMENT_H diff --git a/src/plugins/security/model/longdecimaltextbox.h b/src/plugins/security/model/longdecimaltextbox.h new file mode 100644 index 000000000..030871a30 --- /dev/null +++ b/src/plugins/security/model/longdecimaltextbox.h @@ -0,0 +1,60 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_LONG_DECIMAL_TEXTBOX_H +#define SECURITY_LONG_DECIMAL_TEXTBOX_H + +#include "security.h" + +#include "dataelementcontent.h" + +namespace security { + +/** + * \class LongDecimalTextBox + * \brief Represents a text box with or without a spin control for entering long decimal numbers. + * + * \ingroup security + * \ingroup presentation + */ +class LongDecimalTextBox: public DataElementContent +{ +public: + + /*! + * \brief defaultValue + */ + uint64_t defaultValue; + + /*! + * \brief spinBox + */ + bool spinBox { false }; + + /*! + * \brief spinStep + */ + uint64_t spinStep {1}; + +}; + +} // of namespace security + +#endif // SECURITY_LONG_DECIMAL_TEXTBOX_H diff --git a/src/plugins/security/model/longdecimaltype.h b/src/plugins/security/model/longdecimaltype.h new file mode 100644 index 000000000..f8669f77d --- /dev/null +++ b/src/plugins/security/model/longdecimaltype.h @@ -0,0 +1,46 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_LONG_DECIMAL_TYPE_H +#define SECURITY_LONG_DECIMAL_TYPE_H + +#include "security.h" + +#include + +namespace security +{ + +/*! + * \class LongDecimalElement + * \brief The LongDecimalType class + */ +class LongDecimalType +{ +public: + /*! + * \brief value + */ + uint64_t value {}; +}; + +} // of namespace security + +#endif // SECURITY_LONG_DECIMAL_TYPE_H diff --git a/src/plugins/security/model/CategoryReference.cpp b/src/plugins/security/model/multitextbox.h similarity index 65% rename from src/plugins/security/model/CategoryReference.cpp rename to src/plugins/security/model/multitextbox.h index 6ebe10686..77b636d86 100644 --- a/src/plugins/security/model/CategoryReference.cpp +++ b/src/plugins/security/model/multitextbox.h @@ -17,23 +17,38 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_CategoryReference_BODY -/************************************************************ - CategoryReference class body - ************************************************************/ +#ifndef SECURITY_MULTITEXTBOX_H +#define SECURITY_MULTITEXTBOX_H -// include associated header file -#include "security/CategoryReference.h" +#include "security.h" -// Derived includes directives +#include "dataelementcontent.h" -namespace security { +namespace security +{ -// static attributes (if any) +/** + * \class MultiTextBox + * \brief Represents a textbox display element with default entry. + * + * \ingroup security + * \ingroup presentation + */ +class MultiTextBox : public DataElementContent +{ +public: + /*! + * \brief label + */ + std::string label{}; -}// of namespace security + /*! + * \brief defaultValue + */ + std::string defaultValue{}; +}; -/************************************************************ - End of CategoryReference class body - ************************************************************/ +} // of namespace security + +#endif // SECURITY_MULTITEXTBOX_H diff --git a/src/plugins/security/model/multitextelement.h b/src/plugins/security/model/multitextelement.h new file mode 100644 index 000000000..a1c179418 --- /dev/null +++ b/src/plugins/security/model/multitextelement.h @@ -0,0 +1,41 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_MULTITEXT_ELEMENT_H +#define SECURITY_MULTITEXT_ELEMENT_H + +#include "security.h" + +#include "securityelement.h" + +namespace security +{ + +/*! + * \class MultiTextElement + * \brief Describes a multi line text element in a policy. + */ +class MultiTextElement: public SecurityElement +{ +}; + +} // of namespace security + +#endif // SECURITY_MULTITEXT_ELEMENT_H diff --git a/src/plugins/security/model/presentationelements.h b/src/plugins/security/model/presentationelements.h new file mode 100644 index 000000000..d6cda3dd8 --- /dev/null +++ b/src/plugins/security/model/presentationelements.h @@ -0,0 +1,103 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_PRESENTATION_ELEMENTS_H +#define SECURITY_PRESENTATION_ELEMENTS_H + +#include "security.h" + +#include "checkbox.h" +#include "combobox.h" +#include "comment.h" +#include "decimaltextbox.h" +#include "dropdownlist.h" +#include "groupbox.h" +#include "listbox.h" +#include "longdecimaltextbox.h" +#include "multitextbox.h" +#include "textbox.h" + +#include + +namespace security +{ + +/*! + * \class PresentationElements + * \brief The PresentationElements class + */ +class PresentationElements +{ +public: + + /*! + * \brief decimalTextBox + */ + std::vector decimalTextBox {}; + + /*! + * \brief textBox + */ + std::vector textBox{}; + + /*! + * \brief checkBox + */ + std::vector checkBox{}; + + /*! + * \brief comboBox + */ + std::vector comboBox{}; + + /*! + * \brief dropdownList + */ + std::vector dropdownList{}; + + /*! + * \brief longDecimalTextBox + */ + std::vector longDecimalTextBox{}; + + /*! + * \brief multiTextBox + */ + std::vector multiTextBox{}; + + /*! + * \brief groupBox + */ + std::vector groupBox{}; + + /*! + * \brief listBox + */ + std::vector listBox{}; + + /*! + * \brief comment + */ + std::vector comment{}; +}; + +} // of namespace security + +#endif // SECURITY_PRESENTATION_ELEMENTS_H diff --git a/src/plugins/security/model/radiobutton.h b/src/plugins/security/model/radiobutton.h new file mode 100644 index 000000000..0a74803f3 --- /dev/null +++ b/src/plugins/security/model/radiobutton.h @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_RADIO_BUTTON_H +#define SECURITY_RADIO_BUTTON_H + +#include "security.h" + +#include "dataelement.h" + +namespace security +{ + +/*! + * \class RadioButton + * \brief Represents a radio button display element.\nCan be associated with a BooleanElement. + */ +class RadioButton: public DataElement +{ +public: + + /*! + * \brief defaultChecked Shows if radio button is enabled by default. + */ + bool defaultChecked { false }; +}; + +} // of namespace security + +#endif // SECURITY_RADIO_BUTTON_H diff --git a/src/plugins/security/model/security.h b/src/plugins/security/model/security.h new file mode 100644 index 000000000..87fef60f0 --- /dev/null +++ b/src/plugins/security/model/security.h @@ -0,0 +1,31 @@ +#ifndef SECURITY_H +#define SECURITY_H + +namespace security +{ + +/** + * \enum SecurityType + * \brief bAn enumeration of the 3 possible types a security definition can belong to. + */ +enum class SecurityType +{ + /*! + * + */ + User = 0, + + /*! + * + */ + Machine = 1, + + /*! + * + */ + Both = 2 +}; + +} // of namespace security + +#endif // SECURITY_H diff --git a/src/plugins/security/model/securitydefinition.h b/src/plugins/security/model/securitydefinition.h new file mode 100644 index 000000000..8f00ce3e9 --- /dev/null +++ b/src/plugins/security/model/securitydefinition.h @@ -0,0 +1,107 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_SECURITY_DEFINITION_H +#define SECURITY_SECURITY_DEFINITION_H + +#include "security.h" + +#include "securityelements.h" +#include "securityvalue.h" +#include "securityvaluelist.h" + +#include +#include +#include + +namespace security +{ + +/*! + \class SecurityDefinition + * \brief The SecurityDefinition class + */ +class SecurityDefinition +{ +public: + /*! + * \brief name + */ + std::string name {}; + + /*! + * \brief displayName + */ + std::string displayName {}; + + /*! + * \brief explainText + */ + std::string explainText {}; + + /*! + * \brief sectionName + */ + std::unique_ptr sectionName {}; + + /*! + * \brief propertyName + */ + std::unique_ptr propertyName {}; + + /*! + * \brief securityType + */ + SecurityType securityType { SecurityType::Machine }; + + /*! + * \brief parentCategory + */ + std::string parentCategory {}; + + /*! + * \brief elements + */ + std::unique_ptr elements {}; + + /*! + * \brief enabledValue + */ + std::unique_ptr enabledValue {}; + + /*! + * \brief disabledValue + */ + std::unique_ptr disabledValue {}; + + /*! + * \brief enabledList + */ + std::unique_ptr enabledList; + + /*! + * \brief disabledList + */ + std::unique_ptr disabledList; +}; + +} // of namespace security + +#endif // SECURITY_SECURITY_DEFINITION_H diff --git a/src/plugins/security/model/securitydefinitions.h b/src/plugins/security/model/securitydefinitions.h new file mode 100644 index 000000000..9ca705fc9 --- /dev/null +++ b/src/plugins/security/model/securitydefinitions.h @@ -0,0 +1,60 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_SECURITY_DEFINITIONS_H +#define SECURITY_SECURITY_DEFINITIONS_H + +#include "security.h" + +#include "securitydefinition.h" + +#include +#include +#include + +namespace security +{ + +/*! + * \class SecurityDefinitions + * \brief The SecurityDefinitions class + */ +class SecurityDefinitions +{ +public: + /*! + * \brief revision + */ + std::string revision{}; + + /*! + * \brief schemaVersion + */ + std::string schemaVersion{}; + + /*! + * \brief security + */ + std::vector > security {}; +}; + +} // of namespace security + +#endif // SECURITY_SECURITY_DEFINITIONS_H diff --git a/src/plugins/security/model/CheckBox.cpp b/src/plugins/security/model/securitydescriptoreditor.h similarity index 67% rename from src/plugins/security/model/CheckBox.cpp rename to src/plugins/security/model/securitydescriptoreditor.h index 7f5413038..ae973d672 100644 --- a/src/plugins/security/model/CheckBox.cpp +++ b/src/plugins/security/model/securitydescriptoreditor.h @@ -17,23 +17,30 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_CheckBox_BODY -/************************************************************ - CheckBox class body - ************************************************************/ +#ifndef SECURITY_SECURITY_DESCRIPTOR_EDITOR_H +#define SECURITY_SECURITY_DESCRIPTOR_EDITOR_H -// include associated header file -#include "security/CheckBox.h" +#include "security.h" -// Derived includes directives +#include "dataelement.h" -namespace security { +namespace security +{ -// static attributes (if any) +/*! + * \class SecurityDescriptorEditor + * \brief Represents a security descriptor editor display element. + */ +class SecurityDescriptorEditor: public DataElement +{ +public: + /*! + * \brief label Label of the security editor button. + */ + std::string label{}; +}; -}// of namespace security +} // of namespace security -/************************************************************ - End of CheckBox class body - ************************************************************/ +#endif // SECURITY_SECURITY_DESCRIPTOR_EDITOR_H diff --git a/src/plugins/security/model/securityelement.h b/src/plugins/security/model/securityelement.h new file mode 100644 index 000000000..cc801b2a7 --- /dev/null +++ b/src/plugins/security/model/securityelement.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_SECURITY_ELEMENT_H +#define SECURITY_SECURITY_ELEMENT_H + +#include "security.h" + +#include +#include + +namespace security +{ + +/*! + * \class SecurityElement + * \brief The SecurityElement class + */ +class SecurityElement +{ +public: + + /*! + * \brief refId + */ + std::string refId{}; + + /*! + * \brief clientExtension + */ + QUuid clientExtension{}; + + /*! + * \brief propertyName + */ + std::string propertyName{}; +}; + +} // of namespace security + +#endif // SECURITY_SECURITY_ELEMENT_H diff --git a/src/plugins/security/model/SecurityItem.h b/src/plugins/security/model/securityelements.h similarity index 51% rename from src/plugins/security/model/SecurityItem.h rename to src/plugins/security/model/securityelements.h index 95a27926e..7ea104c9a 100644 --- a/src/plugins/security/model/SecurityItem.h +++ b/src/plugins/security/model/securityelements.h @@ -17,54 +17,69 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#ifndef SECURITY_SECURITYITEM_H -#define SECURITY_SECURITYITEM_H -/************************************************************ - SecurityItem class header - ************************************************************/ +#ifndef SECURITY_SECURITY_ELEMENTS_H +#define SECURITY_SECURITY_ELEMENTS_H -#include "security/Pkg_security.h" +#include "security.h" -#include "security/SecurityValue.h" +#include "booleanelement.h" +#include "decimalelement.h" +#include "enumerationelement.h" +#include "listelement.h" +#include "longdecimalelement.h" +#include "multitextelement.h" +#include "textelement.h" #include +#include -namespace security { +namespace security +{ -/************************************************************/ -/** - * +/*! + * \class SecurityElements + * \brief The SecurityElements class */ -class SecurityItem { +class SecurityElements +{ public: + /*! + * \brief boolean + */ + std::vector boolean {}; - /** - * - */ - std::string sectionName; + /*! + * \brief decimal + */ + std::vector decimal {}; - /** - * - */ - std::string propertyName; + /*! + * \brief text + */ + std::vector text {}; - /** - * - */ - SecurityValue value; + /*! + * \brief enumElement + */ + std::vector enumElement {}; -}; -/************************************************************/ -/* External declarations (package visibility) */ -/************************************************************/ + /*! + * \brief list + */ + std::vector list {}; -/* Inline functions */ + /*! + * \brief longDecimal + */ + std::vector longDecimal {}; -} // of namespace security + /*! + * \brief multiText + */ + std::vector multiText {}; +}; -/************************************************************ - End of SecurityItem class header - ************************************************************/ +} // of namespace security -#endif +#endif // SECURITY_SECURITY_ELEMENTS_H diff --git a/src/plugins/security/model/securityitem.h b/src/plugins/security/model/securityitem.h new file mode 100644 index 000000000..3021ef409 --- /dev/null +++ b/src/plugins/security/model/securityitem.h @@ -0,0 +1,61 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_SECURITY_ITEM_H +#define SECURITY_SECURITY_ITEM_H + +#include "security.h" + +#include "securityvalue.h" + +#include + +namespace security { + +/*! + * \class SecurityItem + * \brief The SecurityItem class represents element of security policy. + * + * \ingroup security + * + * \see SecurityValue + */ +class SecurityItem +{ +public: + /*! + * \brief sectionName Name of the section to place item into. + */ + std::string sectionName {}; + + /*! + * \brief propertyName Name of the property associated with this security policy element. + */ + std::string propertyName {}; + + /*! + * \brief value Value of current element. + */ + SecurityValue value {}; +}; + +} // of namespace security + +#endif // SECURITY_SECURITY_ITEM_H diff --git a/src/plugins/security/model/securitypresentation.h b/src/plugins/security/model/securitypresentation.h new file mode 100644 index 000000000..f5264cd84 --- /dev/null +++ b/src/plugins/security/model/securitypresentation.h @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_SECURITY_PRESENTATION_H +#define SECURITY_SECURITY_PRESENTATION_H + +#include "security.h" + +#include "presentationelements.h" + +#include + +namespace security +{ + +/*! + * \class SecurityPresentation + * \brief Root presentation element. + */ +class SecurityPresentation: public PresentationElements +{ +public: + /*! + * \brief id Id of current presentation element. + */ + std::string id{}; + + /*! + * \brief text + */ + std::string text{}; + + /*! + * \brief icon Icon associated with current presentation element. + */ + std::string icon{}; +}; + +} // of namespace security + +#endif // SECURITY_SECURITY_PRESENTATION_H diff --git a/src/plugins/security/model/Comment.cpp b/src/plugins/security/model/securityvalue.h similarity index 69% rename from src/plugins/security/model/Comment.cpp rename to src/plugins/security/model/securityvalue.h index 404a33a38..9f09b4b5a 100644 --- a/src/plugins/security/model/Comment.cpp +++ b/src/plugins/security/model/securityvalue.h @@ -17,23 +17,24 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_Comment_BODY -/************************************************************ - Comment class body - ************************************************************/ +#ifndef SECURITY_SECURITY_VALUE_H +#define SECURITY_SECURITY_VALUE_H -// include associated header file -#include "security/Comment.h" - -// Derived includes directives +#include "security.h" namespace security { -// static attributes (if any) +/*! + * \class SecurityValue + * \brief The SecurityValue class + */ +class SecurityValue +{ +public: + // TODO: implement +}; -}// of namespace security +} // of namespace security -/************************************************************ - End of Comment class body - ************************************************************/ +#endif // SECURITY_SECURITY_VALUE_H diff --git a/src/plugins/security/model/BooleanElement.cpp b/src/plugins/security/model/securityvaluelist.h similarity index 66% rename from src/plugins/security/model/BooleanElement.cpp rename to src/plugins/security/model/securityvaluelist.h index 7c8d904f4..9b49f3401 100644 --- a/src/plugins/security/model/BooleanElement.cpp +++ b/src/plugins/security/model/securityvaluelist.h @@ -17,23 +17,37 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ** ***********************************************************************************************************************/ -#define security_BooleanElement_BODY -/************************************************************ - BooleanElement class body - ************************************************************/ +#ifndef SECURITY_SECURITY_VALUE_LIST_H +#define SECURITY_SECURITY_VALUE_LIST_H -// include associated header file -#include "security/BooleanElement.h" +#include "security.h" -// Derived includes directives +#include "securityvalue.h" + +#include +#include namespace security { -// static attributes (if any) +/*! + \class SecurityValueList + * \brief The SecurityValueList class stores list of values. + */ +class SecurityValueList +{ +public: + /*! + * \brief item List of items. + */ + std::vector items{}; + + /*! + * \brief defaultString + */ + std::string defaultString{}; +}; -}// of namespace security +} // of namespace security -/************************************************************ - End of BooleanElement class body - ************************************************************/ +#endif // SECURITY_SECURITY_VALUE_LIST_H diff --git a/src/plugins/security/model/textbox.h b/src/plugins/security/model/textbox.h new file mode 100644 index 000000000..3733ba9e3 --- /dev/null +++ b/src/plugins/security/model/textbox.h @@ -0,0 +1,54 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_TEXTBOX_H +#define SECURITY_TEXTBOX_H + +#include "security.h" + +#include "dataelementcontent.h" + +#include + +namespace security +{ + +/** + * \class TextBox + * \brief Represents a textbox display element with default entry. + */ +class TextBox: public DataElementContent +{ +public: + + /*! + * \brief label + */ + std::string label{}; + + /*! + * \brief defaultValue + */ + std::string defaultValue{}; +}; + +} // of namespace security + +#endif // SECURITY_TEXTBOX_H diff --git a/src/plugins/security/model/textelement.h b/src/plugins/security/model/textelement.h new file mode 100644 index 000000000..f844b9b7d --- /dev/null +++ b/src/plugins/security/model/textelement.h @@ -0,0 +1,59 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_TEXT_ELEMENT_H +#define SECURITY_TEXT_ELEMENT_H + +#include "security.h" + +#include "securityelement.h" + +namespace security +{ + +/** + * \class TextElement + * \brief Describes a single line text element in a policy. + * + * \ingroup model + */ +class TextElement: public SecurityElement +{ +public: + + /*! + * \brief required If this element is required. + */ + bool required { false }; + + /*! + * \brief maxLength Maximum length of text element. If text exceeds maximum length it will be truncated. + */ + uint32_t maxLength { 1024 }; + + /*! + * \brief soft If previous value should be replaced. + */ + bool soft { false }; +}; + +} // of namespace security + +#endif // SECURITY_TEXT_ELEMENT_H From b74f992ecc7787519674f0ca8211dd4c96b19dd9 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 3 Aug 2023 16:37:36 +0400 Subject: [PATCH 08/60] chore: move files --- src/plugins/security/CMakeLists.txt | 70 +++++++++---------- .../model/{ => presentation}/category.h | 2 - .../model/{ => presentation}/checkbox.h | 2 - .../model/{ => presentation}/combobox.h | 2 - .../model/{ => presentation}/comment.h | 2 - .../model/{ => presentation}/dataelement.h | 2 - .../{ => presentation}/dataelementcontent.h | 2 - .../model/{ => presentation}/decimaltextbox.h | 2 - .../model/{ => presentation}/dropdownlist.h | 2 - .../model/{ => presentation}/groupbox.h | 2 - .../{ => presentation}/ldapsearchdialog.h | 2 - .../model/{ => presentation}/listbox.h | 2 - .../{ => presentation}/longdecimaltextbox.h | 2 - .../model/{ => presentation}/multitextbox.h | 2 - .../{ => presentation}/presentationelements.h | 2 - .../model/{ => presentation}/radiobutton.h | 2 - .../securitydescriptoreditor.h | 2 - .../{ => presentation}/securitypresentation.h | 2 - .../model/{ => presentation}/textbox.h | 2 - .../model/{ => sdmx}/booleanelement.h | 0 .../model/{ => sdmx}/decimalelement.h | 0 .../security/model/{ => sdmx}/decimaltype.h | 0 .../model/{ => sdmx}/enumerationelement.h | 0 .../security/model/{ => sdmx}/listelement.h | 0 .../model/{ => sdmx}/longdecimalelement.h | 0 .../model/{ => sdmx}/longdecimaltype.h | 0 .../model/{ => sdmx}/multitextelement.h | 0 .../security/model/{ => sdmx}/security.h | 0 .../model/{ => sdmx}/securitydefinition.h | 0 .../model/{ => sdmx}/securitydefinitions.h | 0 .../model/{ => sdmx}/securityelement.h | 0 .../model/{ => sdmx}/securityelements.h | 0 .../security/model/{ => sdmx}/securityitem.h | 0 .../security/model/{ => sdmx}/securityvalue.h | 0 .../model/{ => sdmx}/securityvaluelist.h | 0 .../security/model/{ => sdmx}/textelement.h | 0 36 files changed, 35 insertions(+), 71 deletions(-) rename src/plugins/security/model/{ => presentation}/category.h (98%) rename src/plugins/security/model/{ => presentation}/checkbox.h (98%) rename src/plugins/security/model/{ => presentation}/combobox.h (98%) rename src/plugins/security/model/{ => presentation}/comment.h (98%) rename src/plugins/security/model/{ => presentation}/dataelement.h (98%) rename src/plugins/security/model/{ => presentation}/dataelementcontent.h (98%) rename src/plugins/security/model/{ => presentation}/decimaltextbox.h (98%) rename src/plugins/security/model/{ => presentation}/dropdownlist.h (98%) rename src/plugins/security/model/{ => presentation}/groupbox.h (98%) rename src/plugins/security/model/{ => presentation}/ldapsearchdialog.h (98%) rename src/plugins/security/model/{ => presentation}/listbox.h (98%) rename src/plugins/security/model/{ => presentation}/longdecimaltextbox.h (98%) rename src/plugins/security/model/{ => presentation}/multitextbox.h (98%) rename src/plugins/security/model/{ => presentation}/presentationelements.h (99%) rename src/plugins/security/model/{ => presentation}/radiobutton.h (98%) rename src/plugins/security/model/{ => presentation}/securitydescriptoreditor.h (98%) rename src/plugins/security/model/{ => presentation}/securitypresentation.h (98%) rename src/plugins/security/model/{ => presentation}/textbox.h (98%) rename src/plugins/security/model/{ => sdmx}/booleanelement.h (100%) rename src/plugins/security/model/{ => sdmx}/decimalelement.h (100%) rename src/plugins/security/model/{ => sdmx}/decimaltype.h (100%) rename src/plugins/security/model/{ => sdmx}/enumerationelement.h (100%) rename src/plugins/security/model/{ => sdmx}/listelement.h (100%) rename src/plugins/security/model/{ => sdmx}/longdecimalelement.h (100%) rename src/plugins/security/model/{ => sdmx}/longdecimaltype.h (100%) rename src/plugins/security/model/{ => sdmx}/multitextelement.h (100%) rename src/plugins/security/model/{ => sdmx}/security.h (100%) rename src/plugins/security/model/{ => sdmx}/securitydefinition.h (100%) rename src/plugins/security/model/{ => sdmx}/securitydefinitions.h (100%) rename src/plugins/security/model/{ => sdmx}/securityelement.h (100%) rename src/plugins/security/model/{ => sdmx}/securityelements.h (100%) rename src/plugins/security/model/{ => sdmx}/securityitem.h (100%) rename src/plugins/security/model/{ => sdmx}/securityvalue.h (100%) rename src/plugins/security/model/{ => sdmx}/securityvaluelist.h (100%) rename src/plugins/security/model/{ => sdmx}/textelement.h (100%) diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt index 48ef74fa4..dd001d940 100644 --- a/src/plugins/security/CMakeLists.txt +++ b/src/plugins/security/CMakeLists.txt @@ -15,41 +15,41 @@ include_directories(${CMAKE_SOURCE_DIR}/src) add_subdirectory(schema) set(HEADERS - model/booleanelement.h - model/category.h - model/checkbox.h - model/combobox.h - model/comment.h - model/dataelementcontent.h - model/dataelement.h - model/decimalelement.h - model/decimaltextbox.h - model/decimaltype.h - model/dropdownlist.h - model/enumerationelement.h - model/groupbox.h - model/ldapsearchdialog.h - model/listbox.h - model/listelement.h - model/longdecimalelement.h - model/longdecimaltextbox.h - model/longdecimaltype.h - model/multitextbox.h - model/multitextelement.h - model/presentationelements.h - model/radiobutton.h - model/security.h - model/securitydefinition.h - model/securitydefinitions.h - model/securitydescriptoreditor.h - model/securityelement.h - model/securityelements.h - model/securityitem.h - model/securitypresentation.h - model/securityvalue.h - model/securityvaluelist.h - model/textbox.h - model/textelement.h + model/presentation/category.h + model/presentation/checkbox.h + model/presentation/combobox.h + model/presentation/comment.h + model/presentation/dataelementcontent.h + model/presentation/dataelement.h + model/presentation/decimaltextbox.h + model/presentation/dropdownlist.h + model/presentation/groupbox.h + model/presentation/ldapsearchdialog.h + model/presentation/listbox.h + model/presentation/longdecimaltextbox.h + model/presentation/multitextbox.h + model/presentation/presentationelements.h + model/presentation/radiobutton.h + model/presentation/securitydescriptoreditor.h + model/presentation/securitypresentation.h + model/presentation/textbox.h + model/sdmx/booleanelement.h + model/sdmx/decimalelement.h + model/sdmx/decimaltype.h + model/sdmx/enumerationelement.h + model/sdmx/listelement.h + model/sdmx/longdecimalelement.h + model/sdmx/longdecimaltype.h + model/sdmx/multitextelement.h + model/sdmx/securitydefinition.h + model/sdmx/securitydefinitions.h + model/sdmx/securityelement.h + model/sdmx/securityelements.h + model/sdmx/security.h + model/sdmx/securityitem.h + model/sdmx/securityvalue.h + model/sdmx/securityvaluelist.h + model/sdmx/textelement.h ) set(SOURCES diff --git a/src/plugins/security/model/category.h b/src/plugins/security/model/presentation/category.h similarity index 98% rename from src/plugins/security/model/category.h rename to src/plugins/security/model/presentation/category.h index 9a42883d8..dfea87610 100644 --- a/src/plugins/security/model/category.h +++ b/src/plugins/security/model/presentation/category.h @@ -21,8 +21,6 @@ #ifndef SECURITY_CATEGORY_H #define SECURITY_CATEGORY_H -#include "security.h" - #include #include diff --git a/src/plugins/security/model/checkbox.h b/src/plugins/security/model/presentation/checkbox.h similarity index 98% rename from src/plugins/security/model/checkbox.h rename to src/plugins/security/model/presentation/checkbox.h index 3e939c2b0..43e4f429e 100644 --- a/src/plugins/security/model/checkbox.h +++ b/src/plugins/security/model/presentation/checkbox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_CHECKBOX_H #define SECURITY_CHECKBOX_H -#include "security.h" - #include "dataelementcontent.h" namespace security diff --git a/src/plugins/security/model/combobox.h b/src/plugins/security/model/presentation/combobox.h similarity index 98% rename from src/plugins/security/model/combobox.h rename to src/plugins/security/model/presentation/combobox.h index 1f5ab558a..d7f54ddde 100644 --- a/src/plugins/security/model/combobox.h +++ b/src/plugins/security/model/presentation/combobox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_COMBOBOX_H #define SECURITY_COMBOBOX_H -#include "security.h" - #include "dataelementcontent.h" #include diff --git a/src/plugins/security/model/comment.h b/src/plugins/security/model/presentation/comment.h similarity index 98% rename from src/plugins/security/model/comment.h rename to src/plugins/security/model/presentation/comment.h index 56164317f..c7c165b28 100644 --- a/src/plugins/security/model/comment.h +++ b/src/plugins/security/model/presentation/comment.h @@ -21,8 +21,6 @@ #ifndef SECURITY_COMMENT_H #define SECURITY_COMMENT_H -#include "security.h" - #include "dataelement.h" #include diff --git a/src/plugins/security/model/dataelement.h b/src/plugins/security/model/presentation/dataelement.h similarity index 98% rename from src/plugins/security/model/dataelement.h rename to src/plugins/security/model/presentation/dataelement.h index ebff6bfd5..0f02f7bfe 100644 --- a/src/plugins/security/model/dataelement.h +++ b/src/plugins/security/model/presentation/dataelement.h @@ -21,8 +21,6 @@ #ifndef SECURITY_DATA_ELEMENT_H #define SECURITY_DATA_ELEMENT_H -#include "security.h" - #include namespace security diff --git a/src/plugins/security/model/dataelementcontent.h b/src/plugins/security/model/presentation/dataelementcontent.h similarity index 98% rename from src/plugins/security/model/dataelementcontent.h rename to src/plugins/security/model/presentation/dataelementcontent.h index 4bfec1d78..a3d6fe803 100644 --- a/src/plugins/security/model/dataelementcontent.h +++ b/src/plugins/security/model/presentation/dataelementcontent.h @@ -21,8 +21,6 @@ #ifndef SECURITY_DATA_ELEMENT_CONTENT_H #define SECURITY_DATA_ELEMENT_CONTENT_H -#include "security.h" - #include namespace security diff --git a/src/plugins/security/model/decimaltextbox.h b/src/plugins/security/model/presentation/decimaltextbox.h similarity index 98% rename from src/plugins/security/model/decimaltextbox.h rename to src/plugins/security/model/presentation/decimaltextbox.h index 8c1f01ab9..3c56c3c62 100644 --- a/src/plugins/security/model/decimaltextbox.h +++ b/src/plugins/security/model/presentation/decimaltextbox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_DECIMAL_TEXTBOX_H #define SECURITY_DECIMAL_TEXTBOX_H -#include "security.h" - #include "dataelementcontent.h" namespace security diff --git a/src/plugins/security/model/dropdownlist.h b/src/plugins/security/model/presentation/dropdownlist.h similarity index 98% rename from src/plugins/security/model/dropdownlist.h rename to src/plugins/security/model/presentation/dropdownlist.h index f4c421668..e1b34610e 100644 --- a/src/plugins/security/model/dropdownlist.h +++ b/src/plugins/security/model/presentation/dropdownlist.h @@ -21,8 +21,6 @@ #ifndef SECURITY_DROPDOWNLIST_H #define SECURITY_DROPDOWNLIST_H -#include "security.h" - #include "dataelementcontent.h" namespace security diff --git a/src/plugins/security/model/groupbox.h b/src/plugins/security/model/presentation/groupbox.h similarity index 98% rename from src/plugins/security/model/groupbox.h rename to src/plugins/security/model/presentation/groupbox.h index a0c4de535..d797882f5 100644 --- a/src/plugins/security/model/groupbox.h +++ b/src/plugins/security/model/presentation/groupbox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_GROUPBOX_H #define SECURITY_GROUPBOX_H -#include "security.h" - #include "dataelementcontent.h" #include "presentationelements.h" diff --git a/src/plugins/security/model/ldapsearchdialog.h b/src/plugins/security/model/presentation/ldapsearchdialog.h similarity index 98% rename from src/plugins/security/model/ldapsearchdialog.h rename to src/plugins/security/model/presentation/ldapsearchdialog.h index 328d157c4..e952f4bb7 100644 --- a/src/plugins/security/model/ldapsearchdialog.h +++ b/src/plugins/security/model/presentation/ldapsearchdialog.h @@ -21,8 +21,6 @@ #ifndef SECURITY_LDAP_SEARCH_DIALOG_H #define SECURITY_LDAP_SEARCH_DIALOG_H -#include "security.h" - #include "dataelementcontent.h" #include diff --git a/src/plugins/security/model/listbox.h b/src/plugins/security/model/presentation/listbox.h similarity index 98% rename from src/plugins/security/model/listbox.h rename to src/plugins/security/model/presentation/listbox.h index 333a3dbe4..11de70fa2 100644 --- a/src/plugins/security/model/listbox.h +++ b/src/plugins/security/model/presentation/listbox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_LISTBOX_H #define SECURITY_LISTBOX_H -#include "security.h" - #include "dataelementcontent.h" namespace security diff --git a/src/plugins/security/model/longdecimaltextbox.h b/src/plugins/security/model/presentation/longdecimaltextbox.h similarity index 98% rename from src/plugins/security/model/longdecimaltextbox.h rename to src/plugins/security/model/presentation/longdecimaltextbox.h index 030871a30..a329b750c 100644 --- a/src/plugins/security/model/longdecimaltextbox.h +++ b/src/plugins/security/model/presentation/longdecimaltextbox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_LONG_DECIMAL_TEXTBOX_H #define SECURITY_LONG_DECIMAL_TEXTBOX_H -#include "security.h" - #include "dataelementcontent.h" namespace security { diff --git a/src/plugins/security/model/multitextbox.h b/src/plugins/security/model/presentation/multitextbox.h similarity index 98% rename from src/plugins/security/model/multitextbox.h rename to src/plugins/security/model/presentation/multitextbox.h index 77b636d86..6836accc0 100644 --- a/src/plugins/security/model/multitextbox.h +++ b/src/plugins/security/model/presentation/multitextbox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_MULTITEXTBOX_H #define SECURITY_MULTITEXTBOX_H -#include "security.h" - #include "dataelementcontent.h" namespace security diff --git a/src/plugins/security/model/presentationelements.h b/src/plugins/security/model/presentation/presentationelements.h similarity index 99% rename from src/plugins/security/model/presentationelements.h rename to src/plugins/security/model/presentation/presentationelements.h index d6cda3dd8..6c9ae979b 100644 --- a/src/plugins/security/model/presentationelements.h +++ b/src/plugins/security/model/presentation/presentationelements.h @@ -21,8 +21,6 @@ #ifndef SECURITY_PRESENTATION_ELEMENTS_H #define SECURITY_PRESENTATION_ELEMENTS_H -#include "security.h" - #include "checkbox.h" #include "combobox.h" #include "comment.h" diff --git a/src/plugins/security/model/radiobutton.h b/src/plugins/security/model/presentation/radiobutton.h similarity index 98% rename from src/plugins/security/model/radiobutton.h rename to src/plugins/security/model/presentation/radiobutton.h index 0a74803f3..fa20ac3f4 100644 --- a/src/plugins/security/model/radiobutton.h +++ b/src/plugins/security/model/presentation/radiobutton.h @@ -21,8 +21,6 @@ #ifndef SECURITY_RADIO_BUTTON_H #define SECURITY_RADIO_BUTTON_H -#include "security.h" - #include "dataelement.h" namespace security diff --git a/src/plugins/security/model/securitydescriptoreditor.h b/src/plugins/security/model/presentation/securitydescriptoreditor.h similarity index 98% rename from src/plugins/security/model/securitydescriptoreditor.h rename to src/plugins/security/model/presentation/securitydescriptoreditor.h index ae973d672..de86cf75d 100644 --- a/src/plugins/security/model/securitydescriptoreditor.h +++ b/src/plugins/security/model/presentation/securitydescriptoreditor.h @@ -21,8 +21,6 @@ #ifndef SECURITY_SECURITY_DESCRIPTOR_EDITOR_H #define SECURITY_SECURITY_DESCRIPTOR_EDITOR_H -#include "security.h" - #include "dataelement.h" namespace security diff --git a/src/plugins/security/model/securitypresentation.h b/src/plugins/security/model/presentation/securitypresentation.h similarity index 98% rename from src/plugins/security/model/securitypresentation.h rename to src/plugins/security/model/presentation/securitypresentation.h index f5264cd84..0b90c6dd9 100644 --- a/src/plugins/security/model/securitypresentation.h +++ b/src/plugins/security/model/presentation/securitypresentation.h @@ -21,8 +21,6 @@ #ifndef SECURITY_SECURITY_PRESENTATION_H #define SECURITY_SECURITY_PRESENTATION_H -#include "security.h" - #include "presentationelements.h" #include diff --git a/src/plugins/security/model/textbox.h b/src/plugins/security/model/presentation/textbox.h similarity index 98% rename from src/plugins/security/model/textbox.h rename to src/plugins/security/model/presentation/textbox.h index 3733ba9e3..8538d4d29 100644 --- a/src/plugins/security/model/textbox.h +++ b/src/plugins/security/model/presentation/textbox.h @@ -21,8 +21,6 @@ #ifndef SECURITY_TEXTBOX_H #define SECURITY_TEXTBOX_H -#include "security.h" - #include "dataelementcontent.h" #include diff --git a/src/plugins/security/model/booleanelement.h b/src/plugins/security/model/sdmx/booleanelement.h similarity index 100% rename from src/plugins/security/model/booleanelement.h rename to src/plugins/security/model/sdmx/booleanelement.h diff --git a/src/plugins/security/model/decimalelement.h b/src/plugins/security/model/sdmx/decimalelement.h similarity index 100% rename from src/plugins/security/model/decimalelement.h rename to src/plugins/security/model/sdmx/decimalelement.h diff --git a/src/plugins/security/model/decimaltype.h b/src/plugins/security/model/sdmx/decimaltype.h similarity index 100% rename from src/plugins/security/model/decimaltype.h rename to src/plugins/security/model/sdmx/decimaltype.h diff --git a/src/plugins/security/model/enumerationelement.h b/src/plugins/security/model/sdmx/enumerationelement.h similarity index 100% rename from src/plugins/security/model/enumerationelement.h rename to src/plugins/security/model/sdmx/enumerationelement.h diff --git a/src/plugins/security/model/listelement.h b/src/plugins/security/model/sdmx/listelement.h similarity index 100% rename from src/plugins/security/model/listelement.h rename to src/plugins/security/model/sdmx/listelement.h diff --git a/src/plugins/security/model/longdecimalelement.h b/src/plugins/security/model/sdmx/longdecimalelement.h similarity index 100% rename from src/plugins/security/model/longdecimalelement.h rename to src/plugins/security/model/sdmx/longdecimalelement.h diff --git a/src/plugins/security/model/longdecimaltype.h b/src/plugins/security/model/sdmx/longdecimaltype.h similarity index 100% rename from src/plugins/security/model/longdecimaltype.h rename to src/plugins/security/model/sdmx/longdecimaltype.h diff --git a/src/plugins/security/model/multitextelement.h b/src/plugins/security/model/sdmx/multitextelement.h similarity index 100% rename from src/plugins/security/model/multitextelement.h rename to src/plugins/security/model/sdmx/multitextelement.h diff --git a/src/plugins/security/model/security.h b/src/plugins/security/model/sdmx/security.h similarity index 100% rename from src/plugins/security/model/security.h rename to src/plugins/security/model/sdmx/security.h diff --git a/src/plugins/security/model/securitydefinition.h b/src/plugins/security/model/sdmx/securitydefinition.h similarity index 100% rename from src/plugins/security/model/securitydefinition.h rename to src/plugins/security/model/sdmx/securitydefinition.h diff --git a/src/plugins/security/model/securitydefinitions.h b/src/plugins/security/model/sdmx/securitydefinitions.h similarity index 100% rename from src/plugins/security/model/securitydefinitions.h rename to src/plugins/security/model/sdmx/securitydefinitions.h diff --git a/src/plugins/security/model/securityelement.h b/src/plugins/security/model/sdmx/securityelement.h similarity index 100% rename from src/plugins/security/model/securityelement.h rename to src/plugins/security/model/sdmx/securityelement.h diff --git a/src/plugins/security/model/securityelements.h b/src/plugins/security/model/sdmx/securityelements.h similarity index 100% rename from src/plugins/security/model/securityelements.h rename to src/plugins/security/model/sdmx/securityelements.h diff --git a/src/plugins/security/model/securityitem.h b/src/plugins/security/model/sdmx/securityitem.h similarity index 100% rename from src/plugins/security/model/securityitem.h rename to src/plugins/security/model/sdmx/securityitem.h diff --git a/src/plugins/security/model/securityvalue.h b/src/plugins/security/model/sdmx/securityvalue.h similarity index 100% rename from src/plugins/security/model/securityvalue.h rename to src/plugins/security/model/sdmx/securityvalue.h diff --git a/src/plugins/security/model/securityvaluelist.h b/src/plugins/security/model/sdmx/securityvaluelist.h similarity index 100% rename from src/plugins/security/model/securityvaluelist.h rename to src/plugins/security/model/sdmx/securityvaluelist.h diff --git a/src/plugins/security/model/textelement.h b/src/plugins/security/model/sdmx/textelement.h similarity index 100% rename from src/plugins/security/model/textelement.h rename to src/plugins/security/model/sdmx/textelement.h From 1767003a5f4442859b956817d517512d508d923e Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 3 Aug 2023 17:09:22 +0400 Subject: [PATCH 09/60] feat: add ui elements placeholder --- src/plugins/security/CMakeLists.txt | 7 ++ .../security/model/ui/presentationbuilder.cpp | 39 +++++++++++ .../security/model/ui/presentationbuilder.h | 70 +++++++++++++++++++ .../security/model/ui/securityproxymodel.cpp | 48 +++++++++++++ .../security/model/ui/securityproxymodel.h | 52 ++++++++++++++ .../security/model/ui/securitywidget.cpp | 39 +++++++++++ .../security/model/ui/securitywidget.h | 54 ++++++++++++++ .../security/model/ui/securitywidget.ui | 19 +++++ 8 files changed, 328 insertions(+) create mode 100644 src/plugins/security/model/ui/presentationbuilder.cpp create mode 100644 src/plugins/security/model/ui/presentationbuilder.h create mode 100644 src/plugins/security/model/ui/securityproxymodel.cpp create mode 100644 src/plugins/security/model/ui/securityproxymodel.h create mode 100644 src/plugins/security/model/ui/securitywidget.cpp create mode 100644 src/plugins/security/model/ui/securitywidget.h create mode 100644 src/plugins/security/model/ui/securitywidget.ui diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt index dd001d940..6d192960d 100644 --- a/src/plugins/security/CMakeLists.txt +++ b/src/plugins/security/CMakeLists.txt @@ -50,12 +50,19 @@ set(HEADERS model/sdmx/securityvalue.h model/sdmx/securityvaluelist.h model/sdmx/textelement.h + model/ui/presentationbuilder.h + model/ui/securityproxymodel.h + model/ui/securitywidget.h ) set(SOURCES + model/ui/presentationbuilder.cpp + model/ui/securityproxymodel.cpp + model/ui/securitywidget.cpp ) set(UI_FORMS + model/ui/securitywidget.ui ) set(PLUGIN_HEADERS diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp new file mode 100644 index 000000000..83007a3a6 --- /dev/null +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "presentationbuilder.h" + +namespace security +{ + +class PresentationBuilderPrivate +{ +public: +}; + +PresentationBuilderPrivate* PresentationBuilder::d = new PresentationBuilderPrivate(); + +QVBoxLayout *PresentationBuilder::build(const PresentationBuilderParams ¶ms) +{ + Q_UNUSED(params); + return nullptr; +} + +} diff --git a/src/plugins/security/model/ui/presentationbuilder.h b/src/plugins/security/model/ui/presentationbuilder.h new file mode 100644 index 000000000..d641dccba --- /dev/null +++ b/src/plugins/security/model/ui/presentationbuilder.h @@ -0,0 +1,70 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef GPUI_SECURITY_PRESENTATION_BUILDER_H +#define GPUI_SECURITY_PRESENTATION_BUILDER_H + +#include +#include + +class QVBoxLayout; + +namespace security +{ + class SecurityPresentation; + class SecurityDefinition; +} + +namespace security +{ + struct PresentationBuilderParams final + { + const security::SecurityPresentation& presentation; + const security::SecurityDefinition& security; + void* source; // TODO: Implement. + QPushButton& saveButton; + bool& dataChanged; + bool& stateEnabled; + }; + + class PresentationBuilderPrivate; + + /*! + * \class PresentationBuilder + * \brief The PresentationBuilder class + * + * \ingroup gui + */ + class PresentationBuilder + { + public: + /*! + * @brief build + * @param presentation Defines a reference to policy representation. + * @return nullptr if build failed, and widget associated with policy otherwise. + */ + static QVBoxLayout *build(const PresentationBuilderParams& params); + + private: + static PresentationBuilderPrivate* d; + }; +} + +#endif // GPUI_SECURITY_PRESENTATION_BUILDER_H diff --git a/src/plugins/security/model/ui/securityproxymodel.cpp b/src/plugins/security/model/ui/securityproxymodel.cpp new file mode 100644 index 000000000..1f8941a25 --- /dev/null +++ b/src/plugins/security/model/ui/securityproxymodel.cpp @@ -0,0 +1,48 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "securityproxymodel.h" + +namespace security +{ +class SecurityProxyModelPrivate +{ +public: +}; + +SecurityProxyModel::SecurityProxyModel() +{ + +} + +SecurityProxyModel::~SecurityProxyModel() +{ + +} + +QVariant SecurityProxyModel::data(const QModelIndex &proxyIndex, int role) const +{ + Q_UNUSED(proxyIndex); + Q_UNUSED(role); + + return QVariant(); +} + +} // namespace security diff --git a/src/plugins/security/model/ui/securityproxymodel.h b/src/plugins/security/model/ui/securityproxymodel.h new file mode 100644 index 000000000..2309aa627 --- /dev/null +++ b/src/plugins/security/model/ui/securityproxymodel.h @@ -0,0 +1,52 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef GPUI_SECURITY_PROXY_MODEL_H +#define GPUI_SECURITY_PROXY_MODEL_H + +#include + +namespace security +{ +class SecurityProxyModelPrivate; + +class SecurityProxyModel : public QIdentityProxyModel +{ + Q_OBJECT + +public: + SecurityProxyModel(); + ~SecurityProxyModel(); + + QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override; + +private: + SecurityProxyModelPrivate *d = nullptr; + +private: + SecurityProxyModel(const SecurityProxyModel &) = delete; // copy ctor + SecurityProxyModel(SecurityProxyModel &&) = delete; // move ctor + SecurityProxyModel &operator=(const SecurityProxyModel &) = delete; // copy assignment + SecurityProxyModel &operator=(SecurityProxyModel &&) = delete; // move assignment +}; + +} // namespace security + +#endif // GPUI_SECURITY_PROXY_MODEL_H diff --git a/src/plugins/security/model/ui/securitywidget.cpp b/src/plugins/security/model/ui/securitywidget.cpp new file mode 100644 index 000000000..9fd5715fd --- /dev/null +++ b/src/plugins/security/model/ui/securitywidget.cpp @@ -0,0 +1,39 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "securitywidget.h" +#include "ui_securitywidget.h" + +namespace security +{ + +SecurityWidget::SecurityWidget(QWidget *parent) + : QWidget(parent) + , ui(new Ui::SecurityWidget()) +{ + ui->setupUi(this); +} + +SecurityWidget::~SecurityWidget() +{ + delete ui; +} + +} diff --git a/src/plugins/security/model/ui/securitywidget.h b/src/plugins/security/model/ui/securitywidget.h new file mode 100644 index 000000000..8df620cc0 --- /dev/null +++ b/src/plugins/security/model/ui/securitywidget.h @@ -0,0 +1,54 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef SECURITY_SECURITY_WIDGET_H +#define SECURITY_SECURITY_WIDGET_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class SecurityWidget; } +QT_END_NAMESPACE + +namespace security +{ + +class SecurityWidget : public QWidget +{ +public: + Q_OBJECT + +public: + explicit SecurityWidget(QWidget* parent = nullptr); + ~SecurityWidget(); + +private: + SecurityWidget(const SecurityWidget&) = delete; // copy ctor + SecurityWidget(SecurityWidget&&) = delete; // move ctor + SecurityWidget& operator=(const SecurityWidget&) = delete; // copy assignment + SecurityWidget& operator=(SecurityWidget&&) = delete; // move assignment + +private: + Ui::SecurityWidget *ui {nullptr}; +}; + +} + +#endif // SECURITY_SECURITY_WIDGET_H diff --git a/src/plugins/security/model/ui/securitywidget.ui b/src/plugins/security/model/ui/securitywidget.ui new file mode 100644 index 000000000..283f1c246 --- /dev/null +++ b/src/plugins/security/model/ui/securitywidget.ui @@ -0,0 +1,19 @@ + + + SecurityWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + From 379d0c82a51591ea2c91625cd751556a58987217 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 4 Aug 2023 16:48:16 +0400 Subject: [PATCH 10/60] feat: add security test data --- .../user_rights_assignment/security.sdml | 22 +++++++++++++++++++ .../user_rights_assignment/security.sdmx | 16 ++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/data/security/user_rights_assignment/security.sdml create mode 100644 tests/data/security/user_rights_assignment/security.sdmx diff --git a/tests/data/security/user_rights_assignment/security.sdml b/tests/data/security/user_rights_assignment/security.sdml new file mode 100644 index 000000000..2c12ec4ab --- /dev/null +++ b/tests/data/security/user_rights_assignment/security.sdml @@ -0,0 +1,22 @@ + + + + + Deny log on as a batch job + +Deny log on as a service + +This security setting determines which service accounts are prevented from registering a process as a service. This policy setting supersedes the Log on as a service policy setting if an account is subject to both policies. + +Note: This security setting does not apply to the System, Local Service, or Network Service accounts. + +Default: None. + + + + + + + + + \ No newline at end of file diff --git a/tests/data/security/user_rights_assignment/security.sdmx b/tests/data/security/user_rights_assignment/security.sdmx new file mode 100644 index 000000000..895a6baee --- /dev/null +++ b/tests/data/security/user_rights_assignment/security.sdmx @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + From 51643b4be5273f80c2d43a6867c48488aefa2155 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:29:32 +0400 Subject: [PATCH 11/60] fix: security definitions --- src/plugins/security/model/sdmx/securitydefinition.h | 2 +- src/plugins/security/model/sdmx/securitydefinitions.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/security/model/sdmx/securitydefinition.h b/src/plugins/security/model/sdmx/securitydefinition.h index 8f00ce3e9..2cd53b46d 100644 --- a/src/plugins/security/model/sdmx/securitydefinition.h +++ b/src/plugins/security/model/sdmx/securitydefinition.h @@ -79,7 +79,7 @@ class SecurityDefinition /*! * \brief elements */ - std::unique_ptr elements {}; + std::vector> elements {}; /*! * \brief enabledValue diff --git a/src/plugins/security/model/sdmx/securitydefinitions.h b/src/plugins/security/model/sdmx/securitydefinitions.h index 9ca705fc9..adcc7b456 100644 --- a/src/plugins/security/model/sdmx/securitydefinitions.h +++ b/src/plugins/security/model/sdmx/securitydefinitions.h @@ -52,7 +52,7 @@ class SecurityDefinitions /*! * \brief security */ - std::vector > security {}; + std::vector > security {}; }; } // of namespace security From f19e65e364e40877f6cbfc96881c1cfa891698b3 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:30:08 +0400 Subject: [PATCH 12/60] feat: add sdmx adapters implementation --- src/plugins/sdmx/sdmxformat.cpp | 301 +++++++++++++++++++++++++++++++- 1 file changed, 298 insertions(+), 3 deletions(-) diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index 7cad398a0..8a96a3751 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -20,9 +20,296 @@ #include "sdmxformat.h" +#include "../security/schema/security.h" +#include "../security/model/sdmx/securitydefinitions.h" + +#include "../common/exceptionhandler.h" + namespace gpui { +template +inline void assign_if_exists(TOutput &output, const TInput &input) +{ + if (input.present()) + { + output = input.get(); + } +} + +template +void adapter_base(security::SecurityElement *output, const ElementType &input) +{ + output->refId = input.refId(); + + if (input.clientExtension().present()) + { + output->clientExtension = QUuid(input.clientExtension().get().c_str()); + } + +// assign_if_exists(output->propertyName, input.propertyName()); +} + +template +void decimal_adapter_base(TOutput *output, const TInput &input) +{ + adapter_base(output, input); + +// output->maxValue = input.maxValue().value(); +// output->minValue = input.minValue(); + output->required = input.required(); + output->soft = input.soft(); + output->storeAsText = input.storeAsText(); + +// assign_if_exists(output->propertyName, input.propertyName()); +} + +template +void adapt_elements(const SequenceType &sequence, std::vector> &elements) +{ + for (const auto &adaptee : sequence) + { + auto adaptedElement = AdapterType::create(adaptee); + + elements.push_back(std::move(adaptedElement)); + } +} + +class XsdBooleanElementAdapter : public security::BooleanElement +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::BooleanElement BooleanElement; + +public: + XsdBooleanElementAdapter(const BooleanElement &element) + { + adapter_base(this, element); + + this->propertyName = element.valueName(); + } + + static std::unique_ptr create(const BooleanElement &element) + { + return std::make_unique(element); + } +}; + +class XsdDecimalElementAdapter : public security::DecimalElement +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::DecimalElement DecimalElement; + +public: + XsdDecimalElementAdapter(const DecimalElement &element) { decimal_adapter_base(this, element); } + + static std::unique_ptr create(const DecimalElement &element) + { + return std::make_unique(element); + } +}; + +class XsdEnumElementAdapter : public security::EnumerationElement +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::EnumerationElement EnumElement; + +public: + XsdEnumElementAdapter(const EnumElement &element) + { + adapter_base(this, element); + + this->propertyName = element.valueName(); + + this->required = element.required(); + +// for (auto &item : element.) +// { +// if (item.value().decimal().present()) +// { +// this->items.push_back( +// std::make_pair(item.displayName(), +// std::make_unique(item.value().decimal().get().value()))); +// } + +// if (item.value().longDecimal().present()) +// { +// this->items.push_back(std::make_pair(item.displayName(), +// std::make_unique( +// item.value().longDecimal().get().value()))); +// } + +// if (item.value().string().present()) +// { +// this->items.push_back( +// std::make_pair(item.displayName(), +// std::make_unique(item.value().string().get()))); +// } +// } + } + + static std::unique_ptr create(const EnumElement &element) + { + return std::make_unique(element); + } +}; + +class XsdListElementAdapter : public security::ListElement +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::ListElement ListElement; + +public: + XsdListElementAdapter(const ListElement &element) + { + adapter_base(this, element); + + assign_if_exists(this->valuePrefix, element.valuePrefix()); + + this->additive = element.additive(); + + this->expandable = element.expandable(); + + this->explicitValue = element.explicitValue(); + } + + static std::unique_ptr create(const ListElement &element) + { + return std::make_unique(element); + } +}; + +class XsdTextElementAdapter : public security::TextElement +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::TextElement TextElement; + +public: + XsdTextElementAdapter(const TextElement &element) + { + adapter_base(this, element); + + this->propertyName = element.valueName(); + + this->required = element.required(); + + this->maxLength = element.maxLength(); + +// this->expandable = element.expandable(); + + this->soft = element.soft(); + } + + static std::unique_ptr create(const TextElement &element) + { + return std::make_unique(element); + } +}; + +class XsdLongDecimalElementAdapter : public security::LongDecimalElement +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::LongDecimalElement LongDecimalElement; + +public: + XsdLongDecimalElementAdapter(const LongDecimalElement &element) { decimal_adapter_base(this, element); } + + static std::unique_ptr create(const LongDecimalElement &element) + { + return std::make_unique(element); + } +}; + +class XsdMultiTextElementAdapter : public security::MultiTextElement +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::MultiTextElement MultiTextElement; + +public: + XsdMultiTextElementAdapter(const MultiTextElement &element) + { + adapter_base(this, element); + + this->propertyName = element.valueName(); + } + + static std::unique_ptr create(const MultiTextElement &element) + { + return std::make_unique(element); + } +}; + +class XsdSecurityAdapter : public security::SecurityDefinition +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::SecurityDefinition SecurityDefinition; + +public: + XsdSecurityAdapter(const SecurityDefinition &definition) + : security::SecurityDefinition() + { + this->name = definition.name(); + this->displayName = definition.displayName(); + + assign_if_exists(this->explainText, definition.explainText()); + + if (definition.parentCategory().present()) + { + this->parentCategory = definition.parentCategory()->ref(); + } + + assign_if_exists(this->propertyName, definition.valueName()); + assign_if_exists(this->sectionName, definition.sectionName()); + } + + static std::shared_ptr create(const SecurityDefinition &element) + { + return std::make_shared(element); + } +}; + +class XsdSecurityDefinitionsAdapter : public security::SecurityDefinitions +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::SecurityDefinitions SecurityDefinitions; + +public: + XsdSecurityDefinitionsAdapter(const SecurityDefinitions &definitions) + : security::SecurityDefinitions() + { + this->revision = definitions.revision(); + this->schemaVersion = definitions.schemaVersion(); + + for (const auto securityElement : definitions.security()) + { + auto ourSecurity = XsdSecurityAdapter::create(securityElement); + + if (securityElement.elements().present()) + { + adapt_elements(securityElement.elements()->boolean(), ourSecurity->elements); + + adapt_elements(securityElement.elements()->decimal(), ourSecurity->elements); + + adapt_elements(securityElement.elements()->enum_(), ourSecurity->elements); + + adapt_elements(securityElement.elements()->text(), ourSecurity->elements); + + adapt_elements(securityElement.elements()->list(), ourSecurity->elements); + + adapt_elements(securityElement.elements()->longDecimal(), ourSecurity->elements); + + adapt_elements(securityElement.elements()->multiText(), ourSecurity->elements); + } + + this->security.push_back(ourSecurity); + } + } + + static std::shared_ptr create(const SecurityDefinitions &element) + { + return std::make_shared(element); + } +}; + SdmxFormat::SdmxFormat() : io::PolicyFileFormat("sdmx") { @@ -30,10 +317,18 @@ SdmxFormat::SdmxFormat() bool SdmxFormat::read(std::istream &input, io::PolicyResourcesFile *file) { - Q_UNUSED(input); - Q_UNUSED(file); + std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityDefinitions> securityDefinitions; + auto operation = [&]() { + securityDefinitions = GroupPolicy::SecurityDefinitions::SecurityDefinitions_(input, ::xsd::cxx::tree::flags::dont_validate); - return false; + auto security = XsdSecurityDefinitionsAdapter::create(*securityDefinitions); + +// file->add(security); TODO: Implement. + }; + + auto errorHandler = [&](const std::string &error) { this->setErrorString(error); }; + + return ExceptionHandler::handleOperation(operation, errorHandler); } bool SdmxFormat::write(std::ostream &output, io::PolicyResourcesFile *file) From 322dfa9c4e8e14280934ca9aa1086c1c3f784e53 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:36:27 +0400 Subject: [PATCH 13/60] feat: add sdml code --- src/plugins/sdml/sdmlformat.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index ab3c132d4..dfabac5c0 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -20,6 +20,10 @@ #include "sdmlformat.h" +#include "../security/schema/security.h" + +#include "../common/exceptionhandler.h" + namespace gpui { @@ -30,10 +34,20 @@ SdmlFormat::SdmlFormat() bool SdmlFormat::read(std::istream &input, io::PolicyResourcesFile *file) { - Q_UNUSED(input); - Q_UNUSED(file); + std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityDefinitions> securityDefinitions; + auto operation = [&]() { + std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityPresentation>policyDefinitionResources; +// = ::GroupPolicy::SecurityDefinitions::SecurityPresentation_(input, +// ::xsd::cxx::tree::flags::dont_validate +// | ::xsd::cxx::tree::flags::keep_dom +// | ::xsd::cxx::tree::flags::own_dom); - return false; +// file->add(XsdResourcesAdapter::create(*policyDefinitionResources)); + }; + + auto errorHandler = [&](const std::string &error) { this->setErrorString(error); }; + + return ExceptionHandler::handleOperation(operation, errorHandler); } bool SdmlFormat::write(std::ostream &output, io::PolicyResourcesFile *file) From d9868fe0943176cf596499a464d461318d5575df Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 7 Aug 2023 13:03:26 +0400 Subject: [PATCH 14/60] chore: add q_unused to file variable --- src/plugins/sdmx/sdmxformat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index 8a96a3751..0e6a7136e 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -317,8 +317,10 @@ SdmxFormat::SdmxFormat() bool SdmxFormat::read(std::istream &input, io::PolicyResourcesFile *file) { + Q_UNUSED(file); + std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityDefinitions> securityDefinitions; - auto operation = [&]() { + auto operation = [&]() noexcept { securityDefinitions = GroupPolicy::SecurityDefinitions::SecurityDefinitions_(input, ::xsd::cxx::tree::flags::dont_validate); auto security = XsdSecurityDefinitionsAdapter::create(*securityDefinitions); From 2493fc027fe72b6bdc5ca6a7fff8d9c55018cdd2 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:47:39 +0400 Subject: [PATCH 15/60] feat: update schema --- src/plugins/sdmx/sdmxformat.cpp | 27 +++++---- src/plugins/security/schema/security.xsd | 76 ++++++++++++------------ 2 files changed, 53 insertions(+), 50 deletions(-) mode change 100755 => 100644 src/plugins/security/schema/security.xsd diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index 0e6a7136e..0768577a5 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -47,7 +47,7 @@ void adapter_base(security::SecurityElement *output, const ElementType &input) output->clientExtension = QUuid(input.clientExtension().get().c_str()); } -// assign_if_exists(output->propertyName, input.propertyName()); + output->propertyName = input.propertyName(); } template @@ -55,13 +55,13 @@ void decimal_adapter_base(TOutput *output, const TInput &input) { adapter_base(output, input); -// output->maxValue = input.maxValue().value(); -// output->minValue = input.minValue(); + assign_if_exists(output->maxValue, input.maxValue()); + assign_if_exists(output->minValue, input.minValue()); output->required = input.required(); output->soft = input.soft(); output->storeAsText = input.storeAsText(); -// assign_if_exists(output->propertyName, input.propertyName()); + output->propertyName = input.propertyName(); } template @@ -85,7 +85,7 @@ class XsdBooleanElementAdapter : public security::BooleanElement { adapter_base(this, element); - this->propertyName = element.valueName(); + this->propertyName = element.propertyName(); } static std::unique_ptr create(const BooleanElement &element) @@ -118,7 +118,7 @@ class XsdEnumElementAdapter : public security::EnumerationElement { adapter_base(this, element); - this->propertyName = element.valueName(); + this->propertyName = element.propertyName(); this->required = element.required(); @@ -188,14 +188,12 @@ class XsdTextElementAdapter : public security::TextElement { adapter_base(this, element); - this->propertyName = element.valueName(); + this->propertyName = element.propertyName(); this->required = element.required(); this->maxLength = element.maxLength(); -// this->expandable = element.expandable(); - this->soft = element.soft(); } @@ -229,7 +227,7 @@ class XsdMultiTextElementAdapter : public security::MultiTextElement { adapter_base(this, element); - this->propertyName = element.valueName(); + this->propertyName = element.propertyName(); } static std::unique_ptr create(const MultiTextElement &element) @@ -257,8 +255,13 @@ class XsdSecurityAdapter : public security::SecurityDefinition this->parentCategory = definition.parentCategory()->ref(); } - assign_if_exists(this->propertyName, definition.valueName()); - assign_if_exists(this->sectionName, definition.sectionName()); + std::string propertyNameLocal{}; + std::string sectionNameLocal = definition.sectionName(); + + assign_if_exists(propertyNameLocal, definition.propertyName()); + + this->propertyName = std::make_unique(propertyNameLocal); + this->sectionName = std::make_unique(sectionNameLocal); } static std::shared_ptr create(const SecurityDefinition &element) diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd old mode 100755 new mode 100644 index d7ee393ac..a0ff2aad9 --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -7,7 +7,6 @@ - @@ -82,18 +81,18 @@ - - - - - - + + + + + + - + @@ -106,9 +105,6 @@ - - - A grouping of security definitions. @@ -116,12 +112,15 @@ - + + + + @@ -132,18 +131,18 @@ - + - - - - - - - + + + + + + + @@ -156,25 +155,25 @@ - + - - + + - + - + - + @@ -230,17 +229,17 @@ - - - - - - - - + + + + + + + + - - + + @@ -252,12 +251,13 @@ + - + @@ -318,7 +318,7 @@ - + Represents a security descriptor editor display element. From eb33abe7dc7f8013521c1ae0419c5a7d77639cd5 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:48:42 +0400 Subject: [PATCH 16/60] fix: update security definitions --- src/plugins/security/model/sdmx/securitydefinition.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/security/model/sdmx/securitydefinition.h b/src/plugins/security/model/sdmx/securitydefinition.h index 2cd53b46d..8474d0253 100644 --- a/src/plugins/security/model/sdmx/securitydefinition.h +++ b/src/plugins/security/model/sdmx/securitydefinition.h @@ -94,12 +94,12 @@ class SecurityDefinition /*! * \brief enabledList */ - std::unique_ptr enabledList; + std::unique_ptr enabledList{}; /*! * \brief disabledList */ - std::unique_ptr disabledList; + std::unique_ptr disabledList{}; }; } // of namespace security From a9035e99d7af78d7a7e1a0e78703f7aba5e2fb3f Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 7 Aug 2023 16:16:51 +0400 Subject: [PATCH 17/60] feat: add basefile --- src/io/CMakeLists.txt | 2 + src/io/basefile.cpp | 114 ++++++++++++++++++++++++++++++++++++++++++ src/io/basefile.h | 64 ++++++++++++++++++++++++ 3 files changed, 180 insertions(+) create mode 100644 src/io/basefile.cpp create mode 100644 src/io/basefile.h diff --git a/src/io/CMakeLists.txt b/src/io/CMakeLists.txt index b2a8e511a..bd128ffc9 100644 --- a/src/io/CMakeLists.txt +++ b/src/io/CMakeLists.txt @@ -1,6 +1,7 @@ find_package(Qt5 COMPONENTS Core REQUIRED) set(HEADERS + basefile.h genericfile.h genericfile.inl genericreader.h @@ -21,6 +22,7 @@ set(HEADERS ) set(SOURCES + basefile.cpp commentresourcesfile.cpp inifile.cpp io.cpp diff --git a/src/io/basefile.cpp b/src/io/basefile.cpp new file mode 100644 index 000000000..9621248e8 --- /dev/null +++ b/src/io/basefile.cpp @@ -0,0 +1,114 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "basefile.h" + +#include + +namespace io +{ + +template +class BaseFilePrivate +{ +public: + std::vector> definitions = {}; +}; + +/*! + * \class BaseFile BaseFile.h + * \brief The BaseFile class represents a policy file. + * \ingroup io + * + * The BaseFile class provides a container for definitions. + */ +template +BaseFile::BaseFile() + : GenericFile>() + , d(new BaseFilePrivate()) +{} + +template +BaseFile::~BaseFile() +{ + delete d; +} + +/*! + * \brief BaseFile::addPolicyDefinitions Adds definitions to the file. + * \param policyDefinitions Policy definitions to add. + */ +template +void BaseFile::add(std::shared_ptr definitions) +{ + d->definitions.emplace_back(definitions); +} + +/*! + * \brief BaseFile::removePolicyDefinitions Removes policy definitions from the file. + * \param policyDefinitions Policy definitions to remove. + */ +template +void BaseFile::remove(std::shared_ptr definitions) +{ + d->definitions.erase(std::remove_if(d->definitions.begin(), + d->definitions.end(), + [definitions](std::shared_ptr currentPolicy) { + return currentPolicy == definitions; + })); +} + +/*! + * \brief BaseFile::getAllPolicyDefinitions Returns all definitions from the file. + * \return + */ +template +std::vector> BaseFile::getAll() +{ + return d->definitions; +} + +/*! + * \brief BaseFile::policyDefinitionsCount Return number of definitions in current file. + * \return Amount of policy definitions in current file. + */ +template +size_t BaseFile::count() +{ + return d->definitions.size(); +} + +/*! + * \brief BaseFile::getPolicyDefinitions Returns a definition by index. + * \param index Index of a definitions. + * \return If definitions are found than returns definitions otherwise retruns null pointer. + */ +template +std::shared_ptr BaseFile::get(const size_t index) +{ + if (index < d->definitions.size()) + { + return d->definitions[index]; + } + + return std::shared_ptr(nullptr); +} + +} // namespace io diff --git a/src/io/basefile.h b/src/io/basefile.h new file mode 100644 index 000000000..d47effe28 --- /dev/null +++ b/src/io/basefile.h @@ -0,0 +1,64 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef GPUI_BASEFILE_H +#define GPUI_BASEFILE_H + +#include "io.h" + +#include "genericfile.h" +#include "policyfileformat.h" + +#include + +namespace io { + template + class BaseFilePrivate; + + template + class GPUI_IO_EXPORT BaseFile : public GenericFile, PolicyFileFormat>> + { + public: + BaseFile(); + + ~BaseFile(); + + void add(std::shared_ptr resources); + + void remove(std::shared_ptr resources); + + std::vector> getAll(); + + size_t count(); + + std::shared_ptr get(const size_t index); + + private: + BaseFile(const BaseFile&) = delete; // copy ctor + BaseFile(BaseFile&&) = delete; // move ctor + BaseFile& operator=(const BaseFile&) = delete; // copy assignment + BaseFile& operator=(BaseFile&&) = delete; // move assignment + + private: + BaseFilePrivate* const d; + }; +} + +#endif // GPUI_BASEFILE_H From 23605a94772286c22a09f44d701cead98abd2f70 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 7 Aug 2023 16:38:30 +0400 Subject: [PATCH 18/60] chore: refactor sdmx/sdml to use basefile --- src/plugins/sdml/sdmlformat.cpp | 6 +++--- src/plugins/sdml/sdmlformat.h | 14 +++++++++++--- src/plugins/sdml/sdmlplugin.cpp | 2 +- src/plugins/sdmx/sdmxformat.cpp | 8 ++++---- src/plugins/sdmx/sdmxformat.h | 14 +++++++++++--- src/plugins/sdmx/sdmxplugin.cpp | 2 +- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index dfabac5c0..2672bb501 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -28,11 +28,11 @@ namespace gpui { SdmlFormat::SdmlFormat() - : io::PolicyFileFormat("sdml") + : io::PolicyFileFormat("sdml") { } -bool SdmlFormat::read(std::istream &input, io::PolicyResourcesFile *file) +bool SdmlFormat::read(std::istream &input, SdmlFile *file) { std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityDefinitions> securityDefinitions; auto operation = [&]() { @@ -50,7 +50,7 @@ bool SdmlFormat::read(std::istream &input, io::PolicyResourcesFile *file) return ExceptionHandler::handleOperation(operation, errorHandler); } -bool SdmlFormat::write(std::ostream &output, io::PolicyResourcesFile *file) +bool SdmlFormat::write(std::ostream &output, SdmlFile *file) { Q_UNUSED(output); Q_UNUSED(file); diff --git a/src/plugins/sdml/sdmlformat.h b/src/plugins/sdml/sdmlformat.h index f9a3c3be6..cca2871fa 100644 --- a/src/plugins/sdml/sdmlformat.h +++ b/src/plugins/sdml/sdmlformat.h @@ -23,19 +23,27 @@ #include "../../../src/core/common.h" +#include "../../../src/io/basefile.h" #include "../../../src/io/policyfileformat.h" #include "../../../src/io/policyresourcesfile.h" +namespace security +{ + class SecurityPresentation; +} + namespace gpui { -class GPUI_SYMBOL_EXPORT SdmlFormat : public io::PolicyFileFormat +typedef io::BaseFile SdmlFile; + +class GPUI_SYMBOL_EXPORT SdmlFormat : public io::PolicyFileFormat { public: SdmlFormat(); - bool read(std::istream &input, io::PolicyResourcesFile *file) override; + bool read(std::istream &input, SdmlFile *file) override; - bool write(std::ostream &output, io::PolicyResourcesFile *file) override; + bool write(std::ostream &output, SdmlFile *file) override; }; } // namespace gpui diff --git a/src/plugins/sdml/sdmlplugin.cpp b/src/plugins/sdml/sdmlplugin.cpp index c35ed4797..f65d422d0 100644 --- a/src/plugins/sdml/sdmlplugin.cpp +++ b/src/plugins/sdml/sdmlplugin.cpp @@ -30,7 +30,7 @@ class SdmlPlugin : public Plugin SdmlPlugin() : Plugin("sdml") { - GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmlPlugin); + GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmlPlugin); } }; } // namespace gpui diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index 0768577a5..015b9b7b6 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -314,11 +314,11 @@ class XsdSecurityDefinitionsAdapter : public security::SecurityDefinitions }; SdmxFormat::SdmxFormat() - : io::PolicyFileFormat("sdmx") + : io::PolicyFileFormat("sdmx") { } -bool SdmxFormat::read(std::istream &input, io::PolicyResourcesFile *file) +bool SdmxFormat::read(std::istream &input, SdmxFile *file) { Q_UNUSED(file); @@ -328,7 +328,7 @@ bool SdmxFormat::read(std::istream &input, io::PolicyResourcesFile *file) auto security = XsdSecurityDefinitionsAdapter::create(*securityDefinitions); -// file->add(security); TODO: Implement. + file->add(security); }; auto errorHandler = [&](const std::string &error) { this->setErrorString(error); }; @@ -336,7 +336,7 @@ bool SdmxFormat::read(std::istream &input, io::PolicyResourcesFile *file) return ExceptionHandler::handleOperation(operation, errorHandler); } -bool SdmxFormat::write(std::ostream &output, io::PolicyResourcesFile *file) +bool SdmxFormat::write(std::ostream &output, SdmxFile *file) { Q_UNUSED(output); Q_UNUSED(file); diff --git a/src/plugins/sdmx/sdmxformat.h b/src/plugins/sdmx/sdmxformat.h index 38e7ba23c..41ca48ae9 100644 --- a/src/plugins/sdmx/sdmxformat.h +++ b/src/plugins/sdmx/sdmxformat.h @@ -23,19 +23,27 @@ #include "../../../src/core/common.h" +#include "../../../src/io/basefile.h" #include "../../../src/io/policyfileformat.h" #include "../../../src/io/policyresourcesfile.h" +namespace security +{ + class SecurityDefinitions; +} + namespace gpui { -class GPUI_SYMBOL_EXPORT SdmxFormat : public io::PolicyFileFormat +typedef io::BaseFile SdmxFile; + +class GPUI_SYMBOL_EXPORT SdmxFormat : public io::PolicyFileFormat { public: SdmxFormat(); - bool read(std::istream &input, io::PolicyResourcesFile *file) override; + bool read(std::istream &input, SdmxFile *file) override; - bool write(std::ostream &output, io::PolicyResourcesFile *file) override; + bool write(std::ostream &output, SdmxFile *file) override; }; } // namespace gpui diff --git a/src/plugins/sdmx/sdmxplugin.cpp b/src/plugins/sdmx/sdmxplugin.cpp index bdf2735fb..83b0385db 100644 --- a/src/plugins/sdmx/sdmxplugin.cpp +++ b/src/plugins/sdmx/sdmxplugin.cpp @@ -30,7 +30,7 @@ class SdmxPlugin : public Plugin SdmxPlugin() : Plugin("sdmx") { - GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmxPlugin); + GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmxPlugin); } }; } // namespace gpui From 14862b458dbd516d03d3a52d1868d0dc3b6ba31c Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:09:15 +0400 Subject: [PATCH 19/60] fix: update sdml structures --- src/plugins/sdml/sdmlformat.cpp | 199 +++++++++++++++++- .../model/presentation/dataelementcontent.h | 6 +- .../security/model/presentation/groupbox.h | 2 + .../model/presentation/longdecimaltextbox.h | 2 +- 4 files changed, 200 insertions(+), 9 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 2672bb501..5d476030c 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -22,11 +22,200 @@ #include "../security/schema/security.h" +#include "../security/model/presentation/securitypresentation.h" + #include "../common/exceptionhandler.h" namespace gpui { +class XsdCheckBoxAdapter : public security::CheckBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::CheckBox CheckBox; + +public: + XsdCheckBoxAdapter(const CheckBox &widget) + : security::CheckBox() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::unique_ptr create(const CheckBox &widget) + { + return std::make_unique(widget); + } +}; + +class XsdComboBoxAdapter : public security::ComboBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::ComboBox ComboBox; + +public: + XsdComboBoxAdapter(const ComboBox &widget) + : security::ComboBox() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::unique_ptr create(const ComboBox &widget) + { + return std::make_unique(widget); + } +}; + +class XsdDecimalTextBoxAdapter : public security::DecimalTextBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::DecimalTextBox DecimalTextBox; + +public: + XsdDecimalTextBoxAdapter(const DecimalTextBox &widget) + : security::DecimalTextBox() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::unique_ptr create(const DecimalTextBox &widget) + { + return std::make_unique(widget); + } +}; + +class XsdDropdownListAdapter : public security::DropdownList +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::DropdownList DropdownList; + +public: + XsdDropdownListAdapter(const DropdownList &widget) + : security::DropdownList() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::unique_ptr create(const DropdownList &widget) + { + return std::make_unique(widget); + } +}; + +class XsdListBoxAdapter : public security::ListBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::ListBox ListBox; + +public: + XsdListBoxAdapter(const ListBox &widget) + : security::ListBox() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::unique_ptr create(const ListBox &widget) + { + return std::make_unique(widget); + } +}; + +class XsdLongDecimalTextBoxAdapter : public security::LongDecimalTextBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::LongDecimalTextBox LongDecimalTextBox; + +public: + XsdLongDecimalTextBoxAdapter(const LongDecimalTextBox &widget) + : security::LongDecimalTextBox() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::unique_ptr create(const LongDecimalTextBox &widget) + { + return std::make_unique(widget); + } +}; + +class XsdMultiTextBoxAdapter : public security::MultiTextBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::MultiTextBox MultiTextBox; + +public: + XsdMultiTextBoxAdapter(const MultiTextBox &widget) + : security::MultiTextBox() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::unique_ptr create(const MultiTextBox &widget) + { + return std::make_unique(widget); + } +}; + +class XsdTextBoxAdapter : public security::TextBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::TextBox TextBox; + +public: + XsdTextBoxAdapter(const TextBox &widget) + : security::TextBox() + { + if (widget.defaultValue().present()) + { + this->defaultValue = widget.defaultValue().get(); + } + this->label = widget.label(); + this->refId = widget.refId(); + } + + static std::unique_ptr create(const TextBox &widget) + { + return std::make_unique(widget); + } +}; + +class XsdTextAdapter : public security::TextBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::TextElement TextElement; + +public: + XsdTextAdapter(const TextElement &string) + : security::TextBox() + { + Q_UNUSED(string); + // TODO: Implement. + } + + static std::unique_ptr create(const TextElement &string) + { + return std::make_unique(string); + } +}; + +template +void adapt_widgets(const SequenceType &sequence, + std::map> &widgets) +{ + for (const auto &adaptee : sequence) + { + auto adaptedElement = AdapterType::create(adaptee); + + widgets[adaptee.refId()] = std::move(adaptedElement); + } +} + SdmlFormat::SdmlFormat() : io::PolicyFileFormat("sdml") { @@ -34,15 +223,15 @@ SdmlFormat::SdmlFormat() bool SdmlFormat::read(std::istream &input, SdmlFile *file) { + Q_UNUSED(input); + std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityDefinitions> securityDefinitions; auto operation = [&]() { std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityPresentation>policyDefinitionResources; -// = ::GroupPolicy::SecurityDefinitions::SecurityPresentation_(input, -// ::xsd::cxx::tree::flags::dont_validate -// | ::xsd::cxx::tree::flags::keep_dom -// | ::xsd::cxx::tree::flags::own_dom); -// file->add(XsdResourcesAdapter::create(*policyDefinitionResources)); + std::shared_ptr securityPresentation(nullptr); + + file->add(securityPresentation); }; auto errorHandler = [&](const std::string &error) { this->setErrorString(error); }; diff --git a/src/plugins/security/model/presentation/dataelementcontent.h b/src/plugins/security/model/presentation/dataelementcontent.h index a3d6fe803..a9808a50e 100644 --- a/src/plugins/security/model/presentation/dataelementcontent.h +++ b/src/plugins/security/model/presentation/dataelementcontent.h @@ -39,17 +39,17 @@ class DataElementContent /*! * \brief value An initial value of graphical element. */ - std::string value; + std::string value{}; /*! * \brief refId A reference Id. */ - std::string refId; + std::string refId{}; /*! * \brief postfix A description that follows graphical element. */ - std::string postfix; + std::string postfix{}; }; } // of namespace security diff --git a/src/plugins/security/model/presentation/groupbox.h b/src/plugins/security/model/presentation/groupbox.h index d797882f5..9bc1c3d01 100644 --- a/src/plugins/security/model/presentation/groupbox.h +++ b/src/plugins/security/model/presentation/groupbox.h @@ -29,6 +29,8 @@ namespace security { +class PresentationElements; + /*! * \class GroupBox * \brief The GroupBox class are used to provide an identifiable grouping for other graphical elements. diff --git a/src/plugins/security/model/presentation/longdecimaltextbox.h b/src/plugins/security/model/presentation/longdecimaltextbox.h index a329b750c..289429352 100644 --- a/src/plugins/security/model/presentation/longdecimaltextbox.h +++ b/src/plugins/security/model/presentation/longdecimaltextbox.h @@ -39,7 +39,7 @@ class LongDecimalTextBox: public DataElementContent /*! * \brief defaultValue */ - uint64_t defaultValue; + uint64_t defaultValue{}; /*! * \brief spinBox From 395f6c2eaf0c4346c77c9e16af52e4c46f4c3ca9 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:10:19 +0400 Subject: [PATCH 20/60] fix: add reference in loop --- src/plugins/sdmx/sdmxformat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index 015b9b7b6..20ff55e56 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -282,7 +282,7 @@ class XsdSecurityDefinitionsAdapter : public security::SecurityDefinitions this->revision = definitions.revision(); this->schemaVersion = definitions.schemaVersion(); - for (const auto securityElement : definitions.security()) + for (const auto& securityElement : definitions.security()) { auto ourSecurity = XsdSecurityAdapter::create(securityElement); From cea294c20a5ada76675a4c739779724aed239828 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:55:26 +0400 Subject: [PATCH 21/60] fix: udpate schema --- src/plugins/security/schema/security.xsd | 139 ++++++++++++++--------- 1 file changed, 84 insertions(+), 55 deletions(-) diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd index a0ff2aad9..b46b46268 100644 --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -3,15 +3,11 @@ - - - - Describes a choice element in a policy with associated values for the true and false cases. @@ -50,6 +46,9 @@ + + Describes a list element in a security policy. + @@ -81,18 +80,18 @@ - - - - - - + + + + + + - + @@ -112,7 +111,7 @@ - + @@ -127,22 +126,24 @@ - + + - - - + + + + - - - - - - - + + + + + + + @@ -155,25 +156,25 @@ - + - - + + - + - + - + @@ -194,8 +195,10 @@ - - + + + + @@ -222,41 +225,40 @@ - + - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + @@ -292,20 +294,29 @@ Represents a dropdown list display element. + + Represents a textbox display element with default entry. - - - - + + + + + + + + Represents a listbox display element. + + + @@ -369,9 +380,27 @@ - + + + + + Root element for presentation resources. + + + + + + + + + + + + + + From d770b13813c3a22a2d54f0d0cf42d1b19ead03c4 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:55:52 +0400 Subject: [PATCH 22/60] fix: update sdmx --- src/plugins/sdmx/sdmxformat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index 20ff55e56..ea9283b94 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -279,8 +279,8 @@ class XsdSecurityDefinitionsAdapter : public security::SecurityDefinitions XsdSecurityDefinitionsAdapter(const SecurityDefinitions &definitions) : security::SecurityDefinitions() { - this->revision = definitions.revision(); - this->schemaVersion = definitions.schemaVersion(); + assign_if_exists(this->revision, definitions.revision()); + assign_if_exists(this->schemaVersion, definitions.schemaVersion()); for (const auto& securityElement : definitions.security()) { From 2e9093baa45f204dcae38dc2e6be4d25776898cf Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:02:07 +0400 Subject: [PATCH 23/60] feat: udpate sdml element --- src/plugins/security/CMakeLists.txt | 2 + .../security/model/presentation/combobox.h | 2 +- .../model/presentation/dropdownlist.h | 29 ++++++++ .../security/model/presentation/listbox.h | 2 +- .../model/presentation/presentationelements.h | 6 ++ .../securitypresentationresources.h | 70 +++++++++++++++++++ .../security/model/presentation/text.h | 47 +++++++++++++ 7 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 src/plugins/security/model/presentation/securitypresentationresources.h create mode 100644 src/plugins/security/model/presentation/text.h diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt index 6d192960d..a5bc24c86 100644 --- a/src/plugins/security/CMakeLists.txt +++ b/src/plugins/security/CMakeLists.txt @@ -32,7 +32,9 @@ set(HEADERS model/presentation/radiobutton.h model/presentation/securitydescriptoreditor.h model/presentation/securitypresentation.h + model/presentation/securitypresentationresources.h model/presentation/textbox.h + model/presentation/text.h model/sdmx/booleanelement.h model/sdmx/decimalelement.h model/sdmx/decimaltype.h diff --git a/src/plugins/security/model/presentation/combobox.h b/src/plugins/security/model/presentation/combobox.h index d7f54ddde..4ea22dc1a 100644 --- a/src/plugins/security/model/presentation/combobox.h +++ b/src/plugins/security/model/presentation/combobox.h @@ -53,7 +53,7 @@ class ComboBox: public DataElementContent * \brief suggestions A suggested value to be placed in the drop-down list. * Multiple suggestion elements result in multiple suggestions. */ - std::string suggestion {}; + std::vector suggestion {}; /*! * \brief noSort If elements should be sorted. diff --git a/src/plugins/security/model/presentation/dropdownlist.h b/src/plugins/security/model/presentation/dropdownlist.h index e1b34610e..f2610a3a4 100644 --- a/src/plugins/security/model/presentation/dropdownlist.h +++ b/src/plugins/security/model/presentation/dropdownlist.h @@ -23,6 +23,9 @@ #include "dataelementcontent.h" +#include +#include + namespace security { @@ -32,6 +35,32 @@ namespace security */ class DropdownList : public DataElementContent { +public: + /*! + * \brief noSort + */ + bool noSort { false }; + + /*! + * \brief defaultItem The numerical value identifying the default choice of the list of items. + * The item list is numbered starting from 0. + */ + unsigned int defaultItem { 0 }; + + /*! + * \brief label Text associated with the drop-down list. + */ + std::string label{}; + + /*! + * \brief values Values of the drop-down list. + */ + std::vector values{}; + + /*! + * \brief refId A mapping to the element. + */ + std::string refId{}; }; } // of namespace security diff --git a/src/plugins/security/model/presentation/listbox.h b/src/plugins/security/model/presentation/listbox.h index 11de70fa2..6c2dddf0b 100644 --- a/src/plugins/security/model/presentation/listbox.h +++ b/src/plugins/security/model/presentation/listbox.h @@ -33,7 +33,7 @@ namespace security * \ingroup security * \ingroup presentation */ -class ListBox : DataElementContent +class ListBox : public DataElementContent { }; diff --git a/src/plugins/security/model/presentation/presentationelements.h b/src/plugins/security/model/presentation/presentationelements.h index 6c9ae979b..58e319b67 100644 --- a/src/plugins/security/model/presentation/presentationelements.h +++ b/src/plugins/security/model/presentation/presentationelements.h @@ -31,6 +31,7 @@ #include "longdecimaltextbox.h" #include "multitextbox.h" #include "textbox.h" +#include "text.h" #include @@ -94,6 +95,11 @@ class PresentationElements * \brief comment */ std::vector comment{}; + + /*! + * \brief text + */ + std::vector text{}; }; } // of namespace security diff --git a/src/plugins/security/model/presentation/securitypresentationresources.h b/src/plugins/security/model/presentation/securitypresentationresources.h new file mode 100644 index 000000000..b63bed402 --- /dev/null +++ b/src/plugins/security/model/presentation/securitypresentationresources.h @@ -0,0 +1,70 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_SECURITY_PRESENTATION_RESOURCES_H +#define SECURITY_SECURITY_PRESENTATION_RESOURCES_H + +#include "securitypresentation.h" + +#include +#include + +namespace security +{ + +/*! + * \class SecurityPresentationResources + * \brief Root presentation element. + */ +class SecurityPresentationResources +{ +public: + /*! + * \brief displayName The localized friendly name of the policy settings file. + * Unsupported by current Group Policy tools. + */ + std::string displayName{}; + + /*! + * \brief description The localized description of policy settings contained in an .adml file. + * Unsupported by current Group Policy tools. + */ + std::string description{}; + + /*! + * \brief annotation A comment string for .adml files. + * Strings added to this tag will not be processed by Group Policy tools. + */ + std::vector annotation{}; + + /*! + * \brief stringTable A table of localized strings. + */ + std::map stringTable{}; + + /*! + * \brief presentationTable A table of presentation elements representing policy setting parameters. + */ + std::map> presentationTable{}; +}; + +} // of namespace security + +#endif // SECURITY_SECURITY_PRESENTATION_RESOURCES_H diff --git a/src/plugins/security/model/presentation/text.h b/src/plugins/security/model/presentation/text.h new file mode 100644 index 000000000..63c3c1398 --- /dev/null +++ b/src/plugins/security/model/presentation/text.h @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** + ** + ** Copyright (C) 2023 BaseALT Ltd. + ** + ** This program is free software; you can redistribute it and/or + ** modify it under the terms of the GNU General Public License + ** as published by the Free Software Foundation; either version 2 + ** of the License, or (at your option) any later version. + ** + ** This program is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with this program; if not, write to the Free Software + ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ** + ***********************************************************************************************************************/ + +#ifndef SECURITY_TEXT_H +#define SECURITY_TEXT_H + +#include "dataelement.h" + +#include + +namespace security +{ + +/** + * \class Text + * \brief Represents a text display element with default entry. + */ +class Text: public DataElement +{ +public: + + /*! + * \brief content + */ + std::string content{}; +}; + +} // of namespace security + +#endif // SECURITY_TEXT_H From a11db05065a66ff9fdfd21cf85c58e378ddcac0c Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:02:34 +0400 Subject: [PATCH 24/60] feat: update sdml format --- src/plugins/sdml/sdmlformat.cpp | 79 ++++++++++++++++++------ src/plugins/security/schema/security.xsd | 2 +- 2 files changed, 62 insertions(+), 19 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 5d476030c..f8dc10d65 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -22,13 +22,22 @@ #include "../security/schema/security.h" -#include "../security/model/presentation/securitypresentation.h" +#include "../security/model/presentation/securitypresentationresources.h" #include "../common/exceptionhandler.h" namespace gpui { +template +inline void assign_if_exists(TOutput &output, const TInput &input) +{ + if (input.present()) + { + output = input.get(); + } +} + class XsdCheckBoxAdapter : public security::CheckBox { private: @@ -38,8 +47,9 @@ class XsdCheckBoxAdapter : public security::CheckBox XsdCheckBoxAdapter(const CheckBox &widget) : security::CheckBox() { - Q_UNUSED(widget); - // TODO: Implement. + this->defaultChecked = widget.defaultChecked(); + + assign_if_exists(this->postfix, widget.postfix()); } static std::unique_ptr create(const CheckBox &widget) @@ -57,8 +67,15 @@ class XsdComboBoxAdapter : public security::ComboBox XsdComboBoxAdapter(const ComboBox &widget) : security::ComboBox() { - Q_UNUSED(widget); - // TODO: Implement. + this->refId = widget.refId(); + assign_if_exists(this->postfix, widget.postfix()); + + assign_if_exists(this->defaultValue, widget.defaultChecked()); + + for (const auto& suggestionText : widget.suggestion()) + { + this->suggestion.emplace_back(suggestionText); + } } static std::unique_ptr create(const ComboBox &widget) @@ -76,8 +93,10 @@ class XsdDecimalTextBoxAdapter : public security::DecimalTextBox XsdDecimalTextBoxAdapter(const DecimalTextBox &widget) : security::DecimalTextBox() { - Q_UNUSED(widget); - // TODO: Implement. + this->spinBox = widget.spin(); + assign_if_exists(this->defaultValue, widget.defaultValue()); + assign_if_exists(this->spinStep, widget.spinStep()); + assign_if_exists(this->postfix, widget.postfix()); } static std::unique_ptr create(const DecimalTextBox &widget) @@ -114,8 +133,7 @@ class XsdListBoxAdapter : public security::ListBox XsdListBoxAdapter(const ListBox &widget) : security::ListBox() { - Q_UNUSED(widget); - // TODO: Implement. + assign_if_exists(this->postfix, widget.postfix()); } static std::unique_ptr create(const ListBox &widget) @@ -133,8 +151,10 @@ class XsdLongDecimalTextBoxAdapter : public security::LongDecimalTextBox XsdLongDecimalTextBoxAdapter(const LongDecimalTextBox &widget) : security::LongDecimalTextBox() { - Q_UNUSED(widget); - // TODO: Implement. + this->spinBox = widget.spin(); + assign_if_exists(this->defaultValue, widget.defaultValue()); + assign_if_exists(this->spinStep, widget.spinStep()); + assign_if_exists(this->postfix, widget.postfix()); } static std::unique_ptr create(const LongDecimalTextBox &widget) @@ -152,8 +172,9 @@ class XsdMultiTextBoxAdapter : public security::MultiTextBox XsdMultiTextBoxAdapter(const MultiTextBox &widget) : security::MultiTextBox() { - Q_UNUSED(widget); - // TODO: Implement. +// this->defaultHeight = widget.defaultHeight(); + this->refId = widget.refId(); +// this->showAsDialog = widget.showAsDialog(); } static std::unique_ptr create(const MultiTextBox &widget) @@ -185,20 +206,20 @@ class XsdTextBoxAdapter : public security::TextBox } }; -class XsdTextAdapter : public security::TextBox +class XsdTextAdapter : public security::Text { private: typedef ::GroupPolicy::SecurityDefinitions::TextElement TextElement; public: - XsdTextAdapter(const TextElement &string) - : security::TextBox() + XsdTextAdapter(const TextElement &widget) + : security::Text() { - Q_UNUSED(string); + Q_UNUSED(widget); // TODO: Implement. } - static std::unique_ptr create(const TextElement &string) + static std::unique_ptr create(const TextElement &string) { return std::make_unique(string); } @@ -216,6 +237,28 @@ void adapt_widgets(const SequenceType &sequence, } } +class XsdResourcesAdapter : public security::SecurityPresentationResources +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::SecurityPresentationResources SecurityPresentationResources; + +public: + XsdResourcesAdapter(const SecurityPresentationResources &resources) + : security::SecurityPresentationResources() + { + for (const auto &presentation : resources.presentationTable()) + { + Q_UNUSED(presentation); + // TODO: Implement. + } + } + + static std::unique_ptr create(const SecurityPresentationResources &resources) + { + return std::make_unique(resources); + } +}; + SdmlFormat::SdmlFormat() : io::PolicyFileFormat("sdml") { diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd index b46b46268..37fa04f88 100644 --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -391,7 +391,7 @@ Root element for presentation resources. - + From 2d89dcaef6c2cb6517ba424aba46d8ae16b41eb7 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:55:44 +0400 Subject: [PATCH 25/60] feat: update security widget --- .../security/model/ui/securitywidget.ui | 146 +++++++++++++++++- 1 file changed, 144 insertions(+), 2 deletions(-) diff --git a/src/plugins/security/model/ui/securitywidget.ui b/src/plugins/security/model/ui/securitywidget.ui index 283f1c246..76dd2dc51 100644 --- a/src/plugins/security/model/ui/securitywidget.ui +++ b/src/plugins/security/model/ui/securitywidget.ui @@ -6,13 +6,155 @@ 0 0 - 400 - 300 + 649 + 544 Form + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 52 + + + + + 16777215 + 52 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + + + + true + + + + + + + + + + Qt::Horizontal + + + + true + + + + + 0 + 0 + 400 + 445 + + + + + + + + + + Help: + + + descriptionTextEdit + + + + + + + + 0 + 4 + + + + + 215 + 0 + + + + Qt::NoFocus + + + true + + + + + + + + + + + Qt::Horizontal + + + + 508 + 20 + + + + + + + + &Cancel + + + + + + + &OK + + + + From 865322277c697c221d358df2490949ae19552de2 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:28:28 +0400 Subject: [PATCH 26/60] feat: implement first version of security proxy model --- .../security/model/ui/presentationbuilder.h | 4 -- .../security/model/ui/securityproxymodel.cpp | 35 ++++++++++-- .../security/model/ui/securityproxymodel.h | 6 ++ .../security/model/ui/securitywidget.cpp | 57 ++++++++++++++++++- .../security/model/ui/securitywidget.h | 14 ++++- 5 files changed, 105 insertions(+), 11 deletions(-) diff --git a/src/plugins/security/model/ui/presentationbuilder.h b/src/plugins/security/model/ui/presentationbuilder.h index d641dccba..9bc1d31d2 100644 --- a/src/plugins/security/model/ui/presentationbuilder.h +++ b/src/plugins/security/model/ui/presentationbuilder.h @@ -38,10 +38,6 @@ namespace security { const security::SecurityPresentation& presentation; const security::SecurityDefinition& security; - void* source; // TODO: Implement. - QPushButton& saveButton; - bool& dataChanged; - bool& stateEnabled; }; class PresentationBuilderPrivate; diff --git a/src/plugins/security/model/ui/securityproxymodel.cpp b/src/plugins/security/model/ui/securityproxymodel.cpp index 1f8941a25..661bce9f7 100644 --- a/src/plugins/security/model/ui/securityproxymodel.cpp +++ b/src/plugins/security/model/ui/securityproxymodel.cpp @@ -20,29 +20,54 @@ #include "securityproxymodel.h" +#include "../administrative_templates/bundle/itemtype.h" +#include "../administrative_templates/bundle/policyroles.h" + +#include "securitywidget.h" + namespace security { + class SecurityProxyModelPrivate { public: }; SecurityProxyModel::SecurityProxyModel() + : d(new SecurityProxyModelPrivate()) { - } SecurityProxyModel::~SecurityProxyModel() { - + delete d; } QVariant SecurityProxyModel::data(const QModelIndex &proxyIndex, int role) const { - Q_UNUSED(proxyIndex); - Q_UNUSED(role); + if (role == model::bundle::POLICY_WIDGET) + { + std::function widgetCreator = [=]() { + auto contentWidget = new SecurityWidget(); - return QVariant(); + contentWidget->setMachineSecuritySource(); + contentWidget->setUserSecuritySource(); + + contentWidget->setModelIndex(proxyIndex); + + connect(contentWidget, + &SecurityWidget::savePolicyChanges, + this, + &SecurityProxyModel::savePolicyChanges); + return contentWidget; + }; + + return QVariant::fromValue(widgetCreator); + } + + return QIdentityProxyModel::data(proxyIndex, role); } } // namespace security + +Q_DECLARE_METATYPE(std::function) diff --git a/src/plugins/security/model/ui/securityproxymodel.h b/src/plugins/security/model/ui/securityproxymodel.h index 2309aa627..e4acbcfa5 100644 --- a/src/plugins/security/model/ui/securityproxymodel.h +++ b/src/plugins/security/model/ui/securityproxymodel.h @@ -37,6 +37,12 @@ class SecurityProxyModel : public QIdentityProxyModel QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override; + void setUserSecuritySource(); + void setMachineSecuritySource(); + +signals: + void savePolicyChanges(); + private: SecurityProxyModelPrivate *d = nullptr; diff --git a/src/plugins/security/model/ui/securitywidget.cpp b/src/plugins/security/model/ui/securitywidget.cpp index 9fd5715fd..3e930ba66 100644 --- a/src/plugins/security/model/ui/securitywidget.cpp +++ b/src/plugins/security/model/ui/securitywidget.cpp @@ -21,11 +21,24 @@ #include "securitywidget.h" #include "ui_securitywidget.h" +#include "../administrative_templates/bundle/itemtype.h" +#include "../administrative_templates/bundle/policyroles.h" + +#include "../sdmx/securitydefinition.h" +#include "../presentation/securitypresentation.h" + +#include "presentationbuilder.h" + +using namespace model::bundle; + namespace security { +typedef std::shared_ptr<::security::SecurityDefinition> SecurityPtr; +typedef std::shared_ptr<::security::SecurityPresentation> PresentationPtr; + SecurityWidget::SecurityWidget(QWidget *parent) - : QWidget(parent) + : PluginWidgetInterface(parent) , ui(new Ui::SecurityWidget()) { ui->setupUi(this); @@ -36,4 +49,46 @@ SecurityWidget::~SecurityWidget() delete ui; } +void SecurityWidget::setModelIndex(const QModelIndex &index) +{ + const QAbstractItemModel *model = index.model(); + + if (model) + { + ui->securityNameLabel->setText((tr("Security policy: ") + model->data(index, Qt::DisplayRole).value()).trimmed()); + ui->descriptionTextEdit->setText(model->data(index, PolicyRoles::EXPLAIN_TEXT).value()); + + if (model->data(index, PolicyRoles::ITEM_TYPE).value() == ItemType::ITEM_TYPE_POLICY) + { + auto presentation = model->data(index, PolicyRoles::PRESENTATION).value(); + auto security = model->data(index, PolicyRoles::POLICY).value(); + + if (presentation && security) + { + auto layout = ::security::PresentationBuilder::build( + { + *presentation, + *security, + }); + + if (layout) + { + ui->contentScrollArea->widget()->setLayout(layout); + } + } + } + } } + +void SecurityWidget::setUserSecuritySource() +{ +} + +void SecurityWidget::setMachineSecuritySource() +{ +} + +} + +Q_DECLARE_METATYPE(std::shared_ptr<::security::SecurityDefinition>) +Q_DECLARE_METATYPE(std::shared_ptr<::security::SecurityPresentation>) diff --git a/src/plugins/security/model/ui/securitywidget.h b/src/plugins/security/model/ui/securitywidget.h index 8df620cc0..de42523c1 100644 --- a/src/plugins/security/model/ui/securitywidget.h +++ b/src/plugins/security/model/ui/securitywidget.h @@ -23,6 +23,8 @@ #include +#include "../../gui/pluginwidgetinterface.h" + QT_BEGIN_NAMESPACE namespace Ui { class SecurityWidget; } QT_END_NAMESPACE @@ -30,7 +32,7 @@ QT_END_NAMESPACE namespace security { -class SecurityWidget : public QWidget +class SecurityWidget : public gui::PluginWidgetInterface { public: Q_OBJECT @@ -39,6 +41,16 @@ class SecurityWidget : public QWidget explicit SecurityWidget(QWidget* parent = nullptr); ~SecurityWidget(); + void setModelIndex(const QModelIndex &index); + + void setUserSecuritySource(); + void setMachineSecuritySource(); + + virtual bool hasDataChanged() override final; + +signals: + void savePolicyChanges(); + private: SecurityWidget(const SecurityWidget&) = delete; // copy ctor SecurityWidget(SecurityWidget&&) = delete; // move ctor From 10842385be7256c0c1f9311b4d66b4174b34e4d6 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 15 Aug 2023 17:58:42 +0400 Subject: [PATCH 27/60] feat: add presentation builder for security --- .../model/presentation/presentationelements.h | 2 + .../model/presentation/securitypresentation.h | 24 ++ .../securitypresentationresources.h | 2 +- .../security/model/ui/presentationbuilder.cpp | 287 +++++++++++++++++- .../security/model/ui/presentationbuilder.h | 3 +- 5 files changed, 313 insertions(+), 5 deletions(-) diff --git a/src/plugins/security/model/presentation/presentationelements.h b/src/plugins/security/model/presentation/presentationelements.h index 58e319b67..1e7f0f6a7 100644 --- a/src/plugins/security/model/presentation/presentationelements.h +++ b/src/plugins/security/model/presentation/presentationelements.h @@ -38,6 +38,8 @@ namespace security { +class GroupBox; + /*! * \class PresentationElements * \brief The PresentationElements class diff --git a/src/plugins/security/model/presentation/securitypresentation.h b/src/plugins/security/model/presentation/securitypresentation.h index 0b90c6dd9..5e5c933e9 100644 --- a/src/plugins/security/model/presentation/securitypresentation.h +++ b/src/plugins/security/model/presentation/securitypresentation.h @@ -23,14 +23,33 @@ #include "presentationelements.h" +#include #include +#include +#include +#include namespace security { +// the variant to visit +typedef ::std::variant PresentationElement; /*! * \class SecurityPresentation * \brief Root presentation element. + * + * \ingroup security + * \ingroup presentation */ class SecurityPresentation: public PresentationElements { @@ -49,6 +68,11 @@ class SecurityPresentation: public PresentationElements * \brief icon Icon associated with current presentation element. */ std::string icon{}; + + /*! + * \brief widgets List of widgets, associated with their ids. + */ + std::vector>> widgets{}; }; } // of namespace security diff --git a/src/plugins/security/model/presentation/securitypresentationresources.h b/src/plugins/security/model/presentation/securitypresentationresources.h index b63bed402..3244c5e74 100644 --- a/src/plugins/security/model/presentation/securitypresentationresources.h +++ b/src/plugins/security/model/presentation/securitypresentationresources.h @@ -62,7 +62,7 @@ class SecurityPresentationResources /*! * \brief presentationTable A table of presentation elements representing policy setting parameters. */ - std::map> presentationTable{}; + std::vector>> presentationTable{}; }; } // of namespace security diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index 83007a3a6..746e601b5 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -20,20 +20,303 @@ #include "presentationbuilder.h" +#include + +#include "../presentation/checkbox.h" +#include "../presentation/combobox.h" +#include "../presentation/decimaltextbox.h" +#include "../presentation/dropdownlist.h" +#include "../presentation/groupbox.h" +#include "../presentation/ldapsearchdialog.h" +#include "../presentation/listbox.h" +#include "../presentation/longdecimaltextbox.h" +#include "../presentation/multitextbox.h" +#include "../presentation/text.h" +#include "../presentation/textbox.h" + +#include "../presentation/securitypresentationresources.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +template +inline constexpr bool always_false_v = false; + namespace security { +template +QLayoutItem *createAndAttachLabel(QWidget *buddy, const QString &text) +{ + QLabel *label = new QLabel(text.trimmed()); + label->setBuddy(buddy); + label->setWordWrap(true); + + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(1); + + label->setSizePolicy(sizePolicy); + buddy->setSizePolicy(sizePolicy); + + TLayoutItem *container = new TLayoutItem(); + container->addWidget(label); + container->addWidget(buddy); + + return container; +} + class PresentationBuilderPrivate { public: + + void visit(DecimalTextBox &widget) const + { + QWidget *textBox = createAnyDecimalTextBox(widget.spinBox, widget.defaultValue, widget.spinStep); + + QLayoutItem *container = createAndAttachLabel(textBox, QString::fromStdString(widget.postfix)); + + addToLayout(container); + } + + void visit(TextBox &widget) const + { + QLineEdit *lineEdit = new QLineEdit(); + lineEdit->setText(QString::fromStdString(widget.defaultValue)); + + QLayoutItem *container = createAndAttachLabel(lineEdit, QString::fromStdString(widget.label)); + + addToLayout(container); + } + + void visit(CheckBox &widget) const + { + QCheckBox *checkBox = new QCheckBox(); + + checkBox->setChecked(widget.defaultChecked); + QLayoutItem *container = createAndAttachLabel(checkBox, QString::fromStdString(widget.postfix)); + + addToLayout(container); + } + + void visit(ComboBox &widget) const + { + QComboBox *comboBox = new QComboBox(); + comboBox->setCurrentText(QString::fromStdString(widget.defaultValue)); + for (const auto &item : widget.suggestion) + { + comboBox->addItem(QString::fromStdString(item)); + } + + QLayoutItem *container = createAndAttachLabel(comboBox, QString::fromStdString(widget.label)); + + addToLayout(container); + } + + void visit(DropdownList &widget) const + { + QComboBox *comboBox = new QComboBox(); + comboBox->setCurrentIndex(widget.defaultItem); + + QLayoutItem *container = createAndAttachLabel(comboBox, QString::fromStdString(widget.label)); + + if (widget.values.size() > 0) + { + for (auto &value : widget.values) + { + comboBox->addItem(QString::fromStdString(value)); + } + if (widget.defaultItem < widget.values.size()) + { + comboBox->setCurrentIndex(widget.defaultItem); + } + } + + addToLayout(container); + } + + void visit(LongDecimalTextBox &widget) const + { + QWidget *textBox = createAnyDecimalTextBox(widget.spinBox, widget.defaultValue, widget.spinStep); + + QLayoutItem *container = createAndAttachLabel(textBox, QString::fromStdString(widget.postfix)); + + addToLayout(container); + } + + void visit(MultiTextBox &widget) const + { + Q_UNUSED(widget); + QTextEdit *textEdit = new QTextEdit(); + + // TODO: Implement. + + addToLayout(textEdit); + } + + void visit(GroupBox &widget) const + { + Q_UNUSED(widget); + QGroupBox *groupBox = new QGroupBox(); + + // TODO: Implement. + + addToLayout(groupBox); + } + + void visit(ListBox &widget) const + { + // TODO: Implement. + + Q_UNUSED(widget); + } + + void visit(Comment &widget) const + { + QLabel *label = new QLabel(); + label->setText(QString::fromStdString(widget.text)); + label->setWordWrap(true); + label->setAlignment(Qt::AlignHCenter); + addToLayout(label); + } + + void visit(Text &widget) const + { + QLabel *label = new QLabel(); + label->setText(QString::fromStdString(widget.content)); + label->setWordWrap(true); + label->setAlignment(Qt::AlignHCenter); + addToLayout(label); + } + + void setLayout(QLayout *layout) { m_layout = layout; } + + void setSecurity(const SecurityDefinition &security) { m_security = &security; } + + void setCurrentElementName(std::string elementName) { m_elementName = elementName; } + +private: + QLayout *m_layout = nullptr; + const SecurityDefinition *m_security = nullptr; + std::string m_elementName = ""; + +private: + void addToLayout(QWidget *widget) const + { + if (m_layout) + { + m_layout->addWidget(widget); + } + } + + void addToLayout(QLayoutItem *container) const + { + if (container) + { + m_layout->addItem(container); + } + } + +private: + template + QWidget *createAnyDecimalTextBox(bool spin, Number value, Number step) const + { + if (spin) + { + ::gui::AltSpinBox *spinBox = new ::gui::AltSpinBox(); + spinBox->setMinimum(0); + spinBox->setMaximum(std::numeric_limits::max()); + spinBox->setSingleStep(step); + spinBox->setValue(value); + + return spinBox; + } + + QLineEdit *edit = new QLineEdit(); + edit->setText(QString::number(value)); + edit->setValidator(new QIntValidator(0, std::numeric_limits::max())); + + return edit; + } }; PresentationBuilderPrivate* PresentationBuilder::d = new PresentationBuilderPrivate(); QVBoxLayout *PresentationBuilder::build(const PresentationBuilderParams ¶ms) { - Q_UNUSED(params); - return nullptr; + QVBoxLayout *layout = new QVBoxLayout(); + d->setLayout(layout); + d->setSecurity(params.security); + + for (const auto &widget : params.presentation.widgets) + { + d->setCurrentElementName(widget.first); + + std::visit([](auto&& arg) noexcept + { + using T = std::decay_t; + if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else if constexpr (std::is_same_v) + { + d->visit(arg); + } + else + { + static_assert(always_false_v, "non-exhaustive visitor!"); + } + }, *widget.second.get()); + } + layout->addStretch(); + + return layout; } } diff --git a/src/plugins/security/model/ui/presentationbuilder.h b/src/plugins/security/model/ui/presentationbuilder.h index 9bc1d31d2..86f3f2053 100644 --- a/src/plugins/security/model/ui/presentationbuilder.h +++ b/src/plugins/security/model/ui/presentationbuilder.h @@ -23,8 +23,7 @@ #include #include - -class QVBoxLayout; +#include namespace security { From 9db06e6ecd649d5963f5ab53497c4ffa80713e2e Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 15 Aug 2023 17:59:29 +0400 Subject: [PATCH 28/60] feat!: switch c++ standard to c++17 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a61bff8d..0a1d2c9b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ execute_process( OUTPUT_VARIABLE GPUI_GEAR_VERSION WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + string(REPLACE "." ";" GEAR_VERSION_LIST ${GPUI_GEAR_VERSION}) list(GET GEAR_VERSION_LIST 0 GPUI_VERSION_MAJOR) list(GET GEAR_VERSION_LIST 1 GPUI_VERSION_MINOR) From 53442698665c991d0019b126c4d122b401f3b49c Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 15 Aug 2023 18:32:14 +0400 Subject: [PATCH 29/60] feat: add security bundle --- src/plugins/security/CMakeLists.txt | 2 + .../security/model/bundle/securitybundle.cpp | 108 +++++++++++++++++ .../security/model/bundle/securitybundle.h | 84 +++++++++++++ src/plugins/security/securitysnapin.cpp | 110 +++++++++++++++++- 4 files changed, 300 insertions(+), 4 deletions(-) create mode 100644 src/plugins/security/model/bundle/securitybundle.cpp create mode 100644 src/plugins/security/model/bundle/securitybundle.h diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt index a5bc24c86..34186f86a 100644 --- a/src/plugins/security/CMakeLists.txt +++ b/src/plugins/security/CMakeLists.txt @@ -15,6 +15,7 @@ include_directories(${CMAKE_SOURCE_DIR}/src) add_subdirectory(schema) set(HEADERS + model/bundle/securitybundle.h model/presentation/category.h model/presentation/checkbox.h model/presentation/combobox.h @@ -58,6 +59,7 @@ set(HEADERS ) set(SOURCES + model/bundle/securitybundle.cpp model/ui/presentationbuilder.cpp model/ui/securityproxymodel.cpp model/ui/securitywidget.cpp diff --git a/src/plugins/security/model/bundle/securitybundle.cpp b/src/plugins/security/model/bundle/securitybundle.cpp new file mode 100644 index 000000000..29a63c427 --- /dev/null +++ b/src/plugins/security/model/bundle/securitybundle.cpp @@ -0,0 +1,108 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "securitybundle.h" + +#include +#include + +namespace security +{ + +SecurityBundle::SecurityBundle() +{ + +} + +SecurityBundle::~SecurityBundle() +{ + +} + +std::unique_ptr SecurityBundle::loadFolder(const std::string &path, const std::string &language) +{ + Q_UNUSED(path); + Q_UNUSED(language); + + return nullptr; +} + +bool SecurityBundle::loadAdmxAndAdml(const QFileInfo &admxFileName) +{ + Q_UNUSED(admxFileName); + + return false; +} + +QString SecurityBundle::constructFileName(const QFileInfo &fileName) +{ + Q_UNUSED(fileName); + + return ""; +} + +void SecurityBundle::rearrangeTreeItems() +{ +} + +void SecurityBundle::assignParentCategory(const std::string &rawCategory, + QStandardItem *machineItem, + QStandardItem *userItem, + const std::string &fileName) +{ + Q_UNUSED(rawCategory); + Q_UNUSED(machineItem); + Q_UNUSED(userItem); + Q_UNUSED(fileName); +} + +QStandardItem *SecurityBundle::createItem(const QString &displayName, + const QString &iconName, + const QString &explainText, + const uint itemType, + int securityType, + const bool alreadyInserted) +{ + Q_UNUSED(displayName); + Q_UNUSED(iconName); + Q_UNUSED(explainText); + Q_UNUSED(itemType); + Q_UNUSED(securityType); + Q_UNUSED(alreadyInserted); + + return nullptr; +} + +void SecurityBundle::assignSupportedOn() +{ +} + +void SecurityBundle::removeEmptyItems() +{ +} + +void SecurityBundle::iterateModelAndRemoveEmptyFolders(QAbstractItemModel *model, + const QModelIndex &parent) +{ + Q_UNUSED(model); + Q_UNUSED(parent); +} + +} diff --git a/src/plugins/security/model/bundle/securitybundle.h b/src/plugins/security/model/bundle/securitybundle.h new file mode 100644 index 000000000..c28e5dd18 --- /dev/null +++ b/src/plugins/security/model/bundle/securitybundle.h @@ -0,0 +1,84 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef GPUI_SECURITY_BUNDLE_H +#define GPUI_SECURITY_BUNDLE_H + +#include +#include + +class QFileInfo; +class QString; +class QStandardItem; +class QStandardItemModel; +class QAbstractItemModel; +class QModelIndex; + +namespace security +{ + +class SecurityBundlePrivate; + +class SecurityBundle +{ +public: + SecurityBundle(); + ~SecurityBundle(); + + std::unique_ptr loadFolder(const std::string &path, const std::string &language); + +private: + SecurityBundle(const SecurityBundle &) = delete; // copy ctor + SecurityBundle(SecurityBundle &&) = delete; // move ctor + SecurityBundle &operator=(const SecurityBundle &) = delete; // copy assignment + SecurityBundle &operator=(SecurityBundle &&) = delete; // move assignment + +private: + SecurityBundlePrivate *d { nullptr }; + +private: + bool loadAdmxAndAdml(const QFileInfo &admxFileName); + + QString constructFileName(const QFileInfo &fileName); + + + void rearrangeTreeItems(); + void assignParentCategory(const std::string &rawCategory, + QStandardItem *machineItem, + QStandardItem *userItem, + const std::string &fileName); + + QStandardItem *createItem(const QString &displayName, + const QString &iconName, + const QString &explainText, + const uint itemType, + int securityType, + const bool alreadyInserted); + + void assignSupportedOn(); + + void removeEmptyItems(); + + void iterateModelAndRemoveEmptyFolders(QAbstractItemModel *model, const QModelIndex &parent); +}; + +} // namespace security + +#endif // GPUI_SECURITY_BUNDLE_H diff --git a/src/plugins/security/securitysnapin.cpp b/src/plugins/security/securitysnapin.cpp index e79d0df91..6d1afdd27 100644 --- a/src/plugins/security/securitysnapin.cpp +++ b/src/plugins/security/securitysnapin.cpp @@ -20,11 +20,73 @@ #include "securitysnapin.h" +#include + +#include "model/ui/securityproxymodel.h" +#include "model/bundle/securitybundle.h" + +#include "../storage/smb/smbdirectory.h" + + +using namespace security; + namespace gpui { class SecuritySnapInPrivate { public: + std::string sdmxPath = "/usr/share/PolicyDefinitions/"; + std::string localeName = "en-US"; + std::string policyPath = ""; + + std::unique_ptr model = nullptr; + std::unique_ptr proxyModel = nullptr; + + void onDataSave() + { + createDirectory(policyPath + "/User/"); + createDirectory(policyPath + "/Machine/"); + } + + void policyBundleLoad() + { + auto bundle = std::make_unique(); + model = bundle->loadFolder(sdmxPath, localeName); + proxyModel->setSourceModel(model.get()); + } + + void createDirectory(const std::string &directoryName) + { + const QString path = QString::fromStdString(directoryName); + + if (path.startsWith("smb://")) + { + gpui::smb::SmbDirectory dir(path); + + if (!dir.exists()) + { + dir.mkdir(path); + } + } + else + { + QDir dir(path); + + if (!dir.exists()) + { + dir.mkdir(path); + } + } + } + + SecuritySnapInPrivate() {} + +private: + SecuritySnapInPrivate(const SecuritySnapInPrivate&) = delete; // copy ctor + SecuritySnapInPrivate(SecuritySnapInPrivate&&) = delete; // move ctor + SecuritySnapInPrivate& operator=(const SecuritySnapInPrivate&) = delete; // copy assignment + SecuritySnapInPrivate& operator=(SecuritySnapInPrivate&&) = delete; // move assignment + }; SecuritySnapIn::SecuritySnapIn() @@ -38,9 +100,42 @@ SecuritySnapIn::SecuritySnapIn() { } -void SecuritySnapIn::onInitialize(QMainWindow *mainWindow) +void SecuritySnapIn::onInitialize(QMainWindow *window) { - Q_UNUSED(mainWindow); + auto mainWindow = dynamic_cast<::gpui::MainWindow *>(window); + + if (mainWindow) + { + d->sdmxPath = mainWindow->getAdmxPath().toStdString(); + d->localeName = mainWindow->getLanguage().toStdString(); + qWarning() << "Setting default settings for security templates snap-in: " + << d->sdmxPath.c_str() + << d->localeName.c_str(); + } + + d->proxyModel = std::make_unique(); + + d->policyBundleLoad(); + + QObject::connect(d->proxyModel.get(), &SecurityProxyModel::savePolicyChanges, [&]() { + d->onDataSave(); + }); + + setRootNode(static_cast(d->proxyModel.get())); + + if (mainWindow) + { + QObject::connect(mainWindow, &MainWindow::admxPathChanged, [&](const QString &admxPath) { + qWarning() << "Loading bundle from snap-in: " << admxPath; + d->sdmxPath = admxPath.toStdString(); + d->policyBundleLoad(); + }); + + QObject::connect(d->proxyModel.get(), + &SecurityProxyModel::savePolicyChanges, + mainWindow, + &MainWindow::updateStatusBar); + } } void SecuritySnapIn::onShutdown() @@ -49,17 +144,24 @@ void SecuritySnapIn::onShutdown() void SecuritySnapIn::onDataLoad(const std::string &policyPath, const std::string &locale) { - Q_UNUSED(policyPath); Q_UNUSED(locale); + + if (!policyPath.empty()) + { + d->policyPath = policyPath; + } } void SecuritySnapIn::onDataSave() { + d->onDataSave(); } void SecuritySnapIn::onRetranslateUI(const std::string &locale) { - Q_UNUSED(locale); + d->localeName = locale; + d->policyBundleLoad(); + setRootNode(static_cast(d->proxyModel.get())); } } From 7ecdd4ba7b1b56cc9d7132aa92d1f8501d178a76 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:35:30 +0400 Subject: [PATCH 30/60] feat: update security definitions --- src/plugins/security/model/sdmx/securitydefinition.h | 5 +++++ src/plugins/security/model/sdmx/securitydefinitions.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/plugins/security/model/sdmx/securitydefinition.h b/src/plugins/security/model/sdmx/securitydefinition.h index 8474d0253..8a7b6d465 100644 --- a/src/plugins/security/model/sdmx/securitydefinition.h +++ b/src/plugins/security/model/sdmx/securitydefinition.h @@ -71,6 +71,11 @@ class SecurityDefinition */ SecurityType securityType { SecurityType::Machine }; + /*! + * \brief presentation A reference to a policy presentation in the localized presentation section/table. + */ + std::unique_ptr presentation{}; + /*! * \brief parentCategory */ diff --git a/src/plugins/security/model/sdmx/securitydefinitions.h b/src/plugins/security/model/sdmx/securitydefinitions.h index adcc7b456..ef600aa65 100644 --- a/src/plugins/security/model/sdmx/securitydefinitions.h +++ b/src/plugins/security/model/sdmx/securitydefinitions.h @@ -25,6 +25,8 @@ #include "securitydefinition.h" +#include "../presentation/category.h" + #include #include #include @@ -49,6 +51,12 @@ class SecurityDefinitions */ std::string schemaVersion{}; + /*! + * \brief categories Contains a list of categories under which Group Policy + * settings will be displayed in the Editor. + */ + std::vector> categories{}; + /*! * \brief security */ From 8301ac4b3350b2d23eb0bb24959ae86bd4c546a6 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:37:34 +0400 Subject: [PATCH 31/60] feat: implement basic security bundle --- .../security/model/bundle/securitybundle.cpp | 492 +++++++++++++++++- .../security/model/bundle/securitybundle.h | 6 +- 2 files changed, 471 insertions(+), 27 deletions(-) diff --git a/src/plugins/security/model/bundle/securitybundle.cpp b/src/plugins/security/model/bundle/securitybundle.cpp index 29a63c427..e8298ce75 100644 --- a/src/plugins/security/model/bundle/securitybundle.cpp +++ b/src/plugins/security/model/bundle/securitybundle.cpp @@ -21,45 +21,391 @@ #include "securitybundle.h" #include +#include #include +#include + +#include "../administrative_templates/bundle/itemtype.h" +#include "../administrative_templates/bundle/policyroles.h" + +#include "../sdmx/security.h" + +#include "../../../src/core/pluginstorage.h" + +#include "../../../src/plugins/sdml/sdmlformat.h" +#include "../../../src/plugins/sdmx/sdmxformat.h" + +#include +#include +#include + +#include "../sdmx/securitydefinitions.h" +#include "../presentation/securitypresentationresources.h" +#include "../presentation/securitypresentation.h" + +using namespace model::bundle; namespace security { -SecurityBundle::SecurityBundle() +struct CategoryStorage { + QStandardItem *machineItem = nullptr; + QStandardItem *userItem = nullptr; + Category category = {}; + std::string fileName = {}; +}; + +struct SecurityStorage +{ + SecurityType type = security::SecurityType::Machine; + std::string category = {}; + std::string fileName = {}; + QStandardItem *item = nullptr; +}; + +class SecurityBundlePrivate +{ +public: + std::unique_ptr treeModel = nullptr; + QStandardItem *rootMachineItem = nullptr; + QStandardItem *rootUserItem = nullptr; + std::vector items = {}; + std::map supportedOnMap = {}; + QStringList languageDirectoryPaths = {}; + std::vector unassignedItems = {}; + std::map categoryItemMap = {}; +}; + +template +std::unique_ptr loadPolicies(const QString &pluginName, const QFileInfo &fileName) +{ + std::unique_ptr policies; + + TFormat *format = gpui::PluginStorage::instance()->createPluginClass(pluginName); + + if (!format) + { + return policies; + } + + std::ifstream file; + + file.open(fileName.absoluteFilePath().toStdString(), std::ifstream::in); + + if (file.good()) + { + policies = std::make_unique(); + + if (!format->read(file, policies.get())) + { + qWarning() << fileName.fileName() + " " + QString::fromStdString(format->getErrorString()); + } + } + + file.close(); + delete format; + + return policies; } -SecurityBundle::~SecurityBundle() +QString SecurityBundle::constructFileName(const QFileInfo &fileName) { + QString sdmlFileName = fileName.fileName(); + sdmlFileName.replace(sdmlFileName.length() - 4, 4, "sdml"); + for (const auto &path : d->languageDirectoryPaths) + { + QDir admlDir(path); + if (admlDir.isEmpty()) + { + continue; + } + for (const auto &file : admlDir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot)) + { + if (file.fileName().toLower().compare(sdmlFileName.toLower()) == 0) + { + return file.absoluteFilePath(); + } + } + } + + return sdmlFileName; } -std::unique_ptr SecurityBundle::loadFolder(const std::string &path, const std::string &language) +std::string findStringById(const std::string &id, const std::unique_ptr &resource) { - Q_UNUSED(path); - Q_UNUSED(language); + if (id.length() < 10 || id.compare(0, 9, "$(string.") != 0) + { + return id; + } + std::string pureId = id.substr(9, id.length() - 10); + for (auto ¤tResource : resource->getAll()) + { + auto search = currentResource->stringTable.find(pureId); + if (search != currentResource->stringTable.end()) + { + return search->second; + } + } + + return pureId; +} + +std::shared_ptr findPresentationById( + const std::string &id, const std::unique_ptr &resource) +{ + if (id.length() < 16 || id.compare(0, 15, "$(presentation.") != 0) + { + return nullptr; + } + std::string pureId = id.substr(15, id.length() - 16); + for (auto ¤tResource : resource->getAll()) + { + auto &table = currentResource->presentationTable; + + auto search = std::find_if(table.begin(), table.end(), [pureId](auto& element) + { + return pureId.compare(element.first) == 0; + }); + + if (search != table.end()) + { + return search->second; + } + } return nullptr; } -bool SecurityBundle::loadAdmxAndAdml(const QFileInfo &admxFileName) +void handlePresentation(const std::shared_ptr &presentation, + const std::shared_ptr &policy, + const std::unique_ptr<::gpui::SdmlFile> &policyResources) { - Q_UNUSED(admxFileName); + Q_UNUSED(presentation); + Q_UNUSED(policy); + Q_UNUSED(policyResources); + // TODO: Implement. +} - return false; +SecurityBundle::SecurityBundle() + : d(new SecurityBundlePrivate()) +{ } -QString SecurityBundle::constructFileName(const QFileInfo &fileName) +SecurityBundle::~SecurityBundle() +{ + delete d; +} + +std::unique_ptr SecurityBundle::loadFolder(const std::string &path, const std::string &language) { - Q_UNUSED(fileName); + d->treeModel = std::make_unique(); - return ""; + QStandardItem *rootItem = d->treeModel->invisibleRootItem(); + QStandardItem *visibleRootItem = createItem(QObject::tr("[Local Group Policy]"), + "text-x-generic-template", + QObject::tr("Local group policies"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::Both, + false); + visibleRootItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340003}"), model::bundle::CURRENT_UUID); + + rootItem->appendRow(visibleRootItem); + + QStandardItem *machineItem = createItem(QObject::tr("Machine"), + "computer", + QObject::tr("Machine level policies"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::Machine, + false); + machineItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340003}"), model::bundle::PARENT_UUID); + machineItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340000}"), model::bundle::CURRENT_UUID); + d->rootMachineItem = createItem(QObject::tr("Administrative Templates"), + "folder", + QObject::tr("Machine administrative templates"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::Machine, + false); + machineItem->appendRow(d->rootMachineItem); + QStandardItem *userItem = createItem(QObject::tr("User"), + "user-home", + QObject::tr("User level policies"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::User, + false); + userItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340003}"), model::bundle::PARENT_UUID); + userItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340001}"), model::bundle::CURRENT_UUID); + d->rootUserItem = createItem(QObject::tr("Administrative Templates"), + "folder", + QObject::tr("User administrative templates"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::User, + false); + userItem->appendRow(d->rootUserItem); + + visibleRootItem->appendRow(machineItem); + visibleRootItem->appendRow(userItem); + + const QDir dir(path.c_str()); + const QFileInfoList files = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot); + const QFileInfoList directories = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); + + const QString qLanguage = QString::fromStdString(language).toLower(); + + d->languageDirectoryPaths.clear(); + + for (const QFileInfo &subDir : directories) + { + if (subDir.fileName().toLower().endsWith(qLanguage)) + { + d->languageDirectoryPaths.append(subDir.absoluteFilePath()); + } + } + + for (const QFileInfo &file : files) + { + if (file.fileName().toLower().endsWith(".sdmx")) + { + loadSdmxAndSdml(file); + } + } + + rearrangeTreeItems(); + assignSupportedOn(); + + removeEmptyItems(); + + return std::move(d->treeModel); +} + +bool SecurityBundle::loadSdmxAndSdml(const QFileInfo &sdmxFileName) +{ + auto securityDefinitions + = loadPolicies>("sdmx", sdmxFileName); + if (!securityDefinitions.get()) + { + return false; + } + + QString admlFileName = constructFileName(sdmxFileName); + auto policyResources + = loadPolicies<::gpui::SdmlFile, io::PolicyFileFormat<::gpui::SdmlFile>>("sdml", admlFileName); + if (!policyResources.get()) + { + return false; + } + + std::string fileName = sdmxFileName.fileName().toStdString(); + + for (auto &definition : securityDefinitions->getAll()) + { + for (auto &category : definition->categories) + { + auto categoryName = category->name + "." + fileName; + + QString displayName = QString::fromStdString(findStringById(category->displayName, policyResources)); + QString explainText = QString::fromStdString(findStringById(category->explainText, policyResources)); + + d->categoryItemMap[categoryName].machineItem = createItem(displayName, + "folder", + explainText, + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::Machine, + false); + d->categoryItemMap[categoryName].userItem = createItem(displayName, + "folder", + explainText, + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::User, + false); + d->categoryItemMap[categoryName].category = *category; + d->categoryItemMap[categoryName].fileName = fileName; + + d->categoryItemMap[category->name].machineItem = d->categoryItemMap[categoryName].machineItem; + d->categoryItemMap[category->name].userItem = d->categoryItemMap[categoryName].userItem; + + if (category->parentCategory.size() == 0) + { + d->rootUserItem->appendRow(d->categoryItemMap[categoryName].userItem); + d->rootMachineItem->appendRow(d->categoryItemMap[categoryName].machineItem); + } + } + + for (auto &policy : definition->security) + { + + QString displayName = QString::fromStdString(findStringById(policy->displayName, policyResources)); + QString explainText = QString::fromStdString(findStringById(policy->explainText, policyResources)); + + auto policyItem = createItem(displayName, + "text-x-generic", + explainText, + ItemType::ITEM_TYPE_POLICY, + policy->securityType, + false); + + SecurityStorage container; + container.category = policy->parentCategory; + container.item = policyItem; + container.type = policy->securityType; + container.fileName = sdmxFileName.fileName().toStdString(); + + if (policy->presentation) + { + auto presentation = findPresentationById(*policy->presentation.get(), policyResources); + if (presentation) + { + policyItem->setData(QVariant::fromValue(presentation), PolicyRoles::PRESENTATION); + handlePresentation(presentation, policy, policyResources); + } + } + + policyItem->setData(QVariant::fromValue(policy), PolicyRoles::POLICY); + + d->unassignedItems.push_back(container); + } + } + + return true; } void SecurityBundle::rearrangeTreeItems() { + for (const auto &entry : d->categoryItemMap) + { + assignParentCategory(entry.second.category.parentCategory, + entry.second.machineItem, + entry.second.userItem, + entry.second.fileName); + } + + for (const auto &item : d->unassignedItems) + { + if (item.type == SecurityType::User) + { + assignParentCategory(item.category, nullptr, item.item, item.fileName); + } + else if (item.type == SecurityType::Machine) + { + assignParentCategory(item.category, item.item, nullptr, item.fileName); + } + else + { + item.item->setData(static_cast(SecurityType::Machine), PolicyRoles::POLICY_TYPE); + QStandardItem *copyItem = createItem(item.item->text(), + "text-x-generic", + item.item->data(PolicyRoles::EXPLAIN_TEXT).value(), + ItemType::ITEM_TYPE_POLICY, + SecurityType::User, + true); + copyItem->setData(item.item->data(PolicyRoles::SUPPORTED_ON), PolicyRoles::SUPPORTED_ON); + copyItem->setData(item.item->data(PolicyRoles::PRESENTATION), PolicyRoles::PRESENTATION); + copyItem->setData(item.item->data(PolicyRoles::POLICY), PolicyRoles::POLICY); + assignParentCategory(item.category, item.item, copyItem, item.fileName); + } + } } void SecurityBundle::assignParentCategory(const std::string &rawCategory, @@ -67,27 +413,95 @@ void SecurityBundle::assignParentCategory(const std::string &rawCategory, QStandardItem *userItem, const std::string &fileName) { - Q_UNUSED(rawCategory); - Q_UNUSED(machineItem); - Q_UNUSED(userItem); - Q_UNUSED(fileName); + std::string parentCategory = rawCategory; + std::string::size_type position = parentCategory.find(':'); + if (position != std::string::npos) + { + parentCategory = parentCategory.substr(position + 1); + } + + std::string parentCategoryWithFilename = parentCategory + "." + fileName; + + auto search = d->categoryItemMap.find(parentCategoryWithFilename); + if (search != d->categoryItemMap.end()) + { + if (machineItem) + { + if (!machineItem->data(PolicyRoles::POLICY_WIDGET + 1).value()) + { + search->second.machineItem->appendRow(machineItem); + machineItem->setData(true, PolicyRoles::POLICY_WIDGET + 1); + } + } + if (userItem) + { + if (!userItem->data(PolicyRoles::POLICY_WIDGET + 1).value()) + { + search->second.userItem->appendRow(userItem); + userItem->setData(true, PolicyRoles::POLICY_WIDGET + 1); + } + } + } + else if ((search = d->categoryItemMap.find(parentCategory)) != d->categoryItemMap.end()) + { + if (machineItem) + { + if (!machineItem->data(PolicyRoles::POLICY_WIDGET + 1).value()) + { + search->second.machineItem->appendRow(machineItem); + machineItem->setData(true, PolicyRoles::POLICY_WIDGET + 1); + } + } + if (userItem) + { + if (!userItem->data(PolicyRoles::POLICY_WIDGET + 1).value()) + { + search->second.userItem->appendRow(userItem); + userItem->setData(true, PolicyRoles::POLICY_WIDGET + 1); + } + } + } + else if (rawCategory.size() > 0) + { + qWarning() << "Unable to find parent category: " << rawCategory.c_str() << fileName.c_str(); + if (machineItem) + { + if (!machineItem->data(PolicyRoles::POLICY_WIDGET + 1).value()) + { + d->rootMachineItem->appendRow(machineItem); + machineItem->setData(true, PolicyRoles::POLICY_WIDGET + 1); + } + } + + if (userItem) + { + if (!userItem->data(PolicyRoles::POLICY_WIDGET + 1).value()) + { + d->rootUserItem->appendRow(userItem); + userItem->setData(true, PolicyRoles::POLICY_WIDGET + 1); + } + } + } } QStandardItem *SecurityBundle::createItem(const QString &displayName, const QString &iconName, const QString &explainText, const uint itemType, - int securityType, + const SecurityType securityType, const bool alreadyInserted) { - Q_UNUSED(displayName); - Q_UNUSED(iconName); - Q_UNUSED(explainText); - Q_UNUSED(itemType); - Q_UNUSED(securityType); - Q_UNUSED(alreadyInserted); + QStandardItem *categoryItem = new QStandardItem(displayName.trimmed()); + categoryItem->setIcon(QIcon::fromTheme(iconName)); + categoryItem->setFlags(categoryItem->flags() & (~Qt::ItemIsEditable)); + categoryItem->setData(explainText, PolicyRoles::EXPLAIN_TEXT); + categoryItem->setData(itemType, PolicyRoles::ITEM_TYPE); + categoryItem->setData(static_cast(securityType), PolicyRoles::POLICY_TYPE); + categoryItem->setData(alreadyInserted, PolicyRoles::POLICY_WIDGET + 1); - return nullptr; + d->items.push_back(categoryItem); + + return categoryItem; } void SecurityBundle::assignSupportedOn() @@ -96,13 +510,41 @@ void SecurityBundle::assignSupportedOn() void SecurityBundle::removeEmptyItems() { + iterateModelAndRemoveEmptyFolders(d->treeModel.get(), d->rootMachineItem->index()); + iterateModelAndRemoveEmptyFolders(d->treeModel.get(), d->rootUserItem->index()); } void SecurityBundle::iterateModelAndRemoveEmptyFolders(QAbstractItemModel *model, const QModelIndex &parent) { - Q_UNUSED(model); - Q_UNUSED(parent); + for (int r = 0; r < model->rowCount(parent); ++r) + { + QModelIndex index = model->index(r, 0, parent); + QVariant data = model->data(index, PolicyRoles::ITEM_TYPE); + + qDebug() << "Folder " << model->data(index) << " has children: " << model->hasChildren(index) + << " type: " << data; + + if (model->hasChildren(index)) + { + iterateModelAndRemoveEmptyFolders(model, index); + } + else + { + if (data == 0) + { + qDebug() << "Deleted folder " << model->data(index); + + model->removeRow(index.row(), index.parent()); + + iterateModelAndRemoveEmptyFolders(model, index.parent()); + } + } + } } } + +Q_DECLARE_METATYPE(std::shared_ptr<::security::SecurityPresentation>) +Q_DECLARE_METATYPE(std::shared_ptr<::security::SecurityDefinition>) + diff --git a/src/plugins/security/model/bundle/securitybundle.h b/src/plugins/security/model/bundle/securitybundle.h index c28e5dd18..e427b7476 100644 --- a/src/plugins/security/model/bundle/securitybundle.h +++ b/src/plugins/security/model/bundle/securitybundle.h @@ -24,6 +24,8 @@ #include #include +#include "../sdmx/security.h" + class QFileInfo; class QString; class QStandardItem; @@ -54,7 +56,7 @@ class SecurityBundle SecurityBundlePrivate *d { nullptr }; private: - bool loadAdmxAndAdml(const QFileInfo &admxFileName); + bool loadSdmxAndSdml(const QFileInfo &sdmxFileName); QString constructFileName(const QFileInfo &fileName); @@ -69,7 +71,7 @@ class SecurityBundle const QString &iconName, const QString &explainText, const uint itemType, - int securityType, + const SecurityType securityType, const bool alreadyInserted); void assignSupportedOn(); From 912381c075a9f873e3ef8d5089b756a79967e2fc Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 17 Aug 2023 14:34:33 +0400 Subject: [PATCH 32/60] chore: refactor sdml format --- src/plugins/sdml/sdmlformat.cpp | 2 +- src/plugins/sdml/sdmlformat.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index f8dc10d65..a654756bd 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -272,7 +272,7 @@ bool SdmlFormat::read(std::istream &input, SdmlFile *file) auto operation = [&]() { std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityPresentation>policyDefinitionResources; - std::shared_ptr securityPresentation(nullptr); + std::shared_ptr securityPresentation(nullptr); file->add(securityPresentation); }; diff --git a/src/plugins/sdml/sdmlformat.h b/src/plugins/sdml/sdmlformat.h index cca2871fa..a3e450afa 100644 --- a/src/plugins/sdml/sdmlformat.h +++ b/src/plugins/sdml/sdmlformat.h @@ -29,12 +29,12 @@ namespace security { - class SecurityPresentation; + class SecurityPresentationResources; } namespace gpui { -typedef io::BaseFile SdmlFile; +typedef io::BaseFile SdmlFile; class GPUI_SYMBOL_EXPORT SdmlFormat : public io::PolicyFileFormat { From 0157bd5f565d225d89c801a78bdc077d83ccdfcb Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:44:49 +0400 Subject: [PATCH 33/60] feat: update sdml format --- src/plugins/sdml/sdmlformat.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index a654756bd..0cf118219 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -253,9 +253,9 @@ class XsdResourcesAdapter : public security::SecurityPresentationResources } } - static std::unique_ptr create(const SecurityPresentationResources &resources) + static std::shared_ptr create(const SecurityPresentationResources &resources) { - return std::make_unique(resources); + return std::make_shared(resources); } }; @@ -268,11 +268,11 @@ bool SdmlFormat::read(std::istream &input, SdmlFile *file) { Q_UNUSED(input); - std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityDefinitions> securityDefinitions; + std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityPresentationResources> securityDefinitions; auto operation = [&]() { - std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityPresentation>policyDefinitionResources; + securityDefinitions = GroupPolicy::SecurityDefinitions::SecurityPresentationResources_(input, ::xsd::cxx::tree::flags::dont_validate); - std::shared_ptr securityPresentation(nullptr); + auto securityPresentation = XsdResourcesAdapter::create(*securityDefinitions); file->add(securityPresentation); }; From f7d4353e37bb2d131ece4bb408c5fff9d005c1e5 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 17 Aug 2023 17:04:31 +0400 Subject: [PATCH 34/60] wip: update sdml format plugin --- src/plugins/sdml/sdmlformat.cpp | 74 ++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 0cf118219..16ab3c374 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -249,7 +249,79 @@ class XsdResourcesAdapter : public security::SecurityPresentationResources for (const auto &presentation : resources.presentationTable()) { Q_UNUSED(presentation); - // TODO: Implement. + + auto securityPresentation = std::make_shared(); + auto &widgetsVector = securityPresentation->widgets; + + const xercesc::DOMNode *n = presentation._node(); + assert(n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE); + const xercesc::DOMElement *re = static_cast(n); + + for (n = re->getFirstChild(); n != 0; n = n->getNextSibling()) + { + if (n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE) + { + auto elementNode = static_cast(n); + auto elementType = QString::fromStdU16String(elementNode->getTagName()); + if (elementType.compare("checkBox") == 0) + { + auto checkBox = std::make_unique<::GroupPolicy::SecurityDefinitions::CheckBox>(*elementNode); + auto widget = XsdCheckBoxAdapter::create(*checkBox); + widgetsVector.emplace_back(checkBox->refId(), widget); + } + else if (elementType.compare("comboBox") == 0) + { + auto comboBox = std::make_unique<::GroupPolicy::SecurityDefinitions::ComboBox>(*elementNode); + auto widget = XsdComboBoxAdapter::create(*comboBox); + widgetsVector.emplace_back(comboBox->refId(), widget); + } + else if (elementType.compare("decimalTextBox") == 0) + { + auto decimalTextBox = std::make_unique<::GroupPolicy::SecurityDefinitions::DecimalTextBox>( + *elementNode); + auto widget = XsdDecimalTextBoxAdapter::create(*decimalTextBox); + widgetsVector.emplace_back(decimalTextBox->refId(), widget); + } + else if (elementType.compare("dropdownList") == 0) + { + auto dropdownList = std::make_unique<::GroupPolicy::SecurityDefinitions::DropdownList>( + *elementNode); + auto widget = XsdDropdownListAdapter::create(*dropdownList); +// widgetsVector.emplace_back(dropdownList->refId(), widget); + } + else if (elementType.compare("listBox") == 0) + { + auto listBox = std::make_unique<::GroupPolicy::SecurityDefinitions::ListBox>(*elementNode); + auto widget = XsdListBoxAdapter::create(*listBox); + widgetsVector.emplace_back(listBox->refId(), widget); + } + else if (elementType.compare("longDecimalTextBox") == 0) + { + auto longDecimalTextBox + = std::make_unique<::GroupPolicy::SecurityDefinitions::LongDecimalTextBox>(*elementNode); + auto widget = XsdLongDecimalTextBoxAdapter::create(*longDecimalTextBox); + widgetsVector.emplace_back(longDecimalTextBox->refId(), widget); + } + else if (elementType.compare("multiTextBox") == 0) + { + auto multiTextBox = std::make_unique<::GroupPolicy::SecurityDefinitions::MultiTextBox>( + *elementNode); + auto widget = XsdMultiTextBoxAdapter::create(*multiTextBox); + widgetsVector.emplace_back(multiTextBox->refId(), widget); + } + else if (elementType.compare("textBox") == 0) + { + auto textBox = std::make_unique<::GroupPolicy::SecurityDefinitions::TextBox>(*elementNode); + auto widget = XsdTextBoxAdapter::create(*textBox); + widgetsVector.emplace_back(textBox->refId(), widget); + } + else if (elementType.compare("text") == 0) + { + auto text = std::make_unique<::GroupPolicy::SecurityDefinitions::Comment>(*elementNode); + // TODO: Implement. + } + } + } } } From 85673b849cc7ec1cdb8830c1cc0b0a2a59eea356 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 17 Aug 2023 17:43:15 +0400 Subject: [PATCH 35/60] chore: update types in sdml format --- src/plugins/sdml/sdmlformat.cpp | 36 +++++++-------- .../model/presentation/securitypresentation.h | 24 +++++----- .../security/model/ui/presentationbuilder.cpp | 46 +++++++++---------- 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 16ab3c374..aa54f441b 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -52,9 +52,9 @@ class XsdCheckBoxAdapter : public security::CheckBox assign_if_exists(this->postfix, widget.postfix()); } - static std::unique_ptr create(const CheckBox &widget) + static std::shared_ptr create(const CheckBox &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -78,9 +78,9 @@ class XsdComboBoxAdapter : public security::ComboBox } } - static std::unique_ptr create(const ComboBox &widget) + static std::shared_ptr create(const ComboBox &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -99,9 +99,9 @@ class XsdDecimalTextBoxAdapter : public security::DecimalTextBox assign_if_exists(this->postfix, widget.postfix()); } - static std::unique_ptr create(const DecimalTextBox &widget) + static std::shared_ptr create(const DecimalTextBox &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -118,9 +118,9 @@ class XsdDropdownListAdapter : public security::DropdownList // TODO: Implement. } - static std::unique_ptr create(const DropdownList &widget) + static std::shared_ptr create(const DropdownList &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -136,9 +136,9 @@ class XsdListBoxAdapter : public security::ListBox assign_if_exists(this->postfix, widget.postfix()); } - static std::unique_ptr create(const ListBox &widget) + static std::shared_ptr create(const ListBox &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -157,9 +157,9 @@ class XsdLongDecimalTextBoxAdapter : public security::LongDecimalTextBox assign_if_exists(this->postfix, widget.postfix()); } - static std::unique_ptr create(const LongDecimalTextBox &widget) + static std::shared_ptr create(const LongDecimalTextBox &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -177,9 +177,9 @@ class XsdMultiTextBoxAdapter : public security::MultiTextBox // this->showAsDialog = widget.showAsDialog(); } - static std::unique_ptr create(const MultiTextBox &widget) + static std::shared_ptr create(const MultiTextBox &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -200,9 +200,9 @@ class XsdTextBoxAdapter : public security::TextBox this->refId = widget.refId(); } - static std::unique_ptr create(const TextBox &widget) + static std::shared_ptr create(const TextBox &widget) { - return std::make_unique(widget); + return std::make_shared(widget); } }; @@ -219,9 +219,9 @@ class XsdTextAdapter : public security::Text // TODO: Implement. } - static std::unique_ptr create(const TextElement &string) + static std::shared_ptr create(const TextElement &string) { - return std::make_unique(string); + return std::make_shared(string); } }; diff --git a/src/plugins/security/model/presentation/securitypresentation.h b/src/plugins/security/model/presentation/securitypresentation.h index 5e5c933e9..66bc30e08 100644 --- a/src/plugins/security/model/presentation/securitypresentation.h +++ b/src/plugins/security/model/presentation/securitypresentation.h @@ -32,17 +32,17 @@ namespace security { // the variant to visit -typedef ::std::variant PresentationElement; +typedef ::std::variant, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr, + std::shared_ptr > PresentationElement; /*! * \class SecurityPresentation @@ -72,7 +72,7 @@ class SecurityPresentation: public PresentationElements /*! * \brief widgets List of widgets, associated with their ids. */ - std::vector>> widgets{}; + std::vector> widgets{}; }; } // of namespace security diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index 746e601b5..e2ebce0d2 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -264,55 +264,55 @@ QVBoxLayout *PresentationBuilder::build(const PresentationBuilderParams ¶ms) std::visit([](auto&& arg) noexcept { using T = std::decay_t; - if constexpr (std::is_same_v) + if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v >) { - d->visit(arg); + d->visit(*arg); } else { static_assert(always_false_v, "non-exhaustive visitor!"); } - }, *widget.second.get()); + }, widget.second); } layout->addStretch(); From 564d84f33faa3a19530a794c9b53f29f87933ea8 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:40:12 +0400 Subject: [PATCH 36/60] feat: add new widgets to presentation widget --- src/plugins/sdml/sdmlformat.cpp | 75 +++++++++++++++++++ .../model/presentation/presentationelements.h | 12 +++ .../model/presentation/securitypresentation.h | 4 +- .../security/model/ui/presentationbuilder.cpp | 22 ++++++ 4 files changed, 112 insertions(+), 1 deletion(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index aa54f441b..52123fdac 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -225,6 +225,63 @@ class XsdTextAdapter : public security::Text } }; +class XsdLdapSearchDialogAdapter : public security::LdapSearchDialog +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::LdapSearchDialog LdapSearchDialog; + +public: + XsdLdapSearchDialogAdapter(const LdapSearchDialog &widget) + : security::LdapSearchDialog() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::shared_ptr create(const LdapSearchDialog &string) + { + return std::make_shared(string); + } +}; + +class XsdRadioButtonAdapter : public security::RadioButton +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::RadioButton RadioButton; + +public: + XsdRadioButtonAdapter(const RadioButton& widget) + : security::RadioButton() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::shared_ptr create(const RadioButton &radioButton) + { + return std::make_shared(radioButton); + } +}; + +class XsdGroupBoxAdapter : public security::GroupBox +{ +private: + typedef ::GroupPolicy::SecurityDefinitions::GroupBox GroupBox; + +public: + XsdGroupBoxAdapter(const GroupBox& widget) + : security::GroupBox() + { + Q_UNUSED(widget); + // TODO: Implement. + } + + static std::shared_ptr create(const GroupBox &groupBox) + { + return std::make_shared(groupBox); + } +}; + template void adapt_widgets(const SequenceType &sequence, std::map> &widgets) @@ -320,6 +377,24 @@ class XsdResourcesAdapter : public security::SecurityPresentationResources auto text = std::make_unique<::GroupPolicy::SecurityDefinitions::Comment>(*elementNode); // TODO: Implement. } + else if (elementType.compare("ldapSearchDialog") == 0) + { + auto ldapSearch = std::make_unique<::GroupPolicy::SecurityDefinitions::LdapSearchDialog>(*elementNode); + auto widget = XsdLdapSearchDialogAdapter::create(*ldapSearch); + widgetsVector.emplace_back(ldapSearch->refId(), widget); + } + else if (elementType.compare("radioButton") == 0) + { + auto radioButton = std::make_unique<::GroupPolicy::SecurityDefinitions::RadioButton>(*elementNode); + auto widget = XsdRadioButtonAdapter::create(*radioButton); + widgetsVector.emplace_back(radioButton->refId(), widget); + } + else if (elementType.compare("groupBox") == 0) + { + auto groupBox = std::make_unique<::GroupPolicy::SecurityDefinitions::GroupBox>(*elementNode); + auto widget = XsdGroupBoxAdapter::create(*groupBox); + widgetsVector.emplace_back(groupBox->refId(), widget); + } } } } diff --git a/src/plugins/security/model/presentation/presentationelements.h b/src/plugins/security/model/presentation/presentationelements.h index 1e7f0f6a7..2240459a5 100644 --- a/src/plugins/security/model/presentation/presentationelements.h +++ b/src/plugins/security/model/presentation/presentationelements.h @@ -29,6 +29,8 @@ #include "groupbox.h" #include "listbox.h" #include "longdecimaltextbox.h" +#include "ldapsearchdialog.h" +#include "radiobutton.h" #include "multitextbox.h" #include "textbox.h" #include "text.h" @@ -102,6 +104,16 @@ class PresentationElements * \brief text */ std::vector text{}; + + /*! + * \brief ldapSearchDialog + */ + std::vector ldapSearchDialog{}; + + /*! + * \brief radioButton + */ + std::vector radioButton{}; }; } // of namespace security diff --git a/src/plugins/security/model/presentation/securitypresentation.h b/src/plugins/security/model/presentation/securitypresentation.h index 66bc30e08..b9da122c3 100644 --- a/src/plugins/security/model/presentation/securitypresentation.h +++ b/src/plugins/security/model/presentation/securitypresentation.h @@ -42,7 +42,9 @@ typedef ::std::variant, std::shared_ptr, std::shared_ptr, std::shared_ptr, - std::shared_ptr > PresentationElement; + std::shared_ptr, + std::shared_ptr, + std::shared_ptr > PresentationElement; /*! * \class SecurityPresentation diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index e2ebce0d2..1144a7c58 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -180,6 +180,20 @@ class PresentationBuilderPrivate Q_UNUSED(widget); } + void visit(LdapSearchDialog &widget) const + { + // TODO: Implement. + + Q_UNUSED(widget); + } + + void visit(RadioButton &widget) const + { + // TODO: Implement. + + Q_UNUSED(widget); + } + void visit(Comment &widget) const { QLabel *label = new QLabel(); @@ -308,6 +322,14 @@ QVBoxLayout *PresentationBuilder::build(const PresentationBuilderParams ¶ms) { d->visit(*arg); } + else if constexpr (std::is_same_v >) + { + d->visit(*arg); + } + else if constexpr (std::is_same_v >) + { + d->visit(*arg); + } else { static_assert(always_false_v, "non-exhaustive visitor!"); From e866c424f98a2dfece1a2e1643f290c93828dbb5 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 18 Aug 2023 16:45:43 +0400 Subject: [PATCH 37/60] feat: implement radio button --- src/plugins/security/model/ui/presentationbuilder.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index 1144a7c58..b4ccd5bb3 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -189,9 +190,12 @@ class PresentationBuilderPrivate void visit(RadioButton &widget) const { - // TODO: Implement. + QRadioButton *radioButton = new QRadioButton(); - Q_UNUSED(widget); + radioButton->setChecked(widget.defaultChecked); + QLayoutItem *container = createAndAttachLabel(radioButton, ""); + + addToLayout(container); } void visit(Comment &widget) const From 9f421298fa13c1b6772c3085313a1ebe14539ed3 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:13:51 +0400 Subject: [PATCH 38/60] feat: implement ldap search dialog in sdml plugin --- src/plugins/sdml/sdmlformat.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 52123fdac..acb4e7572 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -234,8 +234,13 @@ class XsdLdapSearchDialogAdapter : public security::LdapSearchDialog XsdLdapSearchDialogAdapter(const LdapSearchDialog &widget) : security::LdapSearchDialog() { - Q_UNUSED(widget); - // TODO: Implement. + this->refId = widget.refId(); + + assign_if_exists(this->postfix, widget.postfix()); + assign_if_exists(this->dn, widget.dn()); + assign_if_exists(this->filter, widget.filter()); + assign_if_exists(this->addLabel, widget.addLabel()); + assign_if_exists(this->removeLabel, widget.removeLabel()); } static std::shared_ptr create(const LdapSearchDialog &string) From fbb63ad78c89b25058feb3660e70c851e9762f07 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:20:07 +0400 Subject: [PATCH 39/60] feat: implement radio button in sdml format --- src/plugins/sdml/sdmlformat.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index acb4e7572..695752cbb 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -258,8 +258,9 @@ class XsdRadioButtonAdapter : public security::RadioButton XsdRadioButtonAdapter(const RadioButton& widget) : security::RadioButton() { - Q_UNUSED(widget); - // TODO: Implement. + this->refId = widget.refId(); + + assign_if_exists(this->defaultChecked, widget.defaultChecked()); } static std::shared_ptr create(const RadioButton &radioButton) From 212a6530ef15cba266b5ec649ee1f77fb6c8b311 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 21 Aug 2023 18:46:59 +0400 Subject: [PATCH 40/60] feat: implement group box in sdml --- src/plugins/sdml/sdmlformat.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 695752cbb..22dd39048 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -215,7 +215,8 @@ class XsdTextAdapter : public security::Text XsdTextAdapter(const TextElement &widget) : security::Text() { - Q_UNUSED(widget); + this->refId = widget.refId(); + // TODO: Implement. } @@ -278,8 +279,15 @@ class XsdGroupBoxAdapter : public security::GroupBox XsdGroupBoxAdapter(const GroupBox& widget) : security::GroupBox() { - Q_UNUSED(widget); - // TODO: Implement. + this->refId = widget.refId(); + + assign_if_exists(this->label, widget.label()); + + assign_if_exists(this->hasCheckBox, widget.hasCheckBox()); + + assign_if_exists(this->defaultChecked, widget.defaultChecked()); + + assign_if_exists(this->hasBorder, widget.hasBorder()); } static std::shared_ptr create(const GroupBox &groupBox) From d3b7ccc04a994cb43eecba9cdd87bd64a6a09cfb Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:10:58 +0400 Subject: [PATCH 41/60] feat: add ldap search widget and browse dialog --- src/plugins/security/CMakeLists.txt | 6 ++ .../security/model/ui/browseldapdialog.cpp | 47 ++++++++++ .../security/model/ui/browseldapdialog.h | 59 ++++++++++++ .../security/model/ui/browseldapdialog.ui | 74 +++++++++++++++ .../model/ui/ldapsearchlistwidget.cpp | 89 +++++++++++++++++++ .../security/model/ui/ldapsearchlistwidget.h | 67 ++++++++++++++ .../security/model/ui/ldapsearchlistwidget.ui | 51 +++++++++++ 7 files changed, 393 insertions(+) create mode 100644 src/plugins/security/model/ui/browseldapdialog.cpp create mode 100644 src/plugins/security/model/ui/browseldapdialog.h create mode 100644 src/plugins/security/model/ui/browseldapdialog.ui create mode 100644 src/plugins/security/model/ui/ldapsearchlistwidget.cpp create mode 100644 src/plugins/security/model/ui/ldapsearchlistwidget.h create mode 100644 src/plugins/security/model/ui/ldapsearchlistwidget.ui diff --git a/src/plugins/security/CMakeLists.txt b/src/plugins/security/CMakeLists.txt index 34186f86a..71eaf6329 100644 --- a/src/plugins/security/CMakeLists.txt +++ b/src/plugins/security/CMakeLists.txt @@ -56,6 +56,8 @@ set(HEADERS model/ui/presentationbuilder.h model/ui/securityproxymodel.h model/ui/securitywidget.h + model/ui/ldapsearchlistwidget.h + model/ui/browseldapdialog.h ) set(SOURCES @@ -63,10 +65,14 @@ set(SOURCES model/ui/presentationbuilder.cpp model/ui/securityproxymodel.cpp model/ui/securitywidget.cpp + model/ui/ldapsearchlistwidget.cpp + model/ui/browseldapdialog.cpp ) set(UI_FORMS model/ui/securitywidget.ui + model/ui/ldapsearchlistwidget.ui + model/ui/browseldapdialog.ui ) set(PLUGIN_HEADERS diff --git a/src/plugins/security/model/ui/browseldapdialog.cpp b/src/plugins/security/model/ui/browseldapdialog.cpp new file mode 100644 index 000000000..94874ae89 --- /dev/null +++ b/src/plugins/security/model/ui/browseldapdialog.cpp @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "browseldapdialog.h" +#include "ui_browseldapdialog.h" + +namespace security +{ + +class BrowseLdapDialogPrivate +{ +private: +}; + +BrowseLdapDialog::BrowseLdapDialog(QWidget *parent) + : QDialog(parent) + , d(new BrowseLdapDialogPrivate()) + , ui(new Ui::BrowseLdapDialog()) +{ + ui->setupUi(this); +} + +BrowseLdapDialog::~BrowseLdapDialog() +{ + delete d; + delete ui; +} + +} + diff --git a/src/plugins/security/model/ui/browseldapdialog.h b/src/plugins/security/model/ui/browseldapdialog.h new file mode 100644 index 000000000..dc189aa7e --- /dev/null +++ b/src/plugins/security/model/ui/browseldapdialog.h @@ -0,0 +1,59 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef SECURITY_BROWSE_LDAP_DIALOG_H +#define SECURITY_BROWSE_LDAP_DIALOG_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class BrowseLdapDialog; } +QT_END_NAMESPACE + +namespace security +{ + +class BrowseLdapDialogPrivate; + +class BrowseLdapDialog : public QDialog +{ +public: + Q_OBJECT + +public: + explicit BrowseLdapDialog(QWidget* parent = nullptr); + ~BrowseLdapDialog() override; + +private: + BrowseLdapDialog(const BrowseLdapDialog&) = delete; // copy ctor + BrowseLdapDialog(BrowseLdapDialog&&) = delete; // move ctor + BrowseLdapDialog& operator=(const BrowseLdapDialog&) = delete; // copy assignment + BrowseLdapDialog& operator=(BrowseLdapDialog&&) = delete; // move assignment + +private: + BrowseLdapDialogPrivate *d{}; + +private: + Ui::BrowseLdapDialog *ui{}; +}; + +} + +#endif//SECURITY_BROWSE_LDAP_DIALOG_H diff --git a/src/plugins/security/model/ui/browseldapdialog.ui b/src/plugins/security/model/ui/browseldapdialog.ui new file mode 100644 index 000000000..b695c1b5e --- /dev/null +++ b/src/plugins/security/model/ui/browseldapdialog.ui @@ -0,0 +1,74 @@ + + + BrowseLdapDialog + + + + 0 + 0 + 411 + 83 + + + + Dialog + + + + + + + + + Browse + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + BrowseLdapDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + BrowseLdapDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.cpp b/src/plugins/security/model/ui/ldapsearchlistwidget.cpp new file mode 100644 index 000000000..9cc206b8c --- /dev/null +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.cpp @@ -0,0 +1,89 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#include "ldapsearchlistwidget.h" +#include "ui_ldapsearchlistwidget.h" + +#include "browseldapdialog.h" + +#include + +namespace security +{ + +class LdapSearchListWidgetPrivate +{ +public: + QString filter{}; + QString dn{}; + + LdapSearchListWidgetPrivate(const QString &newFilter, const QString &newDN) + : filter(newFilter) + , dn(newDN) + {} +}; + +LdapSearchListWidget::LdapSearchListWidget(const QString &filter, const QString &dn, QWidget *parent) + : QWidget(parent) + , d(new LdapSearchListWidgetPrivate(filter, dn)) + , ui(new Ui::LdapSearchListWidget()) +{ + ui->setupUi(this); +} + +LdapSearchListWidget::LdapSearchListWidget(const std::string &filter, const std::string &dn, QWidget *parent) + : LdapSearchListWidget(QString::fromStdString(filter), QString::fromStdString(dn), parent) +{ +} + +LdapSearchListWidget::~LdapSearchListWidget() +{ + delete d; + delete ui; +} + +void LdapSearchListWidget::setAddButtonText(const QString &text) +{ + ui->addButton->setText(text); +} + +void LdapSearchListWidget::setRemoveButtonText(const QString &text) +{ + ui->removeButton->setText(text); +} + +void LdapSearchListWidget::on_addButton_Pressed() +{ + auto browseLdapDialog = new BrowseLdapDialog(this); + browseLdapDialog->show(); +} + +void LdapSearchListWidget::on_removeButton_Pressed() +{ + auto selectedItems = ui->listWidget->selectedItems(); + + for (const auto& selectedItem : selectedItems) + { + ui->listWidget->removeItemWidget(selectedItem); + delete selectedItem; + } +} + +} diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.h b/src/plugins/security/model/ui/ldapsearchlistwidget.h new file mode 100644 index 000000000..faf1c17dd --- /dev/null +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.h @@ -0,0 +1,67 @@ +/*********************************************************************************************************************** +** +** Copyright (C) 2023 BaseALT Ltd. +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License +** as published by the Free Software Foundation; either version 2 +** of the License, or (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +** +***********************************************************************************************************************/ + +#ifndef SECURITY_LDAP_SEARCH_LIST_WIDGET_H +#define SECURITY_LDAP_SEARCH_LIST_WIDGET_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class LdapSearchListWidget; } +QT_END_NAMESPACE + +namespace security +{ + +class LdapSearchListWidgetPrivate; + +class LdapSearchListWidget : public QWidget +{ +public: + Q_OBJECT + +public: + explicit LdapSearchListWidget(const QString& filter, const QString& dn, QWidget* parent = nullptr); + explicit LdapSearchListWidget(const std::string& filter, const std::string& dn, QWidget* parent = nullptr); + ~LdapSearchListWidget() override; + + void setAddButtonText(const QString& text); + void setRemoveButtonText(const QString& text); + +private slots: + void on_addButton_Pressed(); + void on_removeButton_Pressed(); + +private: + LdapSearchListWidget(const LdapSearchListWidget&) = delete; // copy ctor + LdapSearchListWidget(LdapSearchListWidget&&) = delete; // move ctor + LdapSearchListWidget& operator=(const LdapSearchListWidget&) = delete; // copy assignment + LdapSearchListWidget& operator=(LdapSearchListWidget&&) = delete; // move assignment + +private: + LdapSearchListWidgetPrivate *d{}; + +private: + Ui::LdapSearchListWidget *ui{}; +}; + +} + +#endif//SECURITY_LDAP_SEARCH_LIST_WIDGET_H diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.ui b/src/plugins/security/model/ui/ldapsearchlistwidget.ui new file mode 100644 index 000000000..99871b6a9 --- /dev/null +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.ui @@ -0,0 +1,51 @@ + + + LdapSearchListWidget + + + + 0 + 0 + 411 + 300 + + + + Form + + + + + + Add button + + + + + + + Remove button + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + From e8a6869899aee23fc745483a97960b682bf1adaf Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:21:11 +0400 Subject: [PATCH 42/60] feat: implement ldap search widget in presentation builder --- src/plugins/security/model/ui/presentationbuilder.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index b4ccd5bb3..1d729d2e8 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -35,6 +35,7 @@ #include "../presentation/textbox.h" #include "../presentation/securitypresentationresources.h" +#include "ldapsearchlistwidget.h" #include #include @@ -183,9 +184,14 @@ class PresentationBuilderPrivate void visit(LdapSearchDialog &widget) const { - // TODO: Implement. + LdapSearchListWidget* ldapSearchListWidget = new LdapSearchListWidget(widget.filter, widget.dn); + ldapSearchListWidget->setAddButtonText(QString::fromStdString(widget.addLabel)); + ldapSearchListWidget->setRemoveButtonText(QString::fromStdString(widget.removeLabel)); - Q_UNUSED(widget); + QLayoutItem *container = createAndAttachLabel(ldapSearchListWidget, + QString::fromStdString(widget.postfix)); + + addToLayout(container); } void visit(RadioButton &widget) const From bc8d50b74d21f51da4aa44581388df29783eaa98 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:28:03 +0400 Subject: [PATCH 43/60] feat: update groupbox in presentation builder --- src/plugins/security/model/ui/presentationbuilder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index 1d729d2e8..acf212a67 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -167,8 +167,9 @@ class PresentationBuilderPrivate void visit(GroupBox &widget) const { - Q_UNUSED(widget); QGroupBox *groupBox = new QGroupBox(); + groupBox->setCheckable(widget.hasCheckBox); + groupBox->setChecked(widget.defaultChecked); // TODO: Implement. From d00841899f1f077adc15069525204131714cd237 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:19:56 +0400 Subject: [PATCH 44/60] feat: update multi text element --- .../model/presentation/multitextbox.h | 10 ++++++++++ .../security/model/ui/presentationbuilder.cpp | 19 +++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/plugins/security/model/presentation/multitextbox.h b/src/plugins/security/model/presentation/multitextbox.h index 6836accc0..444634070 100644 --- a/src/plugins/security/model/presentation/multitextbox.h +++ b/src/plugins/security/model/presentation/multitextbox.h @@ -45,6 +45,16 @@ class MultiTextBox : public DataElementContent * \brief defaultValue */ std::string defaultValue{}; + + /*! + * \brief showAsDialog If we need to display multitext as a dialog. + */ + bool showAsDialog = false; + + /*! + * \brief defaultHeight Deafult height of the widget. + */ + unsigned int defaultHeight = 3; }; } // of namespace security diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index acf212a67..11578cb57 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -50,6 +50,7 @@ #include #include +#include template inline constexpr bool always_false_v = false; @@ -159,8 +160,7 @@ class PresentationBuilderPrivate { Q_UNUSED(widget); QTextEdit *textEdit = new QTextEdit(); - - // TODO: Implement. + textEdit->setMaximumHeight(widget.defaultHeight * textEdit->fontMetrics().height()); addToLayout(textEdit); } @@ -178,9 +178,20 @@ class PresentationBuilderPrivate void visit(ListBox &widget) const { - // TODO: Implement. + QPushButton *button = new QPushButton(QObject::tr("Edit")); - Q_UNUSED(widget); + QLayoutItem *container = createAndAttachLabel(button, QString::fromStdString(widget.postfix)); + + auto onClicked = [&]() { + gpui::ListBoxDialog *listBox = new gpui::ListBoxDialog(QString::fromStdString(widget.postfix)); + listBox->setAttribute(Qt::WA_DeleteOnClose); + + listBox->show(); + }; + + QObject::connect(button, &QPushButton::clicked, onClicked); + + addToLayout(container); } void visit(LdapSearchDialog &widget) const From 91d8e1fb1a6bccaac82d1d7948d3c8764a549440 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 22 Aug 2023 19:09:11 +0400 Subject: [PATCH 45/60] feat: update browse ldap dialog --- .../security/model/ui/browseldapdialog.ui | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plugins/security/model/ui/browseldapdialog.ui b/src/plugins/security/model/ui/browseldapdialog.ui index b695c1b5e..3f264baf7 100644 --- a/src/plugins/security/model/ui/browseldapdialog.ui +++ b/src/plugins/security/model/ui/browseldapdialog.ui @@ -14,17 +14,17 @@ Dialog - - - - + Browse - + + + + Qt::Horizontal @@ -34,6 +34,13 @@ + + + + Resource to browse: + + + From 33edcf08982df60222cc6dc2f6eb3f56af70ae55 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:41:12 +0400 Subject: [PATCH 46/60] fix: security widget --- src/plugins/security/model/ui/securitywidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/security/model/ui/securitywidget.cpp b/src/plugins/security/model/ui/securitywidget.cpp index 3e930ba66..142316166 100644 --- a/src/plugins/security/model/ui/securitywidget.cpp +++ b/src/plugins/security/model/ui/securitywidget.cpp @@ -88,6 +88,11 @@ void SecurityWidget::setMachineSecuritySource() { } +bool SecurityWidget::hasDataChanged() +{ + return false; +} + } Q_DECLARE_METATYPE(std::shared_ptr<::security::SecurityDefinition>) From 93da03e88908a2ce3c1d3c3d674a508ac74d0f02 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:43:05 +0400 Subject: [PATCH 47/60] feat: update security bundle --- .../security/model/bundle/securitybundle.cpp | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/plugins/security/model/bundle/securitybundle.cpp b/src/plugins/security/model/bundle/securitybundle.cpp index e8298ce75..d856cfb2c 100644 --- a/src/plugins/security/model/bundle/securitybundle.cpp +++ b/src/plugins/security/model/bundle/securitybundle.cpp @@ -222,13 +222,21 @@ std::unique_ptr SecurityBundle::loadFolder(const std::string false); machineItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340003}"), model::bundle::PARENT_UUID); machineItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340000}"), model::bundle::CURRENT_UUID); - d->rootMachineItem = createItem(QObject::tr("Administrative Templates"), - "folder", - QObject::tr("Machine administrative templates"), - ItemType::ITEM_TYPE_CATEGORY, - SecurityType::Machine, - false); - machineItem->appendRow(d->rootMachineItem); + QStandardItem *machineSystemSettingsItem = createItem(QObject::tr("System settings"), + "folder", + QObject::tr("System settings for computer"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::Machine, + false); + machineItem->appendRow(machineSystemSettingsItem); + d->rootMachineItem = createItem(QObject::tr("Security Settings"), + "folder", + QObject::tr("Machine level security settings"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::User, + false); + machineSystemSettingsItem->appendRow(d->rootMachineItem); + QStandardItem *userItem = createItem(QObject::tr("User"), "user-home", QObject::tr("User level policies"), @@ -237,13 +245,20 @@ std::unique_ptr SecurityBundle::loadFolder(const std::string false); userItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340003}"), model::bundle::PARENT_UUID); userItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340001}"), model::bundle::CURRENT_UUID); - d->rootUserItem = createItem(QObject::tr("Administrative Templates"), - "folder", - QObject::tr("User administrative templates"), - ItemType::ITEM_TYPE_CATEGORY, - SecurityType::User, - false); - userItem->appendRow(d->rootUserItem); + QStandardItem *userSystemSettingsItem = createItem(QObject::tr("System settings"), + "folder", + QObject::tr("System settings for user"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::User, + false); + userItem->appendRow(userSystemSettingsItem); + d->rootUserItem = createItem(QObject::tr("Security Settings"), + "folder", + QObject::tr("User level security settings"), + ItemType::ITEM_TYPE_CATEGORY, + SecurityType::User, + false); + userSystemSettingsItem->appendRow(d->rootUserItem); visibleRootItem->appendRow(machineItem); visibleRootItem->appendRow(userItem); From 9c3d4eb0d3860c1d3f8ddbb33840799fc398af25 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:15:52 +0400 Subject: [PATCH 48/60] feat: add ids for security model --- src/plugins/scripts/scriptstreemodel.cpp | 4 ++++ src/plugins/security/model/bundle/securitybundle.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/scripts/scriptstreemodel.cpp b/src/plugins/scripts/scriptstreemodel.cpp index 674b520ac..011407e95 100644 --- a/src/plugins/scripts/scriptstreemodel.cpp +++ b/src/plugins/scripts/scriptstreemodel.cpp @@ -86,7 +86,9 @@ void ScriptsTreeModel::populateModel() machineNamespace->setProperty(ScriptsFolderItem::CATEGORY, true); auto machineSystemSettings = insertItem(machineNamespace); + auto machineSystemUuid = QUuid("{123e4567-e89b-12d3-a456-426652340010}"); machineSystemSettings->setDisplayName(QObject::tr("System settings").toStdString()); + machineSystemSettings->setProperty(ScriptsFolderItem::NODE_ID, machineSystemUuid); machineSystemSettings->setProperty(ScriptsFolderItem::PARENT_ID, machineUuid); machineSystemSettings->setProperty(ScriptsFolderItem::HELP_MSG, QObject::tr("System settings for computer").toStdString()); @@ -110,7 +112,9 @@ void ScriptsTreeModel::populateModel() userNamespace->setProperty(ScriptsFolderItem::CATEGORY, true); auto userSystemSetting = insertItem(userNamespace); + auto userSystemUuid = QUuid("{123e4567-e89b-12d3-a456-426652340011}"); userSystemSetting->setDisplayName(QObject::tr("System settings").toStdString()); + userSystemSetting->setProperty(ScriptsFolderItem::NODE_ID, userSystemUuid); userSystemSetting->setProperty(ScriptsFolderItem::PARENT_ID, userUuid); userSystemSetting->setProperty(ScriptsFolderItem::HELP_MSG, QObject::tr("System settings for user").toStdString()); diff --git a/src/plugins/security/model/bundle/securitybundle.cpp b/src/plugins/security/model/bundle/securitybundle.cpp index d856cfb2c..bf09d1cbb 100644 --- a/src/plugins/security/model/bundle/securitybundle.cpp +++ b/src/plugins/security/model/bundle/securitybundle.cpp @@ -228,6 +228,8 @@ std::unique_ptr SecurityBundle::loadFolder(const std::string ItemType::ITEM_TYPE_CATEGORY, SecurityType::Machine, false); + machineSystemSettingsItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340000}"), model::bundle::PARENT_UUID); + machineSystemSettingsItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340010}"), model::bundle::CURRENT_UUID); machineItem->appendRow(machineSystemSettingsItem); d->rootMachineItem = createItem(QObject::tr("Security Settings"), "folder", @@ -251,6 +253,8 @@ std::unique_ptr SecurityBundle::loadFolder(const std::string ItemType::ITEM_TYPE_CATEGORY, SecurityType::User, false); + userSystemSettingsItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340001}"), model::bundle::PARENT_UUID); + userSystemSettingsItem->setData(QUuid("{123e4567-e89b-12d3-a456-426652340011}"), model::bundle::CURRENT_UUID); userItem->appendRow(userSystemSettingsItem); d->rootUserItem = createItem(QObject::tr("Security Settings"), "folder", From f1deef71d1580dcbf498a8a9535268b7c0d1583c Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:36:15 +0400 Subject: [PATCH 49/60] feat: add translations to security plugin --- .../model/ui/i18n/security_translation_en.ts | 141 ++++++++++++++++++ .../model/ui/i18n/security_translation_ru.ts | 141 ++++++++++++++++++ 2 files changed, 282 insertions(+) create mode 100644 src/plugins/security/model/ui/i18n/security_translation_en.ts create mode 100644 src/plugins/security/model/ui/i18n/security_translation_ru.ts diff --git a/src/plugins/security/model/ui/i18n/security_translation_en.ts b/src/plugins/security/model/ui/i18n/security_translation_en.ts new file mode 100644 index 000000000..be256c7dc --- /dev/null +++ b/src/plugins/security/model/ui/i18n/security_translation_en.ts @@ -0,0 +1,141 @@ + + + + + BrowseLdapDialog + + + Dialog + Dialog + + + + Browse + Browse + + + + Resource to browse: + Resource to browse: + + + + LdapSearchListWidget + + + Form + Form + + + + Add button + Add button + + + + Remove button + Remove button + + + + QObject + + + [Local Group Policy] + [Local Group Policy] + + + + Local group policies + Local group policies + + + + Machine + Machine + + + + Machine level policies + Machine level policies + + + + + System settings + System settings + + + + System settings for computer + System settings for computer + + + + + Security Settings + Security Settings + + + + Machine level security settings + Machine level security settings + + + + User + User + + + + User level policies + User level policies + + + + System settings for user + System settings for user + + + + User level security settings + User level security settings + + + + Edit + Edit + + + + SecurityWidget + + + Form + Form + + + + Help: + Help: + + + + &Cancel + &Cancel + + + + &OK + &OK + + + + security::SecurityWidget + + + Security policy: + Security policy: + + + diff --git a/src/plugins/security/model/ui/i18n/security_translation_ru.ts b/src/plugins/security/model/ui/i18n/security_translation_ru.ts new file mode 100644 index 000000000..d6562a5a3 --- /dev/null +++ b/src/plugins/security/model/ui/i18n/security_translation_ru.ts @@ -0,0 +1,141 @@ + + + + + BrowseLdapDialog + + + Dialog + Диалог + + + + Browse + Просмотр + + + + Resource to browse: + Ресурс для поиска: + + + + LdapSearchListWidget + + + Form + Форма + + + + Add button + Кнопка добавить + + + + Remove button + Кнопка удалить + + + + QObject + + + [Local Group Policy] + [Локальная групповая политика] + + + + Local group policies + Локальные групповые политики + + + + Machine + Компьютер + + + + Machine level policies + Политики уровня компьютера + + + + + System settings + Настройки системы + + + + System settings for computer + Настройки системы для компьютера + + + + + Security Settings + Настройки безопастности + + + + Machine level security settings + Настройки безопастности компьютера + + + + User + Пользователь + + + + User level policies + Групповые политики пользователя + + + + System settings for user + Настройки системы пользователя + + + + User level security settings + Настройки безовпстности пользователя + + + + Edit + Редактировать + + + + SecurityWidget + + + Form + Форма + + + + Help: + Помощь: + + + + &Cancel + &Отмена + + + + &OK + &ОК + + + + security::SecurityWidget + + + Security policy: + Политика безопастности: + + + From f21f3e17aa33f1a1c1392991297b94363f0d5e24 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:57:18 +0400 Subject: [PATCH 50/60] fix: fix basefile implementation --- src/io/CMakeLists.txt | 2 +- src/io/basefile.h | 2 ++ src/io/{basefile.cpp => basefile.inl} | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/io/{basefile.cpp => basefile.inl} (99%) diff --git a/src/io/CMakeLists.txt b/src/io/CMakeLists.txt index bd128ffc9..fc48a77a0 100644 --- a/src/io/CMakeLists.txt +++ b/src/io/CMakeLists.txt @@ -2,6 +2,7 @@ find_package(Qt5 COMPONENTS Core REQUIRED) set(HEADERS basefile.h + basefile.inl genericfile.h genericfile.inl genericreader.h @@ -22,7 +23,6 @@ set(HEADERS ) set(SOURCES - basefile.cpp commentresourcesfile.cpp inifile.cpp io.cpp diff --git a/src/io/basefile.h b/src/io/basefile.h index d47effe28..c048aee56 100644 --- a/src/io/basefile.h +++ b/src/io/basefile.h @@ -61,4 +61,6 @@ namespace io { }; } +#include "basefile.inl" + #endif // GPUI_BASEFILE_H diff --git a/src/io/basefile.cpp b/src/io/basefile.inl similarity index 99% rename from src/io/basefile.cpp rename to src/io/basefile.inl index 9621248e8..cebb793ac 100644 --- a/src/io/basefile.cpp +++ b/src/io/basefile.inl @@ -18,8 +18,6 @@ ** ***********************************************************************************************************************/ -#include "basefile.h" - #include namespace io From 084959c9dfa95ed15d2e17d72ace87135387ac30 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:04:23 +0400 Subject: [PATCH 51/60] fix: fix sdml plugin --- src/plugins/sdml/CMakeLists.txt | 3 ++- src/plugins/sdml/sdmlplugin.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/sdml/CMakeLists.txt b/src/plugins/sdml/CMakeLists.txt index 452a27ffb..da9c07dd8 100644 --- a/src/plugins/sdml/CMakeLists.txt +++ b/src/plugins/sdml/CMakeLists.txt @@ -19,5 +19,6 @@ set(SOURCES ${SOURCES} ${HEADERS}) add_gpui_plugin(${PLUGIN_NAME} ${SOURCES}) target_link_libraries(${PLUGIN_NAME} Qt5::Core) target_link_libraries(${PLUGIN_NAME} ${GPUI_LIBRARIES}) +target_link_libraries(${PLUGIN_NAME} policy-common) +target_link_libraries(${PLUGIN_NAME} security_static_xsd_library) target_link_libraries(${PLUGIN_NAME} xerces-c) -target_link_libraries(${PLUGIN_NAME}) diff --git a/src/plugins/sdml/sdmlplugin.cpp b/src/plugins/sdml/sdmlplugin.cpp index f65d422d0..5b352e19e 100644 --- a/src/plugins/sdml/sdmlplugin.cpp +++ b/src/plugins/sdml/sdmlplugin.cpp @@ -30,7 +30,7 @@ class SdmlPlugin : public Plugin SdmlPlugin() : Plugin("sdml") { - GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmlPlugin); + GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmlFormat); } }; } // namespace gpui From 875974ff4ee55fdd5951e36d2e3d6922f46d3aac Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:04:38 +0400 Subject: [PATCH 52/60] fix: fix sdmx plugin --- src/plugins/sdmx/CMakeLists.txt | 3 ++- src/plugins/sdmx/sdmxplugin.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/sdmx/CMakeLists.txt b/src/plugins/sdmx/CMakeLists.txt index 7a1f283ad..11a334c60 100644 --- a/src/plugins/sdmx/CMakeLists.txt +++ b/src/plugins/sdmx/CMakeLists.txt @@ -19,5 +19,6 @@ set(SOURCES ${SOURCES} ${HEADERS}) add_gpui_plugin(${PLUGIN_NAME} ${SOURCES}) target_link_libraries(${PLUGIN_NAME} Qt5::Core) target_link_libraries(${PLUGIN_NAME} ${GPUI_LIBRARIES}) +target_link_libraries(${PLUGIN_NAME} policy-common) +target_link_libraries(${PLUGIN_NAME} security_static_xsd_library) target_link_libraries(${PLUGIN_NAME} xerces-c) -target_link_libraries(${PLUGIN_NAME}) diff --git a/src/plugins/sdmx/sdmxplugin.cpp b/src/plugins/sdmx/sdmxplugin.cpp index 83b0385db..8ff3b3ea4 100644 --- a/src/plugins/sdmx/sdmxplugin.cpp +++ b/src/plugins/sdmx/sdmxplugin.cpp @@ -30,7 +30,7 @@ class SdmxPlugin : public Plugin SdmxPlugin() : Plugin("sdmx") { - GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmxPlugin); + GPUI_REGISTER_PLUGIN_CLASS(typeid(io::PolicyFileFormat).name(), SdmxFormat); } }; } // namespace gpui From 399018bda2a047cc2472f4fadb0205979cc58650 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 31 Aug 2023 17:29:41 +0400 Subject: [PATCH 53/60] chore: update sdml format --- src/plugins/sdml/sdmlformat.cpp | 191 +++++++++++++++++--------------- 1 file changed, 104 insertions(+), 87 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 22dd39048..9a1e3fac5 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -215,7 +215,7 @@ class XsdTextAdapter : public security::Text XsdTextAdapter(const TextElement &widget) : security::Text() { - this->refId = widget.refId(); + this->refId = widget.id(); // TODO: Implement. } @@ -317,97 +317,111 @@ class XsdResourcesAdapter : public security::SecurityPresentationResources XsdResourcesAdapter(const SecurityPresentationResources &resources) : security::SecurityPresentationResources() { - for (const auto &presentation : resources.presentationTable()) + this->description = resources.description(); + this->displayName = resources.displayName(); + + if (resources.resources().stringTable().present()) { - Q_UNUSED(presentation); + for (const auto &string : resources.resources().stringTable()->string()) + { + this->stringTable[string.id()] = string; + } + } - auto securityPresentation = std::make_shared(); - auto &widgetsVector = securityPresentation->widgets; + if (resources.resources().presentationTable().present()) + { + for (const auto &presentation : resources.resources().presentationTable()->presentation()) + { + Q_UNUSED(presentation); - const xercesc::DOMNode *n = presentation._node(); - assert(n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE); - const xercesc::DOMElement *re = static_cast(n); + auto securityPresentation = std::make_shared(); + auto &widgetsVector = securityPresentation->widgets; - for (n = re->getFirstChild(); n != 0; n = n->getNextSibling()) - { - if (n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE) + const xercesc::DOMNode *n = presentation._node(); + assert(n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE); + const xercesc::DOMElement *re = static_cast(n); + + for (n = re->getFirstChild(); n != 0; n = n->getNextSibling()) { - auto elementNode = static_cast(n); - auto elementType = QString::fromStdU16String(elementNode->getTagName()); - if (elementType.compare("checkBox") == 0) - { - auto checkBox = std::make_unique<::GroupPolicy::SecurityDefinitions::CheckBox>(*elementNode); - auto widget = XsdCheckBoxAdapter::create(*checkBox); - widgetsVector.emplace_back(checkBox->refId(), widget); - } - else if (elementType.compare("comboBox") == 0) - { - auto comboBox = std::make_unique<::GroupPolicy::SecurityDefinitions::ComboBox>(*elementNode); - auto widget = XsdComboBoxAdapter::create(*comboBox); - widgetsVector.emplace_back(comboBox->refId(), widget); - } - else if (elementType.compare("decimalTextBox") == 0) - { - auto decimalTextBox = std::make_unique<::GroupPolicy::SecurityDefinitions::DecimalTextBox>( - *elementNode); - auto widget = XsdDecimalTextBoxAdapter::create(*decimalTextBox); - widgetsVector.emplace_back(decimalTextBox->refId(), widget); - } - else if (elementType.compare("dropdownList") == 0) - { - auto dropdownList = std::make_unique<::GroupPolicy::SecurityDefinitions::DropdownList>( - *elementNode); - auto widget = XsdDropdownListAdapter::create(*dropdownList); -// widgetsVector.emplace_back(dropdownList->refId(), widget); - } - else if (elementType.compare("listBox") == 0) - { - auto listBox = std::make_unique<::GroupPolicy::SecurityDefinitions::ListBox>(*elementNode); - auto widget = XsdListBoxAdapter::create(*listBox); - widgetsVector.emplace_back(listBox->refId(), widget); - } - else if (elementType.compare("longDecimalTextBox") == 0) - { - auto longDecimalTextBox - = std::make_unique<::GroupPolicy::SecurityDefinitions::LongDecimalTextBox>(*elementNode); - auto widget = XsdLongDecimalTextBoxAdapter::create(*longDecimalTextBox); - widgetsVector.emplace_back(longDecimalTextBox->refId(), widget); - } - else if (elementType.compare("multiTextBox") == 0) - { - auto multiTextBox = std::make_unique<::GroupPolicy::SecurityDefinitions::MultiTextBox>( - *elementNode); - auto widget = XsdMultiTextBoxAdapter::create(*multiTextBox); - widgetsVector.emplace_back(multiTextBox->refId(), widget); - } - else if (elementType.compare("textBox") == 0) - { - auto textBox = std::make_unique<::GroupPolicy::SecurityDefinitions::TextBox>(*elementNode); - auto widget = XsdTextBoxAdapter::create(*textBox); - widgetsVector.emplace_back(textBox->refId(), widget); - } - else if (elementType.compare("text") == 0) - { - auto text = std::make_unique<::GroupPolicy::SecurityDefinitions::Comment>(*elementNode); - // TODO: Implement. - } - else if (elementType.compare("ldapSearchDialog") == 0) - { - auto ldapSearch = std::make_unique<::GroupPolicy::SecurityDefinitions::LdapSearchDialog>(*elementNode); - auto widget = XsdLdapSearchDialogAdapter::create(*ldapSearch); - widgetsVector.emplace_back(ldapSearch->refId(), widget); - } - else if (elementType.compare("radioButton") == 0) - { - auto radioButton = std::make_unique<::GroupPolicy::SecurityDefinitions::RadioButton>(*elementNode); - auto widget = XsdRadioButtonAdapter::create(*radioButton); - widgetsVector.emplace_back(radioButton->refId(), widget); - } - else if (elementType.compare("groupBox") == 0) + if (n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE) { - auto groupBox = std::make_unique<::GroupPolicy::SecurityDefinitions::GroupBox>(*elementNode); - auto widget = XsdGroupBoxAdapter::create(*groupBox); - widgetsVector.emplace_back(groupBox->refId(), widget); + auto elementNode = static_cast(n); + auto elementType = QString::fromStdU16String(elementNode->getTagName()); + if (elementType.compare("checkBox") == 0) + { + auto checkBox = std::make_unique<::GroupPolicy::SecurityDefinitions::CheckBox>(*elementNode); + auto widget = XsdCheckBoxAdapter::create(*checkBox); + widgetsVector.emplace_back(checkBox->refId(), widget); + } + else if (elementType.compare("comboBox") == 0) + { + auto comboBox = std::make_unique<::GroupPolicy::SecurityDefinitions::ComboBox>(*elementNode); + auto widget = XsdComboBoxAdapter::create(*comboBox); + widgetsVector.emplace_back(comboBox->refId(), widget); + } + else if (elementType.compare("decimalTextBox") == 0) + { + auto decimalTextBox = std::make_unique<::GroupPolicy::SecurityDefinitions::DecimalTextBox>( + *elementNode); + auto widget = XsdDecimalTextBoxAdapter::create(*decimalTextBox); + widgetsVector.emplace_back(decimalTextBox->refId(), widget); + } + else if (elementType.compare("dropdownList") == 0) + { + auto dropdownList = std::make_unique<::GroupPolicy::SecurityDefinitions::DropdownList>( + *elementNode); + auto widget = XsdDropdownListAdapter::create(*dropdownList); + // widgetsVector.emplace_back(dropdownList->refId(), widget); + } + else if (elementType.compare("listBox") == 0) + { + auto listBox = std::make_unique<::GroupPolicy::SecurityDefinitions::ListBox>(*elementNode); + auto widget = XsdListBoxAdapter::create(*listBox); + widgetsVector.emplace_back(listBox->refId(), widget); + } + else if (elementType.compare("longDecimalTextBox") == 0) + { + auto longDecimalTextBox + = std::make_unique<::GroupPolicy::SecurityDefinitions::LongDecimalTextBox>(*elementNode); + auto widget = XsdLongDecimalTextBoxAdapter::create(*longDecimalTextBox); + widgetsVector.emplace_back(longDecimalTextBox->refId(), widget); + } + else if (elementType.compare("multiTextBox") == 0) + { + auto multiTextBox = std::make_unique<::GroupPolicy::SecurityDefinitions::MultiTextBox>( + *elementNode); + auto widget = XsdMultiTextBoxAdapter::create(*multiTextBox); + widgetsVector.emplace_back(multiTextBox->refId(), widget); + } + else if (elementType.compare("textBox") == 0) + { + auto textBox = std::make_unique<::GroupPolicy::SecurityDefinitions::TextBox>(*elementNode); + auto widget = XsdTextBoxAdapter::create(*textBox); + widgetsVector.emplace_back(textBox->refId(), widget); + } + else if (elementType.compare("text") == 0) + { + auto text = std::make_unique<::GroupPolicy::SecurityDefinitions::Comment>(*elementNode); + // TODO: Implement. + } + else if (elementType.compare("ldapSearchDialog") == 0) + { + auto ldapSearch = std::make_unique<::GroupPolicy::SecurityDefinitions::LdapSearchDialog>(*elementNode); + auto widget = XsdLdapSearchDialogAdapter::create(*ldapSearch); + widgetsVector.emplace_back(ldapSearch->refId(), widget); + } + else if (elementType.compare("radioButton") == 0) + { + auto radioButton = std::make_unique<::GroupPolicy::SecurityDefinitions::RadioButton>(*elementNode); + auto widget = XsdRadioButtonAdapter::create(*radioButton); + widgetsVector.emplace_back(radioButton->refId(), widget); + } + else if (elementType.compare("groupBox") == 0) + { + auto groupBox = std::make_unique<::GroupPolicy::SecurityDefinitions::GroupBox>(*elementNode); + auto widget = XsdGroupBoxAdapter::create(*groupBox); + widgetsVector.emplace_back(groupBox->refId(), widget); + } } } } @@ -431,7 +445,10 @@ bool SdmlFormat::read(std::istream &input, SdmlFile *file) std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityPresentationResources> securityDefinitions; auto operation = [&]() { - securityDefinitions = GroupPolicy::SecurityDefinitions::SecurityPresentationResources_(input, ::xsd::cxx::tree::flags::dont_validate); + securityDefinitions = GroupPolicy::SecurityDefinitions::securityPresentationResources(input, + ::xsd::cxx::tree::flags::dont_validate + | ::xsd::cxx::tree::flags::keep_dom + | ::xsd::cxx::tree::flags::own_dom); auto securityPresentation = XsdResourcesAdapter::create(*securityDefinitions); From d11e59dedc99a74bab15d387a001498b7151e09e Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 31 Aug 2023 17:30:13 +0400 Subject: [PATCH 54/60] chore: update sdmx format --- src/plugins/sdmx/sdmxformat.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index ea9283b94..3ba4b1def 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -40,7 +40,7 @@ inline void assign_if_exists(TOutput &output, const TInput &input) template void adapter_base(security::SecurityElement *output, const ElementType &input) { - output->refId = input.refId(); + output->refId = input.id(); if (input.clientExtension().present()) { @@ -245,7 +245,7 @@ class XsdSecurityAdapter : public security::SecurityDefinition XsdSecurityAdapter(const SecurityDefinition &definition) : security::SecurityDefinition() { - this->name = definition.name(); + this->name = definition.name(); this->displayName = definition.displayName(); assign_if_exists(this->explainText, definition.explainText()); @@ -282,7 +282,7 @@ class XsdSecurityDefinitionsAdapter : public security::SecurityDefinitions assign_if_exists(this->revision, definitions.revision()); assign_if_exists(this->schemaVersion, definitions.schemaVersion()); - for (const auto& securityElement : definitions.security()) + for (const auto& securityElement : definitions.security()->securityDefinition()) { auto ourSecurity = XsdSecurityAdapter::create(securityElement); @@ -323,8 +323,9 @@ bool SdmxFormat::read(std::istream &input, SdmxFile *file) Q_UNUSED(file); std::unique_ptr<::GroupPolicy::SecurityDefinitions::SecurityDefinitions> securityDefinitions; - auto operation = [&]() noexcept { - securityDefinitions = GroupPolicy::SecurityDefinitions::SecurityDefinitions_(input, ::xsd::cxx::tree::flags::dont_validate); + auto operation = [&]() { + securityDefinitions = GroupPolicy::SecurityDefinitions::securityDefinitions(input, + ::xsd::cxx::tree::flags::dont_validate); auto security = XsdSecurityDefinitionsAdapter::create(*securityDefinitions); From 83654c8a4476f485c568dc8bdbfa58219e01de3e Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 31 Aug 2023 17:30:40 +0400 Subject: [PATCH 55/60] fix: fix multiple schema issues --- src/plugins/security/schema/security.xsd | 331 ++++++++++++----------- 1 file changed, 176 insertions(+), 155 deletions(-) diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd index 37fa04f88..f346f5048 100644 --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -1,47 +1,39 @@ - - - - - - - - - + Describes a choice element in a policy with associated values for the true and false cases. - + - - - - - - + + + + + + - - + + - - - - - - + + + + + + @@ -50,11 +42,11 @@ Describes a list element in a security policy. - + - - - + + + @@ -63,7 +55,7 @@ Describes a multi line text element in a policy. - + @@ -71,36 +63,36 @@ Describes a single line text element in a policy. - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + An enumeration of the 3 possible types a security definition can belong to. - - + + @@ -109,82 +101,85 @@ A grouping of security definitions. - - - + + + - - - + + + - + - + - + - - + + + + + + - + - - + + - - - - - - - - - + + + + + + + + - + - + - + - + - - - + + + - + - - + + - + - + - - + + - - + + - + @@ -194,11 +189,11 @@ Root presentation element. - + - + - + @@ -208,8 +203,8 @@ Represents a checkbox display element.\nCan be associated with a BooleanElement. - - + + @@ -223,43 +218,43 @@ Represents a text box with or without a spin control for entering decimal numbers. - - - - + + + + - + - + - - + + - + - - - - - - - - - - - + + + + + + + + + + + - + @@ -267,13 +262,14 @@ Represents a combobox display element with default/suggested entries. - + - - - + + + - + + @@ -282,10 +278,10 @@ Represents a textbox display element with default entry. - + - - + + @@ -294,18 +290,18 @@ Represents a dropdown list display element. - - + + Represents a textbox display element with default entry. - + - - + + @@ -315,7 +311,7 @@ Represents a listbox display element. - + @@ -323,9 +319,9 @@ Represents a comment display element. - - - + + + @@ -334,8 +330,8 @@ Represents a security descriptor editor display element. - - + + @@ -344,11 +340,11 @@ Represents a LDAP search dialog display element.\nCan be associated with a TextElement. - + - - + + @@ -357,12 +353,12 @@ Represents a radio button display element.\nCan be associated with a BooleanElement. - - + + - + A standard {12345678-1234-1234-1234-123456789abcd} style guid string. @@ -371,36 +367,61 @@ - + Represents a text box with or without a spin control for entering long decimal numbers. - - - - + + + + - - + - Root element for presentation resources. + A localized string - - - - - - - - + - + + + + A table of referenced localized strings and policy presentations. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 83d65970bbde48ad757216e3cfbb3c8eefeb6f4b Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 31 Aug 2023 18:51:42 +0400 Subject: [PATCH 56/60] fix: fix security schema --- src/plugins/security/schema/security.xsd | 30 +++++++++++------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd index f346f5048..b5d5850ec 100644 --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -391,25 +391,23 @@ - + + + + + + + + + + + A table of referenced localized strings and policy presentations. - - - - - - - - - - - - - - + + @@ -417,7 +415,7 @@ - + From b7ebebe6d1ed8be337ddbf25cf3130be08b9e630 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Thu, 31 Aug 2023 19:21:16 +0400 Subject: [PATCH 57/60] fix: fix presentation --- src/plugins/sdml/sdmlformat.cpp | 4 +++- src/plugins/sdmx/sdmxformat.cpp | 4 ++++ src/plugins/security/schema/security.xsd | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 9a1e3fac5..36f628e1c 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -337,6 +337,8 @@ class XsdResourcesAdapter : public security::SecurityPresentationResources auto securityPresentation = std::make_shared(); auto &widgetsVector = securityPresentation->widgets; + this->presentationTable.emplace_back(presentation.id(), securityPresentation); + const xercesc::DOMNode *n = presentation._node(); assert(n->getNodeType() == xercesc::DOMNode::ELEMENT_NODE); const xercesc::DOMElement *re = static_cast(n); @@ -371,7 +373,7 @@ class XsdResourcesAdapter : public security::SecurityPresentationResources auto dropdownList = std::make_unique<::GroupPolicy::SecurityDefinitions::DropdownList>( *elementNode); auto widget = XsdDropdownListAdapter::create(*dropdownList); - // widgetsVector.emplace_back(dropdownList->refId(), widget); +// widgetsVector.emplace_back(dropdownList->refId(), widget); } else if (elementType.compare("listBox") == 0) { diff --git a/src/plugins/sdmx/sdmxformat.cpp b/src/plugins/sdmx/sdmxformat.cpp index 3ba4b1def..792a18dea 100644 --- a/src/plugins/sdmx/sdmxformat.cpp +++ b/src/plugins/sdmx/sdmxformat.cpp @@ -260,6 +260,10 @@ class XsdSecurityAdapter : public security::SecurityDefinition assign_if_exists(propertyNameLocal, definition.propertyName()); + std::string presentationName{}; + assign_if_exists(presentationName, definition.presentation()); + + this->presentation = std::make_unique(presentationName); this->propertyName = std::make_unique(propertyNameLocal); this->sectionName = std::make_unique(sectionNameLocal); } diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd index b5d5850ec..efddbb207 100644 --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -84,6 +84,7 @@ + From 8db298c431622058d1b6ea6613bc44bf012031e5 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:15:51 +0400 Subject: [PATCH 58/60] fix: remove label from layout in security widget --- .../security/model/ui/presentationbuilder.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index 11578cb57..7ddfa6c77 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -61,20 +61,10 @@ namespace security template QLayoutItem *createAndAttachLabel(QWidget *buddy, const QString &text) { - QLabel *label = new QLabel(text.trimmed()); - label->setBuddy(buddy); - label->setWordWrap(true); - - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(1); - - label->setSizePolicy(sizePolicy); - buddy->setSizePolicy(sizePolicy); + Q_UNUSED(text); TLayoutItem *container = new TLayoutItem(); - container->addWidget(label); container->addWidget(buddy); - return container; } From 354e8fb81b3ea7ff438aa2549a1bac509c8e6f64 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:16:20 +0400 Subject: [PATCH 59/60] fix: fix signal name in ldap search widget --- src/plugins/security/model/ui/ldapsearchlistwidget.cpp | 4 ++-- src/plugins/security/model/ui/ldapsearchlistwidget.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.cpp b/src/plugins/security/model/ui/ldapsearchlistwidget.cpp index 9cc206b8c..740a20557 100644 --- a/src/plugins/security/model/ui/ldapsearchlistwidget.cpp +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.cpp @@ -69,13 +69,13 @@ void LdapSearchListWidget::setRemoveButtonText(const QString &text) ui->removeButton->setText(text); } -void LdapSearchListWidget::on_addButton_Pressed() +void security::LdapSearchListWidget::on_addButton_clicked() { auto browseLdapDialog = new BrowseLdapDialog(this); browseLdapDialog->show(); } -void LdapSearchListWidget::on_removeButton_Pressed() +void security::LdapSearchListWidget::on_removeButton_clicked() { auto selectedItems = ui->listWidget->selectedItems(); diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.h b/src/plugins/security/model/ui/ldapsearchlistwidget.h index faf1c17dd..469a11c6f 100644 --- a/src/plugins/security/model/ui/ldapsearchlistwidget.h +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.h @@ -46,8 +46,8 @@ class LdapSearchListWidget : public QWidget void setRemoveButtonText(const QString& text); private slots: - void on_addButton_Pressed(); - void on_removeButton_Pressed(); + void on_addButton_clicked(); + void on_removeButton_clicked(); private: LdapSearchListWidget(const LdapSearchListWidget&) = delete; // copy ctor From 51884dd6329328e69bb651f5056af5d5b6c924c1 Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:20:49 +0400 Subject: [PATCH 60/60] feat: add group box to ldap search widget --- src/plugins/sdml/sdmlformat.cpp | 1 + .../model/presentation/ldapsearchdialog.h | 5 ++ .../model/ui/ldapsearchlistwidget.cpp | 8 +- .../security/model/ui/ldapsearchlistwidget.h | 4 +- .../security/model/ui/ldapsearchlistwidget.ui | 85 +++++++++++++------ .../security/model/ui/presentationbuilder.cpp | 2 +- src/plugins/security/schema/security.xsd | 1 + 7 files changed, 74 insertions(+), 32 deletions(-) diff --git a/src/plugins/sdml/sdmlformat.cpp b/src/plugins/sdml/sdmlformat.cpp index 36f628e1c..5cf9786de 100644 --- a/src/plugins/sdml/sdmlformat.cpp +++ b/src/plugins/sdml/sdmlformat.cpp @@ -242,6 +242,7 @@ class XsdLdapSearchDialogAdapter : public security::LdapSearchDialog assign_if_exists(this->filter, widget.filter()); assign_if_exists(this->addLabel, widget.addLabel()); assign_if_exists(this->removeLabel, widget.removeLabel()); + assign_if_exists(this->title, widget.title()); } static std::shared_ptr create(const LdapSearchDialog &string) diff --git a/src/plugins/security/model/presentation/ldapsearchdialog.h b/src/plugins/security/model/presentation/ldapsearchdialog.h index e952f4bb7..df2da7fb7 100644 --- a/src/plugins/security/model/presentation/ldapsearchdialog.h +++ b/src/plugins/security/model/presentation/ldapsearchdialog.h @@ -57,6 +57,11 @@ class LdapSearchDialog: public DataElementContent * \brief removeLabel Label for remove button. */ std::string removeLabel{}; + + /*! + * \brief title Label for group box. + */ + std::string title{}; }; } // of namespace security diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.cpp b/src/plugins/security/model/ui/ldapsearchlistwidget.cpp index 740a20557..3dd238819 100644 --- a/src/plugins/security/model/ui/ldapsearchlistwidget.cpp +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.cpp @@ -40,16 +40,18 @@ class LdapSearchListWidgetPrivate {} }; -LdapSearchListWidget::LdapSearchListWidget(const QString &filter, const QString &dn, QWidget *parent) +LdapSearchListWidget::LdapSearchListWidget(const QString &filter, const QString &dn, const QString &title, QWidget *parent) : QWidget(parent) , d(new LdapSearchListWidgetPrivate(filter, dn)) , ui(new Ui::LdapSearchListWidget()) { ui->setupUi(this); + + ui->groupBox->setTitle(title); } -LdapSearchListWidget::LdapSearchListWidget(const std::string &filter, const std::string &dn, QWidget *parent) - : LdapSearchListWidget(QString::fromStdString(filter), QString::fromStdString(dn), parent) +LdapSearchListWidget::LdapSearchListWidget(const std::string &filter, const std::string &dn, const std::string &title, QWidget *parent) + : LdapSearchListWidget(QString::fromStdString(filter), QString::fromStdString(dn), QString::fromStdString(title), parent) { } diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.h b/src/plugins/security/model/ui/ldapsearchlistwidget.h index 469a11c6f..0e3b7190b 100644 --- a/src/plugins/security/model/ui/ldapsearchlistwidget.h +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.h @@ -38,8 +38,8 @@ class LdapSearchListWidget : public QWidget Q_OBJECT public: - explicit LdapSearchListWidget(const QString& filter, const QString& dn, QWidget* parent = nullptr); - explicit LdapSearchListWidget(const std::string& filter, const std::string& dn, QWidget* parent = nullptr); + explicit LdapSearchListWidget(const QString& filter, const QString& dn, const QString &title, QWidget* parent = nullptr); + explicit LdapSearchListWidget(const std::string& filter, const std::string& dn, const std::string &title, QWidget* parent = nullptr); ~LdapSearchListWidget() override; void setAddButtonText(const QString& text); diff --git a/src/plugins/security/model/ui/ldapsearchlistwidget.ui b/src/plugins/security/model/ui/ldapsearchlistwidget.ui index 99871b6a9..4868c302e 100644 --- a/src/plugins/security/model/ui/ldapsearchlistwidget.ui +++ b/src/plugins/security/model/ui/ldapsearchlistwidget.ui @@ -13,36 +13,69 @@ Form - - - - - Add button + + + + + Ldap search header: - - - - - - Remove button + + false - - - - - - Qt::Horizontal + + true - - - 40 - 20 - + + false - - - - + + + 7 + + + 7 + + + 7 + + + 7 + + + 5 + + + + + + + + Add button + + + + + + + Remove button + + + + + + + Qt::Horizontal + + + + 190 + 20 + + + + + + diff --git a/src/plugins/security/model/ui/presentationbuilder.cpp b/src/plugins/security/model/ui/presentationbuilder.cpp index 7ddfa6c77..f425e7455 100644 --- a/src/plugins/security/model/ui/presentationbuilder.cpp +++ b/src/plugins/security/model/ui/presentationbuilder.cpp @@ -186,7 +186,7 @@ class PresentationBuilderPrivate void visit(LdapSearchDialog &widget) const { - LdapSearchListWidget* ldapSearchListWidget = new LdapSearchListWidget(widget.filter, widget.dn); + LdapSearchListWidget* ldapSearchListWidget = new LdapSearchListWidget(widget.filter, widget.dn, widget.title); ldapSearchListWidget->setAddButtonText(QString::fromStdString(widget.addLabel)); ldapSearchListWidget->setRemoveButtonText(QString::fromStdString(widget.removeLabel)); diff --git a/src/plugins/security/schema/security.xsd b/src/plugins/security/schema/security.xsd index efddbb207..fb69d7846 100644 --- a/src/plugins/security/schema/security.xsd +++ b/src/plugins/security/schema/security.xsd @@ -346,6 +346,7 @@ +