From 5082ac5c1bf05a26e3129c2ae6422b70462d077b Mon Sep 17 00:00:00 2001 From: Nick Logozzo Date: Mon, 8 Jan 2024 13:00:49 -0500 Subject: [PATCH] libaura --> libnick (#15) * libaura --> libnick * Update documentation.cpp * Update auratests.cpp * Update auratests.cpp --- .github/workflows/linux.yml | 2 +- .github/workflows/windows.yml | 2 +- CMakeLists.txt | 28 +- README.md | 36 +-- cmake/config.cmake.in | 4 +- cmake/{libaura.pc.in => libnick.pc.in} | 2 +- docs/README.md | 28 +- docs/aura.md | 272 ++---------------- docs/events.md | 16 +- docs/filesystem.md | 131 ++++++++- docs/helpers.md | 6 +- docs/keyring.md | 22 +- docs/localization.md | 10 +- docs/network.md | 12 +- docs/notifications.md | 24 +- docs/taskbar.md | 8 +- docs/update.md | 134 ++++++++- include/{ => aura}/appinfo.h | 8 +- include/{ => aura}/aura.h | 0 include/{ => aura}/configurationbase.h | 0 include/{ => aura}/interprocesscommunicator.h | 0 include/events/event.h | 2 +- include/events/eventargs.h | 2 +- include/events/parameventargs.h | 2 +- include/filesystem/fileaction.h | 2 +- .../filesystem/filesystemchangedeventargs.h | 2 +- include/filesystem/filesystemwatcher.h | 2 +- include/{ => filesystem}/systemdirectories.h | 2 +- include/{ => filesystem}/userdirectories.h | 2 +- include/filesystem/watcherflags.h | 2 +- include/helpers/stringhelpers.h | 2 +- include/helpers/webhelpers.h | 2 +- include/keyring/credential.h | 2 +- include/keyring/credentialcheckstatus.h | 2 +- include/keyring/keyring.h | 2 +- include/keyring/keyringdialogcontroller.h | 2 +- include/keyring/passwordcontent.h | 2 +- include/keyring/passwordgenerator.h | 2 +- include/keyring/passwordstrength.h | 2 +- include/keyring/store.h | 2 +- include/keyring/systemcredentials.h | 2 +- include/localization/documentation.h | 2 +- include/localization/gettext.h | 6 +- include/network/networkmonitor.h | 2 +- include/network/networkstate.h | 2 +- .../network/networkstatechangedeventargs.h | 2 +- .../notifications/notificationsenteventargs.h | 2 +- include/notifications/notificationseverity.h | 2 +- include/notifications/notifyicon.h | 2 +- include/notifications/notifyiconmenu.h | 2 +- include/notifications/shellnotification.h | 8 +- .../shellnotificationsenteventargs.h | 2 +- include/taskbar/progressstate.h | 2 +- include/taskbar/taskbaritem.h | 2 +- include/update/updater.h | 4 +- include/{ => update}/version.h | 2 +- include/{ => update}/versiontype.h | 2 +- src/{ => aura}/appinfo.cpp | 4 +- src/{ => aura}/aura.cpp | 6 +- src/{ => aura}/configurationbase.cpp | 6 +- src/{ => aura}/interprocesscommunicator.cpp | 4 +- src/filesystem/filesystemchangedeventargs.cpp | 2 +- src/filesystem/filesystemwatcher.cpp | 2 +- src/{ => filesystem}/systemdirectories.cpp | 12 +- src/{ => filesystem}/userdirectories.cpp | 26 +- src/helpers/stringhelpers.cpp | 2 +- src/helpers/webhelpers.cpp | 2 +- src/keyring/credential.cpp | 2 +- src/keyring/keyring.cpp | 2 +- src/keyring/keyringdialogcontroller.cpp | 2 +- src/keyring/passwordgenerator.cpp | 2 +- src/keyring/passwordstrength.cpp | 2 +- src/keyring/store.cpp | 6 +- src/keyring/systemcredentials.cpp | 2 +- src/localization/documentation.cpp | 10 +- src/localization/gettext.cpp | 2 +- src/network/networkmonitor.cpp | 6 +- src/network/networkstatechangedeventargs.cpp | 2 +- .../notificationsenteventargs.cpp | 2 +- src/notifications/notifyicon.cpp | 6 +- src/notifications/notifyiconmenu.cpp | 2 +- src/notifications/shellnotification.cpp | 15 +- .../shellnotificationsenteventargs.cpp | 2 +- src/taskbar/taskbaritem.cpp | 2 +- src/update/updater.cpp | 10 +- src/{ => update}/version.cpp | 4 +- tests/auratests.cpp | 12 +- tests/eventtests.cpp | 2 +- tests/filewatchertests.cpp | 4 +- tests/ipctests.cpp | 6 +- tests/keyringtests.cpp | 2 +- tests/networktests.cpp | 4 +- tests/notifyicontests.cpp | 4 +- tests/passwordtests.cpp | 2 +- tests/storetests.cpp | 2 +- tests/stringtests.cpp | 6 +- tests/systemcredentialstests.cpp | 2 +- tests/taskbartests.cpp | 2 +- tests/updatertests.cpp | 5 +- tests/versiontests.cpp | 4 +- tests/webtests.cpp | 2 +- vcpkg/portfile.cmake | 6 +- vcpkg/usage | 6 +- vcpkg/vcpkg.json | 10 +- 104 files changed, 531 insertions(+), 526 deletions(-) rename cmake/{libaura.pc.in => libnick.pc.in} (90%) rename include/{ => aura}/appinfo.h (97%) rename include/{ => aura}/aura.h (100%) rename include/{ => aura}/configurationbase.h (100%) rename include/{ => aura}/interprocesscommunicator.h (100%) rename include/{ => filesystem}/systemdirectories.h (92%) rename include/{ => filesystem}/userdirectories.h (98%) rename include/{ => update}/version.h (99%) rename include/{ => update}/versiontype.h (85%) rename src/{ => aura}/appinfo.cpp (98%) rename src/{ => aura}/aura.cpp (96%) rename src/{ => aura}/configurationbase.cpp (85%) rename src/{ => aura}/interprocesscommunicator.cpp (98%) rename src/{ => filesystem}/systemdirectories.cpp (73%) rename src/{ => filesystem}/userdirectories.cpp (89%) rename src/{ => update}/version.cpp (98%) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c7e99c0..fe32599 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -59,7 +59,7 @@ jobs: working-directory: ${{github.workspace}}/build run: cmake --install . --prefix "${{github.workspace}}/install" - name: "Test" - run: ${{github.workspace}}/build/libaura_test + run: ${{github.workspace}}/build/libnick_test - name: Upload uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f8319db..d45b35a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -48,7 +48,7 @@ jobs: working-directory: ${{github.workspace}}/build run: cmake --install . --prefix "${{github.workspace}}/install" - name: "Test" - run: ${{github.workspace}}/build/Release/libaura_test.exe + run: ${{github.workspace}}/build/Release/libnick_test.exe - name: Upload uses: actions/upload-artifact@v3 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a73b39..3bfce88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,19 +17,25 @@ if (POLICY CMP0141) set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") endif() -#libaura Definition -project ("libaura" LANGUAGES C CXX VERSION 2024.1.2 DESCRIPTION "A cross-platform base for native Nickvision applications.") +#libnick Definition +project ("libnick" LANGUAGES C CXX VERSION 2024.1.3 DESCRIPTION "A cross-platform base for native Nickvision applications.") include(CMakePackageConfigHelpers) include(GNUInstallDirs) -#libaura Setup +#libnick Setup add_compile_definitions(SQLITE_HAS_CODEC) if(LINUX) add_compile_definitions(HAVE_USLEEP) endif() add_library (${PROJECT_NAME} + "src/aura/appinfo.cpp" + "src/aura/aura.cpp" + "src/aura/configurationbase.cpp" + "src/aura/interprocesscommunicator.cpp" "src/filesystem/filesystemchangedeventargs.cpp" "src/filesystem/filesystemwatcher.cpp" + "src/filesystem/systemdirectories.cpp" + "src/filesystem/userdirectories.cpp" "src/helpers/stringhelpers.cpp" "src/helpers/webhelpers.cpp" "src/keyring/credential.cpp" @@ -50,14 +56,8 @@ add_library (${PROJECT_NAME} "src/notifications/shellnotificationsenteventargs.cpp" "src/taskbar/taskbaritem.cpp" "src/update/updater.cpp" - "src/appinfo.cpp" - "src/aura.cpp" - "src/configurationbase.cpp" - "src/interprocesscommunicator.cpp" - "src/sqlite3.c" - "src/systemdirectories.cpp" - "src/userdirectories.cpp" - "src/version.cpp") + "src/update/version.cpp" + "src/sqlite3.c") target_include_directories(${PROJECT_NAME} PUBLIC "$" "$") set_target_properties(${PROJECT_NAME} PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION}") set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "${PROJECT_VERSION}") @@ -67,7 +67,7 @@ else() target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic) endif() -#libaura Packages +#libnick Packages find_package(Boost REQUIRED COMPONENTS locale) find_package(CURL REQUIRED) find_package(jsoncpp CONFIG REQUIRED) @@ -91,7 +91,7 @@ elseif(LINUX) target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread PkgConfig::libsecret unofficial::UUID::uuid) endif() -#libaura Install +#libnick Install configure_file("${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}.pc.in" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}.pc" @ONLY) configure_package_config_file("${CMAKE_SOURCE_DIR}/cmake/config.cmake.in" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") write_basic_package_version_file("${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" VERSION "${PROJECT_VERSION}" COMPATIBILITY AnyNewerVersion) @@ -102,7 +102,7 @@ install(EXPORT "${PROJECT_NAME}Targets" FILE "${PROJECT_NAME}Targets.cmake" NAME install(FILES "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") export(EXPORT "${PROJECT_NAME}Targets" FILE "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Targets.cmake" NAMESPACE ${PROJECT_NAME}::) -#libaura Test +#libnick Test if (NOT BUILD_TESTING STREQUAL OFF) add_executable(${PROJECT_NAME}_test "tests/auratests.cpp" diff --git a/README.md b/README.md index a62a4f8..02d3942 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -# libaura +# libnick Logo **A cross-platform base for native Nickvision applications.** -libaura provides Nickvision apps with a common set of cross-platform (Windows and Linux) APIs for managing system and desktop app functionality such as network management, taskbar icons, translations, app updates, and more. +libnick provides Nickvision apps with a common set of cross-platform (Windows and Linux) APIs for managing system and desktop app functionality such as network management, taskbar icons, translations, app updates, and more. ## Documentation Documentation for this library and its modules can be found [here](/docs). ## Dependencies -The following are a list of dependencies used by libaura. +The following are a list of dependencies used by libnick. Following the [build instructions](#building-and-installing) below using vcpkg, will ensure these dependencies are installed properly for your platform. @@ -23,7 +23,7 @@ Following the [build instructions](#building-and-installing) below using vcpkg, - libgettext - maddy - openssl - - Used for sqlcipher, as libaura manually includes and compiles sqlcipher. + - Used for sqlcipher, as libnick manually includes and compiles sqlcipher. ### Linux Only The above dependencies must be installed, plus the following for linux systems: @@ -32,20 +32,20 @@ The above dependencies must be installed, plus the following for linux systems: - libuuid ## Building and Installing -libaura uses `vcpkg` to manage its dependencies and `cmake` as its build system. +libnick uses `vcpkg` to manage its dependencies and `cmake` as its build system. -Ensure both `vcpkg` and `cmake` are installed on your system before building and installing libaura. +Ensure both `vcpkg` and `cmake` are installed on your system before building and installing libnick. -A C++20 compiler is also required to build libaura. +A C++20 compiler is also required to build libnick. ### Configuring vcpkg 1. Set the `VCPKG_ROOT` environment variable to the path of your vcpkg installation's root directory. #### Windows 1. Set `VCPKG_DEFAULT_TRIPLET` to `x64-windows` -1. Run `vcpkg install boost-locale curl gettext gettext-libintl gtest jsoncpp maddy openssl` +1. Run `vcpkg install boost-locale curl gettext-libintl gtest jsoncpp maddy openssl` #### Linux 1. Set `VCPKG_DEFAULT_TRIPLET` to `x64-linux` -1. Run `vcpkg install boost-locale curl gettext gettext-libintl glib gtest jsoncpp libsecret libuuid maddy openssl` +1. Run `vcpkg install boost-locale curl gettext-libintl glib gtest jsoncpp libsecret libuuid maddy openssl` ### Building 1. First, clone/download the repo. @@ -53,20 +53,20 @@ A C++20 compiler is also required to build libaura. 1. Create a new `build` directory and `cd` into it. #### Windows 1. From the `build` folder, run `cmake .. -G "Visual Studio 17 2022"`. - - To skip building libaura's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command. + - To skip building libnick's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command. 1. From the `build` folder, run `cmake --build . --config Release`. -1. After these commands complete, libaura will be successfully built and its binaries can be found in the `Release` folder of the `build` folder. +1. After these commands complete, libnick will be successfully built and its binaries can be found in the `Release` folder of the `build` folder. #### Linux 1. From the `build` folder, run `cmake .. -DCMAKE_BUILD_TYPE=Release`. - - To skip building libaura's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command. + - To skip building libnick's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command. 1. From the `build` folder, run `cmake --build .`. -1. After these commands complete, libaura will be successfully built and its binaries can be found in the `build` folder. +1. After these commands complete, libnick will be successfully built and its binaries can be found in the `build` folder. ### Installing -1. To install libaura to the system, from the `build` folder, run `cmake --install . --prefix "PATH_TO_INSTALL_DIR"`. - - Replace `PATH_TO_INSTALL_DIR` with the path to a folder to install libaura to. +1. To install libnick to the system, from the `build` folder, run `cmake --install . --prefix "PATH_TO_INSTALL_DIR"`. + - Replace `PATH_TO_INSTALL_DIR` with the path to a folder to install libnick to. - This is usually a dependencies folder set up by the programmer, added to the PATH variable, to allow linking to said dependencies. - On linux, `PATH_TO_INSTALL_DIR` would usually be `/usr`. - - This command will export and install libaura cmake targets allowing you to simply use libaura in other cmake projects by adding: - - `find_package(libaura CONFIG REQUIRED)` - - `target_link_libraries(main PRIVATE libaura::libaura)` + - This command will export and install libnick cmake targets allowing you to simply use libnick in other cmake projects by adding: + - `find_package(libnick CONFIG REQUIRED)` + - `target_link_libraries(main PRIVATE libnick::libnick)` diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in index 07b9342..2a078c9 100644 --- a/cmake/config.cmake.in +++ b/cmake/config.cmake.in @@ -1,6 +1,6 @@ @PACKAGE_INIT@ -include("${CMAKE_CURRENT_LIST_DIR}/libauraTargets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/libnickTargets.cmake") include(CMakeFindDependencyMacro) find_dependency(Boost REQUIRED COMPONENTS locale) @@ -21,4 +21,4 @@ if(LINUX) find_dependency(unofficial-libuuid CONFIG REQUIRED) endif() -check_required_components(libaura) \ No newline at end of file +check_required_components(libnick) \ No newline at end of file diff --git a/cmake/libaura.pc.in b/cmake/libnick.pc.in similarity index 90% rename from cmake/libaura.pc.in rename to cmake/libnick.pc.in index b3f1913..b64ac51 100644 --- a/cmake/libaura.pc.in +++ b/cmake/libnick.pc.in @@ -8,5 +8,5 @@ Description: @PROJECT_DESCRIPTION@ Version: @PROJECT_VERSION@ Requires: -Libs: -L${libdir} -llibaura +Libs: -L${libdir} -llibnick Cflags: -I${includedir} \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 015a757..ed90ae6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ -# libaura Documentation +# libnick Documentation -This folder contains all of the necessary documentation for using libaura and it's provided modules. +This folder contains all of the necessary documentation for using libnick and it's provided modules. Each module (separated by namespace) contains its own documentation file that can be found within this folder or via one of the links below. @@ -20,20 +20,20 @@ This means that the class provides the following methods for `m_var`: `std::stri If a member variable is get or set only, we will document this as `std::string Var: get` and `std::string Var: set` respectively. ### Events -libaura provides a C#-inspired event system module under the Nickvision::Aura::Events namespace. This module contains a class `Event` that handles registering and calling callbacks when said event is invoked. +libnick provides a C#-inspired event system module under the Nickvision::Events namespace. This module contains a class `Event` that handles registering and calling callbacks when said event is invoked. -For example, assume a class has an event defined as `Nickvision::Aura::Events::Event m_saved`. We will document exposure of this event as `Event Saved`. +For example, assume a class has an event defined as `Nickvision::Events::Event m_saved`. We will document exposure of this event as `Event Saved`. -This means that the class provides the following method, allowing consumers to register callbacks to the event using the `+=` operator: `Nickvision::Aura::Events::Event& saved()`. +This means that the class provides the following method, allowing consumers to register callbacks to the event using the `+=` operator: `Nickvision::Events::Event& saved()`. ## Modules - [Nickvision::Aura](aura.md) -- [Nickvision::Aura::Events](events.md) -- [Nickvision::Aura::Filesystem](filesystem.md) -- [Nickvision::Aura::Helpers](helpers.md) -- [Nickvision::Aura::Keyring](keyring.md) -- [Nickvision::Aura::Localization](localization.md) -- [Nickvision::Aura::Network](network.md) -- [Nickvision::Aura::Notifications](notifications.md) -- [Nickvision::Aura::Taskbar](taskbar.md) -- [Nickvision::Aura::Update](update.md) \ No newline at end of file +- [Nickvision::Events](events.md) +- [Nickvision::Filesystem](filesystem.md) +- [Nickvision::Helpers](helpers.md) +- [Nickvision::Keyring](keyring.md) +- [Nickvision::Localization](localization.md) +- [Nickvision::Network](network.md) +- [Nickvision::Notifications](notifications.md) +- [Nickvision::Taskbar](taskbar.md) +- [Nickvision::Update](update.md) \ No newline at end of file diff --git a/docs/aura.md b/docs/aura.md index cec7208..8488bf9 100644 --- a/docs/aura.md +++ b/docs/aura.md @@ -1,22 +1,17 @@ -# Nickvision::Aura +# Nickvision -This module contains types and functions every Nickvision application utilizes. +This module contains types and functions for creating Nickvision applications. ## Table of Contents - [AppInfo](#appinfo) - [Aura](#aura) - [ConfigurationBase](#configurationbase) -- [EnumFlags](#enumflags) - [InterProcessCommunicator](#interprocesscommunicator) -- [SystemDirectories](#systemdirectories) -- [UserDirectories](#userdirectories) -- [Version](#version) -- [VersionType](#versiontype) ## AppInfo Description: A model for the information about an application. -Interface: [appinfo.h](/include/appinfo.h) +Interface: [appinfo.h](/include/aura/appinfo.h) Type: `class` @@ -49,7 +44,7 @@ Path: `Nickvision::Aura::AppInfo` - The application description. - Ex: `"A template for Nickvision applications."` - ``` - Nickvision::Aura::Version Version: get, set + Nickvision::Version Version: get, set ``` - The application version. - Ex: `2023.12.0` @@ -132,7 +127,7 @@ Path: `Nickvision::Aura::AppInfo` ## Aura Description: An application base. -Interface: [aura.h](/include/aura.h) +Interface: [aura.h](/include/aura/aura.h) Type: `class` @@ -140,7 +135,7 @@ Path: `Nickvision::Aura::Aura` ### Member Variables - ``` - Nickvision::Aura::AppInfo& AppInfo: get + Nickvision::AppInfo& AppInfo: get ``` - The AppInfo object for the application @@ -151,12 +146,12 @@ Path: `Nickvision::Aura::Aura` - Accepts: The string key of the config file, key. - Returns: A reference to the configuration object of type T with key key. - Throws: `std::invalid_argument` if key is empty - - Note: T must be a type that derives from `Nickvision::Aura::ConfigurationBase` + - Note: T must be a type that derives from `Nickvision::ConfigurationBase` - Ex: `getConfig("config")` will return the `Configuration` object parsed from a `config.json` file on disk. ### Static Functions - ```cpp - Nickvision::Aura::Aura& init(const std::string& id, const std::string& name, const std::string& englishShortName) + Nickvision::Aura& init(const std::string& id, const std::string& name, const std::string& englishShortName) ``` - Accepts: An application id, id, an application name, name, and an application english short name, englishShortName. - Returns: A reference to the newly initialized singleton `Aura` object. @@ -164,7 +159,7 @@ Path: `Nickvision::Aura::Aura` - Note: This also calls curl_global_init(). - Note: This also calls Localization::Gettext::init(). - ```cpp - Nickvision::Aura::Aura& getActive() + Nickvision::Aura& getActive() ``` - Returns: The reference to the singleton `Aura` object. - Throws: `std::logic_error` if `Aura::init()` was not yet called. @@ -194,7 +189,7 @@ Path: `Nickvision::Aura::Aura` ## ConfigurationBase Description: A base class for configuration files. -Interface: [configurationbase.h](/include/configurationbase.h) +Interface: [configurationbase.h](/include/aura/configurationbase.h) Type: `class` @@ -208,7 +203,7 @@ Path: `Nickvision::Aura::ConfigurationBase` ### Events - ``` - Event Saved + Event Saved ``` - Invoked when the configuration file is saved to disk @@ -259,7 +254,7 @@ public: ``` This object can now be used by an Aura-based application: ```cpp -void onConfigSaved(const Nickvision::Aura::Events::EventArgs& e) +void onConfigSaved(const Nickvision::Events::EventArgs& e) { std::cout << "Config saved to disk." << std::endl; } @@ -283,7 +278,7 @@ Description: Macros for working with enums to be used as flags. Interface: [enumflags.h](/include/enumflags.h) -Type: `namespace` +Type: `file` ### Macros - ```cpp @@ -297,7 +292,7 @@ Type: `namespace` ## InterProcessCommunicator Description: An inter process communicator (server/client). -Interface: [interprocesscommunicator.h](/include/interprocesscommunicator.h) +Interface: [interprocesscommunicator.h](/include/aura/interprocesscommunicator.h) Type: `class` @@ -315,7 +310,7 @@ Path: `Nickvision::Aura::InterProcessCommunicator` ### Events - ``` - Event>> CommandReceived + Event>> CommandReceived ``` - Invoked when this IPC server instance received a command from a client instance. - Note: If `isClient()` is true, this event will never be invoked for that instance. @@ -342,7 +337,7 @@ Path: `Nickvision::Aura::InterProcessCommunicator` - Note: If this instance is the running server and communicate was called on said instance, `CommandReceived` will still be triggered with the passed args. ### Performing Inter-Process Communication -libaura uses named-pipes on Windows and Unix Domain Sockets on Linux to establish inter process server and client communicators, while abstracting all of that away from the consumer in the easy to use `InterProcessCommunicator` API. +libnick uses named-pipes on Windows and Unix Domain Sockets on Linux to establish inter process server and client communicators, while abstracting all of that away from the consumer in the easy to use `InterProcessCommunicator` API. Upon creating an `InterProcessCommunicator` object, either `isServer()` or `isClient()` will return true depending on whether or not this instance is a server or client respectively. Server instances should register a callback to the `CommandReceived` event to be invoked when clients send commands to the server. @@ -372,238 +367,3 @@ If this program is ran for the first time, ipc will be the server instance. `han If this program is ran not for the first time, its arguments will be sent to the first instance and this instance itself will close. The first instance's `handleArguments` function will be called as a result of `CommandReceived` being invoked by the ipc server receiving the command. -## SystemDirectories -Description: Functions for working with system directories. - -Interface: [systemdirectories.h](/include/systemdirectories.h) - -Type: `namespace` - -Path: `Nickvision::Aura::SystemDirectories` - -### Functions -- ```cpp - std::vector getPath() - ``` - - Returns: The list of directory paths found in the system's PATH variable. -- ```cpp - std::vector getConfig() - ``` - - Returns: The list of directory paths found in the system's XDG_CONFIG_DIRS variable. -- ```cpp - std::vector getData() - ``` - - Returns: The list of directory paths found in the system's XDG_DATA_DIRS variable. - -## UserDirectories -Description: Functions for working with user directories. - -Interface: [userdirectories.h](/include/userdirectories.h) - -Type: `namespace` - -Path: `Nickvision::Aura::UserDirectories` - -### Functions -- ```cpp - std::filesystem::path getHome() - ``` - - Returns: The path to the user's home directory. - - Returns: `FOLDERID_Profile` on Windows, `$HOME` on Linux. -- ```cpp - std::filesystem::path getConfig() - ``` - - Returns: The path to the user's config directory. - - Returns: `FOLDERID_RoamingAppData` on Windows, `XDG_CONFIG_HOME` on Linux. -- ```cpp - std::filesystem::path getApplicationConfig() - ``` - - Returns: The path to the application's config directory. - - Returns: `getConfig() + Aura::getActive().getAppInfo().getName()` -- ```cpp - std::filesystem::path getCache() - ``` - - Returns: The path to the user's cache directory. - - Returns: `FOLDERID_LocalAppData` on Windows, `XDG_CACHE_HOME` on Linux. -- ```cpp - std::filesystem::path getApplicationCache() - ``` - - Returns: The path to the application's cache directory. - - Returns: `getCache() + Aura::getActive().getAppInfo().getName()` -- ```cpp - std::filesystem::path getLocalData() - ``` - - Returns: The path to the user's local data directory. - - Returns: `FOLDERID_RoamingAppData` on Windows, `XDG_DATA_HOME` on Linux. -- ```cpp - std::filesystem::path getApplicationLocalData() - ``` - - Returns: The path to the application's local data directory. - - Returns: `getLocalData() + Aura::getActive().getAppInfo().getName()` -- ```cpp - std::filesystem::path getRuntime() - ``` - - Returns: The path to the user's runtime directory. - - Returns: Empty path on Windows, `XDG_RUNTIME_DIR` on Linux. -- ```cpp - std::filesystem::path getDesktop() - ``` - - Returns: The path to the user's desktop directory. - - Returns: `FOLDERID_Desktop` on Windows, `XDG_DESKTOP_DIR` on Linux. -- ```cpp - std::filesystem::path getDocuments() - ``` - - Returns: The path to the user's documents directory. - - Returns: `FOLDERID_Documents` on Windows, `XDG_DOCUMENTS_DIR` on Linux. -- ```cpp - std::filesystem::path getDownloads() - ``` - - Returns: The path to the user's downloads directory. - - Returns: `FOLDERID_Downloads` on Windows, `XDG_DOWNLOAD_DIR` on Linux. -- ```cpp - std::filesystem::path getMusic() - ``` - - Returns: The path to the user's music directory. - - Returns: `FOLDERID_Music` on Windows, `XDG_MUSIC_DIR` on Linux. -- ```cpp - std::filesystem::path getPictures() - ``` - - Returns: The path to the user's pictures directory. - - Returns: `FOLDERID_Pictures` on Windows, `XDG_PICTURES_DIR` on Linux. -- ```cpp - std::filesystem::path getPublicShare() - ``` - - Returns: The path to the user's pictures directory. - - Returns: Empty path on Windows, `XDG_PUBLICSHARE_DIR` on Linux. -- ```cpp - std::filesystem::path getTemplates() - ``` - - Returns: The path to the user's pictures directory. - - Returns: `FOLDERID_Templates` on Windows, `XDG_TEMPLATES_DIR` on Linux. -- ```cpp - std::filesystem::path getVideos() - ``` - - Returns: The path to the user's pictures directory. - - Returns: `FOLDERID_Videos` on Windows, `XDG_VIDEOS_DIR` on Linux. - -## Version -Description: A model for a version number. Formatted in "major.minor.build-dev". - -Interface: [version.h](/include/version.h) - -Type: `class` - -Path: `Nickvision::Aura::Version` - -### Member Variables -- ``` - Nickvision::Aura::VersionType VersionType: get - ``` - - The type of the version - -### Methods -- ```cpp - Version() - ``` - - Constructs a blank Version. -- ```cpp - Version(int major, int minor, int build) - ``` - - Constructs a Version. - - Accepts: The major version number, major, the minor version number, minor, and the build version number, build. -- ```cpp - Version(int major, int minor, int build, const std::string& dev) - ``` - - Constructs a Version. - - Accepts: The major version number, major, the minor version number, minor, the build version number, build, and the dev version string, dev. -- ```cpp - Version(const std::string& version) - ``` - - Constructs a Version. - - Accepts: The version as a string to parse, version. - - Note: version must be in the format of `"major.minor.build-dev"`. -- ```cpp - int getMajor() const - ``` - - Returns: The major number of the version. -- ```cpp - int getMinor() const - ``` - - Returns: The minor number of the version. -- ```cpp - int getBuild() const - ``` - - Returns: The build number of the version. -- ```cpp - const std::string& getDev() const - ``` - - Returns: The dev string of the version. -- ```cpp - const std::string& toString() const - ``` - - Returns: The string representation of the Version -- ```cpp - bool empty() const - ``` - - Returns: `true` if the Version object is empty - - Returns: `false` if the Version object is not empty -- ```cpp - bool operator<(const Version& compare) const - ``` - - Accepts: The version object to compare to this object, compare. - - Returns: `true` if this < compare. - - Returns: `false` if this >= compare. -- ```cpp - bool operator<=(const Version& compare) const - ``` - - Accepts: The version object to compare to this object, compare. - - Returns: `true` if this <= compare. - - Returns: `false` if this > compare. -- ```cpp - bool operator>(const Version& compare) const - ``` - - Accepts: The version object to compare to this object, compare. - - Returns: `true` if this > compare. - - Returns: `false` if this <= compare. -- ```cpp - bool operator>=(const Version& compare) const - ``` - - Accepts: The version object to compare to this object, compare. - - Returns: `true` if this >= compare. - - Returns: `false` if this < compare. -- ```cpp - bool operator==(const Version& compare) const - ``` - - Accepts: The version object to compare to this object, compare. - - Returns: `true` if this == compare. - - Returns: `false` if this != compare. -- ```cpp - bool operator!=(const Version& compare) const - ``` - - Accepts: The version object to compare to this object, compare. - - Returns: `true` if this != compare. - - Returns: `false` if this == compare. -- ```cpp - friend std::ostream& operator<<(std::ostream& os, const Version& version) - ``` - - Accepts: The ostream to output the version to, os, and the Version object to output, version. - - Returns: A reference to the ostream object accepted by the function. - -## VersionType -Description: Types of a version - -Interface: [versiontype.h](/include/versiontype.h) - -Type: `enum class` - -Path: `Nickvision::Aura::VersionType` - -### Values -- ```cpp - Stable = 0 - ``` - - Represents a stable version -- ```cpp - Preview = 1 - ``` - - Represents a preview (dev) version \ No newline at end of file diff --git a/docs/events.md b/docs/events.md index a46bf04..b3da80c 100644 --- a/docs/events.md +++ b/docs/events.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Events +# Nickvision::Events This module provides a C#-inspired event system to be used in C++ applications. @@ -15,9 +15,9 @@ Description: An event that can have handlers subscribe to it, which in turn will Interface: [event.h](/include/events/event.h) Type: `template class` -- The typename T must derive from `Nickvision::Aura::Events::EventArgs` +- The typename T must derive from `Nickvision::Events::EventArgs` -Path: `Nickvision::Aura::Events::Event` +Path: `Nickvision::Events::Event` ### Methods - ```cpp @@ -62,7 +62,7 @@ Path: `Nickvision::Aura::Events::Event` - Moves an Event object. ### Defining Events In Your Classes -libaura events are designed to easily integrate within your classes to easily notify consumers of changes in state of an object. +libnick events are designed to easily integrate within your classes to easily notify consumers of changes in state of an object. Let's take a look at [ConfigurationBase](/include/configurationbase.h) and how it defines and uses events. @@ -93,7 +93,7 @@ Here we can see how `ConfigurationBase` defines a `saved` event, exposes it to t A consumer of `ConfigurationBase` can easily subscribe to the event and have its handler called when the configuration object is saved: ```cpp -void handler(const Nickvision::Aura::Events::EventArgs& e) +void handler(const Nickvision::Events::EventArgs& e) { std::cout << "Config saved." << std::endl; } @@ -115,7 +115,7 @@ Interface: [eventargs.h](/include/events/eventargs.h) Type: `class` -Path: `Nickvision::Aura::Events::EventArgs` +Path: `Nickvision::Events::EventArgs` ### Methods - ```cpp @@ -124,7 +124,7 @@ Path: `Nickvision::Aura::Events::EventArgs` - Constructs an EventArgs. ### Note -This class should be the base class of all objects used as a parameter for a libaura Event. +This class should be the base class of all objects used as a parameter for a libnick Event. ## ParamEventArgs Description: An event argument that contains a single parameter. @@ -133,7 +133,7 @@ Interface: [parameventargs.h](/include/events/parameventargs.h) Type: `template class` -Path: `Nickvision::Aura::Events::ParamEventArgs` +Path: `Nickvision::Events::ParamEventArgs` ### Member Variables - ``` diff --git a/docs/filesystem.md b/docs/filesystem.md index 1f3d5e1..9fa507d 100644 --- a/docs/filesystem.md +++ b/docs/filesystem.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Filesystem +# Nickvision::Filesystem This module contains objects for working with the filesystem, such as a file system watcher. @@ -6,9 +6,10 @@ This module contains objects for working with the filesystem, such as a file sys - [FileAction](#fileaction) - [FileSystemChangedEventArgs](#filesystemchangedeventargs) - [FileSystemWatcher](#filesystemwatcher) +- [SystemDirectories](#systemdirectories) +- [UserDirectories](#userdirectories) - [WatcherFlags](#watcherflags) - ## FileAction Description: Actions that cause a file system object to change. @@ -16,7 +17,7 @@ Interface: [fileaction.h](/include/filesystem/fileaction.h) Type: `enum class` -Path: `Nickvision::Aura::Filesystem::FileAction` +Path: `Nickvision::Filesystem::FileAction` ### Values - ```cpp @@ -43,7 +44,7 @@ Interface: [filesystemchangedeventargs.h](/include/filesystem/filesystemchangede Type: `class` -Path: `Nickvision::Aura::Filesystem::FileSystemChangedEventArgs` +Path: `Nickvision::Filesystem::FileSystemChangedEventArgs` ### Member Variables - ```cpp @@ -51,7 +52,7 @@ Path: `Nickvision::Aura::Filesystem::FileSystemChangedEventArgs` ``` - The path of the changed file system object system object. - ```cpp - Nickvision::Aura::Filesystem::FileAction Why: get + Nickvision::Filesystem::FileAction Why: get ``` - The action that caused the file system object to change. @@ -62,7 +63,7 @@ Interface: [filesystemwatcher.h](/include/filesystem/filesystemwatcher.h) Type: `class` -Path: `Nickvision::Aura::Filesystem::FileSystemWatcher` +Path: `Nickvision::Filesystem::FileSystemWatcher` ### Member Variables - ``` @@ -80,7 +81,7 @@ Path: `Nickvision::Aura::Filesystem::FileSystemWatcher` ### Events - ``` - Event Changed + Event Changed ``` - Invoked when a watched flag of the folder is changed. @@ -126,6 +127,120 @@ By default (and when the extension filters list is empty), all files, regardless Otherwise, only the extensions contained in the extension filters list will be watched for changes. +## SystemDirectories +Description: Functions for working with system directories. + +Interface: [systemdirectories.h](/include/filesystem/systemdirectories.h) + +Type: `namespace` + +Path: `Nickvision::Filesystem::SystemDirectories` + +### Functions +- ```cpp + std::vector getPath() + ``` + - Returns: The list of directory paths found in the system's PATH variable. +- ```cpp + std::vector getConfig() + ``` + - Returns: The list of directory paths found in the system's XDG_CONFIG_DIRS variable. +- ```cpp + std::vector getData() + ``` + - Returns: The list of directory paths found in the system's XDG_DATA_DIRS variable. + +## UserDirectories +Description: Functions for working with user directories. + +Interface: [userdirectories.h](/include/filesystem/userdirectories.h) + +Type: `namespace` + +Path: `Nickvision::Filesystem::UserDirectories` + +### Functions +- ```cpp + std::filesystem::path getHome() + ``` + - Returns: The path to the user's home directory. + - Returns: `FOLDERID_Profile` on Windows, `$HOME` on Linux. +- ```cpp + std::filesystem::path getConfig() + ``` + - Returns: The path to the user's config directory. + - Returns: `FOLDERID_RoamingAppData` on Windows, `XDG_CONFIG_HOME` on Linux. +- ```cpp + std::filesystem::path getApplicationConfig() + ``` + - Returns: The path to the application's config directory. + - Returns: `getConfig() + Aura::getActive().getAppInfo().getName()` +- ```cpp + std::filesystem::path getCache() + ``` + - Returns: The path to the user's cache directory. + - Returns: `FOLDERID_LocalAppData` on Windows, `XDG_CACHE_HOME` on Linux. +- ```cpp + std::filesystem::path getApplicationCache() + ``` + - Returns: The path to the application's cache directory. + - Returns: `getCache() + Aura::getActive().getAppInfo().getName()` +- ```cpp + std::filesystem::path getLocalData() + ``` + - Returns: The path to the user's local data directory. + - Returns: `FOLDERID_RoamingAppData` on Windows, `XDG_DATA_HOME` on Linux. +- ```cpp + std::filesystem::path getApplicationLocalData() + ``` + - Returns: The path to the application's local data directory. + - Returns: `getLocalData() + Aura::getActive().getAppInfo().getName()` +- ```cpp + std::filesystem::path getRuntime() + ``` + - Returns: The path to the user's runtime directory. + - Returns: Empty path on Windows, `XDG_RUNTIME_DIR` on Linux. +- ```cpp + std::filesystem::path getDesktop() + ``` + - Returns: The path to the user's desktop directory. + - Returns: `FOLDERID_Desktop` on Windows, `XDG_DESKTOP_DIR` on Linux. +- ```cpp + std::filesystem::path getDocuments() + ``` + - Returns: The path to the user's documents directory. + - Returns: `FOLDERID_Documents` on Windows, `XDG_DOCUMENTS_DIR` on Linux. +- ```cpp + std::filesystem::path getDownloads() + ``` + - Returns: The path to the user's downloads directory. + - Returns: `FOLDERID_Downloads` on Windows, `XDG_DOWNLOAD_DIR` on Linux. +- ```cpp + std::filesystem::path getMusic() + ``` + - Returns: The path to the user's music directory. + - Returns: `FOLDERID_Music` on Windows, `XDG_MUSIC_DIR` on Linux. +- ```cpp + std::filesystem::path getPictures() + ``` + - Returns: The path to the user's pictures directory. + - Returns: `FOLDERID_Pictures` on Windows, `XDG_PICTURES_DIR` on Linux. +- ```cpp + std::filesystem::path getPublicShare() + ``` + - Returns: The path to the user's pictures directory. + - Returns: Empty path on Windows, `XDG_PUBLICSHARE_DIR` on Linux. +- ```cpp + std::filesystem::path getTemplates() + ``` + - Returns: The path to the user's pictures directory. + - Returns: `FOLDERID_Templates` on Windows, `XDG_TEMPLATES_DIR` on Linux. +- ```cpp + std::filesystem::path getVideos() + ``` + - Returns: The path to the user's pictures directory. + - Returns: `FOLDERID_Videos` on Windows, `XDG_VIDEOS_DIR` on Linux. + ## WatcherFlags Description: Flags to describe properties of a file system object that can change. @@ -133,7 +248,7 @@ Interface: [watcherflags.h](/include/filesystem/watcherflags.h) Type: `enum class` with `DEFINE_ENUM_FLAG_OPERATORS` -Path: `Nickvision::Aura::Filesystem::WatcherFlags` +Path: `Nickvision::Filesystem::WatcherFlags` ### Values - ```cpp diff --git a/docs/helpers.md b/docs/helpers.md index 7d1ad22..233ee39 100644 --- a/docs/helpers.md +++ b/docs/helpers.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Helpers +# Nickvision::Helpers This module contains various helper namespaces that making working with C++ a bit less painful. @@ -13,7 +13,7 @@ Interface: [stringhelpers.h](/include/helpers/stringhelpers.h) Type: `namespace` -Path: `Nickvision::Aura::StringHelpers` +Path: `Nickvision::StringHelpers` ### Functions - ```cpp @@ -94,7 +94,7 @@ Interface: [webhelpers.h](/include/helpers/webhelpers.h) Type: `namespace` -Path: `Nickvision::Aura::WebHelpers` +Path: `Nickvision::WebHelpers` ### Functions - ```cpp diff --git a/docs/keyring.md b/docs/keyring.md index e60a5a3..dd9d0df 100644 --- a/docs/keyring.md +++ b/docs/keyring.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Keyring +# Nickvision::Keyring The module contains objects for storing and managing credentials, either through a database file or within a system's credential (secret) manager. @@ -20,7 +20,7 @@ Interface: [credential.h](/include/keyring/credential.h) Type: `class` -Path: `Nickvision::Aura::Keyring::Credential` +Path: `Nickvision::Keyring::Credential` ### Member Variables - ``` @@ -84,7 +84,7 @@ Interface: [credentialcheckstatus.h](/include/keyring/credentialcheckstatus.h) Type: `enum class` with `DEFINE_ENUM_FLAG_OPERATORS` -Path: `Nickvision::Aura::Keyring::CredentialCheckStatus` +Path: `Nickvision::Keyring::CredentialCheckStatus` ### Values - ```cpp @@ -111,7 +111,7 @@ Interface: [keyring.h](/include/keyring/keyring.h) Type: `class` -Path: `Nickvision::Aura::Keyring::Keyring` +Path: `Nickvision::Keyring::Keyring` ### Member Variables - ``` @@ -188,7 +188,7 @@ Interface: [keyringdialogcontroller.h](/include/keyring/keyringdialogcontroller. Type: `class` -Path: `Nickvision::Aura::Keyring::KeyringDialogController` +Path: `Nickvision::Keyring::KeyringDialogController` ### Member Variables - ``` @@ -257,7 +257,7 @@ Interface: [passwordcontent.h](/include/keyring/passwordcontent.h) Type: `enum class` with `DEFINE_ENUM_FLAG_OPERATORS` -Path: `Nickvision::Aura::Keyring::PasswordContent` +Path: `Nickvision::Keyring::PasswordContent` ### Values - ``` @@ -284,11 +284,11 @@ Interface: [passwordgenerator.h](/include/keyring/passwordgenerator.h) Type: `class` -Path: `Nickvision::Aura::Keyring::PasswordGenerator` +Path: `Nickvision::Keyring::PasswordGenerator` ### Member Variables - ``` - Nickvision::Aura::Keyring::PasswordContent ContentFlags: get, set + Nickvision::Keyring::PasswordContent ContentFlags: get, set ``` - The flags of possible characters in a generated password. @@ -311,7 +311,7 @@ Interface: [passwordstrength.h](/include/keyring/passwordstrength.h) Type: `enum class` -Path: `Nickvision::Aura::Keyring::PasswordStrength` +Path: `Nickvision::Keyring::PasswordStrength` ### Values - ``` @@ -353,7 +353,7 @@ Interface: [store.h](/include/keyring/store.h) Type: `class` -Path: `Nickvision::Aura::Keyring::Store` +Path: `Nickvision::Keyring::Store` ### Member Variables - ``` @@ -450,7 +450,7 @@ Interface: [systemcredentials.h](/include/keyring/systemcredentials.h) Type: `namespace` -Path: `Nickvision::Aura::Keyring::SystemCredentials` +Path: `Nickvision::Keyring::SystemCredentials` ### Functions - ```cpp diff --git a/docs/localization.md b/docs/localization.md index e164325..736cef7 100644 --- a/docs/localization.md +++ b/docs/localization.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Localization +# Nickvision::Localization This module contains functions for working with translations and other localization aspects of Nickvision applications. @@ -13,7 +13,7 @@ Interface: [documentation.h](/include/localization/documentation.h) Type: `namespace` -Path: `Nickvision::Aura::Localization::Documentation` +Path: `Nickvision::Localization::Documentation` ### Functions - ```cpp @@ -30,7 +30,7 @@ Interface: [gettext.h](/include/localization/gettext.h) Type: `namespace` -Path: `Nickvision::Aura::Localization::Gettext` +Path: `Nickvision::Localization::Gettext` ### Macros - Note: All strings passed to these macros must be C-Style Strings (`const char*`). @@ -45,12 +45,12 @@ Path: `Nickvision::Aura::Localization::Gettext` - Accepts: A singular version of string to translate, String, a plural version of string to translate, StringPlural, and the number of objects, N, used to determine whether or not to use the plural version of the message. - Returns: The translated message for the given number of objects. - ```cpp - #define _p(Context, String) ::Nickvision::Aura::Localization::pgettext(Context GETTEXT_CONTEXT_SEPARATOR String, String) + #define _p(Context, String) ::Nickvision::Localization::pgettext(Context GETTEXT_CONTEXT_SEPARATOR String, String) ``` - Accepts: The context of a string to translate, context, and the string to translate, msg. - Returns: The translated message for the given context. - ```cpp - #define _pn(Context, String, StringPlural, N) ::Nickvision::Aura::Localization::pngettext(Context GETTEXT_CONTEXT_SEPARATOR String, String, StringPlural, N) + #define _pn(Context, String, StringPlural, N) ::Nickvision::Localization::pngettext(Context GETTEXT_CONTEXT_SEPARATOR String, String, StringPlural, N) ``` - Accepts: The context of a string to translate, context, the singular version of string to translate, msg, the plural version of the string to translate, and the number of objects, n, used to determine whether or not to use the plural version of the message. - Returns: The translated message for the given context and number of objects. diff --git a/docs/network.md b/docs/network.md index 9205e60..f2068f5 100644 --- a/docs/network.md +++ b/docs/network.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Network +# Nickvision::Network This module contains objects for managing a system's network state. @@ -14,17 +14,17 @@ Interface: [networkmonitor.h](/include/network/networkmonitor.h) Type: `class` -Path: `Nickvision::Aura::Network::NetworkMonitor` +Path: `Nickvision::Network::NetworkMonitor` ### Member Variables - ``` - Nickvision::Aura::Network::NetworkState ConnectionState: get + Nickvision::Network::NetworkState ConnectionState: get ``` - The state of the system's network connection. ### Events - ``` - Event StateChanged + Event StateChanged ``` - Invoked when the system's network state is changed. @@ -75,7 +75,7 @@ Interface: [networkstate.h](/include/network/networkstate.h) Type: `enum class` -Path: `Nickvision::Aura::Network::NetworkState` +Path: `Nickvision::Network::NetworkState` ### Values - ``` @@ -98,7 +98,7 @@ Interface: [networkstatechangedeventargs.h](/include/network/networkstatechanged Type: `class` -Path: `Nickvision::Aura::Network::NetworkStateChangedEventArgs` +Path: `Nickvision::Network::NetworkStateChangedEventArgs` ## Member Variables - ``` diff --git a/docs/notifications.md b/docs/notifications.md index efa5ec6..d0363b9 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Notifications +# Nickvision::Notifications This module contains objects for sending notifications within Nickvision applications. @@ -17,7 +17,7 @@ Interface: [notificationsenteventargs.h](/include/notifications/notificationsent Type: `class` -Path: `Nickvision::Aura::Notifications::NotificationSentEventArgs` +Path: `Nickvision::Notifications::NotificationSentEventArgs` ### Member Variables - ``` @@ -25,7 +25,7 @@ Path: `Nickvision::Aura::Notifications::NotificationSentEventArgs` ``` - The message of the notification. - ``` - Nickvision::Aura::Notifications::NotificationSeverity Severity: get + Nickvision::Notifications::NotificationSeverity Severity: get ``` - The severity of the notification. - ``` @@ -51,7 +51,7 @@ Interface: [notificationseverity.h](/include/notifications/notificationseverity. Type: `enum class` -Path: `Nickvision::Aura::Notifications::NotificationSeverity` +Path: `Nickvision::Notifications::NotificationSeverity` ### Values - ``` @@ -80,7 +80,7 @@ Interface: [notifyicon.h](/include/notifications/notifyicon.h) Type: `class` -Path: `Nickvision::Aura::Notifications::NotifyIcon` +Path: `Nickvision::Notifications::NotifyIcon` ### Methods - ```cpp @@ -131,7 +131,7 @@ Interface: [notifyiconmenu.h](/include/notifications/notifyiconmenu.h) Type: `class` -Path: `Nickvision::Aura::Notifications::NotifyIconMenu` +Path: `Nickvision::Notifications::NotifyIconMenu` Note: There are other classes, notably: `NotifyIconMenuItem`, `NotifyIconSeparatorMenuItem`, `NotifyIconActionMenuItem`, that are meant for use by `NotifyIcon`'s implementation of the context menu itself. Users are free to use these objects, however they will not be covered in this documentation. @@ -215,20 +215,20 @@ Interface: [shellnotification.h](/include/notifications/shellnotification.h) Type: `namespace` -Path: `Nickvision::Aura::Notifications::ShellNotification` +Path: `Nickvision::Notifications::ShellNotification` ### Functions - ```cpp void send(const ShellNotificationSentEventArgs& e, HWND hwnd) ``` - Accepts: The `ShellNotificationSentEventArgs` containing the information to show, e, and the `HWND` handle for the main application window, hwnd. The hwnd parameter is only used once on the initial creation of the static `NotifyIcon` and then is ignored on future calls. - - Note: This function is only available on the Windows platform. It uses `Nickvision::Aura::Notifications::NotifyIcon`. + - Note: This function is only available on the Windows platform. It uses `Nickvision::Notifications::NotifyIcon`. - Note: This function supports the action "open" with action param being a path of a file or folder to open. - Throws: std::logic_error if Aura::init() was not called yet - ```cpp - void send(const ShellNotificationSentEventArgs& e) + void send(const ShellNotificationSentEventArgs& e, const std::string& openText) ``` - - Accepts: The `ShellNotificationSentEventArgs` containing the information to show, e. + - Accepts: The `ShellNotificationSentEventArgs` containing the information to show, e, and the localized text of "Open", openText. - Note: This function is only available on the Linux platform. - Note: This function supports the action "open" with action param being a path of a file or folder to open. The app must define an "app.open" action to handle this event. - Throws: std::logic_error if Aura::init() was not called yet @@ -240,7 +240,7 @@ Interface: [shellnotificationsenteventargs.h](/include/notifications/shellnotifi Type: `class` -Path: `Nickvision::Aura::Notifications::ShellNotificationSentEventArgs` +Path: `Nickvision::Notifications::ShellNotificationSentEventArgs` ### Member Variables - ``` @@ -252,7 +252,7 @@ Path: `Nickvision::Aura::Notifications::ShellNotificationSentEventArgs` ``` - The message of the notification. - ``` - Nickvision::Aura::Notifications::NotificationSeverity Severity: get + Nickvision::Notifications::NotificationSeverity Severity: get ``` - The severity of the notification. - ``` diff --git a/docs/taskbar.md b/docs/taskbar.md index 0197e62..fe7d50a 100644 --- a/docs/taskbar.md +++ b/docs/taskbar.md @@ -1,4 +1,4 @@ -# Nickvision::Aura::Taskbar +# Nickvision::Taskbar This module contains objects for manipulating an application's taskbar button. @@ -13,7 +13,7 @@ Interface: [progressstate.h](/include/taskbar/progressstate.h) Type: `enum class` -Path: `Nickvision::Aura::Taskbar::ProgressState` +Path: `Nickvision::Taskbar::ProgressState` ### Values - ``` @@ -44,11 +44,11 @@ Interface: [taskbaritem.h](/include/taskbar/taskbaritem.h) Type: `class` -Path: `Nickvision::Aura::Taskbar::TaskbarItem` +Path: `Nickvision::Taskbar::TaskbarItem` ### Member Variables - ``` - Nickvision::Aura::Taskbar::ProgressState ProgressState: get, set + Nickvision::Taskbar::ProgressState ProgressState: get, set ``` - The state of the progress being shown. - ``` diff --git a/docs/update.md b/docs/update.md index 8f48646..3cdfd7c 100644 --- a/docs/update.md +++ b/docs/update.md @@ -1,9 +1,11 @@ -# Nickvision::Aura::Update +# Nickvision::Update This module contains objects for fetching and updating Nickvision applications. ## Table of Contents - [Updater](#updater) +- [Version](#version) +- [VersionType](#versiontype) ## Updater Description: Event args for when a notification is sent. @@ -12,7 +14,7 @@ Interface: [updater.h](/include/update/updater.h) Type: `class` -Path: `Nickvision::Aura::Update::Updater` +Path: `Nickvision::Update::Updater` ### Methods - ```cpp @@ -22,13 +24,13 @@ Path: `Nickvision::Aura::Update::Updater` - Accepts: The url of a GitHub repo to check for updates, githubRepoUrl. If githubRepoUrl is empty, the url will attempt to be determined from `Aura::getActive().getAppInfo().getSourceRepo()`. - Throws: `std::invalid_argument` if no valid GitHub url can be determined. - ```cpp - Nickvision::Aura::Version fetchCurrentStableVersion() + Nickvision::Version fetchCurrentStableVersion() ``` - Returns: The latest stable Version found in the repo. - Returns: An empty version on error. - Note: This method scans the tags of the repo and parses versions in the format `major.minor.build`. - ```cpp - Nickvision::Aura::Version fetchCurrentPreviewVersion() + Nickvision::Version fetchCurrentPreviewVersion() ``` - Returns: The latest preview (dev) Version found in the repo. - Returns: An empty version on error. @@ -40,4 +42,126 @@ Path: `Nickvision::Aura::Update::Updater` - Returns: `true` if the update was downloaded and launched successfully. - Returns: `false` if an error occurred when attempting to update the app. - Note: Windows application installers should end in `setup.exe` to be fetched by the Updater. - - Note: This method if only available on the Windows platform. \ No newline at end of file + - Note: This method if only available on the Windows platform. + +## Version +Description: A model for a version number. Formatted in "major.minor.build-dev". + +Interface: [version.h](/include/update/version.h) + +Type: `class` + +Path: `Nickvision::Update::Version` + +### Member Variables +- ``` + Nickvision::VersionType VersionType: get + ``` + - The type of the version + +### Methods +- ```cpp + Version() + ``` + - Constructs a blank Version. +- ```cpp + Version(int major, int minor, int build) + ``` + - Constructs a Version. + - Accepts: The major version number, major, the minor version number, minor, and the build version number, build. +- ```cpp + Version(int major, int minor, int build, const std::string& dev) + ``` + - Constructs a Version. + - Accepts: The major version number, major, the minor version number, minor, the build version number, build, and the dev version string, dev. +- ```cpp + Version(const std::string& version) + ``` + - Constructs a Version. + - Accepts: The version as a string to parse, version. + - Note: version must be in the format of `"major.minor.build-dev"`. +- ```cpp + int getMajor() const + ``` + - Returns: The major number of the version. +- ```cpp + int getMinor() const + ``` + - Returns: The minor number of the version. +- ```cpp + int getBuild() const + ``` + - Returns: The build number of the version. +- ```cpp + const std::string& getDev() const + ``` + - Returns: The dev string of the version. +- ```cpp + const std::string& toString() const + ``` + - Returns: The string representation of the Version +- ```cpp + bool empty() const + ``` + - Returns: `true` if the Version object is empty + - Returns: `false` if the Version object is not empty +- ```cpp + bool operator<(const Version& compare) const + ``` + - Accepts: The version object to compare to this object, compare. + - Returns: `true` if this < compare. + - Returns: `false` if this >= compare. +- ```cpp + bool operator<=(const Version& compare) const + ``` + - Accepts: The version object to compare to this object, compare. + - Returns: `true` if this <= compare. + - Returns: `false` if this > compare. +- ```cpp + bool operator>(const Version& compare) const + ``` + - Accepts: The version object to compare to this object, compare. + - Returns: `true` if this > compare. + - Returns: `false` if this <= compare. +- ```cpp + bool operator>=(const Version& compare) const + ``` + - Accepts: The version object to compare to this object, compare. + - Returns: `true` if this >= compare. + - Returns: `false` if this < compare. +- ```cpp + bool operator==(const Version& compare) const + ``` + - Accepts: The version object to compare to this object, compare. + - Returns: `true` if this == compare. + - Returns: `false` if this != compare. +- ```cpp + bool operator!=(const Version& compare) const + ``` + - Accepts: The version object to compare to this object, compare. + - Returns: `true` if this != compare. + - Returns: `false` if this == compare. +- ```cpp + friend std::ostream& operator<<(std::ostream& os, const Version& version) + ``` + - Accepts: The ostream to output the version to, os, and the Version object to output, version. + - Returns: A reference to the ostream object accepted by the function. + +## VersionType +Description: Types of a version + +Interface: [versiontype.h](/include/update/versiontype.h) + +Type: `enum class` + +Path: `Nickvision::Update::VersionType` + +### Values +- ```cpp + Stable = 0 + ``` + - Represents a stable version +- ```cpp + Preview = 1 + ``` + - Represents a preview (dev) version \ No newline at end of file diff --git a/include/appinfo.h b/include/aura/appinfo.h similarity index 97% rename from include/appinfo.h rename to include/aura/appinfo.h index 43ab4b6..01208c5 100644 --- a/include/appinfo.h +++ b/include/aura/appinfo.h @@ -4,7 +4,7 @@ #include #include #include -#include "version.h" +#include "update/version.h" namespace Nickvision::Aura { @@ -72,12 +72,12 @@ namespace Nickvision::Aura * @brief Gets the application version. * @return The application version */ - const Version& getVersion() const noexcept; + const Update::Version& getVersion() const noexcept; /** * @brief Sets the application version. * @param version The application version */ - void setVersion(const Version& version) noexcept; + void setVersion(const Update::Version& version) noexcept; /** * @brief Gets the application changelog. * @return The application changelog @@ -201,7 +201,7 @@ namespace Nickvision::Aura std::string m_shortName; std::string m_englishShortName; std::string m_description; - Version m_version; + Update::Version m_version; std::string m_changelog; std::string m_htmlChangelog; std::string m_sourceRepo; diff --git a/include/aura.h b/include/aura/aura.h similarity index 100% rename from include/aura.h rename to include/aura/aura.h diff --git a/include/configurationbase.h b/include/aura/configurationbase.h similarity index 100% rename from include/configurationbase.h rename to include/aura/configurationbase.h diff --git a/include/interprocesscommunicator.h b/include/aura/interprocesscommunicator.h similarity index 100% rename from include/interprocesscommunicator.h rename to include/aura/interprocesscommunicator.h diff --git a/include/events/event.h b/include/events/event.h index 60b5ca6..6fb91ef 100644 --- a/include/events/event.h +++ b/include/events/event.h @@ -8,7 +8,7 @@ #include #include "eventargs.h" -namespace Nickvision::Aura::Events +namespace Nickvision::Events { template concept DerivedEventArgs = std::is_base_of_v; diff --git a/include/events/eventargs.h b/include/events/eventargs.h index 9eaf2fb..b90ab36 100644 --- a/include/events/eventargs.h +++ b/include/events/eventargs.h @@ -1,7 +1,7 @@ #ifndef EVENTARGS_H #define EVENTARGS_H -namespace Nickvision::Aura::Events +namespace Nickvision::Events { /** * @brief A base class for event arguments. diff --git a/include/events/parameventargs.h b/include/events/parameventargs.h index aeae8d5..71a6f81 100644 --- a/include/events/parameventargs.h +++ b/include/events/parameventargs.h @@ -3,7 +3,7 @@ #include "eventargs.h" -namespace Nickvision::Aura::Events +namespace Nickvision::Events { /** * @brief An event argument that contains a single parameter. diff --git a/include/filesystem/fileaction.h b/include/filesystem/fileaction.h index f082f17..b2dcad7 100644 --- a/include/filesystem/fileaction.h +++ b/include/filesystem/fileaction.h @@ -1,7 +1,7 @@ #ifndef FILEACTION_H #define FILEACTION_H -namespace Nickvision::Aura::Filesystem +namespace Nickvision::Filesystem { /** * @brief Actions that cause a file system object to change. diff --git a/include/filesystem/filesystemchangedeventargs.h b/include/filesystem/filesystemchangedeventargs.h index 5a995c8..4c1185e 100644 --- a/include/filesystem/filesystemchangedeventargs.h +++ b/include/filesystem/filesystemchangedeventargs.h @@ -5,7 +5,7 @@ #include "fileaction.h" #include "events/eventargs.h" -namespace Nickvision::Aura::Filesystem +namespace Nickvision::Filesystem { /** * @brief Event args for when a file system object is changed. diff --git a/include/filesystem/filesystemwatcher.h b/include/filesystem/filesystemwatcher.h index 691a3f6..2aebc40 100644 --- a/include/filesystem/filesystemwatcher.h +++ b/include/filesystem/filesystemwatcher.h @@ -12,7 +12,7 @@ #include #endif -namespace Nickvision::Aura::Filesystem +namespace Nickvision::Filesystem { /** * @brief A watcher of a file system folder. diff --git a/include/systemdirectories.h b/include/filesystem/systemdirectories.h similarity index 92% rename from include/systemdirectories.h rename to include/filesystem/systemdirectories.h index b23aace..50edd80 100644 --- a/include/systemdirectories.h +++ b/include/filesystem/systemdirectories.h @@ -4,7 +4,7 @@ #include #include -namespace Nickvision::Aura::SystemDirectories +namespace Nickvision::Filesystem::SystemDirectories { /* * @brief Gets a list of directories from the PATH variable diff --git a/include/userdirectories.h b/include/filesystem/userdirectories.h similarity index 98% rename from include/userdirectories.h rename to include/filesystem/userdirectories.h index 4d7dacc..e445200 100644 --- a/include/userdirectories.h +++ b/include/filesystem/userdirectories.h @@ -3,7 +3,7 @@ #include -namespace Nickvision::Aura::UserDirectories +namespace Nickvision::Filesystem::UserDirectories { /* * @brief Gets the user's home directory diff --git a/include/filesystem/watcherflags.h b/include/filesystem/watcherflags.h index bbb6b8e..cf3efc4 100644 --- a/include/filesystem/watcherflags.h +++ b/include/filesystem/watcherflags.h @@ -3,7 +3,7 @@ #include "enumflags.h" -namespace Nickvision::Aura::Filesystem +namespace Nickvision::Filesystem { /** * @brief Flags to describe properties of a file system object that can change. diff --git a/include/helpers/stringhelpers.h b/include/helpers/stringhelpers.h index ef3bf5d..1341191 100644 --- a/include/helpers/stringhelpers.h +++ b/include/helpers/stringhelpers.h @@ -7,7 +7,7 @@ #include #include -namespace Nickvision::Aura::StringHelpers +namespace Nickvision::StringHelpers { template concept StringImplicitlyConstructible = std::is_constructible_v && std::is_convertible_v; diff --git a/include/helpers/webhelpers.h b/include/helpers/webhelpers.h index a6b3098..52c9aa4 100644 --- a/include/helpers/webhelpers.h +++ b/include/helpers/webhelpers.h @@ -6,7 +6,7 @@ #include #include -namespace Nickvision::Aura::WebHelpers +namespace Nickvision::WebHelpers { typedef std::function CurlProgressFunction; diff --git a/include/keyring/credential.h b/include/keyring/credential.h index 5fc238e..cf1ed39 100644 --- a/include/keyring/credential.h +++ b/include/keyring/credential.h @@ -5,7 +5,7 @@ #include #include "passwordstrength.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief A model of a credential stored in a keyring. diff --git a/include/keyring/credentialcheckstatus.h b/include/keyring/credentialcheckstatus.h index 0fa9b57..cb39b38 100644 --- a/include/keyring/credentialcheckstatus.h +++ b/include/keyring/credentialcheckstatus.h @@ -3,7 +3,7 @@ #include "enumflags.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief Flags to describe the status of a validated credential diff --git a/include/keyring/keyring.h b/include/keyring/keyring.h index 126553d..d17f101 100644 --- a/include/keyring/keyring.h +++ b/include/keyring/keyring.h @@ -7,7 +7,7 @@ #include "credential.h" #include "store.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief A model of a keyring object for managing credentials. diff --git a/include/keyring/keyringdialogcontroller.h b/include/keyring/keyringdialogcontroller.h index e4af0e1..93ac209 100644 --- a/include/keyring/keyringdialogcontroller.h +++ b/include/keyring/keyringdialogcontroller.h @@ -8,7 +8,7 @@ #include "credentialcheckstatus.h" #include "keyring.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief A controller for a KeyringDialog. diff --git a/include/keyring/passwordcontent.h b/include/keyring/passwordcontent.h index 7b9ad12..4d24b7b 100644 --- a/include/keyring/passwordcontent.h +++ b/include/keyring/passwordcontent.h @@ -3,7 +3,7 @@ #include "enumflags.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief Flags to describe the content of a password. diff --git a/include/keyring/passwordgenerator.h b/include/keyring/passwordgenerator.h index 42ec594..d01f8e3 100644 --- a/include/keyring/passwordgenerator.h +++ b/include/keyring/passwordgenerator.h @@ -5,7 +5,7 @@ #include #include "passwordcontent.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief A random password generator. diff --git a/include/keyring/passwordstrength.h b/include/keyring/passwordstrength.h index b4c57fe..f4b1285 100644 --- a/include/keyring/passwordstrength.h +++ b/include/keyring/passwordstrength.h @@ -3,7 +3,7 @@ #include -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief Strengths for a password. diff --git a/include/keyring/store.h b/include/keyring/store.h index 3accfbc..50ef374 100644 --- a/include/keyring/store.h +++ b/include/keyring/store.h @@ -14,7 +14,7 @@ #include "credential.h" #include "sqlite3.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { /** * @brief A store object for credentials. Backed by sqlcipher. diff --git a/include/keyring/systemcredentials.h b/include/keyring/systemcredentials.h index b2e566e..89b4404 100644 --- a/include/keyring/systemcredentials.h +++ b/include/keyring/systemcredentials.h @@ -5,7 +5,7 @@ #include #include "credential.h" -namespace Nickvision::Aura::Keyring::SystemCredentials +namespace Nickvision::Keyring::SystemCredentials { /** * @brief Gets a credential from the system's credential manager. diff --git a/include/localization/documentation.h b/include/localization/documentation.h index 54bf8db..446badb 100644 --- a/include/localization/documentation.h +++ b/include/localization/documentation.h @@ -3,7 +3,7 @@ #include -namespace Nickvision::Aura::Localization::Documentation +namespace Nickvision::Localization::Documentation { /** * @brief Gets the url for a documentation page. diff --git a/include/localization/gettext.h b/include/localization/gettext.h index fc38ad5..ac349e8 100644 --- a/include/localization/gettext.h +++ b/include/localization/gettext.h @@ -7,10 +7,10 @@ #define GETTEXT_CONTEXT_SEPARATOR "\004" #define _(String) gettext(String) #define _n(String, StringPlural, N) ngettext(String, StringPlural, N) -#define _p(Context, String) ::Nickvision::Aura::Localization::Gettext::pgettext(Context GETTEXT_CONTEXT_SEPARATOR String, String) -#define _pn(Context, String, StringPlural, N) ::Nickvision::Aura::Localization::Gettext::pngettext(Context GETTEXT_CONTEXT_SEPARATOR String, String, StringPlural, N) +#define _p(Context, String) ::Nickvision::Localization::Gettext::pgettext(Context GETTEXT_CONTEXT_SEPARATOR String, String) +#define _pn(Context, String, StringPlural, N) ::Nickvision::Localization::Gettext::pngettext(Context GETTEXT_CONTEXT_SEPARATOR String, String, StringPlural, N) -namespace Nickvision::Aura::Localization::Gettext +namespace Nickvision::Localization::Gettext { /** * @brief Initializes the gettext system. This function should only be called once, regradless of with different domain names. diff --git a/include/network/networkmonitor.h b/include/network/networkmonitor.h index dce6d72..bc75be5 100644 --- a/include/network/networkmonitor.h +++ b/include/network/networkmonitor.h @@ -10,7 +10,7 @@ #include #endif -namespace Nickvision::Aura::Network +namespace Nickvision::Network { /** * @brief An object to monitor the state of the system's network connection. diff --git a/include/network/networkstate.h b/include/network/networkstate.h index ba6a5bb..b236b31 100644 --- a/include/network/networkstate.h +++ b/include/network/networkstate.h @@ -1,7 +1,7 @@ #ifndef NETWORKSTATE_H #define NETWORKSTATE_H -namespace Nickvision::Aura::Network +namespace Nickvision::Network { /** * @brief States of a network connection. diff --git a/include/network/networkstatechangedeventargs.h b/include/network/networkstatechangedeventargs.h index 546066c..5f1a8ff 100644 --- a/include/network/networkstatechangedeventargs.h +++ b/include/network/networkstatechangedeventargs.h @@ -4,7 +4,7 @@ #include "networkstate.h" #include "events/eventargs.h" -namespace Nickvision::Aura::Network +namespace Nickvision::Network { /** * @brief Event args for when the network state is changed diff --git a/include/notifications/notificationsenteventargs.h b/include/notifications/notificationsenteventargs.h index bd37eb6..b6ccc8d 100644 --- a/include/notifications/notificationsenteventargs.h +++ b/include/notifications/notificationsenteventargs.h @@ -5,7 +5,7 @@ #include "notificationseverity.h" #include "events/eventargs.h" -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { /** * @brief Event args for when a notification is sent. diff --git a/include/notifications/notificationseverity.h b/include/notifications/notificationseverity.h index 815a17e..4d7b240 100644 --- a/include/notifications/notificationseverity.h +++ b/include/notifications/notificationseverity.h @@ -1,7 +1,7 @@ #ifndef NOTIFICATIONSEVERITY_H #define NOTIFICATIONSEVERITY_H -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { /** * @brief Severities for a notification. diff --git a/include/notifications/notifyicon.h b/include/notifications/notifyicon.h index c435c50..2acea7c 100644 --- a/include/notifications/notifyicon.h +++ b/include/notifications/notifyicon.h @@ -13,7 +13,7 @@ #include "notifyiconmenu.h" #include "shellnotificationsenteventargs.h" -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { /** * @brief An icon for the system tray. diff --git a/include/notifications/notifyiconmenu.h b/include/notifications/notifyiconmenu.h index c9a01a4..e4cee4b 100644 --- a/include/notifications/notifyiconmenu.h +++ b/include/notifications/notifyiconmenu.h @@ -7,7 +7,7 @@ #include #include -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { /** * @brief Types of menu items for a NotifyIcon. diff --git a/include/notifications/shellnotification.h b/include/notifications/shellnotification.h index 7f09883..3725bdc 100644 --- a/include/notifications/shellnotification.h +++ b/include/notifications/shellnotification.h @@ -1,17 +1,18 @@ #ifndef SHELLNOTIFICATION_H #define SHELLNOTIFICATION_H +#include #include "shellnotificationsenteventargs.h" #ifdef _WIN32 #include #endif -namespace Nickvision::Aura::Notifications::ShellNotification +namespace Nickvision::Notifications::ShellNotification { #ifdef _WIN32 /** * @brief Sends a notification to the desktop. - * @brief Uses Nickvision::Aura::Notifications::NotifyIcon. + * @brief Uses Nickvision::Notifications::NotifyIcon. * @brief Supports the action "open" with action param being a path of a file or folder to open. * @param e ShellNotificationSentEventArgs * @param hwnd The HWND handle of the main application window. This parameter is only used once on the initial creation of the static NotifyIcon and then is ignored on future calls @@ -24,9 +25,10 @@ namespace Nickvision::Aura::Notifications::ShellNotification * @brief Uses Gio.Notification on Linux. * @brief Supports the action "open" with action param being a path of a file or folder to open. The app must define an "app.open" action to handle this event. * @param e ShellNotificationSentEventArgs + * @param openText Localized text of "Open" * @throw std::logic_error Thrown if Aura::init() was not yet called */ - void send(const ShellNotificationSentEventArgs& e); + void send(const ShellNotificationSentEventArgs& e, const std::string& openText); #endif } diff --git a/include/notifications/shellnotificationsenteventargs.h b/include/notifications/shellnotificationsenteventargs.h index 1b31125..91ad896 100644 --- a/include/notifications/shellnotificationsenteventargs.h +++ b/include/notifications/shellnotificationsenteventargs.h @@ -3,7 +3,7 @@ #include "notificationsenteventargs.h" -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { /** * @brief Event args for when a shell notification is sent. diff --git a/include/taskbar/progressstate.h b/include/taskbar/progressstate.h index c3598a4..9209fb4 100644 --- a/include/taskbar/progressstate.h +++ b/include/taskbar/progressstate.h @@ -1,7 +1,7 @@ #ifndef PROGRESSSTATE_H #define PROGRESSSTATE_H -namespace Nickvision::Aura::Taskbar +namespace Nickvision::Taskbar { /** * @brief States of progress on a taskbar button. diff --git a/include/taskbar/taskbaritem.h b/include/taskbar/taskbaritem.h index b4bc5fe..c6c67d6 100644 --- a/include/taskbar/taskbaritem.h +++ b/include/taskbar/taskbaritem.h @@ -14,7 +14,7 @@ #include #endif -namespace Nickvision::Aura::Taskbar +namespace Nickvision::Taskbar { /** * @brief An item on the taskbar. diff --git a/include/update/updater.h b/include/update/updater.h index 41cce39..99204f7 100644 --- a/include/update/updater.h +++ b/include/update/updater.h @@ -3,9 +3,9 @@ #include #include -#include "../version.h" +#include "version.h" -namespace Nickvision::Aura::Update +namespace Nickvision::Update { /** * @brief An object to check for application updates through GitHub. diff --git a/include/version.h b/include/update/version.h similarity index 99% rename from include/version.h rename to include/update/version.h index 04e2650..ef686b0 100644 --- a/include/version.h +++ b/include/update/version.h @@ -5,7 +5,7 @@ #include #include "versiontype.h" -namespace Nickvision::Aura +namespace Nickvision::Update { /** * @brief A model for a version number. Formatted in "major.minor.build-dev". diff --git a/include/versiontype.h b/include/update/versiontype.h similarity index 85% rename from include/versiontype.h rename to include/update/versiontype.h index bd07f61..f6d0884 100644 --- a/include/versiontype.h +++ b/include/update/versiontype.h @@ -1,7 +1,7 @@ #ifndef VERSIONTYPE_H #define VERSIONTYPE_H -namespace Nickvision::Aura +namespace Nickvision::Update { /** * @brief Types of a version. diff --git a/src/appinfo.cpp b/src/aura/appinfo.cpp similarity index 98% rename from src/appinfo.cpp rename to src/aura/appinfo.cpp index 0c551db..e56c557 100644 --- a/src/appinfo.cpp +++ b/src/aura/appinfo.cpp @@ -1,8 +1,10 @@ -#include "appinfo.h" +#include "aura/appinfo.h" #include #include #include "helpers/stringhelpers.h" +using namespace Nickvision::Update; + namespace Nickvision::Aura { const std::string& AppInfo::getId() const noexcept diff --git a/src/aura.cpp b/src/aura/aura.cpp similarity index 96% rename from src/aura.cpp rename to src/aura/aura.cpp index 125ddb4..572731f 100644 --- a/src/aura.cpp +++ b/src/aura/aura.cpp @@ -1,15 +1,17 @@ -#include "aura.h" +#include "aura/aura.h" #include #include #include #include -#include "systemdirectories.h" +#include "filesystem/systemdirectories.h" #include "localization/gettext.h" #include "helpers/stringhelpers.h" #ifdef __linux__ #include #endif +using namespace Nickvision::Filesystem; + namespace Nickvision::Aura { std::unique_ptr Aura::m_instance = nullptr; diff --git a/src/configurationbase.cpp b/src/aura/configurationbase.cpp similarity index 85% rename from src/configurationbase.cpp rename to src/aura/configurationbase.cpp index bf9664c..8b3a588 100644 --- a/src/configurationbase.cpp +++ b/src/aura/configurationbase.cpp @@ -1,7 +1,9 @@ -#include "configurationbase.h" +#include "aura/configurationbase.h" #include #include -#include "userdirectories.h" +#include "filesystem/userdirectories.h" + +using namespace Nickvision::Filesystem; namespace Nickvision::Aura { diff --git a/src/interprocesscommunicator.cpp b/src/aura/interprocesscommunicator.cpp similarity index 98% rename from src/interprocesscommunicator.cpp rename to src/aura/interprocesscommunicator.cpp index 81d3a94..f8c47ee 100644 --- a/src/interprocesscommunicator.cpp +++ b/src/aura/interprocesscommunicator.cpp @@ -1,7 +1,7 @@ -#include "interprocesscommunicator.h" +#include "aura/interprocesscommunicator.h" #include #include -#include "aura.h" +#include "aura/aura.h" #ifdef __linux__ #include #include diff --git a/src/filesystem/filesystemchangedeventargs.cpp b/src/filesystem/filesystemchangedeventargs.cpp index b83bfc0..35b6d01 100644 --- a/src/filesystem/filesystemchangedeventargs.cpp +++ b/src/filesystem/filesystemchangedeventargs.cpp @@ -1,6 +1,6 @@ #include "filesystem/filesystemchangedeventargs.h" -namespace Nickvision::Aura::Filesystem +namespace Nickvision::Filesystem { FileSystemChangedEventArgs::FileSystemChangedEventArgs(const std::filesystem::path& path, FileAction why) noexcept : m_path{ path }, diff --git a/src/filesystem/filesystemwatcher.cpp b/src/filesystem/filesystemwatcher.cpp index 5801535..f37af1b 100644 --- a/src/filesystem/filesystemwatcher.cpp +++ b/src/filesystem/filesystemwatcher.cpp @@ -7,7 +7,7 @@ #include #endif -namespace Nickvision::Aura::Filesystem +namespace Nickvision::Filesystem { FileSystemWatcher::FileSystemWatcher(const std::filesystem::path& path, bool incudeSubdirectories, WatcherFlags watcherFlags) : m_path{ path }, diff --git a/src/systemdirectories.cpp b/src/filesystem/systemdirectories.cpp similarity index 73% rename from src/systemdirectories.cpp rename to src/filesystem/systemdirectories.cpp index ba1c137..35137ef 100644 --- a/src/systemdirectories.cpp +++ b/src/filesystem/systemdirectories.cpp @@ -1,5 +1,5 @@ -#include "systemdirectories.h" -#include "aura.h" +#include "filesystem/systemdirectories.h" +#include "aura/aura.h" #include "helpers/stringhelpers.h" #ifdef _WIN32 @@ -8,11 +8,11 @@ #define ENV_VAR_PATH_SEPARATOR ":" #endif -namespace Nickvision::Aura +namespace Nickvision::Filesystem { std::vector SystemDirectories::getPath() noexcept { - std::string var{ Aura::getEnvVar("PATH") }; + std::string var{ Aura::Aura::getEnvVar("PATH") }; if (!var.empty()) { return StringHelpers::split(var, ENV_VAR_PATH_SEPARATOR); @@ -22,7 +22,7 @@ namespace Nickvision::Aura std::vector SystemDirectories::getConfig() noexcept { - std::string var{ Aura::getEnvVar("XDG_CONFIG_DIRS") }; + std::string var{ Aura::Aura::getEnvVar("XDG_CONFIG_DIRS") }; if (!var.empty()) { return StringHelpers::split(var, ENV_VAR_PATH_SEPARATOR); @@ -32,7 +32,7 @@ namespace Nickvision::Aura std::vector SystemDirectories::getData() noexcept { - std::string var{ Aura::getEnvVar("XDG_DATA_DIRS") }; + std::string var{ Aura::Aura::getEnvVar("XDG_DATA_DIRS") }; if (!var.empty()) { return StringHelpers::split(var, ENV_VAR_PATH_SEPARATOR); diff --git a/src/userdirectories.cpp b/src/filesystem/userdirectories.cpp similarity index 89% rename from src/userdirectories.cpp rename to src/filesystem/userdirectories.cpp index 5d896e0..5b897b5 100644 --- a/src/userdirectories.cpp +++ b/src/filesystem/userdirectories.cpp @@ -1,7 +1,7 @@ -#include "userdirectories.h" +#include "filesystem/userdirectories.h" #include #include -#include "aura.h" +#include "aura/aura.h" #include "helpers/stringhelpers.h" #ifdef _WIN32 #include @@ -12,12 +12,12 @@ #include #endif -namespace Nickvision::Aura +namespace Nickvision::Filesystem { #ifdef __linux__ static std::filesystem::path getXDGDir(const std::string& key) noexcept { - std::string var{ Aura::getEnvVar(key) }; + std::string var{ Aura::Aura::getEnvVar(key) }; if (!var.empty()) { return var; @@ -60,7 +60,7 @@ namespace Nickvision::Aura } CoTaskMemFree(static_cast(p)); #elif defined(__linux__) - std::filesystem::path var{ Aura::getEnvVar("HOME") }; + std::filesystem::path var{ Aura::Aura::getEnvVar("HOME") }; result = !var.empty() ? var : getpwuid(getuid())->pw_dir; #endif return result; @@ -77,7 +77,7 @@ namespace Nickvision::Aura } CoTaskMemFree(static_cast(p)); #elif defined(__linux__) - std::filesystem::path var{ Aura::getEnvVar("XDG_CONFIG_HOME") }; + std::filesystem::path var{ Aura::Aura::getEnvVar("XDG_CONFIG_HOME") }; result = !var.empty() ? var : (getHome() / ".config"); #endif std::filesystem::create_directories(result); @@ -86,7 +86,7 @@ namespace Nickvision::Aura std::filesystem::path UserDirectories::getApplicationConfig() noexcept { - std::filesystem::path result = getConfig() / Aura::getActive().getAppInfo().getName(); + std::filesystem::path result = getConfig() / Aura::Aura::getActive().getAppInfo().getName(); std::filesystem::create_directories(result); return result; } @@ -102,7 +102,7 @@ namespace Nickvision::Aura } CoTaskMemFree(static_cast(p)); #elif defined(__linux__) - std::filesystem::path var{ Aura::getEnvVar("XDG_CACHE_HOME") }; + std::filesystem::path var{ Aura::Aura::getEnvVar("XDG_CACHE_HOME") }; result = !var.empty() ? var : (getHome() / ".cache"); #endif std::filesystem::create_directories(result); @@ -111,7 +111,7 @@ namespace Nickvision::Aura std::filesystem::path UserDirectories::getApplicationCache() noexcept { - std::filesystem::path result = getCache() / Aura::getActive().getAppInfo().getName(); + std::filesystem::path result = getCache() / Aura::Aura::getActive().getAppInfo().getName(); std::filesystem::create_directories(result); return result; } @@ -122,7 +122,7 @@ namespace Nickvision::Aura #ifdef _WIN32 result = getConfig(); #elif defined(__linux__) - std::filesystem::path var{ Aura::getEnvVar("XDG_DATA_HOME") }; + std::filesystem::path var{ Aura::Aura::getEnvVar("XDG_DATA_HOME") }; result = !var.empty() ? var : (getHome() / ".local/share"); #endif std::filesystem::create_directories(result); @@ -131,7 +131,7 @@ namespace Nickvision::Aura std::filesystem::path UserDirectories::getApplicationLocalData() noexcept { - std::filesystem::path result{ getLocalData() / Aura::getActive().getAppInfo().getName() }; + std::filesystem::path result{ getLocalData() / Aura::Aura::getActive().getAppInfo().getName() }; std::filesystem::create_directories(result); return result; } @@ -140,8 +140,8 @@ namespace Nickvision::Aura { std::filesystem::path result; #ifdef __linux__ - std::filesystem::path var{ Aura::getEnvVar("XDG_RUNTIME_DIR") }; - result = !var.empty() ? var : (std::filesystem::path("/run/user/") / Aura::getEnvVar("UID")); + std::filesystem::path var{ Aura::Aura::getEnvVar("XDG_RUNTIME_DIR") }; + result = !var.empty() ? var : (std::filesystem::path("/run/user/") / Aura::Aura::getEnvVar("UID")); #endif return result; } diff --git a/src/helpers/stringhelpers.cpp b/src/helpers/stringhelpers.cpp index 4c2c639..b2476ef 100644 --- a/src/helpers/stringhelpers.cpp +++ b/src/helpers/stringhelpers.cpp @@ -14,7 +14,7 @@ #include #endif -namespace Nickvision::Aura +namespace Nickvision { std::string StringHelpers::toLower(std::string s) noexcept { diff --git a/src/helpers/webhelpers.cpp b/src/helpers/webhelpers.cpp index 61bc0ed..d16b0f3 100644 --- a/src/helpers/webhelpers.cpp +++ b/src/helpers/webhelpers.cpp @@ -1,7 +1,7 @@ #include "helpers/webhelpers.h" #include -namespace Nickvision::Aura +namespace Nickvision { bool WebHelpers::isValidWebsite(const std::string& url) noexcept { diff --git a/src/keyring/credential.cpp b/src/keyring/credential.cpp index f5ae242..92aec03 100644 --- a/src/keyring/credential.cpp +++ b/src/keyring/credential.cpp @@ -2,7 +2,7 @@ #include #include "helpers/stringhelpers.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { Credential::Credential(int id, const std::string& name, const std::string& uri, const std::string& username, const std::string& password) noexcept : m_id{ id }, diff --git a/src/keyring/keyring.cpp b/src/keyring/keyring.cpp index 285b020..813bbf8 100644 --- a/src/keyring/keyring.cpp +++ b/src/keyring/keyring.cpp @@ -1,7 +1,7 @@ #include "keyring/keyring.h" #include "keyring/systemcredentials.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { Keyring::Keyring(const Store& store) noexcept : m_store{ store } diff --git a/src/keyring/keyringdialogcontroller.cpp b/src/keyring/keyringdialogcontroller.cpp index 882938e..1c0d2b8 100644 --- a/src/keyring/keyringdialogcontroller.cpp +++ b/src/keyring/keyringdialogcontroller.cpp @@ -1,7 +1,7 @@ #include "keyring/keyringdialogcontroller.h" #include "helpers/stringhelpers.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { KeyringDialogController::KeyringDialogController(const std::string& name, const std::optional& keyring) noexcept : m_name{ name }, diff --git a/src/keyring/passwordgenerator.cpp b/src/keyring/passwordgenerator.cpp index 53289d2..86dc0b8 100644 --- a/src/keyring/passwordgenerator.cpp +++ b/src/keyring/passwordgenerator.cpp @@ -2,7 +2,7 @@ #include #include -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { std::vector PasswordGenerator::m_numericChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; std::vector PasswordGenerator::m_upperChars = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; diff --git a/src/keyring/passwordstrength.cpp b/src/keyring/passwordstrength.cpp index a96c650..470fc19 100644 --- a/src/keyring/passwordstrength.cpp +++ b/src/keyring/passwordstrength.cpp @@ -1,6 +1,6 @@ #include "keyring/passwordstrength.h" -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { PasswordStrength getPasswordStrength(const std::string& password) noexcept { diff --git a/src/keyring/store.cpp b/src/keyring/store.cpp index 92f567a..69e4a21 100644 --- a/src/keyring/store.cpp +++ b/src/keyring/store.cpp @@ -1,8 +1,10 @@ #include "keyring/store.h" #include -#include "userdirectories.h" +#include "filesystem/userdirectories.h" -namespace Nickvision::Aura::Keyring +using namespace Nickvision::Filesystem; + +namespace Nickvision::Keyring { static std::filesystem::path getPathFromName(const std::string& name) noexcept { diff --git a/src/keyring/systemcredentials.cpp b/src/keyring/systemcredentials.cpp index 0637b65..67bd1ac 100644 --- a/src/keyring/systemcredentials.cpp +++ b/src/keyring/systemcredentials.cpp @@ -8,7 +8,7 @@ #include #endif -namespace Nickvision::Aura::Keyring +namespace Nickvision::Keyring { #ifdef __linux__ static const SecretSchema KEYRING_SCHEMA = { "org.nickvision.aura.keyring", SECRET_SCHEMA_NONE, { { "application", SECRET_SCHEMA_ATTRIBUTE_STRING }, { "NULL", SECRET_SCHEMA_ATTRIBUTE_STRING } } }; diff --git a/src/localization/documentation.cpp b/src/localization/documentation.cpp index 370ba09..77eb449 100644 --- a/src/localization/documentation.cpp +++ b/src/localization/documentation.cpp @@ -1,16 +1,16 @@ #include "localization/documentation.h" #include -#include "aura.h" +#include "aura/aura.h" #include "helpers/stringhelpers.h" -namespace Nickvision::Aura::Localization +namespace Nickvision::Localization { std::string Documentation::getHelpUrl(const std::string& pageName) noexcept { #ifdef __linux__ - if (Aura::getEnvVar("SNAP").empty()) + if (Aura::Aura::getEnvVar("SNAP").empty()) { - return "help:" + StringHelpers::toLower(Aura::getActive().getAppInfo().getEnglishShortName()) + "/" + pageName; + return "help:" + StringHelpers::toLower(Aura::Aura::getActive().getAppInfo().getEnglishShortName()) + "/" + pageName; } #endif std::string lang{ "C" }; @@ -47,6 +47,6 @@ namespace Nickvision::Aura::Localization } } } - return "https://htmlpreview.github.io/?" + Aura::getActive().getAppInfo().getHtmlDocsStore() + "/" + lang + "/" + pageName + ".html"; + return "https://htmlpreview.github.io/?" + Aura::Aura::getActive().getAppInfo().getHtmlDocsStore() + "/" + lang + "/" + pageName + ".html"; } } \ No newline at end of file diff --git a/src/localization/gettext.cpp b/src/localization/gettext.cpp index ae0f470..76bebd5 100644 --- a/src/localization/gettext.cpp +++ b/src/localization/gettext.cpp @@ -2,7 +2,7 @@ #include #include -namespace Nickvision::Aura::Localization +namespace Nickvision::Localization { bool Gettext::init(const std::string& domainName) noexcept { diff --git a/src/network/networkmonitor.cpp b/src/network/networkmonitor.cpp index 4b4bbdf..fb8e1b2 100644 --- a/src/network/networkmonitor.cpp +++ b/src/network/networkmonitor.cpp @@ -1,12 +1,12 @@ #include "network/networkmonitor.h" #include -#include "aura.h" +#include "aura/aura.h" #include "helpers/stringhelpers.h" #ifdef __linux__ #include #endif -namespace Nickvision::Aura::Network +namespace Nickvision::Network { #ifdef _WIN32 class NetworkListManagerEvents : INetworkListManagerEvents @@ -124,7 +124,7 @@ namespace Nickvision::Aura::Network { std::lock_guard lock{ m_mutex }; NetworkState newState{ NetworkState::Disconnected }; - std::string noNetCheck{ StringHelpers::toLower(Aura::getEnvVar("AURA_DISABLE_NETCHECK")) }; + std::string noNetCheck{ StringHelpers::toLower(Aura::Aura::getEnvVar("AURA_DISABLE_NETCHECK")) }; if (!noNetCheck.empty() && (noNetCheck == "true" || noNetCheck == "t" || noNetCheck == "yes" || noNetCheck == "y" || noNetCheck == "1")) { newState = NetworkState::ConnectedGlobal; diff --git a/src/network/networkstatechangedeventargs.cpp b/src/network/networkstatechangedeventargs.cpp index d1489b1..230dd24 100644 --- a/src/network/networkstatechangedeventargs.cpp +++ b/src/network/networkstatechangedeventargs.cpp @@ -1,6 +1,6 @@ #include "network/networkstatechangedeventargs.h" -namespace Nickvision::Aura::Network +namespace Nickvision::Network { NetworkStateChangedEventArgs::NetworkStateChangedEventArgs(NetworkState state) noexcept : m_state{ state } diff --git a/src/notifications/notificationsenteventargs.cpp b/src/notifications/notificationsenteventargs.cpp index 91005e2..081bec1 100644 --- a/src/notifications/notificationsenteventargs.cpp +++ b/src/notifications/notificationsenteventargs.cpp @@ -1,6 +1,6 @@ #include "notifications/notificationsenteventargs.h" -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { NotificationSentEventArgs::NotificationSentEventArgs(const std::string& message, NotificationSeverity severity, const std::string& action, const std::string& actionParam) noexcept : m_message{ message }, diff --git a/src/notifications/notifyicon.cpp b/src/notifications/notifyicon.cpp index 0b3bdc5..4fe80a8 100644 --- a/src/notifications/notifyicon.cpp +++ b/src/notifications/notifyicon.cpp @@ -2,17 +2,17 @@ #include "notifications/notifyicon.h" #include #include -#include "aura.h" +#include "aura/aura.h" #include "helpers/stringhelpers.h" -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { std::map NotifyIcon::m_icons = {}; NotifyIcon::NotifyIcon(HWND hwnd, const NotifyIconMenu& contextMenu, bool hidden) : m_className{ StringHelpers::newGuid() }, m_isHidden{ hidden }, - m_tooltip{ Aura::getActive().getAppInfo().getName() }, + m_tooltip{ Aura::Aura::getActive().getAppInfo().getName() }, m_contextMenu{ contextMenu }, m_hwnd{ nullptr } { diff --git a/src/notifications/notifyiconmenu.cpp b/src/notifications/notifyiconmenu.cpp index 5f8b5fa..a4843e4 100644 --- a/src/notifications/notifyiconmenu.cpp +++ b/src/notifications/notifyiconmenu.cpp @@ -1,7 +1,7 @@ #ifdef _WIN32 #include "notifications/notifyiconmenu.h" -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { NotifyIconMenuItem::NotifyIconMenuItem(NotifyIconMenuItemType type) noexcept : m_type{ type } diff --git a/src/notifications/shellnotification.cpp b/src/notifications/shellnotification.cpp index b96d8b5..9d72e27 100644 --- a/src/notifications/shellnotification.cpp +++ b/src/notifications/shellnotification.cpp @@ -2,8 +2,7 @@ #include #include #include -#include "aura.h" -#include "localization/gettext.h" +#include "aura/aura.h" #ifdef _WIN32 #include "notifications/notifyicon.h" #include "notifications/notifyiconmenu.h" @@ -11,7 +10,7 @@ #include #endif -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { #ifdef _WIN32 void ShellNotification::send(const ShellNotificationSentEventArgs& e, HWND hwnd) @@ -21,22 +20,22 @@ namespace Nickvision::Aura::Notifications notifyIcon->notify(e); } #elif defined(__linux__) - void ShellNotification::send(const ShellNotificationSentEventArgs& e) + void ShellNotification::send(const ShellNotificationSentEventArgs& e, const std::string& openText) { if (g_application_get_default()) { GNotification* notification{ g_notification_new(e.getTitle().c_str()) }; GIcon* icon{ nullptr }; GFile* fileIcon{ nullptr }; - std::string appId{ Aura::getActive().getAppInfo().getId() }; - if (Aura::getEnvVar("SNAP").empty()) + std::string appId{ Aura::Aura::getActive().getAppInfo().getId() }; + if (Aura::Aura::getEnvVar("SNAP").empty()) { std::string name{ appId + "-symbolic" }; icon = g_themed_icon_new(name.c_str()); } else { - std::string path{ Aura::getEnvVar("SNAP") + "/usr/share/icons/hicolor/symbolic/apps/" + appId + "-symbolic.svg"}; + std::string path{ Aura::Aura::getEnvVar("SNAP") + "/usr/share/icons/hicolor/symbolic/apps/" + appId + "-symbolic.svg"}; fileIcon = g_file_new_for_path(path.c_str()); icon = g_file_icon_new(fileIcon); } @@ -56,7 +55,7 @@ namespace Nickvision::Aura::Notifications } if (e.getAction() == "open" && std::filesystem::exists(e.getActionParam())) { - g_notification_add_button_with_target_value(notification, _("Open"), "app.open", g_variant_new_string(e.getActionParam().c_str())); + g_notification_add_button_with_target_value(notification, openText.c_str(), "app.open", g_variant_new_string(e.getActionParam().c_str())); } g_application_send_notification(g_application_get_default(), appId.c_str(), notification); if (fileIcon) diff --git a/src/notifications/shellnotificationsenteventargs.cpp b/src/notifications/shellnotificationsenteventargs.cpp index 414223a..260fdd3 100644 --- a/src/notifications/shellnotificationsenteventargs.cpp +++ b/src/notifications/shellnotificationsenteventargs.cpp @@ -1,6 +1,6 @@ #include "notifications/shellnotificationsenteventargs.h" -namespace Nickvision::Aura::Notifications +namespace Nickvision::Notifications { ShellNotificationSentEventArgs::ShellNotificationSentEventArgs(const std::string& title, const std::string& message, NotificationSeverity severity, const std::string& action, const std::string& actionParam) noexcept : NotificationSentEventArgs{ message, severity, action, actionParam }, diff --git a/src/taskbar/taskbaritem.cpp b/src/taskbar/taskbaritem.cpp index 21e27cb..5c69ca0 100644 --- a/src/taskbar/taskbaritem.cpp +++ b/src/taskbar/taskbaritem.cpp @@ -8,7 +8,7 @@ using namespace Gdiplus; #include #endif -namespace Nickvision::Aura::Taskbar +namespace Nickvision::Taskbar { TaskbarItem::TaskbarItem() noexcept : m_progressState{ ProgressState::NoProgress }, diff --git a/src/update/updater.cpp b/src/update/updater.cpp index 333dc5f..131950e 100644 --- a/src/update/updater.cpp +++ b/src/update/updater.cpp @@ -4,15 +4,17 @@ #include #include #include -#include "aura.h" -#include "userdirectories.h" +#include "aura/aura.h" +#include "filesystem/userdirectories.h" #include "helpers/stringhelpers.h" #include "helpers/webhelpers.h" #ifdef _WIN32 #include #endif -namespace Nickvision::Aura::Update +using namespace Nickvision::Filesystem; + +namespace Nickvision::Update { Updater::Updater(std::string githubRepoUrl) : m_latestStableReleaseId{ -1 }, @@ -20,7 +22,7 @@ namespace Nickvision::Aura::Update { if (!WebHelpers::isValidWebsite(githubRepoUrl)) { - githubRepoUrl = Aura::getActive().getAppInfo().getSourceRepo(); + githubRepoUrl = Aura::Aura::getActive().getAppInfo().getSourceRepo(); if (!WebHelpers::isValidWebsite(githubRepoUrl)) { throw std::invalid_argument("The source repo of the active Aura::AppInfo is invalid."); diff --git a/src/version.cpp b/src/update/version.cpp similarity index 98% rename from src/version.cpp rename to src/update/version.cpp index 6599d15..de178de 100644 --- a/src/version.cpp +++ b/src/update/version.cpp @@ -1,8 +1,8 @@ -#include "version.h" +#include "update/version.h" #include #include -namespace Nickvision::Aura +namespace Nickvision::Update { Version::Version() noexcept : m_major{ 0 }, diff --git a/tests/auratests.cpp b/tests/auratests.cpp index dd82c29..e21d538 100644 --- a/tests/auratests.cpp +++ b/tests/auratests.cpp @@ -1,9 +1,11 @@ #include -#include "aura.h" -#include "userdirectories.h" +#include "aura/aura.h" +#include "filesystem/userdirectories.h" #include "notifications/shellnotification.h" using namespace Nickvision::Aura; +using namespace Nickvision::Filesystem; +using namespace Nickvision::Notifications; enum class Theme { @@ -85,13 +87,13 @@ TEST_F(AuraTest, DependencyCheck) #endif ASSERT_TRUE(!dependency.empty()); ASSERT_TRUE(std::filesystem::exists(dependency)); - Notifications::ShellNotificationSentEventArgs args{ "Dependency Found!", dependency.string(), Notifications::NotificationSeverity::Success, "open", dependency.string() }; + ShellNotificationSentEventArgs args{ "Dependency Found!", dependency.string(), NotificationSeverity::Success, "open", dependency.string() }; #ifdef _WIN32 if (Aura::getEnvVar("GITHUB_ACTIONS").empty()) { - ASSERT_NO_THROW(Notifications::ShellNotification::send(args, GetConsoleWindow())); + ASSERT_NO_THROW(ShellNotification::send(args, GetConsoleWindow())); } #elif defined(__linux__) - ASSERT_NO_THROW(Notifications::ShellNotification::send(args)); + ASSERT_NO_THROW(ShellNotification::send(args, "Open")); #endif } \ No newline at end of file diff --git a/tests/eventtests.cpp b/tests/eventtests.cpp index 269f226..c1434e5 100644 --- a/tests/eventtests.cpp +++ b/tests/eventtests.cpp @@ -1,7 +1,7 @@ #include #include "events/event.h" -using namespace Nickvision::Aura::Events; +using namespace Nickvision::Events; class StateChangedEventArgs : EventArgs { diff --git a/tests/filewatchertests.cpp b/tests/filewatchertests.cpp index 2b729a8..69bf8dd 100644 --- a/tests/filewatchertests.cpp +++ b/tests/filewatchertests.cpp @@ -1,11 +1,9 @@ #include #include #include -#include "aura.h" #include "filesystem/filesystemwatcher.h" -using namespace Nickvision::Aura; -using namespace Nickvision::Aura::Filesystem; +using namespace Nickvision::Filesystem; class FileWatcherTest : public testing::Test { diff --git a/tests/ipctests.cpp b/tests/ipctests.cpp index 262a987..f95a9db 100644 --- a/tests/ipctests.cpp +++ b/tests/ipctests.cpp @@ -1,10 +1,10 @@ #include #include -#include "aura.h" -#include "interprocesscommunicator.h" +#include "aura/aura.h" +#include "aura/interprocesscommunicator.h" using namespace Nickvision::Aura; -using namespace Nickvision::Aura::Events; +using namespace Nickvision::Events; static std::vector args{ "test1", "test2" }; diff --git a/tests/keyringtests.cpp b/tests/keyringtests.cpp index 8ddfd52..3840d22 100644 --- a/tests/keyringtests.cpp +++ b/tests/keyringtests.cpp @@ -2,7 +2,7 @@ #include "keyring/keyring.h" #include "keyring/keyringdialogcontroller.h" -using namespace Nickvision::Aura::Keyring; +using namespace Nickvision::Keyring; class KeyringTest : public testing::Test { diff --git a/tests/networktests.cpp b/tests/networktests.cpp index 0cd0777..7d421d4 100644 --- a/tests/networktests.cpp +++ b/tests/networktests.cpp @@ -1,9 +1,9 @@ #include -#include "aura.h" +#include "aura/aura.h" #include "network/networkmonitor.h" using namespace Nickvision::Aura; -using namespace Nickvision::Aura::Network; +using namespace Nickvision::Network; TEST(NetworkTests, ConnectedGlobal) { diff --git a/tests/notifyicontests.cpp b/tests/notifyicontests.cpp index 65754d1..b406483 100644 --- a/tests/notifyicontests.cpp +++ b/tests/notifyicontests.cpp @@ -2,12 +2,12 @@ #include #include #include -#include "aura.h" +#include "aura/aura.h" #include "notifications/notifyicon.h" #include "notifications/notifyiconmenu.h" using namespace Nickvision::Aura; -using namespace Nickvision::Aura::Notifications; +using namespace Nickvision::Notifications; class NotifyIconTest : public testing::Test { diff --git a/tests/passwordtests.cpp b/tests/passwordtests.cpp index 6f44ee7..e9c2678 100644 --- a/tests/passwordtests.cpp +++ b/tests/passwordtests.cpp @@ -2,7 +2,7 @@ #include "keyring/passwordgenerator.h" #include "keyring/passwordstrength.h" -using namespace Nickvision::Aura::Keyring; +using namespace Nickvision::Keyring; TEST(PasswordTests, Strength1) { diff --git a/tests/storetests.cpp b/tests/storetests.cpp index 4e977aa..bf2923a 100644 --- a/tests/storetests.cpp +++ b/tests/storetests.cpp @@ -2,7 +2,7 @@ #include "keyring/passwordgenerator.h" #include "keyring/store.h" -using namespace Nickvision::Aura::Keyring; +using namespace Nickvision::Keyring; class StoreTest : public testing::Test { diff --git a/tests/stringtests.cpp b/tests/stringtests.cpp index 5c034c7..a8ff724 100644 --- a/tests/stringtests.cpp +++ b/tests/stringtests.cpp @@ -1,7 +1,7 @@ #include #include "helpers/stringhelpers.h" -using namespace Nickvision::Aura; +using namespace Nickvision; TEST(StringTests, Upper1) { @@ -40,9 +40,9 @@ TEST(StringTests, Trim3) TEST(StringTests, Split1) { - std::vector cmd{ StringHelpers::split("libaura -t fg -y", " ")}; + std::vector cmd{ StringHelpers::split("libnick -t fg -y", " ")}; ASSERT_EQ(cmd.size(), 4); - ASSERT_EQ(cmd[0], "libaura"); + ASSERT_EQ(cmd[0], "libnick"); ASSERT_EQ(cmd[1], "-t"); ASSERT_EQ(cmd[2], "fg"); ASSERT_EQ(cmd[3], "-y"); diff --git a/tests/systemcredentialstests.cpp b/tests/systemcredentialstests.cpp index abec725..5676564 100644 --- a/tests/systemcredentialstests.cpp +++ b/tests/systemcredentialstests.cpp @@ -2,7 +2,7 @@ #include "keyring/credential.h" #include "keyring/systemcredentials.h" -using namespace Nickvision::Aura::Keyring; +using namespace Nickvision::Keyring; static const std::string randCredentialName{ "RandomAuraTestCredential1" }; diff --git a/tests/taskbartests.cpp b/tests/taskbartests.cpp index 3d3cfed..d470d0b 100644 --- a/tests/taskbartests.cpp +++ b/tests/taskbartests.cpp @@ -1,7 +1,7 @@ #include #include "taskbar/taskbaritem.h" -using namespace Nickvision::Aura::Taskbar; +using namespace Nickvision::Taskbar; class TaskbarTest : public testing::Test { diff --git a/tests/updatertests.cpp b/tests/updatertests.cpp index 502a919..f99d1d9 100644 --- a/tests/updatertests.cpp +++ b/tests/updatertests.cpp @@ -1,9 +1,8 @@ #include -#include "version.h" #include "update/updater.h" +#include "update/version.h" -using namespace Nickvision::Aura; -using namespace Nickvision::Aura::Update; +using namespace Nickvision::Update; TEST(UpdaterTests, ParabolicStableUpdate) { diff --git a/tests/versiontests.cpp b/tests/versiontests.cpp index ff57094..0a1e1b0 100644 --- a/tests/versiontests.cpp +++ b/tests/versiontests.cpp @@ -1,7 +1,7 @@ #include -#include "version.h" +#include "update/version.h" -using namespace Nickvision::Aura; +using namespace Nickvision::Update; TEST(VersionTests, EmptyVersion) { diff --git a/tests/webtests.cpp b/tests/webtests.cpp index a0f9ba9..e02d028 100644 --- a/tests/webtests.cpp +++ b/tests/webtests.cpp @@ -2,7 +2,7 @@ #include #include "helpers/webhelpers.h" -using namespace Nickvision::Aura; +using namespace Nickvision; TEST(WebTests, ValidWebsite1) { diff --git a/vcpkg/portfile.cmake b/vcpkg/portfile.cmake index 0a12939..27f761e 100644 --- a/vcpkg/portfile.cmake +++ b/vcpkg/portfile.cmake @@ -4,7 +4,7 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO NickvisionApps/libaura + REPO NickvisionApps/libnick REF "${VERSION}" SHA512 042c92954bf70493152d685f4be3373d86013192809a5686913d215ca47fcd5ed883b130a718be07eaf811eb00a0b406de55171be0e7e3fb7e07e059b7901c37 HEAD_REF main @@ -18,7 +18,7 @@ vcpkg_cmake_configure( vcpkg_cmake_install() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libaura) +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libnick) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") @@ -28,4 +28,4 @@ vcpkg_fixup_pkgconfig() file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) \ No newline at end of file +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) diff --git a/vcpkg/usage b/vcpkg/usage index d060036..a2e2020 100644 --- a/vcpkg/usage +++ b/vcpkg/usage @@ -1,4 +1,4 @@ -libaura provides CMake targets: +libnick provides CMake targets: -find_package(libaura CONFIG REQUIRED) -target_link_libraries(main PRIVATE libaura::libaura) \ No newline at end of file +find_package(libnick CONFIG REQUIRED) +target_link_libraries(main PRIVATE libnick::libnick) diff --git a/vcpkg/vcpkg.json b/vcpkg/vcpkg.json index 788dd19..18f28b3 100644 --- a/vcpkg/vcpkg.json +++ b/vcpkg/vcpkg.json @@ -1,19 +1,15 @@ { - "name": "libaura", + "name": "libnick", "version": "2024.1.2", "maintainers": "Nicholas Logozzo nlogozzo225@gmail.com", "description": "A cross-platform base for native Nickvision applications.", - "homepage": "https://github.com/NickvisionApps/libaura", - "documentation": "https://github.com/NickvisionApps/libaura/tree/main/docs", + "homepage": "https://github.com/NickvisionApps/libnick", + "documentation": "https://github.com/NickvisionApps/libnick/tree/main/docs", "license": "GPL-3.0", "supports": "(windows & x64) | (linux & x64)", "dependencies": [ "boost-locale", "curl", - { - "name": "gettext", - "host": true - }, "gettext-libintl", { "name": "glib",