diff --git a/README.md b/README.md index 393c43aa..857c4795 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ + [Global Settings](#global-settings) + [Entities Definition](#entities-definition) + [Repositories Configuration](#repositories-configuration) - + [Interactor Settings](#interactor-settings) + + [Controller Settings](#controller-settings) + [Application Layer Configuration](#application-layer-configuration) + [DTOs (Data Transfer Objects) Configuration](#dtos--data-transfer-objects--configuration) + [Contracts Configuration](#contracts-configuration) @@ -92,7 +92,7 @@ Libraries and their respective functionalities are organized as follows: - **Contracts**: A common library for most other components, housing all interfaces from `persistence`, `gateway`, and `infrastructure`. This design minimizes tight coupling and circular dependencies. -- **DTO Libraries**: Each functionality has its DTO library, facilitating communication with the `application` layer. DTOs are used for both input and output in interactions with the outer layers, such as interactors. +- **DTO Libraries**: Each functionality has its DTO library, facilitating communication with the `application` layer. DTOs are used for both input and output in interactions with the outer layers, such as controllers. - **CQRS Libraries** (Command Query Responsibility Segregation): The `application` layer is designed to support CQRS, with commands and queries being handled separately. This separation is achieved by using the `CommandHandler` and `QueryHandler` classes. Other classes, such as `CommandValidator` and `QueryValidator`, are used to validate commands and queries, respectively. They are stored away in a separate library called `cqrs`. @@ -100,15 +100,15 @@ Libraries and their respective functionalities are organized as follows: - **Infrastructure**: Optional. Handles actions like file management, local settings, and system queries. It's injected into use cases similar to repositories and gateways. -- **Interactor**: Acts as an internal API to invoke use cases, streamlining the interaction between the user interface and application logic. +- **Controller**: Acts as an internal API to invoke use cases, streamlining the interaction between the user interface and application logic. - **Presenter**: Maintains Qt models and representations of unique entities (referred to as `Singles`), enhancing their integration and usage within the GUI. -- **UI**: The structure allows the simultaneous use of different fronts, each in its own binary. QML and QWidgets UIs can coexist without any conflict. Same for a CLI, an API ... All these fronts will use the same models and interactors. You can have a single main.cpp file for all fronts, or one for each front. It's up to you. Qleany will only generate one for each front. +- **UI**: The structure allows the simultaneous use of different fronts, each in its own binary. QML and QWidgets UIs can coexist without any conflict. Same for a CLI, an API ... All these fronts will use the same models and controllers. You can have a single main.cpp file for all fronts, or one for each front. It's up to you. Qleany will only generate one for each front. Another related point: -- **Registration**: Each component (`persistence`, `gateway`, `infrastructure`, `interactor`) initializes its classes in a corresponding *name*_registration.cpp file, typically called together in the main.cpp. +- **Registration**: Each component (`persistence`, `gateway`, `infrastructure`, `controller`) initializes its classes in a corresponding *name*_registration.cpp file, typically called together in the main.cpp. Project dependencies: ![Alt text](docs/qleany_project_dep.drawio.png) @@ -179,7 +179,7 @@ If you already have a QtWidgets GUI, you can craete a blank GUI in a sub-folder Note: You can use the `examples/simple/src/gui/desktop_application` or `examples/front_ends` as references of what is running fine. 11. Your QtWidgets must be, not at the root of the project, but in a dedicated sub-folder, like with did with `examples/simple/src/gui/desktop_application`. -12. You can now start to implement your GUI and use cases. A GUI made with QWidgets will only use `interactor` for commands/queries and Q_SIGNALS. Also, it will use models from `presenter`. Refer to the example for guidance at `examples/front_ends/src/gui/qt_widgets_application/main.cpp` +12. You can now start to implement your GUI and use cases. A GUI made with QWidgets will only use `controller` for commands/queries and Q_SIGNALS. Also, it will use models from `presenter`. Refer to the example for guidance at `examples/front_ends/src/gui/qt_widgets_application/main.cpp` ### For QtQuick GUI @@ -192,7 +192,7 @@ If you already have a QtQuick GUI, you can craete a blank GUI in a sub-folder ne 11. Your QML GUI must be, not at the root of the project, but in a dedicated sub-folder, like with did with `examples/simple/src/gui/qml_application`. 12. You can now start to implement your GUI and use cases. -A GUI made with QML will **not** use `interactor` and `presenter`. Wrappers around models, Q_SIGNALS, commands and queries all are generated in the QML `real_imports` folder in the QML folder to be made available from QML. Also, QML mocks are generated in `mock_imports`, to be filled by the developer. Refer to the example for guidance at `examples/front_ends/src/gui/qt_quick_application/main.cpp` and `examples/front_ends/src/gui/qt_quick__application/CMakelists.txt` +A GUI made with QML will **not** use `controller` and `presenter`. Wrappers around models, Q_SIGNALS, commands and queries all are generated in the QML `real_imports` folder in the QML folder to be made available from QML. Also, QML mocks are generated in `mock_imports`, to be filled by the developer. Refer to the example for guidance at `examples/front_ends/src/gui/qt_quick_application/main.cpp` and `examples/front_ends/src/gui/qt_quick__application/CMakelists.txt` ### For KF6 Kirigami GUI @@ -232,13 +232,13 @@ Read "Front end Configuration" section below for more details. ### Other Fronts -You can also create a CLI, an API, a gRPC server, or other fronts. You can use the same models and interactors for all fronts. You can have a single main.cpp file for all fronts, or one for each front. It's up to you. +You can also create a CLI, an API, a gRPC server, or other fronts. You can use the same models and controllers for all fronts. You can have a single main.cpp file for all fronts, or one for each front. It's up to you. ### Gateway and Infrastructure The gateway and infrastructure are not generated by Qleany. You have to create them manually. You can use the `examples/simple/src/core/contracts` and `examples/simple/src/core/persistence` as a reference. The `contracts` folder contains the interfaces for the gateway and infrastructure, similar to what is done with the repositories of `persistence`. -So, if I wanted to add a `gateway`, I would create a `gateway` folder in the `src/core/contracts` folder, and add the interfaces for all the public classes offered by the gateway. Then, I would create a `gateway` folder in the `src/core` folder, and add the implementation of the gateway classes. When needed, use cases (handler) in `application` would have a `gateway` parameter using the interface, like what is already done with the repositories, and the `gateway` classes would be instanciated and injected into `interactor` from inside the `main.cpp` file. +So, if I wanted to add a `gateway`, I would create a `gateway` folder in the `src/core/contracts` folder, and add the interfaces for all the public classes offered by the gateway. Then, I would create a `gateway` folder in the `src/core` folder, and add the implementation of the gateway classes. When needed, use cases (handler) in `application` would have a `gateway` parameter using the interface, like what is already done with the repositories, and the `gateway` classes would be instanciated and injected into `controller` from inside the `main.cpp` file. Finally, do not forget a `gateway_registration.cpp` file in the `src/core/gateway` folder to register the gateway classes. @@ -364,14 +364,14 @@ repositories: base_folder_path: path/to/base/folder ``` -### Interactor Settings +### Controller Settings -Configures interactor-specific settings. +Configures controller-specific settings. ```yaml -interactor: - folder_path: path/to/interactor/folder - create_undo_redo_interactor: true/false +controller: + folder_path: path/to/controller/folder + create_undo_redo_controller: true/false ``` ### Application Layer Configuration diff --git a/docs/qleany_project_dep.drawio.png b/docs/qleany_project_dep.drawio.png index ff4a2bad..289efc0e 100644 Binary files a/docs/qleany_project_dep.drawio.png and b/docs/qleany_project_dep.drawio.png differ diff --git a/docs/qleany_project_structure.drawio.png b/docs/qleany_project_structure.drawio.png index 4f3e8697..535445d8 100644 Binary files a/docs/qleany_project_structure.drawio.png and b/docs/qleany_project_structure.drawio.png differ diff --git a/examples/front_ends/CMakeLists.txt b/examples/front_ends/CMakeLists.txt index 78ec233d..4c4d9b00 100644 --- a/examples/front_ends/CMakeLists.txt +++ b/examples/front_ends/CMakeLists.txt @@ -127,7 +127,7 @@ add_subdirectory(src/core/application) # handles the interaction between the system's inner layers (use cases, DTOs) # and the external world -add_subdirectory(src/core/interactor/) +add_subdirectory(src/core/controller/) # handles the Qt models add_subdirectory(src/gui/presenter) diff --git a/examples/front_ends/qleany.yaml b/examples/front_ends/qleany.yaml index 347f7787..42fc04ba 100755 --- a/examples/front_ends/qleany.yaml +++ b/examples/front_ends/qleany.yaml @@ -68,9 +68,9 @@ repositories: repository_folder_path: src/core/persistence/repository/ base_folder_path: src/core/persistence/ -interactor: - folder_path: src/core/interactor/ - create_undo_redo_interactor: true +controller: + folder_path: src/core/controller/ + create_undo_redo_controller: true application: common_cmake_folder_path: src/core/application diff --git a/examples/front_ends/src/core/interactor/CMakeLists.txt b/examples/front_ends/src/core/controller/CMakeLists.txt similarity index 88% rename from examples/front_ends/src/core/interactor/CMakeLists.txt rename to examples/front_ends/src/core/controller/CMakeLists.txt index 46772ef7..e6d8a980 100644 --- a/examples/front_ends/src/core/interactor/CMakeLists.txt +++ b/examples/front_ends/src/core/controller/CMakeLists.txt @@ -9,7 +9,7 @@ find_package( find_package(QCoro6 REQUIRED COMPONENTS Core) # find_package(qleany CONFIG REQUIRED) -set(LIBRARY_NAME front-ends-example-interactor) +set(LIBRARY_NAME front-ends-example-controller) option(BUILD_SHARED_LIBS "Build libraries as shared libraries" ON) @@ -19,21 +19,21 @@ else() set(LIB_TYPE STATIC) endif() -include(interactors.cmake) +include(controllers.cmake) set(SRCS - front_ends_example_interactor_export.h + front_ends_example_controller_export.h event_dispatcher.h event_dispatcher.cpp - interactor_registration.h + controller_registration.h error_signals.h progress_signals.h - interactor_registration.cpp) + controller_registration.cpp) -qt_add_library(${LIBRARY_NAME} ${LIB_TYPE} ${SRCS} ${INTERACTOR_LIST}) +qt_add_library(${LIBRARY_NAME} ${LIB_TYPE} ${SRCS} ${CONTROLLER_LIST}) include(GenerateExportHeader) -generate_export_header(${LIBRARY_NAME} BASE_NAME front_ends_example_interactor) +generate_export_header(${LIBRARY_NAME} BASE_NAME front_ends_example_controller) target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/front_ends/src/core/interactor/brand/brand_interactor.cpp b/examples/front_ends/src/core/controller/brand/brand_controller.cpp similarity index 89% rename from examples/front_ends/src/core/interactor/brand/brand_interactor.cpp rename to examples/front_ends/src/core/controller/brand/brand_controller.cpp index aaf4f2c8..781b8807 100644 --- a/examples/front_ends/src/core/interactor/brand/brand_interactor.cpp +++ b/examples/front_ends/src/core/controller/brand/brand_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "brand_interactor.h" +#include "brand_controller.h" #include "brand/commands/create_brand_command.h" #include "brand/commands/create_brand_command_handler.h" @@ -15,16 +15,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::Brand; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::Brand; using namespace FrontEnds::Application::Features::Brand::Commands; using namespace FrontEnds::Application::Features::Brand::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer BrandInteractor::s_instance = nullptr; +QPointer BrandController::s_instance = nullptr; -BrandInteractor::BrandInteractor(InterfaceRepositoryProvider *repositoryProvider, +BrandController::BrandController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -38,12 +38,12 @@ BrandInteractor::BrandInteractor(InterfaceRepositoryProvider *repositoryProvider s_instance = this; } -BrandInteractor *BrandInteractor::instance() +BrandController *BrandController::instance() { return s_instance.data(); } -QCoro::Task BrandInteractor::get(int id) const +QCoro::Task BrandController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -73,7 +73,7 @@ QCoro::Task BrandInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task> BrandInteractor::getAll() const +QCoro::Task> BrandController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -101,7 +101,7 @@ QCoro::Task> BrandInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task BrandInteractor::create(const CreateBrandDTO &dto) +QCoro::Task BrandController::create(const CreateBrandDTO &dto) { CreateBrandCommand query; @@ -128,7 +128,7 @@ QCoro::Task BrandInteractor::create(const CreateBrandDTO &dto) }); // Create specialized UndoRedoCommand - auto command = new AlterCommand(BrandInteractor::tr("Create brand"), handler, query); + auto command = new AlterCommand(BrandController::tr("Create brand"), handler, query); // push command m_undo_redo_system->push(command, "brand"_L1); @@ -143,7 +143,7 @@ QCoro::Task BrandInteractor::create(const CreateBrandDTO &dto) co_return optional_result.value(); } -QCoro::Task BrandInteractor::update(const UpdateBrandDTO &dto) +QCoro::Task BrandController::update(const UpdateBrandDTO &dto) { UpdateBrandCommand query; @@ -160,7 +160,7 @@ QCoro::Task BrandInteractor::update(const UpdateBrandDTO &dto) QObject::connect(handler, &UpdateBrandCommandHandler::brandDetailsUpdated, m_eventDispatcher->brand(), &BrandSignals::allRelationsInvalidated); // Create specialized UndoRedoCommand - auto command = new AlterCommand(BrandInteractor::tr("Update brand"), handler, query); + auto command = new AlterCommand(BrandController::tr("Update brand"), handler, query); // push command m_undo_redo_system->push(command, "brand"_L1); @@ -175,7 +175,7 @@ QCoro::Task BrandInteractor::update(const UpdateBrandDTO &dto) co_return optional_result.value(); } -QCoro::Task BrandInteractor::remove(int id) +QCoro::Task BrandController::remove(int id) { RemoveBrandCommand query; @@ -189,7 +189,7 @@ QCoro::Task BrandInteractor::remove(int id) // no need to connect to removed signal, because it will be emitted by the repository itself // Create specialized UndoRedoCommand - auto command = new AlterCommand(BrandInteractor::tr("Remove brand"), handler, query); + auto command = new AlterCommand(BrandController::tr("Remove brand"), handler, query); // push command m_undo_redo_system->push(command, "brand"_L1); @@ -204,12 +204,12 @@ QCoro::Task BrandInteractor::remove(int id) co_return true; } -CreateBrandDTO BrandInteractor::getCreateDTO() +CreateBrandDTO BrandController::getCreateDTO() { return CreateBrandDTO(); } -UpdateBrandDTO BrandInteractor::getUpdateDTO() +UpdateBrandDTO BrandController::getUpdateDTO() { return UpdateBrandDTO(); } diff --git a/examples/front_ends/src/core/interactor/brand/brand_interactor.h b/examples/front_ends/src/core/controller/brand/brand_controller.h similarity index 75% rename from examples/front_ends/src/core/interactor/brand/brand_interactor.h rename to examples/front_ends/src/core/controller/brand/brand_controller.h index ab1a09f4..35aaebf4 100644 --- a/examples/front_ends/src/core/interactor/brand/brand_interactor.h +++ b/examples/front_ends/src/core/controller/brand/brand_controller.h @@ -6,7 +6,7 @@ #include "brand/create_brand_dto.h" #include "brand/update_brand_dto.h" #include "event_dispatcher.h" -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include @@ -19,18 +19,18 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace FrontEnds::Contracts::DTO::Brand; -namespace FrontEnds::Interactor::Brand +namespace FrontEnds::Controller::Brand { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT BrandInteractor : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT BrandController : public QObject { Q_OBJECT public: - explicit BrandInteractor(InterfaceRepositoryProvider *repositoryProvider, + explicit BrandController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static BrandInteractor *instance(); + static BrandController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -49,13 +49,13 @@ public Q_SLOTS: QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - BrandInteractor() = delete; - BrandInteractor(const BrandInteractor &) = delete; - BrandInteractor &operator=(const BrandInteractor &) = delete; + BrandController() = delete; + BrandController(const BrandController &) = delete; + BrandController &operator=(const BrandController &) = delete; }; -} // namespace FrontEnds::Interactor::Brand \ No newline at end of file +} // namespace FrontEnds::Controller::Brand \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/brand/brand_signals.h b/examples/front_ends/src/core/controller/brand/brand_signals.h similarity index 79% rename from examples/front_ends/src/core/interactor/brand/brand_signals.h rename to examples/front_ends/src/core/controller/brand/brand_signals.h index 758e0046..615da89b 100644 --- a/examples/front_ends/src/core/interactor/brand/brand_signals.h +++ b/examples/front_ends/src/core/controller/brand/brand_signals.h @@ -2,18 +2,18 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include "brand/brand_dto.h" #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { using namespace FrontEnds::Contracts::DTO::Brand; -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT BrandSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT BrandSignals : public QObject { Q_OBJECT public: @@ -31,4 +31,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT BrandSignals : public QObject void getReplied(BrandDTO dto); void getAllReplied(QList dtoList); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/car/car_interactor.cpp b/examples/front_ends/src/core/controller/car/car_controller.cpp similarity index 89% rename from examples/front_ends/src/core/interactor/car/car_interactor.cpp rename to examples/front_ends/src/core/controller/car/car_controller.cpp index 071c2d5a..487a0640 100644 --- a/examples/front_ends/src/core/interactor/car/car_interactor.cpp +++ b/examples/front_ends/src/core/controller/car/car_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "car_interactor.h" +#include "car_controller.h" #include "car/commands/create_car_command.h" #include "car/commands/create_car_command_handler.h" @@ -18,16 +18,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::Car; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::Car; using namespace FrontEnds::Application::Features::Car::Commands; using namespace FrontEnds::Application::Features::Car::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer CarInteractor::s_instance = nullptr; +QPointer CarController::s_instance = nullptr; -CarInteractor::CarInteractor(InterfaceRepositoryProvider *repositoryProvider, +CarController::CarController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -41,12 +41,12 @@ CarInteractor::CarInteractor(InterfaceRepositoryProvider *repositoryProvider, s_instance = this; } -CarInteractor *CarInteractor::instance() +CarController *CarController::instance() { return s_instance.data(); } -QCoro::Task CarInteractor::get(int id) const +QCoro::Task CarController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -76,7 +76,7 @@ QCoro::Task CarInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task CarInteractor::getWithDetails(int id) const +QCoro::Task CarController::getWithDetails(int id) const { auto queryCommand = new QueryCommand("getWithDetails"_L1); @@ -107,7 +107,7 @@ QCoro::Task CarInteractor::getWithDetails(int id) const co_return optional_result.value(); } -QCoro::Task> CarInteractor::getAll() const +QCoro::Task> CarController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -134,7 +134,7 @@ QCoro::Task> CarInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task CarInteractor::create(const CreateCarDTO &dto) +QCoro::Task CarController::create(const CreateCarDTO &dto) { CreateCarCommand query; @@ -152,7 +152,7 @@ QCoro::Task CarInteractor::create(const CreateCarDTO &dto) }); // Create specialized UndoRedoCommand - auto command = new AlterCommand(CarInteractor::tr("Create car"), handler, query); + auto command = new AlterCommand(CarController::tr("Create car"), handler, query); // push command m_undo_redo_system->push(command, "car"_L1); @@ -167,7 +167,7 @@ QCoro::Task CarInteractor::create(const CreateCarDTO &dto) co_return optional_result.value(); } -QCoro::Task CarInteractor::update(const UpdateCarDTO &dto) +QCoro::Task CarController::update(const UpdateCarDTO &dto) { UpdateCarCommand query; @@ -184,7 +184,7 @@ QCoro::Task CarInteractor::update(const UpdateCarDTO &dto) QObject::connect(handler, &UpdateCarCommandHandler::carDetailsUpdated, m_eventDispatcher->car(), &CarSignals::allRelationsInvalidated); // Create specialized UndoRedoCommand - auto command = new AlterCommand(CarInteractor::tr("Update car"), handler, query); + auto command = new AlterCommand(CarController::tr("Update car"), handler, query); // push command m_undo_redo_system->push(command, "car"_L1); @@ -199,7 +199,7 @@ QCoro::Task CarInteractor::update(const UpdateCarDTO &dto) co_return optional_result.value(); } -QCoro::Task CarInteractor::remove(int id) +QCoro::Task CarController::remove(int id) { RemoveCarCommand query; @@ -213,7 +213,7 @@ QCoro::Task CarInteractor::remove(int id) // no need to connect to removed signal, because it will be emitted by the repository itself // Create specialized UndoRedoCommand - auto command = new AlterCommand(CarInteractor::tr("Remove car"), handler, query); + auto command = new AlterCommand(CarController::tr("Remove car"), handler, query); // push command m_undo_redo_system->push(command, "car"_L1); @@ -228,12 +228,12 @@ QCoro::Task CarInteractor::remove(int id) co_return true; } -CreateCarDTO CarInteractor::getCreateDTO() +CreateCarDTO CarController::getCreateDTO() { return CreateCarDTO(); } -UpdateCarDTO CarInteractor::getUpdateDTO() +UpdateCarDTO CarController::getUpdateDTO() { return UpdateCarDTO(); } diff --git a/examples/front_ends/src/core/interactor/car/car_interactor.h b/examples/front_ends/src/core/controller/car/car_controller.h similarity index 76% rename from examples/front_ends/src/core/interactor/car/car_interactor.h rename to examples/front_ends/src/core/controller/car/car_controller.h index a55ebcad..c8e95a1d 100644 --- a/examples/front_ends/src/core/interactor/car/car_interactor.h +++ b/examples/front_ends/src/core/controller/car/car_controller.h @@ -7,7 +7,7 @@ #include "car/create_car_dto.h" #include "car/update_car_dto.h" #include "event_dispatcher.h" -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include @@ -20,18 +20,18 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace FrontEnds::Contracts::DTO::Car; -namespace FrontEnds::Interactor::Car +namespace FrontEnds::Controller::Car { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT CarInteractor : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT CarController : public QObject { Q_OBJECT public: - explicit CarInteractor(InterfaceRepositoryProvider *repositoryProvider, + explicit CarController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static CarInteractor *instance(); + static CarController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -52,13 +52,13 @@ public Q_SLOTS: QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - CarInteractor() = delete; - CarInteractor(const CarInteractor &) = delete; - CarInteractor &operator=(const CarInteractor &) = delete; + CarController() = delete; + CarController(const CarController &) = delete; + CarController &operator=(const CarController &) = delete; }; -} // namespace FrontEnds::Interactor::Car \ No newline at end of file +} // namespace FrontEnds::Controller::Car \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/car/car_signals.h b/examples/front_ends/src/core/controller/car/car_signals.h similarity index 83% rename from examples/front_ends/src/core/interactor/car/car_signals.h rename to examples/front_ends/src/core/controller/car/car_signals.h index b96f0e1c..0fb7b179 100644 --- a/examples/front_ends/src/core/interactor/car/car_signals.h +++ b/examples/front_ends/src/core/controller/car/car_signals.h @@ -2,7 +2,7 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include "car/car_with_details_dto.h" @@ -12,12 +12,12 @@ #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { using namespace FrontEnds::Contracts::DTO::Car; -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT CarSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT CarSignals : public QObject { Q_OBJECT public: @@ -39,4 +39,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT CarSignals : public QObject void relationInserted(CarRelationDTO dto); void relationRemoved(CarRelationDTO dto); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/client/client_interactor.cpp b/examples/front_ends/src/core/controller/client/client_controller.cpp similarity index 89% rename from examples/front_ends/src/core/interactor/client/client_interactor.cpp rename to examples/front_ends/src/core/controller/client/client_controller.cpp index 41298771..a0e122ca 100644 --- a/examples/front_ends/src/core/interactor/client/client_interactor.cpp +++ b/examples/front_ends/src/core/controller/client/client_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "client_interactor.h" +#include "client_controller.h" #include "client/commands/create_client_command.h" #include "client/commands/create_client_command_handler.h" @@ -18,16 +18,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::Client; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::Client; using namespace FrontEnds::Application::Features::Client::Commands; using namespace FrontEnds::Application::Features::Client::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer ClientInteractor::s_instance = nullptr; +QPointer ClientController::s_instance = nullptr; -ClientInteractor::ClientInteractor(InterfaceRepositoryProvider *repositoryProvider, +ClientController::ClientController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -41,12 +41,12 @@ ClientInteractor::ClientInteractor(InterfaceRepositoryProvider *repositoryProvid s_instance = this; } -ClientInteractor *ClientInteractor::instance() +ClientController *ClientController::instance() { return s_instance.data(); } -QCoro::Task ClientInteractor::get(int id) const +QCoro::Task ClientController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -76,7 +76,7 @@ QCoro::Task ClientInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task ClientInteractor::getWithDetails(int id) const +QCoro::Task ClientController::getWithDetails(int id) const { auto queryCommand = new QueryCommand("getWithDetails"_L1); @@ -107,7 +107,7 @@ QCoro::Task ClientInteractor::getWithDetails(int id) const co_return optional_result.value(); } -QCoro::Task> ClientInteractor::getAll() const +QCoro::Task> ClientController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -135,7 +135,7 @@ QCoro::Task> ClientInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task ClientInteractor::create(const CreateClientDTO &dto) +QCoro::Task ClientController::create(const CreateClientDTO &dto) { CreateClientCommand query; @@ -153,7 +153,7 @@ QCoro::Task ClientInteractor::create(const CreateClientDTO &dto) }); // Create specialized UndoRedoCommand - auto command = new AlterCommand(ClientInteractor::tr("Create client"), handler, query); + auto command = new AlterCommand(ClientController::tr("Create client"), handler, query); // push command m_undo_redo_system->push(command, "client"_L1); @@ -168,7 +168,7 @@ QCoro::Task ClientInteractor::create(const CreateClientDTO &dto) co_return optional_result.value(); } -QCoro::Task ClientInteractor::update(const UpdateClientDTO &dto) +QCoro::Task ClientController::update(const UpdateClientDTO &dto) { UpdateClientCommand query; @@ -185,7 +185,7 @@ QCoro::Task ClientInteractor::update(const UpdateClientDTO &dto) QObject::connect(handler, &UpdateClientCommandHandler::clientDetailsUpdated, m_eventDispatcher->client(), &ClientSignals::allRelationsInvalidated); // Create specialized UndoRedoCommand - auto command = new AlterCommand(ClientInteractor::tr("Update client"), handler, query); + auto command = new AlterCommand(ClientController::tr("Update client"), handler, query); // push command m_undo_redo_system->push(command, "client"_L1); @@ -200,7 +200,7 @@ QCoro::Task ClientInteractor::update(const UpdateClientDTO &dto) co_return optional_result.value(); } -QCoro::Task ClientInteractor::remove(int id) +QCoro::Task ClientController::remove(int id) { RemoveClientCommand query; @@ -214,7 +214,7 @@ QCoro::Task ClientInteractor::remove(int id) // no need to connect to removed signal, because it will be emitted by the repository itself // Create specialized UndoRedoCommand - auto command = new AlterCommand(ClientInteractor::tr("Remove client"), handler, query); + auto command = new AlterCommand(ClientController::tr("Remove client"), handler, query); // push command m_undo_redo_system->push(command, "client"_L1); @@ -229,12 +229,12 @@ QCoro::Task ClientInteractor::remove(int id) co_return true; } -CreateClientDTO ClientInteractor::getCreateDTO() +CreateClientDTO ClientController::getCreateDTO() { return CreateClientDTO(); } -UpdateClientDTO ClientInteractor::getUpdateDTO() +UpdateClientDTO ClientController::getUpdateDTO() { return UpdateClientDTO(); } diff --git a/examples/front_ends/src/core/interactor/client/client_interactor.h b/examples/front_ends/src/core/controller/client/client_controller.h similarity index 76% rename from examples/front_ends/src/core/interactor/client/client_interactor.h rename to examples/front_ends/src/core/controller/client/client_controller.h index b26f1edd..daee8da9 100644 --- a/examples/front_ends/src/core/interactor/client/client_interactor.h +++ b/examples/front_ends/src/core/controller/client/client_controller.h @@ -7,7 +7,7 @@ #include "client/create_client_dto.h" #include "client/update_client_dto.h" #include "event_dispatcher.h" -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include @@ -20,18 +20,18 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace FrontEnds::Contracts::DTO::Client; -namespace FrontEnds::Interactor::Client +namespace FrontEnds::Controller::Client { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT ClientInteractor : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT ClientController : public QObject { Q_OBJECT public: - explicit ClientInteractor(InterfaceRepositoryProvider *repositoryProvider, + explicit ClientController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static ClientInteractor *instance(); + static ClientController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -52,13 +52,13 @@ public Q_SLOTS: QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - ClientInteractor() = delete; - ClientInteractor(const ClientInteractor &) = delete; - ClientInteractor &operator=(const ClientInteractor &) = delete; + ClientController() = delete; + ClientController(const ClientController &) = delete; + ClientController &operator=(const ClientController &) = delete; }; -} // namespace FrontEnds::Interactor::Client \ No newline at end of file +} // namespace FrontEnds::Controller::Client \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/client/client_signals.h b/examples/front_ends/src/core/controller/client/client_signals.h similarity index 84% rename from examples/front_ends/src/core/interactor/client/client_signals.h rename to examples/front_ends/src/core/controller/client/client_signals.h index bcef273b..40dad7a8 100644 --- a/examples/front_ends/src/core/interactor/client/client_signals.h +++ b/examples/front_ends/src/core/controller/client/client_signals.h @@ -2,7 +2,7 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include "client/client_with_details_dto.h" @@ -12,12 +12,12 @@ #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { using namespace FrontEnds::Contracts::DTO::Client; -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT ClientSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT ClientSignals : public QObject { Q_OBJECT public: @@ -39,4 +39,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT ClientSignals : public QObject void relationInserted(ClientRelationDTO dto); void relationRemoved(ClientRelationDTO dto); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/interactor_registration.cpp b/examples/front_ends/src/core/controller/controller_registration.cpp similarity index 85% rename from examples/front_ends/src/core/interactor/interactor_registration.cpp rename to examples/front_ends/src/core/controller/controller_registration.cpp index 49c03f20..2bbe42ce 100644 --- a/examples/front_ends/src/core/interactor/interactor_registration.cpp +++ b/examples/front_ends/src/core/controller/controller_registration.cpp @@ -1,20 +1,20 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "interactor_registration.h" -#include "brand/brand_interactor.h" -#include "car/car_interactor.h" -#include "client/client_interactor.h" -#include "custom/custom_interactor.h" +#include "controller_registration.h" +#include "brand/brand_controller.h" +#include "car/car_controller.h" +#include "client/client_controller.h" +#include "custom/custom_controller.h" #include "event_dispatcher.h" -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include #include #include -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; -InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceRepositoryProvider *repositoryProvider) +ControllerRegistration::ControllerRegistration(QObject *parent, InterfaceRepositoryProvider *repositoryProvider) : QObject{parent} { auto dispatcher = QSharedPointer(new EventDispatcher()); @@ -37,9 +37,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit Q_EMIT dispatcher->error()->warningSent(error); }); - // CarInteractor + // CarController - new Car::CarInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Car::CarController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *carSignalHolder = repositoryProvider->repository("Car")->signalHolder(); @@ -52,9 +52,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit dispatcher->car(), &CarSignals::activeStatusChanged); - // BrandInteractor + // BrandController - new Brand::BrandInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Brand::BrandController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *brandSignalHolder = repositoryProvider->repository("Brand")->signalHolder(); @@ -74,9 +74,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit dispatcher->brand(), &BrandSignals::activeStatusChanged); - // PassengerInteractor + // PassengerController - new Passenger::PassengerInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Passenger::PassengerController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *passengerSignalHolder = repositoryProvider->repository("Passenger")->signalHolder(); @@ -106,9 +106,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit dispatcher->passenger(), &PassengerSignals::activeStatusChanged); - // ClientInteractor + // ClientController - new Client::ClientInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Client::ClientController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *clientSignalHolder = repositoryProvider->repository("Client")->signalHolder(); @@ -121,11 +121,11 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit dispatcher->client(), &ClientSignals::activeStatusChanged); - // CustomInteractor + // CustomController - new Custom::CustomInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Custom::CustomController(repositoryProvider, undoRedoSystem, dispatcher); } -InteractorRegistration::~InteractorRegistration() +ControllerRegistration::~ControllerRegistration() { } \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/interactor_registration.h b/examples/front_ends/src/core/controller/controller_registration.h similarity index 59% rename from examples/front_ends/src/core/interactor/interactor_registration.h rename to examples/front_ends/src/core/controller/controller_registration.h index bb06963c..9693987f 100644 --- a/examples/front_ends/src/core/interactor/interactor_registration.h +++ b/examples/front_ends/src/core/controller/controller_registration.h @@ -3,21 +3,21 @@ #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT InteractorRegistration : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT ControllerRegistration : public QObject { Q_OBJECT public: - explicit InteractorRegistration(QObject *parent, Qleany::Contracts::Repository::InterfaceRepositoryProvider *repositoryProvider); - ~InteractorRegistration(); + explicit ControllerRegistration(QObject *parent, Qleany::Contracts::Repository::InterfaceRepositoryProvider *repositoryProvider); + ~ControllerRegistration(); private: }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/controller/controllers.cmake b/examples/front_ends/src/core/controller/controllers.cmake new file mode 100644 index 00000000..136629b3 --- /dev/null +++ b/examples/front_ends/src/core/controller/controllers.cmake @@ -0,0 +1,22 @@ +# This file was generated automatically by Qleany's generator, edit at your own risk! +# If you do, be careful to not overwrite it when you run the generator again. +set(CONTROLLER_LIST + car/car_controller.h + car/car_controller.cpp + car/car_signals.h + brand/brand_controller.h + brand/brand_controller.cpp + brand/brand_signals.h + passenger/passenger_controller.h + passenger/passenger_controller.cpp + passenger/passenger_signals.h + client/client_controller.h + client/client_controller.cpp + client/client_signals.h + custom/custom_controller.h + custom/custom_controller.cpp + custom/custom_signals.h + undo_redo/undo_redo_controller.h + undo_redo/undo_redo_controller.cpp + undo_redo/undo_redo_signals.h +) \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/custom/custom_interactor.cpp b/examples/front_ends/src/core/controller/custom/custom_controller.cpp similarity index 87% rename from examples/front_ends/src/core/interactor/custom/custom_interactor.cpp rename to examples/front_ends/src/core/controller/custom/custom_controller.cpp index 4eb27aba..83f39f4f 100644 --- a/examples/front_ends/src/core/interactor/custom/custom_interactor.cpp +++ b/examples/front_ends/src/core/controller/custom/custom_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "custom_interactor.h" +#include "custom_controller.h" #include "custom/commands/close_system_command.h" #include "custom/commands/close_system_command_handler.h" @@ -15,16 +15,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::Custom; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::Custom; using namespace FrontEnds::Application::Features::Custom::Commands; using namespace FrontEnds::Application::Features::Custom::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer CustomInteractor::s_instance = nullptr; +QPointer CustomController::s_instance = nullptr; -CustomInteractor::CustomInteractor(InterfaceRepositoryProvider *repositoryProvider, +CustomController::CustomController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -38,12 +38,12 @@ CustomInteractor::CustomInteractor(InterfaceRepositoryProvider *repositoryProvid s_instance = this; } -CustomInteractor *CustomInteractor::instance() +CustomController *CustomController::instance() { return s_instance.data(); } -QCoro::Task<> CustomInteractor::writeRandomThings(WriteRandomThingsDTO dto) +QCoro::Task<> CustomController::writeRandomThings(WriteRandomThingsDTO dto) { WriteRandomThingsCommand query; @@ -69,7 +69,7 @@ QCoro::Task<> CustomInteractor::writeRandomThings(WriteRandomThingsDTO dto) &CustomSignals::writeRandomThingsChanged); // Create specialized UndoRedoCommand - auto command = new AlterCommand(CustomInteractor::tr("Doing WriteRandomThings"), handler, query); + auto command = new AlterCommand(CustomController::tr("Doing WriteRandomThings"), handler, query); // set progress minimum duration command->setProgressMinimumDuration(1000); @@ -81,12 +81,12 @@ QCoro::Task<> CustomInteractor::writeRandomThings(WriteRandomThingsDTO dto) co_return; } -WriteRandomThingsDTO CustomInteractor::getWriteRandomThingsDTO() +WriteRandomThingsDTO CustomController::getWriteRandomThingsDTO() { return WriteRandomThingsDTO(); } -QCoro::Task<> CustomInteractor::runLongOperation() +QCoro::Task<> CustomController::runLongOperation() { RunLongOperationCommand query; @@ -99,7 +99,7 @@ QCoro::Task<> CustomInteractor::runLongOperation() QObject::connect(handler, &RunLongOperationCommandHandler::runLongOperationChanged, m_eventDispatcher->custom(), &CustomSignals::runLongOperationChanged); // Create specialized UndoRedoCommand - auto command = new AlterCommand(CustomInteractor::tr("Doing RunLongOperation"), handler, query); + auto command = new AlterCommand(CustomController::tr("Doing RunLongOperation"), handler, query); // set progress minimum duration command->setProgressMinimumDuration(1000); @@ -111,7 +111,7 @@ QCoro::Task<> CustomInteractor::runLongOperation() co_return; } -QCoro::Task<> CustomInteractor::closeSystem() +QCoro::Task<> CustomController::closeSystem() { CloseSystemCommand query; @@ -132,7 +132,7 @@ QCoro::Task<> CustomInteractor::closeSystem() QObject::connect(handler, &CloseSystemCommandHandler::closeSystemChanged, m_eventDispatcher->custom(), &CustomSignals::closeSystemChanged); // Create specialized UndoRedoCommand - auto command = new AlterCommand(CustomInteractor::tr("Doing CloseSystem"), handler, query); + auto command = new AlterCommand(CustomController::tr("Doing CloseSystem"), handler, query); // set progress minimum duration command->setProgressMinimumDuration(1000); @@ -144,7 +144,7 @@ QCoro::Task<> CustomInteractor::closeSystem() co_return; } -QCoro::Task CustomInteractor::getCurrentTime() const +QCoro::Task CustomController::getCurrentTime() const { auto queryCommand = new QueryCommand("GetCurrentTime"_L1); diff --git a/examples/front_ends/src/core/interactor/custom/custom_interactor.h b/examples/front_ends/src/core/controller/custom/custom_controller.h similarity index 72% rename from examples/front_ends/src/core/interactor/custom/custom_interactor.h rename to examples/front_ends/src/core/controller/custom/custom_controller.h index a315acd0..e44251ae 100644 --- a/examples/front_ends/src/core/interactor/custom/custom_interactor.h +++ b/examples/front_ends/src/core/controller/custom/custom_controller.h @@ -4,7 +4,7 @@ #include "custom/write_random_things_dto.h" #include "event_dispatcher.h" -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include "custom/get_current_time_reply_dto.h" @@ -18,18 +18,18 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace FrontEnds::Contracts::DTO::Custom; -namespace FrontEnds::Interactor::Custom +namespace FrontEnds::Controller::Custom { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT CustomInteractor : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT CustomController : public QObject { Q_OBJECT public: - explicit CustomInteractor(InterfaceRepositoryProvider *repositoryProvider, + explicit CustomController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static CustomInteractor *instance(); + static CustomController *instance(); Q_INVOKABLE QCoro::Task getCurrentTime() const; @@ -41,13 +41,13 @@ public Q_SLOTS: QCoro::Task<> closeSystem(); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - CustomInteractor() = delete; - CustomInteractor(const CustomInteractor &) = delete; - CustomInteractor &operator=(const CustomInteractor &) = delete; + CustomController() = delete; + CustomController(const CustomController &) = delete; + CustomController &operator=(const CustomController &) = delete; }; -} // namespace FrontEnds::Interactor::Custom \ No newline at end of file +} // namespace FrontEnds::Controller::Custom \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/custom/custom_signals.h b/examples/front_ends/src/core/controller/custom/custom_signals.h similarity index 76% rename from examples/front_ends/src/core/interactor/custom/custom_signals.h rename to examples/front_ends/src/core/controller/custom/custom_signals.h index c5947d4a..0e3fa5ac 100644 --- a/examples/front_ends/src/core/interactor/custom/custom_signals.h +++ b/examples/front_ends/src/core/controller/custom/custom_signals.h @@ -2,18 +2,18 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include "custom/get_current_time_reply_dto.h" #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { using namespace FrontEnds::Contracts::DTO::Custom; -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT CustomSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT CustomSignals : public QObject { Q_OBJECT public: @@ -28,4 +28,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT CustomSignals : public QObject void closeSystemChanged(); void getCurrentTimeReplied(GetCurrentTimeReplyDTO dto); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/error_signals.h b/examples/front_ends/src/core/controller/error_signals.h similarity index 62% rename from examples/front_ends/src/core/interactor/error_signals.h rename to examples/front_ends/src/core/controller/error_signals.h index a2c9a371..93762fa9 100644 --- a/examples/front_ends/src/core/interactor/error_signals.h +++ b/examples/front_ends/src/core/controller/error_signals.h @@ -1,13 +1,13 @@ #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT ErrorSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT ErrorSignals : public QObject { Q_OBJECT public: @@ -20,4 +20,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT ErrorSignals : public QObject void warningSent(const Qleany::Error &error); void errorSent(const Qleany::Error &error); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/event_dispatcher.cpp b/examples/front_ends/src/core/controller/event_dispatcher.cpp similarity index 97% rename from examples/front_ends/src/core/interactor/event_dispatcher.cpp rename to examples/front_ends/src/core/controller/event_dispatcher.cpp index 6e81fc6b..6c582a85 100644 --- a/examples/front_ends/src/core/interactor/event_dispatcher.cpp +++ b/examples/front_ends/src/core/controller/event_dispatcher.cpp @@ -1,6 +1,6 @@ #include "event_dispatcher.h" -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; QPointer EventDispatcher::s_instance = nullptr; diff --git a/examples/front_ends/src/core/interactor/event_dispatcher.h b/examples/front_ends/src/core/controller/event_dispatcher.h similarity index 87% rename from examples/front_ends/src/core/interactor/event_dispatcher.h rename to examples/front_ends/src/core/controller/event_dispatcher.h index 508e00fc..2b54dd3a 100644 --- a/examples/front_ends/src/core/interactor/event_dispatcher.h +++ b/examples/front_ends/src/core/controller/event_dispatcher.h @@ -1,7 +1,7 @@ #pragma once #include "error_signals.h" -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include "progress_signals.h" #include "undo_redo/undo_redo_signals.h" @@ -19,9 +19,9 @@ #include #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT EventDispatcher : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT EventDispatcher : public QObject { Q_OBJECT public: @@ -63,4 +63,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT EventDispatcher : public QObject EventDispatcher(const EventDispatcher &) = delete; EventDispatcher &operator=(const EventDispatcher &) = delete; }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/passenger/passenger_interactor.cpp b/examples/front_ends/src/core/controller/passenger/passenger_controller.cpp similarity index 89% rename from examples/front_ends/src/core/interactor/passenger/passenger_interactor.cpp rename to examples/front_ends/src/core/controller/passenger/passenger_controller.cpp index 7213b26e..eb1c15ba 100644 --- a/examples/front_ends/src/core/interactor/passenger/passenger_interactor.cpp +++ b/examples/front_ends/src/core/controller/passenger/passenger_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "passenger_interactor.h" +#include "passenger_controller.h" #include "passenger/commands/create_passenger_command.h" #include "passenger/commands/create_passenger_command_handler.h" @@ -15,16 +15,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::Passenger; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::Passenger; using namespace FrontEnds::Application::Features::Passenger::Commands; using namespace FrontEnds::Application::Features::Passenger::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer PassengerInteractor::s_instance = nullptr; +QPointer PassengerController::s_instance = nullptr; -PassengerInteractor::PassengerInteractor(InterfaceRepositoryProvider *repositoryProvider, +PassengerController::PassengerController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -38,12 +38,12 @@ PassengerInteractor::PassengerInteractor(InterfaceRepositoryProvider *repository s_instance = this; } -PassengerInteractor *PassengerInteractor::instance() +PassengerController *PassengerController::instance() { return s_instance.data(); } -QCoro::Task PassengerInteractor::get(int id) const +QCoro::Task PassengerController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -74,7 +74,7 @@ QCoro::Task PassengerInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task> PassengerInteractor::getAll() const +QCoro::Task> PassengerController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -102,7 +102,7 @@ QCoro::Task> PassengerInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task PassengerInteractor::create(const CreatePassengerDTO &dto) +QCoro::Task PassengerController::create(const CreatePassengerDTO &dto) { CreatePassengerCommand query; @@ -129,7 +129,7 @@ QCoro::Task PassengerInteractor::create(const CreatePassengerDTO & }); // Create specialized UndoRedoCommand - auto command = new AlterCommand(PassengerInteractor::tr("Create passenger"), handler, query); + auto command = new AlterCommand(PassengerController::tr("Create passenger"), handler, query); // push command m_undo_redo_system->push(command, "passenger"_L1); @@ -145,7 +145,7 @@ QCoro::Task PassengerInteractor::create(const CreatePassengerDTO & co_return optional_result.value(); } -QCoro::Task PassengerInteractor::update(const UpdatePassengerDTO &dto) +QCoro::Task PassengerController::update(const UpdatePassengerDTO &dto) { UpdatePassengerCommand query; @@ -165,7 +165,7 @@ QCoro::Task PassengerInteractor::update(const UpdatePassengerDTO & &PassengerSignals::allRelationsInvalidated); // Create specialized UndoRedoCommand - auto command = new AlterCommand(PassengerInteractor::tr("Update passenger"), handler, query); + auto command = new AlterCommand(PassengerController::tr("Update passenger"), handler, query); // push command m_undo_redo_system->push(command, "passenger"_L1); @@ -181,7 +181,7 @@ QCoro::Task PassengerInteractor::update(const UpdatePassengerDTO & co_return optional_result.value(); } -QCoro::Task PassengerInteractor::remove(int id) +QCoro::Task PassengerController::remove(int id) { RemovePassengerCommand query; @@ -195,7 +195,7 @@ QCoro::Task PassengerInteractor::remove(int id) // no need to connect to removed signal, because it will be emitted by the repository itself // Create specialized UndoRedoCommand - auto command = new AlterCommand(PassengerInteractor::tr("Remove passenger"), handler, query); + auto command = new AlterCommand(PassengerController::tr("Remove passenger"), handler, query); // push command m_undo_redo_system->push(command, "passenger"_L1); @@ -210,12 +210,12 @@ QCoro::Task PassengerInteractor::remove(int id) co_return true; } -CreatePassengerDTO PassengerInteractor::getCreateDTO() +CreatePassengerDTO PassengerController::getCreateDTO() { return CreatePassengerDTO(); } -UpdatePassengerDTO PassengerInteractor::getUpdateDTO() +UpdatePassengerDTO PassengerController::getUpdateDTO() { return UpdatePassengerDTO(); } diff --git a/examples/front_ends/src/core/interactor/passenger/passenger_interactor.h b/examples/front_ends/src/core/controller/passenger/passenger_controller.h similarity index 75% rename from examples/front_ends/src/core/interactor/passenger/passenger_interactor.h rename to examples/front_ends/src/core/controller/passenger/passenger_controller.h index 921dfef6..594d4cd6 100644 --- a/examples/front_ends/src/core/interactor/passenger/passenger_interactor.h +++ b/examples/front_ends/src/core/controller/passenger/passenger_controller.h @@ -3,7 +3,7 @@ #pragma once #include "event_dispatcher.h" -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include "passenger/create_passenger_dto.h" #include "passenger/passenger_dto.h" #include "passenger/update_passenger_dto.h" @@ -19,18 +19,18 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace FrontEnds::Contracts::DTO::Passenger; -namespace FrontEnds::Interactor::Passenger +namespace FrontEnds::Controller::Passenger { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT PassengerInteractor : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT PassengerController : public QObject { Q_OBJECT public: - explicit PassengerInteractor(InterfaceRepositoryProvider *repositoryProvider, + explicit PassengerController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static PassengerInteractor *instance(); + static PassengerController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -49,13 +49,13 @@ public Q_SLOTS: QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - PassengerInteractor() = delete; - PassengerInteractor(const PassengerInteractor &) = delete; - PassengerInteractor &operator=(const PassengerInteractor &) = delete; + PassengerController() = delete; + PassengerController(const PassengerController &) = delete; + PassengerController &operator=(const PassengerController &) = delete; }; -} // namespace FrontEnds::Interactor::Passenger \ No newline at end of file +} // namespace FrontEnds::Controller::Passenger \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/passenger/passenger_signals.h b/examples/front_ends/src/core/controller/passenger/passenger_signals.h similarity index 80% rename from examples/front_ends/src/core/interactor/passenger/passenger_signals.h rename to examples/front_ends/src/core/controller/passenger/passenger_signals.h index 7116ee2d..c21c8b25 100644 --- a/examples/front_ends/src/core/interactor/passenger/passenger_signals.h +++ b/examples/front_ends/src/core/controller/passenger/passenger_signals.h @@ -2,18 +2,18 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include "passenger/passenger_dto.h" #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { using namespace FrontEnds::Contracts::DTO::Passenger; -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT PassengerSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT PassengerSignals : public QObject { Q_OBJECT public: @@ -31,4 +31,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT PassengerSignals : public QObject void getReplied(PassengerDTO dto); void getAllReplied(QList dtoList); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/progress_signals.h b/examples/front_ends/src/core/controller/progress_signals.h similarity index 91% rename from examples/front_ends/src/core/interactor/progress_signals.h rename to examples/front_ends/src/core/controller/progress_signals.h index ceae0058..f32f456f 100644 --- a/examples/front_ends/src/core/interactor/progress_signals.h +++ b/examples/front_ends/src/core/controller/progress_signals.h @@ -1,14 +1,14 @@ #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT ProgressSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT ProgressSignals : public QObject { Q_OBJECT public: @@ -53,4 +53,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT ProgressSignals : public QObject void progressTextChanged(const QString &progressText); void progressValueChanged(int progressValue); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/undo_redo/undo_redo_interactor.cpp b/examples/front_ends/src/core/controller/undo_redo/undo_redo_controller.cpp similarity index 62% rename from examples/front_ends/src/core/interactor/undo_redo/undo_redo_interactor.cpp rename to examples/front_ends/src/core/controller/undo_redo/undo_redo_controller.cpp index 50255e8a..58b9c2c3 100644 --- a/examples/front_ends/src/core/interactor/undo_redo/undo_redo_interactor.cpp +++ b/examples/front_ends/src/core/controller/undo_redo/undo_redo_controller.cpp @@ -1,16 +1,16 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "undo_redo_interactor.h" +#include "undo_redo_controller.h" #include -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::UndoRedo; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::UndoRedo; using namespace Qleany::Tools::UndoRedo; -QPointer UndoRedoInteractor::s_instance = nullptr; +QPointer UndoRedoController::s_instance = nullptr; -UndoRedoInteractor::UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) +UndoRedoController::UndoRedoController(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} { // connections for undo commands: @@ -26,102 +26,102 @@ UndoRedoInteractor::UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, s_instance = this; } -UndoRedoInteractor *UndoRedoInteractor::instance() +UndoRedoController *UndoRedoController::instance() { return s_instance.data(); } -bool UndoRedoInteractor::canUndo() const +bool UndoRedoController::canUndo() const { return m_undo_redo_system->canUndo(); } -bool UndoRedoInteractor::canRedo() const +bool UndoRedoController::canRedo() const { return m_undo_redo_system->canRedo(); } -void UndoRedoInteractor::setUndoLimit(int limit) +void UndoRedoController::setUndoLimit(int limit) { m_undo_redo_system->setUndoLimit(limit); } -int UndoRedoInteractor::undoLimit() const +int UndoRedoController::undoLimit() const { return m_undo_redo_system->undoLimit(); } -QString UndoRedoInteractor::undoText() const +QString UndoRedoController::undoText() const { return m_undo_redo_system->undoText(); } -QString UndoRedoInteractor::redoText() const +QString UndoRedoController::redoText() const { return m_undo_redo_system->redoText(); } -QStringList UndoRedoInteractor::undoRedoTextList() const +QStringList UndoRedoController::undoRedoTextList() const { return m_undo_redo_system->undoRedoTextList(); } -int UndoRedoInteractor::currentIndex() const +int UndoRedoController::currentIndex() const { return m_undo_redo_system->currentIndex(); } -QUuid UndoRedoInteractor::activeStackId() const +QUuid UndoRedoController::activeStackId() const { return m_undo_redo_system->activeStackId(); } -QStringList UndoRedoInteractor::queuedCommandTextListByScope(const QString &scopeFlagString) const +QStringList UndoRedoController::queuedCommandTextListByScope(const QString &scopeFlagString) const { return m_undo_redo_system->queuedCommandTextListByScope(scopeFlagString); } -bool UndoRedoInteractor::isRunning() const +bool UndoRedoController::isRunning() const { return m_undo_redo_system->isRunning(); } -int UndoRedoInteractor::numberOfCommands() const +int UndoRedoController::numberOfCommands() const { return m_undo_redo_system->numberOfCommands(); } -QAction *UndoRedoInteractor::createUndoAction(QObject *parent, const QString &prefix) const +QAction *UndoRedoController::createUndoAction(QObject *parent, const QString &prefix) const { return m_undo_redo_system->createUndoAction(parent, prefix); } -QAction *UndoRedoInteractor::createRedoAction(QObject *parent, const QString &prefix) const +QAction *UndoRedoController::createRedoAction(QObject *parent, const QString &prefix) const { return m_undo_redo_system->createRedoAction(parent, prefix); } -void UndoRedoInteractor::undo() +void UndoRedoController::undo() { return m_undo_redo_system->undo(); } -void UndoRedoInteractor::redo() +void UndoRedoController::redo() { return m_undo_redo_system->redo(); } -void UndoRedoInteractor::clear() +void UndoRedoController::clear() { return m_undo_redo_system->clear(); } -void UndoRedoInteractor::setCurrentIndex(int index) +void UndoRedoController::setCurrentIndex(int index) { return m_undo_redo_system->setCurrentIndex(index); } -void UndoRedoInteractor::setActiveStack(const QUuid &stackId) +void UndoRedoController::setActiveStack(const QUuid &stackId) { return m_undo_redo_system->setActiveStack(stackId); } \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/undo_redo/undo_redo_interactor.h b/examples/front_ends/src/core/controller/undo_redo/undo_redo_controller.h similarity index 74% rename from examples/front_ends/src/core/interactor/undo_redo/undo_redo_interactor.h rename to examples/front_ends/src/core/controller/undo_redo/undo_redo_controller.h index d95bff8e..8e237c00 100644 --- a/examples/front_ends/src/core/interactor/undo_redo/undo_redo_interactor.h +++ b/examples/front_ends/src/core/controller/undo_redo/undo_redo_controller.h @@ -3,7 +3,7 @@ #pragma once #include "event_dispatcher.h" -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include @@ -13,16 +13,16 @@ using namespace Qleany::Tools::UndoRedo; -namespace FrontEnds::Interactor::UndoRedo +namespace FrontEnds::Controller::UndoRedo { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT UndoRedoInteractor : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT UndoRedoController : public QObject { Q_OBJECT public: - explicit UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); + explicit UndoRedoController(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static UndoRedoInteractor *instance(); + static UndoRedoController *instance(); Q_INVOKABLE bool canUndo() const; @@ -60,12 +60,12 @@ public Q_SLOTS: void setActiveStack(const QUuid &stackId = QUuid()); private: - static QPointer s_instance; + static QPointer s_instance; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - UndoRedoInteractor() = delete; - UndoRedoInteractor(const UndoRedoInteractor &) = delete; - UndoRedoInteractor &operator=(const UndoRedoInteractor &) = delete; + UndoRedoController() = delete; + UndoRedoController(const UndoRedoController &) = delete; + UndoRedoController &operator=(const UndoRedoController &) = delete; }; -} // namespace FrontEnds::Interactor::UndoRedo \ No newline at end of file +} // namespace FrontEnds::Controller::UndoRedo \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/undo_redo/undo_redo_signals.h b/examples/front_ends/src/core/controller/undo_redo/undo_redo_signals.h similarity index 84% rename from examples/front_ends/src/core/interactor/undo_redo/undo_redo_signals.h rename to examples/front_ends/src/core/controller/undo_redo/undo_redo_signals.h index 09cb9e21..24813918 100644 --- a/examples/front_ends/src/core/interactor/undo_redo/undo_redo_signals.h +++ b/examples/front_ends/src/core/controller/undo_redo/undo_redo_signals.h @@ -2,14 +2,14 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "front_ends_example_interactor_export.h" +#include "front_ends_example_controller_export.h" #include #include -namespace FrontEnds::Interactor +namespace FrontEnds::Controller { -class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT UndoRedoSignals : public QObject +class FRONT_ENDS_EXAMPLE_CONTROLLER_EXPORT UndoRedoSignals : public QObject { Q_OBJECT public: @@ -41,4 +41,4 @@ class FRONT_ENDS_EXAMPLE_INTERACTOR_EXPORT UndoRedoSignals : public QObject */ void undoing(Qleany::Tools::UndoRedo::Scope scope, bool active); }; -} // namespace FrontEnds::Interactor \ No newline at end of file +} // namespace FrontEnds::Controller \ No newline at end of file diff --git a/examples/front_ends/src/core/interactor/interactors.cmake b/examples/front_ends/src/core/interactor/interactors.cmake deleted file mode 100644 index 468c9754..00000000 --- a/examples/front_ends/src/core/interactor/interactors.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# This file was generated automatically by Qleany's generator, edit at your own risk! -# If you do, be careful to not overwrite it when you run the generator again. -set(INTERACTOR_LIST - car/car_interactor.h - car/car_interactor.cpp - car/car_signals.h - brand/brand_interactor.h - brand/brand_interactor.cpp - brand/brand_signals.h - passenger/passenger_interactor.h - passenger/passenger_interactor.cpp - passenger/passenger_signals.h - client/client_interactor.h - client/client_interactor.cpp - client/client_signals.h - custom/custom_interactor.h - custom/custom_interactor.cpp - custom/custom_signals.h - undo_redo/undo_redo_interactor.h - undo_redo/undo_redo_interactor.cpp - undo_redo/undo_redo_signals.h -) \ No newline at end of file diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/CMakeLists.txt b/examples/front_ends/src/gui/kf6_kirigami_application/CMakeLists.txt index 6a73b9b6..5cbaf305 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/CMakeLists.txt +++ b/examples/front_ends/src/gui/kf6_kirigami_application/CMakeLists.txt @@ -23,7 +23,7 @@ qcoro_enable_coroutines() target_link_libraries(${APP_NAME} PUBLIC front-ends-example-entities) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-persistence) -target_link_libraries(${APP_NAME} PUBLIC front-ends-example-interactor) +target_link_libraries(${APP_NAME} PUBLIC front-ends-example-controller) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core QCoro::Qml) diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/main.cpp b/examples/front_ends/src/gui/kf6_kirigami_application/main.cpp index 12d77128..215e5cac 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/main.cpp +++ b/examples/front_ends/src/gui/kf6_kirigami_application/main.cpp @@ -24,7 +24,7 @@ #ifndef BUILD_WITH_MOCKS #include "entities_registration.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "persistence_registration.h" #endif #include "frontendsexampleconfig.h" @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) new FrontEnds::Entities::EntitiesRegistration(&app); auto *persistenceRegistration = new FrontEnds::Persistence::PersistenceRegistration(&app); - new FrontEnds::Interactor::InteractorRegistration(&app, persistenceRegistration->repositoryProvider()); + new FrontEnds::Controller::ControllerRegistration(&app, persistenceRegistration->repositoryProvider()); #endif #ifdef Q_OS_WINDOWS diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/BrandInteractor.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/BrandController.qml similarity index 89% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/BrandInteractor.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/BrandController.qml index a891cd60..57e7b5e0 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/BrandInteractor.qml +++ b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/BrandController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/BrandSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/BrandSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/BrandSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/BrandSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CarInteractor.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CarController.qml similarity index 88% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CarInteractor.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CarController.qml index 3105e3f0..90308305 100644 --- a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CarInteractor.qml +++ b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CarController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CarSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CarSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CarSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CarSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ClientInteractor.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ClientController.qml similarity index 88% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ClientInteractor.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ClientController.qml index afdbc1b0..7ea3f16a 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ClientInteractor.qml +++ b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ClientController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ClientSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ClientSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ClientSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ClientSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CustomInteractor.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CustomController.qml similarity index 92% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CustomInteractor.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CustomController.qml index a764f2cc..26654446 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CustomInteractor.qml +++ b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CustomController.qml @@ -5,7 +5,7 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function writeRandomThings(dto) { @@ -18,7 +18,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -52,7 +52,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -78,7 +78,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -104,7 +104,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CustomSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CustomSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CustomSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/CustomSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ErrorSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ErrorSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ErrorSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ErrorSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/EventDispatcher.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/EventDispatcher.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/EventDispatcher.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/EventDispatcher.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/PassengerInteractor.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/PassengerController.qml similarity index 89% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/PassengerInteractor.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/PassengerController.qml index 754ca48c..87df22d6 100644 --- a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/PassengerInteractor.qml +++ b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/PassengerController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/PassengerSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/PassengerSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/PassengerSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/PassengerSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ProgressSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ProgressSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/ProgressSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/ProgressSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/QCoroQmlTask.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/QCoroQmlTask.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/QCoroQmlTask.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/QCoroQmlTask.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/UndoRedoInteractor.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/UndoRedoController.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/UndoRedoInteractor.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/UndoRedoController.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/UndoRedoSignals.qml b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/UndoRedoSignals.qml similarity index 100% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/UndoRedoSignals.qml rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/UndoRedoSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/qmldir b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/qmldir similarity index 65% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/qmldir rename to examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/qmldir index e7f4fb88..7253ee16 100644 --- a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/qmldir +++ b/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Controllers/qmldir @@ -1,17 +1,17 @@ # This file was generated automatically by Qleany's generator, edit at your own risk! # If you do, be careful to not overwrite it when you run the generator again. -Module Interactors -singleton CarInteractor 1.0 CarInteractor.qml +Module Controllers +singleton CarController 1.0 CarController.qml singleton CarSignals 1.0 CarSignals.qml -singleton BrandInteractor 1.0 BrandInteractor.qml +singleton BrandController 1.0 BrandController.qml singleton BrandSignals 1.0 BrandSignals.qml -singleton PassengerInteractor 1.0 PassengerInteractor.qml +singleton PassengerController 1.0 PassengerController.qml singleton PassengerSignals 1.0 PassengerSignals.qml -singleton ClientInteractor 1.0 ClientInteractor.qml +singleton ClientController 1.0 ClientController.qml singleton ClientSignals 1.0 ClientSignals.qml -singleton CustomInteractor 1.0 CustomInteractor.qml +singleton CustomController 1.0 CustomController.qml singleton CustomSignals 1.0 CustomSignals.qml -singleton UndoRedoInteractor 1.0 UndoRedoInteractor.qml +singleton UndoRedoController 1.0 UndoRedoController.qml singleton UndoRedoSignals 1.0 UndoRedoSignals.qml singleton ProgressSignals 1.0 ProgressSignals.qml singleton ErrorSignals 1.0 ErrorSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/CMakeLists.txt b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/CMakeLists.txt index 60053a6f..f3f2f06c 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/CMakeLists.txt +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/CMakeLists.txt @@ -2,5 +2,5 @@ # If you do, be careful to not overwrite it when you run the generator again. add_subdirectory(models) -add_subdirectory(interactors) +add_subdirectory(controllers) add_subdirectory(singles) \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/CMakeLists.txt b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/CMakeLists.txt similarity index 69% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/CMakeLists.txt rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/CMakeLists.txt index 1e03f03b..3a6c9571 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/CMakeLists.txt +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/CMakeLists.txt @@ -3,26 +3,26 @@ find_package(Qt6 COMPONENTS Core Quick Qml REQUIRED) find_package(QCoro6 REQUIRED COMPONENTS Core Qml) -set(PLUGIN_NAME front-ends-example-qml-interactors) +set(PLUGIN_NAME front-ends-example-qml-controllers) qt_add_library(${PLUGIN_NAME} STATIC) qt6_add_qml_module(${PLUGIN_NAME} - URI "Interactors" + URI "Controllers" VERSION 1.0 SOURCES - foreign_car_interactor.h - foreign_brand_interactor.h - foreign_passenger_interactor.h - foreign_client_interactor.h - foreign_custom_interactor.h + foreign_car_controller.h + foreign_brand_controller.h + foreign_passenger_controller.h + foreign_client_controller.h + foreign_custom_controller.h foreign_event_dispatcher.h - foreign_undo_redo_interactor.h + foreign_undo_redo_controller.h ) -target_link_libraries(${PLUGIN_NAME} PRIVATE front-ends-example-interactor) +target_link_libraries(${PLUGIN_NAME} PRIVATE front-ends-example-controller) target_link_libraries(${PLUGIN_NAME} PRIVATE QCoro::Core QCoro::Qml) target_link_libraries(${PLUGIN_NAME} diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_brand_interactor.h b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_brand_controller.h similarity index 52% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_brand_interactor.h rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_brand_controller.h index 0fc9dbf1..f5f863bd 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_brand_interactor.h +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_brand_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "brand/brand_interactor.h" +#include "brand/brand_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Brand; +using namespace FrontEnds::Controller::Brand; -class ForeignBrandInteractor : public QObject +class ForeignBrandController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(BrandInteractor) + QML_NAMED_ELEMENT(BrandController) public: - ForeignBrandInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignBrandController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = BrandInteractor::instance(); + s_controllerInstance = BrandController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateBrandDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateBrandDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateBrandDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateBrandDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - BrandInteractor *s_interactorInstance = nullptr; + BrandController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_car_interactor.h b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_car_controller.h similarity index 53% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_car_interactor.h rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_car_controller.h index 12d2d351..a3c7fc47 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_car_interactor.h +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_car_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "car/car_interactor.h" +#include "car/car_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Car; +using namespace FrontEnds::Controller::Car; -class ForeignCarInteractor : public QObject +class ForeignCarController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CarInteractor) + QML_NAMED_ELEMENT(CarController) public: - ForeignCarInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCarController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CarInteractor::instance(); + s_controllerInstance = CarController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateCarDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateCarDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateCarDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateCarDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - CarInteractor *s_interactorInstance = nullptr; + CarController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_client_interactor.h b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_client_controller.h similarity index 53% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_client_interactor.h rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_client_controller.h index 315df12c..9909a083 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_client_interactor.h +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_client_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "client/client_interactor.h" +#include "client/client_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Client; +using namespace FrontEnds::Controller::Client; -class ForeignClientInteractor : public QObject +class ForeignClientController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(ClientInteractor) + QML_NAMED_ELEMENT(ClientController) public: - ForeignClientInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignClientController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = ClientInteractor::instance(); + s_controllerInstance = ClientController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateClientDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateClientDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateClientDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateClientDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - ClientInteractor *s_interactorInstance = nullptr; + ClientController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_custom_interactor.h b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_custom_controller.h similarity index 51% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_custom_interactor.h rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_custom_controller.h index ddf95e3e..4c4324d4 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_custom_interactor.h +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_custom_controller.h @@ -1,50 +1,50 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "custom/custom_interactor.h" +#include "custom/custom_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Custom; +using namespace FrontEnds::Controller::Custom; -class ForeignCustomInteractor : public QObject +class ForeignCustomController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CustomInteractor) + QML_NAMED_ELEMENT(CustomController) public: - ForeignCustomInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCustomController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CustomInteractor::instance(); + s_controllerInstance = CustomController::instance(); } Q_INVOKABLE QCoro::QmlTask getCurrentTime() const { - return s_interactorInstance->getCurrentTime(); + return s_controllerInstance->getCurrentTime(); } Q_INVOKABLE QCoro::QmlTask writeRandomThings(WriteRandomThingsDTO dto) { - return s_interactorInstance->writeRandomThings(dto); + return s_controllerInstance->writeRandomThings(dto); } Q_INVOKABLE WriteRandomThingsDTO getWriteRandomThingsDTO() { - return s_interactorInstance->getWriteRandomThingsDTO(); + return s_controllerInstance->getWriteRandomThingsDTO(); } Q_INVOKABLE QCoro::QmlTask runLongOperation() { - return s_interactorInstance->runLongOperation(); + return s_controllerInstance->runLongOperation(); } Q_INVOKABLE QCoro::QmlTask closeSystem() { - return s_interactorInstance->closeSystem(); + return s_controllerInstance->closeSystem(); } private: - CustomInteractor *s_interactorInstance = nullptr; + CustomController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_event_dispatcher.h b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_event_dispatcher.h similarity index 83% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_event_dispatcher.h rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_event_dispatcher.h index 1f94758d..317b59a9 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_event_dispatcher.h +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_event_dispatcher.h @@ -8,18 +8,18 @@ struct ForeignEventDispatcher { Q_GADGET - QML_FOREIGN(FrontEnds::Interactor::EventDispatcher) + QML_FOREIGN(FrontEnds::Controller::EventDispatcher) QML_SINGLETON QML_NAMED_ELEMENT(EventDispatcher) public: // Initialize this singleton instance with the given engine. - inline static FrontEnds::Interactor::EventDispatcher *s_singletonInstance = nullptr; + inline static FrontEnds::Controller::EventDispatcher *s_singletonInstance = nullptr; - static FrontEnds::Interactor::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) + static FrontEnds::Controller::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = FrontEnds::Interactor::EventDispatcher::instance(); + s_singletonInstance = FrontEnds::Controller::EventDispatcher::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_passenger_interactor.h b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_passenger_controller.h similarity index 52% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_passenger_interactor.h rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_passenger_controller.h index b1b93ae2..e16e2fee 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_passenger_interactor.h +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_passenger_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Passenger; +using namespace FrontEnds::Controller::Passenger; -class ForeignPassengerInteractor : public QObject +class ForeignPassengerController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(PassengerInteractor) + QML_NAMED_ELEMENT(PassengerController) public: - ForeignPassengerInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignPassengerController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = PassengerInteractor::instance(); + s_controllerInstance = PassengerController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreatePassengerDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdatePassengerDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreatePassengerDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdatePassengerDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - PassengerInteractor *s_interactorInstance = nullptr; + PassengerController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_undo_redo_interactor.h b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_undo_redo_controller.h similarity index 71% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_undo_redo_interactor.h rename to examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_undo_redo_controller.h index c8e203b6..b5e4be8e 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_undo_redo_interactor.h +++ b/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/controllers/foreign_undo_redo_controller.h @@ -1,26 +1,26 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" #include -using namespace FrontEnds::Interactor::UndoRedo; +using namespace FrontEnds::Controller::UndoRedo; -struct ForeignUndoRedoInteractor +struct ForeignUndoRedoController { Q_GADGET - QML_FOREIGN(FrontEnds::Interactor::UndoRedo::UndoRedoInteractor) + QML_FOREIGN(FrontEnds::Controller::UndoRedo::UndoRedoController) QML_SINGLETON - QML_NAMED_ELEMENT(UndoRedoInteractor) + QML_NAMED_ELEMENT(UndoRedoController) public: // Initialize this singleton instance with the given engine. - inline static UndoRedoInteractor *s_singletonInstance = nullptr; + inline static UndoRedoController *s_singletonInstance = nullptr; - static UndoRedoInteractor *create(QQmlEngine *, QJSEngine *engine) + static UndoRedoController *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = UndoRedoInteractor::instance(); + s_singletonInstance = UndoRedoController::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/realqmlmodules.cmake b/examples/front_ends/src/gui/kf6_kirigami_application/realqmlmodules.cmake index 6b3b14e3..6ae21020 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/realqmlmodules.cmake +++ b/examples/front_ends/src/gui/kf6_kirigami_application/realqmlmodules.cmake @@ -6,7 +6,7 @@ add_subdirectory(real_imports) # For integration in QT Design Studio project, you may have to replace # ${APP_NAME} by ${CMAKE_PROJECT_NAME} or by the name of your project target_link_libraries(${APP_NAME} PRIVATE -front-ends-example-qml-interactorsplugin +front-ends-example-qml-controllersplugin front-ends-example-qml-modelsplugin front-ends-example-qml-singlesplugin ) \ No newline at end of file diff --git a/examples/front_ends/src/gui/presenter/CMakeLists.txt b/examples/front_ends/src/gui/presenter/CMakeLists.txt index cbef2d81..6b6daf9f 100644 --- a/examples/front_ends/src/gui/presenter/CMakeLists.txt +++ b/examples/front_ends/src/gui/presenter/CMakeLists.txt @@ -32,7 +32,7 @@ target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} target_link_libraries(${LIBRARY_NAME} PRIVATE Qt6::Core Qt6::Gui) target_link_libraries(${LIBRARY_NAME} PRIVATE QCoro::Core) target_link_libraries(${LIBRARY_NAME} PUBLIC qleany) -target_link_libraries(${LIBRARY_NAME} PUBLIC front-ends-example-interactor) +target_link_libraries(${LIBRARY_NAME} PUBLIC front-ends-example-controller) if(IOS) install(TARGETS ${LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/examples/front_ends/src/gui/presenter/car_list_model.cpp b/examples/front_ends/src/gui/presenter/car_list_model.cpp index 98370383..a7980271 100644 --- a/examples/front_ends/src/gui/presenter/car_list_model.cpp +++ b/examples/front_ends/src/gui/presenter/car_list_model.cpp @@ -1,9 +1,9 @@ #include "car_list_model.h" -#include "car/car_interactor.h" +#include "car/car_controller.h" #include "event_dispatcher.h" #include -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; using namespace FrontEnds::Presenter; CarListModel::CarListModel(QObject *parent) @@ -124,7 +124,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setId(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; return false; @@ -146,7 +146,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setUuid(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; return false; @@ -168,7 +168,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setCreationDate(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; return false; @@ -190,7 +190,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setUpdateDate(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; return false; @@ -212,7 +212,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setContent(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; return false; @@ -234,7 +234,7 @@ void CarListModel::populate() m_carIdList.clear(); endResetModel(); - auto task = Car::CarInteractor::instance()->getAll(); + auto task = Car::CarController::instance()->getAll(); QCoro::connect(std::move(task), this, [this](auto &&result) { const QList carList = result; for (const auto &car : carList) { diff --git a/examples/front_ends/src/gui/presenter/passenger_list_model_from_car_passengers.cpp b/examples/front_ends/src/gui/presenter/passenger_list_model_from_car_passengers.cpp index 4d78563e..bed3e4bd 100644 --- a/examples/front_ends/src/gui/presenter/passenger_list_model_from_car_passengers.cpp +++ b/examples/front_ends/src/gui/presenter/passenger_list_model_from_car_passengers.cpp @@ -1,10 +1,10 @@ #include "passenger_list_model_from_car_passengers.h" -#include "car/car_interactor.h" +#include "car/car_controller.h" #include "event_dispatcher.h" -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; using namespace FrontEnds::Presenter; PassengerListModelFromCarPassengers::PassengerListModelFromCarPassengers(QObject *parent) @@ -14,7 +14,7 @@ PassengerListModelFromCarPassengers::PassengerListModelFromCarPassengers(QObject if (carId == m_carId) { return; } - auto task = Car::CarInteractor::instance()->getWithDetails(carId); + auto task = Car::CarController::instance()->getWithDetails(carId); QCoro::connect(std::move(task), this, [this, carId](auto &&carDetails) { if (carDetails.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; @@ -114,9 +114,9 @@ PassengerListModelFromCarPassengers::PassengerListModelFromCarPassengers(QObject QList relatedIds = dto.relatedIds(); std::reverse(relatedIds.begin(), relatedIds.end()); - // fetch passenger list from interactor + // fetch passenger list from controller for (int passengerId : relatedIds) { - Passenger::PassengerInteractor::instance()->get(passengerId).then([this, passengerId, position](PassengerDTO passenger) { + Passenger::PassengerController::instance()->get(passengerId).then([this, passengerId, position](PassengerDTO passenger) { // add passenger to this model if (!m_passengerIdList.contains(passengerId)) { beginInsertRows(QModelIndex(), position, position); @@ -220,7 +220,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setId(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; return false; @@ -242,7 +242,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setUuid(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; return false; @@ -264,7 +264,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setCreationDate(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; return false; @@ -286,7 +286,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setUpdateDate(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; return false; @@ -308,7 +308,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setName(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; return false; @@ -332,7 +332,7 @@ void PassengerListModelFromCarPassengers::populate() m_passengerIdList.clear(); endResetModel(); - auto task = Car::CarInteractor::instance()->getWithDetails(m_carId); + auto task = Car::CarController::instance()->getWithDetails(m_carId); QCoro::connect(std::move(task), this, [this](auto &&result) { const QList passengerList = result.passengers(); for (const auto &passenger : passengerList) { diff --git a/examples/front_ends/src/gui/presenter/single_brand.cpp b/examples/front_ends/src/gui/presenter/single_brand.cpp index 9765a9a0..09dc2c22 100644 --- a/examples/front_ends/src/gui/presenter/single_brand.cpp +++ b/examples/front_ends/src/gui/presenter/single_brand.cpp @@ -1,10 +1,10 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "single_brand.h" -#include "brand/brand_interactor.h" +#include "brand/brand_controller.h" #include "event_dispatcher.h" -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; using namespace FrontEnds::Presenter; SingleBrand::SingleBrand(QObject *parent) @@ -71,7 +71,7 @@ void SingleBrand::setId(int newId) // set else { - Brand::BrandInteractor::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; return; @@ -110,7 +110,7 @@ void SingleBrand::setUuid(const QUuid &newUuid) UpdateBrandDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Brand::BrandInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; return; @@ -133,7 +133,7 @@ void SingleBrand::setCreationDate(const QDateTime &newCreationDate) UpdateBrandDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Brand::BrandInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; return; @@ -156,7 +156,7 @@ void SingleBrand::setUpdateDate(const QDateTime &newUpdateDate) UpdateBrandDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Brand::BrandInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; return; @@ -179,7 +179,7 @@ void SingleBrand::setName(const QString &newName) UpdateBrandDTO dto; dto.setId(id()); dto.setName(newName); - Brand::BrandInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; return; diff --git a/examples/front_ends/src/gui/presenter/single_car.cpp b/examples/front_ends/src/gui/presenter/single_car.cpp index 46b08c50..88eb4273 100644 --- a/examples/front_ends/src/gui/presenter/single_car.cpp +++ b/examples/front_ends/src/gui/presenter/single_car.cpp @@ -1,10 +1,10 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "single_car.h" -#include "car/car_interactor.h" +#include "car/car_controller.h" #include "event_dispatcher.h" -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; using namespace FrontEnds::Presenter; SingleCar::SingleCar(QObject *parent) @@ -71,7 +71,7 @@ void SingleCar::setId(int newId) // set else { - Car::CarInteractor::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; return; @@ -110,7 +110,7 @@ void SingleCar::setUuid(const QUuid &newUuid) UpdateCarDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Car::CarInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; return; @@ -133,7 +133,7 @@ void SingleCar::setCreationDate(const QDateTime &newCreationDate) UpdateCarDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Car::CarInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; return; @@ -156,7 +156,7 @@ void SingleCar::setUpdateDate(const QDateTime &newUpdateDate) UpdateCarDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Car::CarInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; return; @@ -179,7 +179,7 @@ void SingleCar::setContent(const QString &newContent) UpdateCarDTO dto; dto.setId(id()); dto.setContent(newContent); - Car::CarInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; return; diff --git a/examples/front_ends/src/gui/presenter/single_client.cpp b/examples/front_ends/src/gui/presenter/single_client.cpp index 93c47108..b51dd987 100644 --- a/examples/front_ends/src/gui/presenter/single_client.cpp +++ b/examples/front_ends/src/gui/presenter/single_client.cpp @@ -1,10 +1,10 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "single_client.h" -#include "client/client_interactor.h" +#include "client/client_controller.h" #include "event_dispatcher.h" -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; using namespace FrontEnds::Presenter; SingleClient::SingleClient(QObject *parent) @@ -64,7 +64,7 @@ void SingleClient::setId(int newId) // set else { - Client::ClientInteractor::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { + Client::ClientController::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid clientId"; return; @@ -100,7 +100,7 @@ void SingleClient::setUuid(const QUuid &newUuid) UpdateClientDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Client::ClientInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { + Client::ClientController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid clientId"; return; @@ -123,7 +123,7 @@ void SingleClient::setCreationDate(const QDateTime &newCreationDate) UpdateClientDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Client::ClientInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { + Client::ClientController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid clientId"; return; @@ -146,7 +146,7 @@ void SingleClient::setUpdateDate(const QDateTime &newUpdateDate) UpdateClientDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Client::ClientInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { + Client::ClientController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid clientId"; return; diff --git a/examples/front_ends/src/gui/presenter/single_passenger.cpp b/examples/front_ends/src/gui/presenter/single_passenger.cpp index a19d7a94..7dfbfb87 100644 --- a/examples/front_ends/src/gui/presenter/single_passenger.cpp +++ b/examples/front_ends/src/gui/presenter/single_passenger.cpp @@ -2,9 +2,9 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_passenger.h" #include "event_dispatcher.h" -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" -using namespace FrontEnds::Interactor; +using namespace FrontEnds::Controller; using namespace FrontEnds::Presenter; SinglePassenger::SinglePassenger(QObject *parent) @@ -71,7 +71,7 @@ void SinglePassenger::setId(int newId) // set else { - Passenger::PassengerInteractor::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { + Passenger::PassengerController::instance()->get(m_id).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid passengerId"; return; @@ -110,7 +110,7 @@ void SinglePassenger::setUuid(const QUuid &newUuid) UpdatePassengerDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Passenger::PassengerInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { + Passenger::PassengerController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid passengerId"; return; @@ -133,7 +133,7 @@ void SinglePassenger::setCreationDate(const QDateTime &newCreationDate) UpdatePassengerDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Passenger::PassengerInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { + Passenger::PassengerController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid passengerId"; return; @@ -156,7 +156,7 @@ void SinglePassenger::setUpdateDate(const QDateTime &newUpdateDate) UpdatePassengerDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Passenger::PassengerInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { + Passenger::PassengerController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid passengerId"; return; @@ -179,7 +179,7 @@ void SinglePassenger::setName(const QString &newName) UpdatePassengerDTO dto; dto.setId(id()); dto.setName(newName); - Passenger::PassengerInteractor::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { + Passenger::PassengerController::instance()->update(dto).then([this](const FrontEnds::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid passengerId"; return; diff --git a/examples/front_ends/src/gui/presenter/single_redo.cpp b/examples/front_ends/src/gui/presenter/single_redo.cpp index 852a085a..0ddf3b12 100644 --- a/examples/front_ends/src/gui/presenter/single_redo.cpp +++ b/examples/front_ends/src/gui/presenter/single_redo.cpp @@ -2,16 +2,16 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_redo.h" #include "event_dispatcher.h" -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::UndoRedo; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::UndoRedo; using namespace FrontEnds::Presenter; SingleRedo::SingleRedo(QObject *parent) : QObject{parent} { - m_action = UndoRedoInteractor::instance()->createUndoAction(this, tr("Redo: %1")); + m_action = UndoRedoController::instance()->createUndoAction(this, tr("Redo: %1")); m_enabled = m_action->isEnabled(); connect(m_action, &QAction::enabledChanged, this, [this](bool newEnabled) { @@ -50,5 +50,5 @@ QString SingleRedo::text() const void SingleRedo::redo() { - UndoRedoInteractor::instance()->redo(); + UndoRedoController::instance()->redo(); } \ No newline at end of file diff --git a/examples/front_ends/src/gui/presenter/single_undo.cpp b/examples/front_ends/src/gui/presenter/single_undo.cpp index 0b1e8adc..924c0655 100644 --- a/examples/front_ends/src/gui/presenter/single_undo.cpp +++ b/examples/front_ends/src/gui/presenter/single_undo.cpp @@ -2,16 +2,16 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_undo.h" #include "event_dispatcher.h" -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" -using namespace FrontEnds::Interactor; -using namespace FrontEnds::Interactor::UndoRedo; +using namespace FrontEnds::Controller; +using namespace FrontEnds::Controller::UndoRedo; using namespace FrontEnds::Presenter; SingleUndo::SingleUndo(QObject *parent) : QObject{parent} { - m_action = UndoRedoInteractor::instance()->createUndoAction(this, tr("Undo: %1")); + m_action = UndoRedoController::instance()->createUndoAction(this, tr("Undo: %1")); m_enabled = m_action->isEnabled(); connect(m_action, &QAction::enabledChanged, this, [this](bool newEnabled) { @@ -50,5 +50,5 @@ QString SingleUndo::text() const void SingleUndo::undo() { - UndoRedoInteractor::instance()->undo(); + UndoRedoController::instance()->undo(); } \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/BrandInteractor.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/BrandController.qml similarity index 89% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/BrandInteractor.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/BrandController.qml index a891cd60..57e7b5e0 100644 --- a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/BrandInteractor.qml +++ b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/BrandController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/BrandSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/BrandSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/BrandSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/BrandSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CarInteractor.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CarController.qml similarity index 88% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CarInteractor.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CarController.qml index 3105e3f0..90308305 100644 --- a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CarInteractor.qml +++ b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CarController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CarSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CarSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CarSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CarSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ClientInteractor.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ClientController.qml similarity index 88% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ClientInteractor.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ClientController.qml index afdbc1b0..7ea3f16a 100644 --- a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ClientInteractor.qml +++ b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ClientController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ClientSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ClientSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ClientSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ClientSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CustomInteractor.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CustomController.qml similarity index 91% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CustomInteractor.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CustomController.qml index 20a0f75b..81019a29 100644 --- a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CustomInteractor.qml +++ b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CustomController.qml @@ -5,7 +5,7 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function writeRandomThings(dto) { @@ -18,7 +18,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -40,7 +40,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -62,7 +62,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -84,7 +84,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CustomSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CustomSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CustomSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/CustomSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ErrorSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ErrorSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ErrorSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ErrorSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/EventDispatcher.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/EventDispatcher.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/EventDispatcher.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/EventDispatcher.qml diff --git a/examples/simple/src/gui/qml_application/mock_imports/Interactors/PassengerInteractor.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/PassengerController.qml similarity index 89% rename from examples/simple/src/gui/qml_application/mock_imports/Interactors/PassengerInteractor.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/PassengerController.qml index 754ca48c..87df22d6 100644 --- a/examples/simple/src/gui/qml_application/mock_imports/Interactors/PassengerInteractor.qml +++ b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/PassengerController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/PassengerSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/PassengerSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/PassengerSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/PassengerSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ProgressSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ProgressSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ProgressSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/ProgressSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/QCoroQmlTask.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/QCoroQmlTask.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/QCoroQmlTask.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/QCoroQmlTask.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/UndoRedoInteractor.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/UndoRedoController.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/UndoRedoInteractor.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/UndoRedoController.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/UndoRedoSignals.qml b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/UndoRedoSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/UndoRedoSignals.qml rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/UndoRedoSignals.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/qmldir b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/qmldir similarity index 65% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/qmldir rename to examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/qmldir index e7f4fb88..7253ee16 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/qmldir +++ b/examples/front_ends/src/gui/qt_design_studio/mock_imports/Controllers/qmldir @@ -1,17 +1,17 @@ # This file was generated automatically by Qleany's generator, edit at your own risk! # If you do, be careful to not overwrite it when you run the generator again. -Module Interactors -singleton CarInteractor 1.0 CarInteractor.qml +Module Controllers +singleton CarController 1.0 CarController.qml singleton CarSignals 1.0 CarSignals.qml -singleton BrandInteractor 1.0 BrandInteractor.qml +singleton BrandController 1.0 BrandController.qml singleton BrandSignals 1.0 BrandSignals.qml -singleton PassengerInteractor 1.0 PassengerInteractor.qml +singleton PassengerController 1.0 PassengerController.qml singleton PassengerSignals 1.0 PassengerSignals.qml -singleton ClientInteractor 1.0 ClientInteractor.qml +singleton ClientController 1.0 ClientController.qml singleton ClientSignals 1.0 ClientSignals.qml -singleton CustomInteractor 1.0 CustomInteractor.qml +singleton CustomController 1.0 CustomController.qml singleton CustomSignals 1.0 CustomSignals.qml -singleton UndoRedoInteractor 1.0 UndoRedoInteractor.qml +singleton UndoRedoController 1.0 UndoRedoController.qml singleton UndoRedoSignals 1.0 UndoRedoSignals.qml singleton ProgressSignals 1.0 ProgressSignals.qml singleton ErrorSignals 1.0 ErrorSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/CMakeLists.txt b/examples/front_ends/src/gui/qt_design_studio/real_imports/CMakeLists.txt index 60053a6f..f3f2f06c 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/CMakeLists.txt +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/CMakeLists.txt @@ -2,5 +2,5 @@ # If you do, be careful to not overwrite it when you run the generator again. add_subdirectory(models) -add_subdirectory(interactors) +add_subdirectory(controllers) add_subdirectory(singles) \ No newline at end of file diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/CMakeLists.txt b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/CMakeLists.txt similarity index 69% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/CMakeLists.txt rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/CMakeLists.txt index 1e03f03b..3a6c9571 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/CMakeLists.txt +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/CMakeLists.txt @@ -3,26 +3,26 @@ find_package(Qt6 COMPONENTS Core Quick Qml REQUIRED) find_package(QCoro6 REQUIRED COMPONENTS Core Qml) -set(PLUGIN_NAME front-ends-example-qml-interactors) +set(PLUGIN_NAME front-ends-example-qml-controllers) qt_add_library(${PLUGIN_NAME} STATIC) qt6_add_qml_module(${PLUGIN_NAME} - URI "Interactors" + URI "Controllers" VERSION 1.0 SOURCES - foreign_car_interactor.h - foreign_brand_interactor.h - foreign_passenger_interactor.h - foreign_client_interactor.h - foreign_custom_interactor.h + foreign_car_controller.h + foreign_brand_controller.h + foreign_passenger_controller.h + foreign_client_controller.h + foreign_custom_controller.h foreign_event_dispatcher.h - foreign_undo_redo_interactor.h + foreign_undo_redo_controller.h ) -target_link_libraries(${PLUGIN_NAME} PRIVATE front-ends-example-interactor) +target_link_libraries(${PLUGIN_NAME} PRIVATE front-ends-example-controller) target_link_libraries(${PLUGIN_NAME} PRIVATE QCoro::Core QCoro::Qml) target_link_libraries(${PLUGIN_NAME} diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_brand_interactor.h b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_brand_controller.h similarity index 52% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_brand_interactor.h rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_brand_controller.h index 0fc9dbf1..f5f863bd 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_brand_interactor.h +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_brand_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "brand/brand_interactor.h" +#include "brand/brand_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Brand; +using namespace FrontEnds::Controller::Brand; -class ForeignBrandInteractor : public QObject +class ForeignBrandController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(BrandInteractor) + QML_NAMED_ELEMENT(BrandController) public: - ForeignBrandInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignBrandController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = BrandInteractor::instance(); + s_controllerInstance = BrandController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateBrandDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateBrandDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateBrandDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateBrandDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - BrandInteractor *s_interactorInstance = nullptr; + BrandController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_car_interactor.h b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_car_controller.h similarity index 53% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_car_interactor.h rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_car_controller.h index 12d2d351..a3c7fc47 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_car_interactor.h +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_car_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "car/car_interactor.h" +#include "car/car_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Car; +using namespace FrontEnds::Controller::Car; -class ForeignCarInteractor : public QObject +class ForeignCarController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CarInteractor) + QML_NAMED_ELEMENT(CarController) public: - ForeignCarInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCarController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CarInteractor::instance(); + s_controllerInstance = CarController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateCarDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateCarDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateCarDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateCarDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - CarInteractor *s_interactorInstance = nullptr; + CarController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_client_interactor.h b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_client_controller.h similarity index 53% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_client_interactor.h rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_client_controller.h index 315df12c..9909a083 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_client_interactor.h +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_client_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "client/client_interactor.h" +#include "client/client_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Client; +using namespace FrontEnds::Controller::Client; -class ForeignClientInteractor : public QObject +class ForeignClientController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(ClientInteractor) + QML_NAMED_ELEMENT(ClientController) public: - ForeignClientInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignClientController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = ClientInteractor::instance(); + s_controllerInstance = ClientController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateClientDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateClientDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateClientDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateClientDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - ClientInteractor *s_interactorInstance = nullptr; + ClientController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_custom_interactor.h b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_custom_controller.h similarity index 51% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_custom_interactor.h rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_custom_controller.h index 14e791ef..67ef6d5e 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_custom_interactor.h +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_custom_controller.h @@ -1,45 +1,45 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "custom/custom_interactor.h" +#include "custom/custom_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Custom; +using namespace FrontEnds::Controller::Custom; -class ForeignCustomInteractor : public QObject +class ForeignCustomController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CustomInteractor) + QML_NAMED_ELEMENT(CustomController) public: - ForeignCustomInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCustomController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CustomInteractor::instance(); + s_controllerInstance = CustomController::instance(); } Q_INVOKABLE QCoro::QmlTask getCurrentTime() const { - return s_interactorInstance->getCurrentTime(); + return s_controllerInstance->getCurrentTime(); } Q_INVOKABLE QCoro::QmlTask writeRandomThings(WriteRandomThingsDTO dto) { - return s_interactorInstance->writeRandomThings(dto); + return s_controllerInstance->writeRandomThings(dto); } Q_INVOKABLE QCoro::QmlTask runLongOperation() { - return s_interactorInstance->runLongOperation(); + return s_controllerInstance->runLongOperation(); } Q_INVOKABLE QCoro::QmlTask closeSystem() { - return s_interactorInstance->closeSystem(); + return s_controllerInstance->closeSystem(); } private: - CustomInteractor *s_interactorInstance = nullptr; + CustomController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_event_dispatcher.h b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_event_dispatcher.h similarity index 83% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_event_dispatcher.h rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_event_dispatcher.h index 1f94758d..317b59a9 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_event_dispatcher.h +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_event_dispatcher.h @@ -8,18 +8,18 @@ struct ForeignEventDispatcher { Q_GADGET - QML_FOREIGN(FrontEnds::Interactor::EventDispatcher) + QML_FOREIGN(FrontEnds::Controller::EventDispatcher) QML_SINGLETON QML_NAMED_ELEMENT(EventDispatcher) public: // Initialize this singleton instance with the given engine. - inline static FrontEnds::Interactor::EventDispatcher *s_singletonInstance = nullptr; + inline static FrontEnds::Controller::EventDispatcher *s_singletonInstance = nullptr; - static FrontEnds::Interactor::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) + static FrontEnds::Controller::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = FrontEnds::Interactor::EventDispatcher::instance(); + s_singletonInstance = FrontEnds::Controller::EventDispatcher::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_passenger_interactor.h b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_passenger_controller.h similarity index 52% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_passenger_interactor.h rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_passenger_controller.h index b1b93ae2..e16e2fee 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_passenger_interactor.h +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_passenger_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Passenger; +using namespace FrontEnds::Controller::Passenger; -class ForeignPassengerInteractor : public QObject +class ForeignPassengerController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(PassengerInteractor) + QML_NAMED_ELEMENT(PassengerController) public: - ForeignPassengerInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignPassengerController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = PassengerInteractor::instance(); + s_controllerInstance = PassengerController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreatePassengerDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdatePassengerDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreatePassengerDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdatePassengerDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - PassengerInteractor *s_interactorInstance = nullptr; + PassengerController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_undo_redo_interactor.h b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_undo_redo_controller.h similarity index 71% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_undo_redo_interactor.h rename to examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_undo_redo_controller.h index c8e203b6..b5e4be8e 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_undo_redo_interactor.h +++ b/examples/front_ends/src/gui/qt_design_studio/real_imports/controllers/foreign_undo_redo_controller.h @@ -1,26 +1,26 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" #include -using namespace FrontEnds::Interactor::UndoRedo; +using namespace FrontEnds::Controller::UndoRedo; -struct ForeignUndoRedoInteractor +struct ForeignUndoRedoController { Q_GADGET - QML_FOREIGN(FrontEnds::Interactor::UndoRedo::UndoRedoInteractor) + QML_FOREIGN(FrontEnds::Controller::UndoRedo::UndoRedoController) QML_SINGLETON - QML_NAMED_ELEMENT(UndoRedoInteractor) + QML_NAMED_ELEMENT(UndoRedoController) public: // Initialize this singleton instance with the given engine. - inline static UndoRedoInteractor *s_singletonInstance = nullptr; + inline static UndoRedoController *s_singletonInstance = nullptr; - static UndoRedoInteractor *create(QQmlEngine *, QJSEngine *engine) + static UndoRedoController *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = UndoRedoInteractor::instance(); + s_singletonInstance = UndoRedoController::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/front_ends/src/gui/qt_design_studio/realqmlmodules.cmake b/examples/front_ends/src/gui/qt_design_studio/realqmlmodules.cmake index 63eceb07..939eca62 100644 --- a/examples/front_ends/src/gui/qt_design_studio/realqmlmodules.cmake +++ b/examples/front_ends/src/gui/qt_design_studio/realqmlmodules.cmake @@ -4,7 +4,7 @@ add_subdirectory(real_imports) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE -front-ends-example-qml-interactorsplugin +front-ends-example-qml-controllersplugin front-ends-example-qml-modelsplugin front-ends-example-qml-singlesplugin ) \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/CMakeLists.txt b/examples/front_ends/src/gui/qt_quick_application/CMakeLists.txt index f56a2be9..3cb84221 100644 --- a/examples/front_ends/src/gui/qt_quick_application/CMakeLists.txt +++ b/examples/front_ends/src/gui/qt_quick_application/CMakeLists.txt @@ -32,7 +32,7 @@ qt_add_resources(${APP_NAME} "configuration" PREFIX "/" FILES target_link_libraries(${APP_NAME} PUBLIC qleany) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-entities) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-persistence) -target_link_libraries(${APP_NAME} PUBLIC front-ends-example-interactor) +target_link_libraries(${APP_NAME} PUBLIC front-ends-example-controller) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core QCoro::Qml) diff --git a/examples/front_ends/src/gui/qt_quick_application/content/App.qml b/examples/front_ends/src/gui/qt_quick_application/content/App.qml index cff24a54..5dcbd15e 100644 --- a/examples/front_ends/src/gui/qt_quick_application/content/App.qml +++ b/examples/front_ends/src/gui/qt_quick_application/content/App.qml @@ -6,7 +6,7 @@ import QtQuick.Layouts import QtQuick.Controls // Components -import Interactors +import Controllers import Models import Singles diff --git a/examples/front_ends/src/gui/qt_quick_application/main.cpp b/examples/front_ends/src/gui/qt_quick_application/main.cpp index 6980c851..aeb58a89 100644 --- a/examples/front_ends/src/gui/qt_quick_application/main.cpp +++ b/examples/front_ends/src/gui/qt_quick_application/main.cpp @@ -2,7 +2,7 @@ // If you do, be careful to not overwrite it when you run the generator again. #ifndef BUILD_WITH_MOCKS #include "entities_registration.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "persistence_registration.h" #endif #include @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) new FrontEnds::Entities::EntitiesRegistration(&app); auto *persistenceRegistration = new FrontEnds::Persistence::PersistenceRegistration(&app); - new FrontEnds::Interactor::InteractorRegistration(&app, persistenceRegistration->repositoryProvider()); + new FrontEnds::Controller::ControllerRegistration(&app, persistenceRegistration->repositoryProvider()); #endif QCoro::Qml::registerTypes(); diff --git a/examples/simple/src/gui/qml_application/mock_imports/Interactors/BrandInteractor.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/BrandController.qml similarity index 89% rename from examples/simple/src/gui/qml_application/mock_imports/Interactors/BrandInteractor.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/BrandController.qml index a891cd60..57e7b5e0 100644 --- a/examples/simple/src/gui/qml_application/mock_imports/Interactors/BrandInteractor.qml +++ b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/BrandController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/BrandSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/BrandSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/BrandSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/BrandSignals.qml diff --git a/examples/simple/src/gui/qml_application/mock_imports/Interactors/CarInteractor.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CarController.qml similarity index 88% rename from examples/simple/src/gui/qml_application/mock_imports/Interactors/CarInteractor.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CarController.qml index 3105e3f0..90308305 100644 --- a/examples/simple/src/gui/qml_application/mock_imports/Interactors/CarInteractor.qml +++ b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CarController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CarSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CarSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CarSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CarSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ClientInteractor.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ClientController.qml similarity index 88% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ClientInteractor.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ClientController.qml index afdbc1b0..7ea3f16a 100644 --- a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/ClientInteractor.qml +++ b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ClientController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ClientSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ClientSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ClientSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ClientSignals.qml diff --git a/examples/simple/src/gui/qml_application/mock_imports/Interactors/CustomInteractor.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CustomController.qml similarity index 91% rename from examples/simple/src/gui/qml_application/mock_imports/Interactors/CustomInteractor.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CustomController.qml index 20a0f75b..81019a29 100644 --- a/examples/simple/src/gui/qml_application/mock_imports/Interactors/CustomInteractor.qml +++ b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CustomController.qml @@ -5,7 +5,7 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function writeRandomThings(dto) { @@ -18,7 +18,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -40,7 +40,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -62,7 +62,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -84,7 +84,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CustomSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CustomSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/CustomSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/CustomSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ErrorSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ErrorSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ErrorSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ErrorSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/EventDispatcher.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/EventDispatcher.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/EventDispatcher.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/EventDispatcher.qml diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/PassengerInteractor.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/PassengerController.qml similarity index 89% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/PassengerInteractor.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/PassengerController.qml index 754ca48c..87df22d6 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/PassengerInteractor.qml +++ b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/PassengerController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/PassengerSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/PassengerSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/PassengerSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/PassengerSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ProgressSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ProgressSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/ProgressSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/ProgressSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/QCoroQmlTask.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/QCoroQmlTask.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/QCoroQmlTask.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/QCoroQmlTask.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/UndoRedoInteractor.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/UndoRedoController.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/UndoRedoInteractor.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/UndoRedoController.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/UndoRedoSignals.qml b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/UndoRedoSignals.qml similarity index 100% rename from examples/front_ends/src/gui/qt_quick_application/mock_imports/Interactors/UndoRedoSignals.qml rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/UndoRedoSignals.qml diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/qmldir b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/qmldir similarity index 65% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/qmldir rename to examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/qmldir index e7f4fb88..7253ee16 100644 --- a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/qmldir +++ b/examples/front_ends/src/gui/qt_quick_application/mock_imports/Controllers/qmldir @@ -1,17 +1,17 @@ # This file was generated automatically by Qleany's generator, edit at your own risk! # If you do, be careful to not overwrite it when you run the generator again. -Module Interactors -singleton CarInteractor 1.0 CarInteractor.qml +Module Controllers +singleton CarController 1.0 CarController.qml singleton CarSignals 1.0 CarSignals.qml -singleton BrandInteractor 1.0 BrandInteractor.qml +singleton BrandController 1.0 BrandController.qml singleton BrandSignals 1.0 BrandSignals.qml -singleton PassengerInteractor 1.0 PassengerInteractor.qml +singleton PassengerController 1.0 PassengerController.qml singleton PassengerSignals 1.0 PassengerSignals.qml -singleton ClientInteractor 1.0 ClientInteractor.qml +singleton ClientController 1.0 ClientController.qml singleton ClientSignals 1.0 ClientSignals.qml -singleton CustomInteractor 1.0 CustomInteractor.qml +singleton CustomController 1.0 CustomController.qml singleton CustomSignals 1.0 CustomSignals.qml -singleton UndoRedoInteractor 1.0 UndoRedoInteractor.qml +singleton UndoRedoController 1.0 UndoRedoController.qml singleton UndoRedoSignals 1.0 UndoRedoSignals.qml singleton ProgressSignals 1.0 ProgressSignals.qml singleton ErrorSignals 1.0 ErrorSignals.qml diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/CMakeLists.txt b/examples/front_ends/src/gui/qt_quick_application/real_imports/CMakeLists.txt index 60053a6f..f3f2f06c 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/CMakeLists.txt +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/CMakeLists.txt @@ -2,5 +2,5 @@ # If you do, be careful to not overwrite it when you run the generator again. add_subdirectory(models) -add_subdirectory(interactors) +add_subdirectory(controllers) add_subdirectory(singles) \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/CMakeLists.txt b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/CMakeLists.txt similarity index 69% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/CMakeLists.txt rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/CMakeLists.txt index 1e03f03b..3a6c9571 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/CMakeLists.txt +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/CMakeLists.txt @@ -3,26 +3,26 @@ find_package(Qt6 COMPONENTS Core Quick Qml REQUIRED) find_package(QCoro6 REQUIRED COMPONENTS Core Qml) -set(PLUGIN_NAME front-ends-example-qml-interactors) +set(PLUGIN_NAME front-ends-example-qml-controllers) qt_add_library(${PLUGIN_NAME} STATIC) qt6_add_qml_module(${PLUGIN_NAME} - URI "Interactors" + URI "Controllers" VERSION 1.0 SOURCES - foreign_car_interactor.h - foreign_brand_interactor.h - foreign_passenger_interactor.h - foreign_client_interactor.h - foreign_custom_interactor.h + foreign_car_controller.h + foreign_brand_controller.h + foreign_passenger_controller.h + foreign_client_controller.h + foreign_custom_controller.h foreign_event_dispatcher.h - foreign_undo_redo_interactor.h + foreign_undo_redo_controller.h ) -target_link_libraries(${PLUGIN_NAME} PRIVATE front-ends-example-interactor) +target_link_libraries(${PLUGIN_NAME} PRIVATE front-ends-example-controller) target_link_libraries(${PLUGIN_NAME} PRIVATE QCoro::Core QCoro::Qml) target_link_libraries(${PLUGIN_NAME} diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_brand_interactor.h b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_brand_controller.h similarity index 52% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_brand_interactor.h rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_brand_controller.h index 0fc9dbf1..f5f863bd 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_brand_interactor.h +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_brand_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "brand/brand_interactor.h" +#include "brand/brand_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Brand; +using namespace FrontEnds::Controller::Brand; -class ForeignBrandInteractor : public QObject +class ForeignBrandController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(BrandInteractor) + QML_NAMED_ELEMENT(BrandController) public: - ForeignBrandInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignBrandController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = BrandInteractor::instance(); + s_controllerInstance = BrandController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateBrandDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateBrandDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateBrandDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateBrandDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - BrandInteractor *s_interactorInstance = nullptr; + BrandController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_car_interactor.h b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_car_controller.h similarity index 53% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_car_interactor.h rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_car_controller.h index 12d2d351..a3c7fc47 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_car_interactor.h +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_car_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "car/car_interactor.h" +#include "car/car_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Car; +using namespace FrontEnds::Controller::Car; -class ForeignCarInteractor : public QObject +class ForeignCarController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CarInteractor) + QML_NAMED_ELEMENT(CarController) public: - ForeignCarInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCarController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CarInteractor::instance(); + s_controllerInstance = CarController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateCarDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateCarDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateCarDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateCarDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - CarInteractor *s_interactorInstance = nullptr; + CarController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_client_interactor.h b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_client_controller.h similarity index 53% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_client_interactor.h rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_client_controller.h index 315df12c..9909a083 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_client_interactor.h +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_client_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "client/client_interactor.h" +#include "client/client_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Client; +using namespace FrontEnds::Controller::Client; -class ForeignClientInteractor : public QObject +class ForeignClientController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(ClientInteractor) + QML_NAMED_ELEMENT(ClientController) public: - ForeignClientInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignClientController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = ClientInteractor::instance(); + s_controllerInstance = ClientController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateClientDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateClientDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateClientDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateClientDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - ClientInteractor *s_interactorInstance = nullptr; + ClientController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_custom_interactor.h b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_custom_controller.h similarity index 51% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_custom_interactor.h rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_custom_controller.h index 14e791ef..67ef6d5e 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_custom_interactor.h +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_custom_controller.h @@ -1,45 +1,45 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "custom/custom_interactor.h" +#include "custom/custom_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Custom; +using namespace FrontEnds::Controller::Custom; -class ForeignCustomInteractor : public QObject +class ForeignCustomController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CustomInteractor) + QML_NAMED_ELEMENT(CustomController) public: - ForeignCustomInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCustomController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CustomInteractor::instance(); + s_controllerInstance = CustomController::instance(); } Q_INVOKABLE QCoro::QmlTask getCurrentTime() const { - return s_interactorInstance->getCurrentTime(); + return s_controllerInstance->getCurrentTime(); } Q_INVOKABLE QCoro::QmlTask writeRandomThings(WriteRandomThingsDTO dto) { - return s_interactorInstance->writeRandomThings(dto); + return s_controllerInstance->writeRandomThings(dto); } Q_INVOKABLE QCoro::QmlTask runLongOperation() { - return s_interactorInstance->runLongOperation(); + return s_controllerInstance->runLongOperation(); } Q_INVOKABLE QCoro::QmlTask closeSystem() { - return s_interactorInstance->closeSystem(); + return s_controllerInstance->closeSystem(); } private: - CustomInteractor *s_interactorInstance = nullptr; + CustomController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_event_dispatcher.h b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_event_dispatcher.h similarity index 83% rename from examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_event_dispatcher.h rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_event_dispatcher.h index 1f94758d..317b59a9 100644 --- a/examples/front_ends/src/gui/qt_quick_application/real_imports/interactors/foreign_event_dispatcher.h +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_event_dispatcher.h @@ -8,18 +8,18 @@ struct ForeignEventDispatcher { Q_GADGET - QML_FOREIGN(FrontEnds::Interactor::EventDispatcher) + QML_FOREIGN(FrontEnds::Controller::EventDispatcher) QML_SINGLETON QML_NAMED_ELEMENT(EventDispatcher) public: // Initialize this singleton instance with the given engine. - inline static FrontEnds::Interactor::EventDispatcher *s_singletonInstance = nullptr; + inline static FrontEnds::Controller::EventDispatcher *s_singletonInstance = nullptr; - static FrontEnds::Interactor::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) + static FrontEnds::Controller::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = FrontEnds::Interactor::EventDispatcher::instance(); + s_singletonInstance = FrontEnds::Controller::EventDispatcher::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_passenger_interactor.h b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_passenger_controller.h similarity index 52% rename from examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_passenger_interactor.h rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_passenger_controller.h index b1b93ae2..e16e2fee 100644 --- a/examples/front_ends/src/gui/qt_design_studio/real_imports/interactors/foreign_passenger_interactor.h +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_passenger_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include #include #include -using namespace FrontEnds::Interactor::Passenger; +using namespace FrontEnds::Controller::Passenger; -class ForeignPassengerInteractor : public QObject +class ForeignPassengerController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(PassengerInteractor) + QML_NAMED_ELEMENT(PassengerController) public: - ForeignPassengerInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignPassengerController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = PassengerInteractor::instance(); + s_controllerInstance = PassengerController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreatePassengerDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdatePassengerDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreatePassengerDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdatePassengerDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - PassengerInteractor *s_interactorInstance = nullptr; + PassengerController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_undo_redo_interactor.h b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_undo_redo_controller.h similarity index 71% rename from examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_undo_redo_interactor.h rename to examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_undo_redo_controller.h index c8e203b6..b5e4be8e 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/real_imports/interactors/foreign_undo_redo_interactor.h +++ b/examples/front_ends/src/gui/qt_quick_application/real_imports/controllers/foreign_undo_redo_controller.h @@ -1,26 +1,26 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" #include -using namespace FrontEnds::Interactor::UndoRedo; +using namespace FrontEnds::Controller::UndoRedo; -struct ForeignUndoRedoInteractor +struct ForeignUndoRedoController { Q_GADGET - QML_FOREIGN(FrontEnds::Interactor::UndoRedo::UndoRedoInteractor) + QML_FOREIGN(FrontEnds::Controller::UndoRedo::UndoRedoController) QML_SINGLETON - QML_NAMED_ELEMENT(UndoRedoInteractor) + QML_NAMED_ELEMENT(UndoRedoController) public: // Initialize this singleton instance with the given engine. - inline static UndoRedoInteractor *s_singletonInstance = nullptr; + inline static UndoRedoController *s_singletonInstance = nullptr; - static UndoRedoInteractor *create(QQmlEngine *, QJSEngine *engine) + static UndoRedoController *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = UndoRedoInteractor::instance(); + s_singletonInstance = UndoRedoController::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/front_ends/src/gui/qt_quick_application/realqmlmodules.cmake b/examples/front_ends/src/gui/qt_quick_application/realqmlmodules.cmake index 0ab9fd01..a3e9368a 100644 --- a/examples/front_ends/src/gui/qt_quick_application/realqmlmodules.cmake +++ b/examples/front_ends/src/gui/qt_quick_application/realqmlmodules.cmake @@ -4,7 +4,7 @@ add_subdirectory(real_imports) target_link_libraries(${APP_NAME} PRIVATE - front-ends-example-qml-interactorsplugin + front-ends-example-qml-controllersplugin front-ends-example-qml-modelsplugin front-ends-example-qml-singlesplugin ) \ No newline at end of file diff --git a/examples/front_ends/src/gui/qt_widgets_application/CMakeLists.txt b/examples/front_ends/src/gui/qt_widgets_application/CMakeLists.txt index 8f1cceea..33383c05 100644 --- a/examples/front_ends/src/gui/qt_widgets_application/CMakeLists.txt +++ b/examples/front_ends/src/gui/qt_widgets_application/CMakeLists.txt @@ -32,6 +32,6 @@ target_link_libraries(${APP_NAME} PUBLIC Qt6::Core Qt6::Widgets Qt6::Concurrent target_link_libraries(${APP_NAME} PUBLIC qleany) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-entities) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-persistence) -target_link_libraries(${APP_NAME} PUBLIC front-ends-example-interactor) +target_link_libraries(${APP_NAME} PUBLIC front-ends-example-controller) target_link_libraries(${APP_NAME} PUBLIC front-ends-example-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core) diff --git a/examples/front_ends/src/gui/qt_widgets_application/main.cpp b/examples/front_ends/src/gui/qt_widgets_application/main.cpp index c690914e..927ee00d 100644 --- a/examples/front_ends/src/gui/qt_widgets_application/main.cpp +++ b/examples/front_ends/src/gui/qt_widgets_application/main.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "entities_registration.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "mainwindow.h" #include "persistence_registration.h" #include @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) new FrontEnds::Entities::EntitiesRegistration(&a); auto *persistenceRegistration = new FrontEnds::Persistence::PersistenceRegistration(&a); - new FrontEnds::Interactor::InteractorRegistration(&a, persistenceRegistration->repositoryProvider()); + new FrontEnds::Controller::ControllerRegistration(&a, persistenceRegistration->repositoryProvider()); MainWindow window; window.show(); diff --git a/examples/front_ends/src/gui/qt_widgets_application/mainwindow.cpp b/examples/front_ends/src/gui/qt_widgets_application/mainwindow.cpp index 92f4333c..2201e57b 100644 --- a/examples/front_ends/src/gui/qt_widgets_application/mainwindow.cpp +++ b/examples/front_ends/src/gui/qt_widgets_application/mainwindow.cpp @@ -3,8 +3,8 @@ #include "mainwindow.h" #include "ui_mainwindow.h" -// example of using an interactor -// #include "my_feature/my_feature_interactor.h" +// example of using an controller +// #include "my_feature/my_feature_controller.h" // example of using a 'single', which represents one entity // #include "single_my_entity.h" @@ -13,10 +13,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ui->setupUi(this); - // auto *myfeatureInteractor = FrontEnds::Interactor::MyFeature::MyFeatureInteractor::instance(); - // auto createMyFeatureDTO = myfeatureInteractor->getCreateDTO(); + // auto *myfeatureController = FrontEnds::Controller::MyFeature::MyFeatureController::instance(); + // auto createMyFeatureDTO = myfeatureController->getCreateDTO(); // createMyFeatureDTO.setContent("Example myfeature 1"); - // const auto &myfeatureDto = co_await myfeatureInteractor->create(createMyFeatureDTO); + // const auto &myfeatureDto = co_await myfeatureController->create(createMyFeatureDTO); // auto *singleMyEntity = new FrontEnds::Presenter::SingleMyEntity(this); diff --git a/examples/simple/qleany.yaml b/examples/simple/qleany.yaml index f07551d9..b88d682b 100755 --- a/examples/simple/qleany.yaml +++ b/examples/simple/qleany.yaml @@ -68,9 +68,9 @@ repositories: repository_folder_path: src/core/persistence/repository/ base_folder_path: src/core/persistence/ -interactor: - folder_path: src/core/interactor/ - create_undo_redo_interactor: true +controller: + folder_path: src/core/controller/ + create_undo_redo_controller: true application: common_cmake_folder_path: src/core/application diff --git a/examples/simple/src/core/CMakeLists.txt b/examples/simple/src/core/CMakeLists.txt index ba074fad..326b7ed4 100755 --- a/examples/simple/src/core/CMakeLists.txt +++ b/examples/simple/src/core/CMakeLists.txt @@ -11,4 +11,4 @@ add_subdirectory(contracts.cqrs) # handles the use cases add_subdirectory(application) # handles the interaction between the system's inner layers (use cases, DTOs) and the external world -add_subdirectory(interactor) +add_subdirectory(controller) diff --git a/examples/simple/src/core/interactor/CMakeLists.txt b/examples/simple/src/core/controller/CMakeLists.txt similarity index 89% rename from examples/simple/src/core/interactor/CMakeLists.txt rename to examples/simple/src/core/controller/CMakeLists.txt index 0259287a..b035865b 100755 --- a/examples/simple/src/core/interactor/CMakeLists.txt +++ b/examples/simple/src/core/controller/CMakeLists.txt @@ -6,7 +6,7 @@ find_package(QCoro6 REQUIRED COMPONENTS Core) # find_package(qleany REQUIRED) # CONFIG disabled for now, because it's not available in the qleany package -set(LIBRARY_NAME simple-example-interactor) +set(LIBRARY_NAME simple-example-controller) option(BUILD_SHARED_LIBS "Build libraries as shared libraries" ON) @@ -17,22 +17,22 @@ else() endif() -include(interactors.cmake) +include(controllers.cmake) set(SRCS event_dispatcher.h event_dispatcher.cpp - interactor_registration.h + controller_registration.h error_signals.h progress_signals.h - interactor_registration.cpp + controller_registration.cpp ) -qt_add_library(${LIBRARY_NAME} ${LIB_TYPE} ${SRCS} ${INTERACTOR_LIST}) +qt_add_library(${LIBRARY_NAME} ${LIB_TYPE} ${SRCS} ${CONTROLLER_LIST}) include(GenerateExportHeader) generate_export_header(${LIBRARY_NAME} - BASE_NAME simple_example_interactor) + BASE_NAME simple_example_controller) target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/examples/simple/src/core/interactor/brand/brand_interactor.cpp b/examples/simple/src/core/controller/brand/brand_controller.cpp similarity index 90% rename from examples/simple/src/core/interactor/brand/brand_interactor.cpp rename to examples/simple/src/core/controller/brand/brand_controller.cpp index 2e3bb713..5836b729 100644 --- a/examples/simple/src/core/interactor/brand/brand_interactor.cpp +++ b/examples/simple/src/core/controller/brand/brand_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "brand_interactor.h" +#include "brand_controller.h" #include "brand/commands/create_brand_command.h" #include "brand/commands/create_brand_command_handler.h" @@ -15,16 +15,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace Simple::Interactor; -using namespace Simple::Interactor::Brand; +using namespace Simple::Controller; +using namespace Simple::Controller::Brand; using namespace Simple::Application::Features::Brand::Commands; using namespace Simple::Application::Features::Brand::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer BrandInteractor::s_instance = nullptr; +QPointer BrandController::s_instance = nullptr; -BrandInteractor::BrandInteractor(InterfaceRepositoryProvider *repositoryProvider, +BrandController::BrandController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -38,12 +38,12 @@ BrandInteractor::BrandInteractor(InterfaceRepositoryProvider *repositoryProvider s_instance = this; } -BrandInteractor *BrandInteractor::instance() +BrandController *BrandController::instance() { return s_instance.data(); } -QCoro::Task BrandInteractor::get(int id) const +QCoro::Task BrandController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -76,7 +76,7 @@ QCoro::Task BrandInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task> BrandInteractor::getAll() const +QCoro::Task> BrandController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -106,7 +106,7 @@ QCoro::Task> BrandInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task BrandInteractor::create(const CreateBrandDTO &dto) +QCoro::Task BrandController::create(const CreateBrandDTO &dto) { CreateBrandCommand query; @@ -135,7 +135,7 @@ QCoro::Task BrandInteractor::create(const CreateBrandDTO &dto) [this](int removedId) { Q_EMIT m_eventDispatcher->brand()->removed(QList() << removedId); }); // Create specialized UndoRedoCommand - auto command = new AlterCommand(BrandInteractor::tr("Create brand"), + auto command = new AlterCommand(BrandController::tr("Create brand"), handler, query); // push command @@ -153,7 +153,7 @@ QCoro::Task BrandInteractor::create(const CreateBrandDTO &dto) co_return optional_result.value(); } -QCoro::Task BrandInteractor::update(const UpdateBrandDTO &dto) +QCoro::Task BrandController::update(const UpdateBrandDTO &dto) { UpdateBrandCommand query; @@ -170,7 +170,7 @@ QCoro::Task BrandInteractor::update(const UpdateBrandDTO &dto) &BrandSignals::allRelationsInvalidated); // Create specialized UndoRedoCommand - auto command = new AlterCommand(BrandInteractor::tr("Update brand"), + auto command = new AlterCommand(BrandController::tr("Update brand"), handler, query); // push command @@ -188,7 +188,7 @@ QCoro::Task BrandInteractor::update(const UpdateBrandDTO &dto) co_return optional_result.value(); } -QCoro::Task BrandInteractor::remove(int id) +QCoro::Task BrandController::remove(int id) { RemoveBrandCommand query; @@ -202,7 +202,7 @@ QCoro::Task BrandInteractor::remove(int id) // no need to connect to removed signal, because it will be emitted by the repository itself // Create specialized UndoRedoCommand - auto command = new AlterCommand(BrandInteractor::tr("Remove brand"), + auto command = new AlterCommand(BrandController::tr("Remove brand"), handler, query); // push command @@ -220,12 +220,12 @@ QCoro::Task BrandInteractor::remove(int id) co_return true; } -CreateBrandDTO BrandInteractor::getCreateDTO() +CreateBrandDTO BrandController::getCreateDTO() { return CreateBrandDTO(); } -UpdateBrandDTO BrandInteractor::getUpdateDTO() +UpdateBrandDTO BrandController::getUpdateDTO() { return UpdateBrandDTO(); } diff --git a/examples/simple/src/core/interactor/brand/brand_interactor.h b/examples/simple/src/core/controller/brand/brand_controller.h similarity index 75% rename from examples/simple/src/core/interactor/brand/brand_interactor.h rename to examples/simple/src/core/controller/brand/brand_controller.h index 6bef4816..056fa6ad 100644 --- a/examples/simple/src/core/interactor/brand/brand_interactor.h +++ b/examples/simple/src/core/controller/brand/brand_controller.h @@ -6,7 +6,7 @@ #include "brand/create_brand_dto.h" #include "brand/update_brand_dto.h" #include "event_dispatcher.h" -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include @@ -19,17 +19,17 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace Simple::Contracts::DTO::Brand; -namespace Simple::Interactor::Brand +namespace Simple::Controller::Brand { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT BrandInteractor : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT BrandController : public QObject { Q_OBJECT public: - explicit BrandInteractor(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, + explicit BrandController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static BrandInteractor *instance(); + static BrandController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -48,13 +48,13 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT BrandInteractor : public QObject QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - BrandInteractor() = delete; - BrandInteractor(const BrandInteractor &) = delete; - BrandInteractor &operator=(const BrandInteractor &) = delete; + BrandController() = delete; + BrandController(const BrandController &) = delete; + BrandController &operator=(const BrandController &) = delete; }; -} // namespace Simple::Interactor::Brand \ No newline at end of file +} // namespace Simple::Controller::Brand \ No newline at end of file diff --git a/examples/simple/src/core/interactor/brand/brand_signals.h b/examples/simple/src/core/controller/brand/brand_signals.h similarity index 80% rename from examples/simple/src/core/interactor/brand/brand_signals.h rename to examples/simple/src/core/controller/brand/brand_signals.h index 9d9877ab..15282af6 100644 --- a/examples/simple/src/core/interactor/brand/brand_signals.h +++ b/examples/simple/src/core/controller/brand/brand_signals.h @@ -2,18 +2,18 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include "brand/brand_dto.h" #include -namespace Simple::Interactor +namespace Simple::Controller { using namespace Simple::Contracts::DTO::Brand; -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT BrandSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT BrandSignals : public QObject { Q_OBJECT public: @@ -30,4 +30,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT BrandSignals : public QObject void getReplied(BrandDTO dto); void getAllReplied(QList dtoList); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/car/car_interactor.cpp b/examples/simple/src/core/controller/car/car_controller.cpp similarity index 89% rename from examples/simple/src/core/interactor/car/car_interactor.cpp rename to examples/simple/src/core/controller/car/car_controller.cpp index 7974eaa1..f29649fe 100644 --- a/examples/simple/src/core/interactor/car/car_interactor.cpp +++ b/examples/simple/src/core/controller/car/car_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "car_interactor.h" +#include "car_controller.h" #include "car/commands/create_car_command.h" #include "car/commands/create_car_command_handler.h" @@ -18,16 +18,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace Simple::Interactor; -using namespace Simple::Interactor::Car; +using namespace Simple::Controller; +using namespace Simple::Controller::Car; using namespace Simple::Application::Features::Car::Commands; using namespace Simple::Application::Features::Car::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer CarInteractor::s_instance = nullptr; +QPointer CarController::s_instance = nullptr; -CarInteractor::CarInteractor(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, +CarController::CarController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} { @@ -40,12 +40,12 @@ CarInteractor::CarInteractor(InterfaceRepositoryProvider *repositoryProvider, Th s_instance = this; } -CarInteractor *CarInteractor::instance() +CarController *CarController::instance() { return s_instance.data(); } -QCoro::Task CarInteractor::get(int id) const +QCoro::Task CarController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -78,7 +78,7 @@ QCoro::Task CarInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task CarInteractor::getWithDetails(int id) const +QCoro::Task CarController::getWithDetails(int id) const { auto queryCommand = new QueryCommand("getWithDetails"_L1); @@ -111,7 +111,7 @@ QCoro::Task CarInteractor::getWithDetails(int id) const co_return optional_result.value(); } -QCoro::Task> CarInteractor::getAll() const +QCoro::Task> CarController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -141,7 +141,7 @@ QCoro::Task> CarInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task CarInteractor::create(const CreateCarDTO &dto) +QCoro::Task CarController::create(const CreateCarDTO &dto) { CreateCarCommand query; @@ -159,7 +159,7 @@ QCoro::Task CarInteractor::create(const CreateCarDTO &dto) // Create specialized UndoRedoCommand auto command = - new AlterCommand(CarInteractor::tr("Create car"), handler, query); + new AlterCommand(CarController::tr("Create car"), handler, query); // push command m_undo_redo_system->push(command, "car"_L1); @@ -176,7 +176,7 @@ QCoro::Task CarInteractor::create(const CreateCarDTO &dto) co_return optional_result.value(); } -QCoro::Task CarInteractor::update(const UpdateCarDTO &dto) +QCoro::Task CarController::update(const UpdateCarDTO &dto) { UpdateCarCommand query; @@ -194,7 +194,7 @@ QCoro::Task CarInteractor::update(const UpdateCarDTO &dto) // Create specialized UndoRedoCommand auto command = - new AlterCommand(CarInteractor::tr("Update car"), handler, query); + new AlterCommand(CarController::tr("Update car"), handler, query); // push command m_undo_redo_system->push(command, "car"_L1); @@ -211,7 +211,7 @@ QCoro::Task CarInteractor::update(const UpdateCarDTO &dto) co_return optional_result.value(); } -QCoro::Task CarInteractor::remove(int id) +QCoro::Task CarController::remove(int id) { RemoveCarCommand query; @@ -226,7 +226,7 @@ QCoro::Task CarInteractor::remove(int id) // Create specialized UndoRedoCommand auto command = - new AlterCommand(CarInteractor::tr("Remove car"), handler, query); + new AlterCommand(CarController::tr("Remove car"), handler, query); // push command m_undo_redo_system->push(command, "car"_L1); @@ -243,12 +243,12 @@ QCoro::Task CarInteractor::remove(int id) co_return true; } -CreateCarDTO CarInteractor::getCreateDTO() +CreateCarDTO CarController::getCreateDTO() { return CreateCarDTO(); } -UpdateCarDTO CarInteractor::getUpdateDTO() +UpdateCarDTO CarController::getUpdateDTO() { return UpdateCarDTO(); } diff --git a/examples/simple/src/core/interactor/car/car_interactor.h b/examples/simple/src/core/controller/car/car_controller.h similarity index 76% rename from examples/simple/src/core/interactor/car/car_interactor.h rename to examples/simple/src/core/controller/car/car_controller.h index 44cb14f1..55590426 100644 --- a/examples/simple/src/core/interactor/car/car_interactor.h +++ b/examples/simple/src/core/controller/car/car_controller.h @@ -7,7 +7,7 @@ #include "car/create_car_dto.h" #include "car/update_car_dto.h" #include "event_dispatcher.h" -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include @@ -20,17 +20,17 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace Simple::Contracts::DTO::Car; -namespace Simple::Interactor::Car +namespace Simple::Controller::Car { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CarInteractor : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT CarController : public QObject { Q_OBJECT public: - explicit CarInteractor(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, + explicit CarController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static CarInteractor *instance(); + static CarController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -51,13 +51,13 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CarInteractor : public QObject QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - CarInteractor() = delete; - CarInteractor(const CarInteractor &) = delete; - CarInteractor &operator=(const CarInteractor &) = delete; + CarController() = delete; + CarController(const CarController &) = delete; + CarController &operator=(const CarController &) = delete; }; -} // namespace Simple::Interactor::Car \ No newline at end of file +} // namespace Simple::Controller::Car \ No newline at end of file diff --git a/examples/simple/src/core/interactor/car/car_signals.h b/examples/simple/src/core/controller/car/car_signals.h similarity index 84% rename from examples/simple/src/core/interactor/car/car_signals.h rename to examples/simple/src/core/controller/car/car_signals.h index 02a2b18e..3e8bcca7 100644 --- a/examples/simple/src/core/interactor/car/car_signals.h +++ b/examples/simple/src/core/controller/car/car_signals.h @@ -2,7 +2,7 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include "car/car_with_details_dto.h" @@ -12,12 +12,12 @@ #include -namespace Simple::Interactor +namespace Simple::Controller { using namespace Simple::Contracts::DTO::Car; -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CarSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT CarSignals : public QObject { Q_OBJECT public: @@ -38,4 +38,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CarSignals : public QObject void relationInserted(CarRelationDTO dto); void relationRemoved(CarRelationDTO dto); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/client/client_interactor.cpp b/examples/simple/src/core/controller/client/client_controller.cpp similarity index 89% rename from examples/simple/src/core/interactor/client/client_interactor.cpp rename to examples/simple/src/core/controller/client/client_controller.cpp index 520a4a4b..8ad7de58 100644 --- a/examples/simple/src/core/interactor/client/client_interactor.cpp +++ b/examples/simple/src/core/controller/client/client_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "client_interactor.h" +#include "client_controller.h" #include "client/commands/create_client_command.h" #include "client/commands/create_client_command_handler.h" @@ -18,16 +18,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace Simple::Interactor; -using namespace Simple::Interactor::Client; +using namespace Simple::Controller; +using namespace Simple::Controller::Client; using namespace Simple::Application::Features::Client::Commands; using namespace Simple::Application::Features::Client::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer ClientInteractor::s_instance = nullptr; +QPointer ClientController::s_instance = nullptr; -ClientInteractor::ClientInteractor(InterfaceRepositoryProvider *repositoryProvider, +ClientController::ClientController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -41,12 +41,12 @@ ClientInteractor::ClientInteractor(InterfaceRepositoryProvider *repositoryProvid s_instance = this; } -ClientInteractor *ClientInteractor::instance() +ClientController *ClientController::instance() { return s_instance.data(); } -QCoro::Task ClientInteractor::get(int id) const +QCoro::Task ClientController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -79,7 +79,7 @@ QCoro::Task ClientInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task ClientInteractor::getWithDetails(int id) const +QCoro::Task ClientController::getWithDetails(int id) const { auto queryCommand = new QueryCommand("getWithDetails"_L1); @@ -112,7 +112,7 @@ QCoro::Task ClientInteractor::getWithDetails(int id) const co_return optional_result.value(); } -QCoro::Task> ClientInteractor::getAll() const +QCoro::Task> ClientController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -142,7 +142,7 @@ QCoro::Task> ClientInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task ClientInteractor::create(const CreateClientDTO &dto) +QCoro::Task ClientController::create(const CreateClientDTO &dto) { CreateClientCommand query; @@ -161,7 +161,7 @@ QCoro::Task ClientInteractor::create(const CreateClientDTO &dto) // Create specialized UndoRedoCommand auto command = new AlterCommand( - ClientInteractor::tr("Create client"), handler, query); + ClientController::tr("Create client"), handler, query); // push command m_undo_redo_system->push(command, "client"_L1); @@ -178,7 +178,7 @@ QCoro::Task ClientInteractor::create(const CreateClientDTO &dto) co_return optional_result.value(); } -QCoro::Task ClientInteractor::update(const UpdateClientDTO &dto) +QCoro::Task ClientController::update(const UpdateClientDTO &dto) { UpdateClientCommand query; @@ -196,7 +196,7 @@ QCoro::Task ClientInteractor::update(const UpdateClientDTO &dto) // Create specialized UndoRedoCommand auto command = new AlterCommand( - ClientInteractor::tr("Update client"), handler, query); + ClientController::tr("Update client"), handler, query); // push command m_undo_redo_system->push(command, "client"_L1); @@ -213,7 +213,7 @@ QCoro::Task ClientInteractor::update(const UpdateClientDTO &dto) co_return optional_result.value(); } -QCoro::Task ClientInteractor::remove(int id) +QCoro::Task ClientController::remove(int id) { RemoveClientCommand query; @@ -228,7 +228,7 @@ QCoro::Task ClientInteractor::remove(int id) // Create specialized UndoRedoCommand auto command = new AlterCommand( - ClientInteractor::tr("Remove client"), handler, query); + ClientController::tr("Remove client"), handler, query); // push command m_undo_redo_system->push(command, "client"_L1); @@ -245,12 +245,12 @@ QCoro::Task ClientInteractor::remove(int id) co_return true; } -CreateClientDTO ClientInteractor::getCreateDTO() +CreateClientDTO ClientController::getCreateDTO() { return CreateClientDTO(); } -UpdateClientDTO ClientInteractor::getUpdateDTO() +UpdateClientDTO ClientController::getUpdateDTO() { return UpdateClientDTO(); } diff --git a/examples/simple/src/core/interactor/client/client_interactor.h b/examples/simple/src/core/controller/client/client_controller.h similarity index 76% rename from examples/simple/src/core/interactor/client/client_interactor.h rename to examples/simple/src/core/controller/client/client_controller.h index 25ad4810..02f02ce2 100644 --- a/examples/simple/src/core/interactor/client/client_interactor.h +++ b/examples/simple/src/core/controller/client/client_controller.h @@ -7,7 +7,7 @@ #include "client/create_client_dto.h" #include "client/update_client_dto.h" #include "event_dispatcher.h" -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include @@ -20,17 +20,17 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace Simple::Contracts::DTO::Client; -namespace Simple::Interactor::Client +namespace Simple::Controller::Client { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ClientInteractor : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT ClientController : public QObject { Q_OBJECT public: - explicit ClientInteractor(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, + explicit ClientController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static ClientInteractor *instance(); + static ClientController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -51,13 +51,13 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ClientInteractor : public QObject QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - ClientInteractor() = delete; - ClientInteractor(const ClientInteractor &) = delete; - ClientInteractor &operator=(const ClientInteractor &) = delete; + ClientController() = delete; + ClientController(const ClientController &) = delete; + ClientController &operator=(const ClientController &) = delete; }; -} // namespace Simple::Interactor::Client \ No newline at end of file +} // namespace Simple::Controller::Client \ No newline at end of file diff --git a/examples/simple/src/core/interactor/client/client_signals.h b/examples/simple/src/core/controller/client/client_signals.h similarity index 84% rename from examples/simple/src/core/interactor/client/client_signals.h rename to examples/simple/src/core/controller/client/client_signals.h index ff6c0045..3b05e68d 100644 --- a/examples/simple/src/core/interactor/client/client_signals.h +++ b/examples/simple/src/core/controller/client/client_signals.h @@ -2,7 +2,7 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include "client/client_with_details_dto.h" @@ -12,12 +12,12 @@ #include -namespace Simple::Interactor +namespace Simple::Controller { using namespace Simple::Contracts::DTO::Client; -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ClientSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT ClientSignals : public QObject { Q_OBJECT public: @@ -38,4 +38,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ClientSignals : public QObject void relationInserted(ClientRelationDTO dto); void relationRemoved(ClientRelationDTO dto); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/interactor_registration.cpp b/examples/simple/src/core/controller/controller_registration.cpp similarity index 86% rename from examples/simple/src/core/interactor/interactor_registration.cpp rename to examples/simple/src/core/controller/controller_registration.cpp index d84b457d..be4a18f4 100644 --- a/examples/simple/src/core/interactor/interactor_registration.cpp +++ b/examples/simple/src/core/controller/controller_registration.cpp @@ -1,20 +1,20 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "interactor_registration.h" -#include "brand/brand_interactor.h" -#include "car/car_interactor.h" -#include "client/client_interactor.h" -#include "custom/custom_interactor.h" +#include "controller_registration.h" +#include "brand/brand_controller.h" +#include "car/car_controller.h" +#include "client/client_controller.h" +#include "custom/custom_controller.h" #include "event_dispatcher.h" -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include #include #include -using namespace Simple::Interactor; +using namespace Simple::Controller; -InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceRepositoryProvider *repositoryProvider) +ControllerRegistration::ControllerRegistration(QObject *parent, InterfaceRepositoryProvider *repositoryProvider) : QObject{parent} { @@ -42,9 +42,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit Q_EMIT dispatcher->error()->warningSent(error); }); - // CarInteractor + // CarController - new Car::CarInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Car::CarController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *carSignalHolder = repositoryProvider->repository("Car")->signalHolder(); @@ -57,9 +57,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit &Qleany::Contracts::Repository::SignalHolder::activeStatusChanged, dispatcher->car(), &CarSignals::activeStatusChanged); - // BrandInteractor + // BrandController - new Brand::BrandInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Brand::BrandController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *brandSignalHolder = repositoryProvider->repository("Brand")->signalHolder(); @@ -80,9 +80,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit &Qleany::Contracts::Repository::SignalHolder::activeStatusChanged, dispatcher->brand(), &BrandSignals::activeStatusChanged); - // PassengerInteractor + // PassengerController - new Passenger::PassengerInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Passenger::PassengerController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *passengerSignalHolder = repositoryProvider->repository("Passenger")->signalHolder(); @@ -115,9 +115,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit &Qleany::Contracts::Repository::SignalHolder::activeStatusChanged, dispatcher->passenger(), &PassengerSignals::activeStatusChanged); - // ClientInteractor + // ClientController - new Client::ClientInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Client::ClientController(repositoryProvider, undoRedoSystem, dispatcher); SignalHolder *clientSignalHolder = repositoryProvider->repository("Client")->signalHolder(); @@ -130,11 +130,11 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit &Qleany::Contracts::Repository::SignalHolder::activeStatusChanged, dispatcher->client(), &ClientSignals::activeStatusChanged); - // CustomInteractor + // CustomController - new Custom::CustomInteractor(repositoryProvider, undoRedoSystem, dispatcher); + new Custom::CustomController(repositoryProvider, undoRedoSystem, dispatcher); } -InteractorRegistration::~InteractorRegistration() +ControllerRegistration::~ControllerRegistration() { } \ No newline at end of file diff --git a/examples/simple/src/core/interactor/interactor_registration.h b/examples/simple/src/core/controller/controller_registration.h similarity index 63% rename from examples/simple/src/core/interactor/interactor_registration.h rename to examples/simple/src/core/controller/controller_registration.h index 8cf1f88d..16c9b146 100644 --- a/examples/simple/src/core/interactor/interactor_registration.h +++ b/examples/simple/src/core/controller/controller_registration.h @@ -3,22 +3,22 @@ #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include -namespace Simple::Interactor +namespace Simple::Controller { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT InteractorRegistration : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT ControllerRegistration : public QObject { Q_OBJECT public: - explicit InteractorRegistration(QObject *parent, + explicit ControllerRegistration(QObject *parent, Qleany::Contracts::Repository::InterfaceRepositoryProvider *repositoryProvider); - ~InteractorRegistration(); + ~ControllerRegistration(); private: }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/controller/controllers.cmake b/examples/simple/src/core/controller/controllers.cmake new file mode 100755 index 00000000..136629b3 --- /dev/null +++ b/examples/simple/src/core/controller/controllers.cmake @@ -0,0 +1,22 @@ +# This file was generated automatically by Qleany's generator, edit at your own risk! +# If you do, be careful to not overwrite it when you run the generator again. +set(CONTROLLER_LIST + car/car_controller.h + car/car_controller.cpp + car/car_signals.h + brand/brand_controller.h + brand/brand_controller.cpp + brand/brand_signals.h + passenger/passenger_controller.h + passenger/passenger_controller.cpp + passenger/passenger_signals.h + client/client_controller.h + client/client_controller.cpp + client/client_signals.h + custom/custom_controller.h + custom/custom_controller.cpp + custom/custom_signals.h + undo_redo/undo_redo_controller.h + undo_redo/undo_redo_controller.cpp + undo_redo/undo_redo_signals.h +) \ No newline at end of file diff --git a/examples/simple/src/core/interactor/custom/custom_interactor.cpp b/examples/simple/src/core/controller/custom/custom_controller.cpp similarity index 88% rename from examples/simple/src/core/interactor/custom/custom_interactor.cpp rename to examples/simple/src/core/controller/custom/custom_controller.cpp index 83fbbbde..2fa908e9 100644 --- a/examples/simple/src/core/interactor/custom/custom_interactor.cpp +++ b/examples/simple/src/core/controller/custom/custom_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "custom_interactor.h" +#include "custom_controller.h" #include "custom/commands/close_system_command.h" #include "custom/commands/close_system_command_handler.h" @@ -15,16 +15,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace Simple::Interactor; -using namespace Simple::Interactor::Custom; +using namespace Simple::Controller; +using namespace Simple::Controller::Custom; using namespace Simple::Application::Features::Custom::Commands; using namespace Simple::Application::Features::Custom::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer CustomInteractor::s_instance = nullptr; +QPointer CustomController::s_instance = nullptr; -CustomInteractor::CustomInteractor(InterfaceRepositoryProvider *repositoryProvider, +CustomController::CustomController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -38,12 +38,12 @@ CustomInteractor::CustomInteractor(InterfaceRepositoryProvider *repositoryProvid s_instance = this; } -CustomInteractor *CustomInteractor::instance() +CustomController *CustomController::instance() { return s_instance.data(); } -QCoro::Task<> CustomInteractor::writeRandomThings(WriteRandomThingsDTO dto) +QCoro::Task<> CustomController::writeRandomThings(WriteRandomThingsDTO dto) { WriteRandomThingsCommand query; @@ -70,7 +70,7 @@ QCoro::Task<> CustomInteractor::writeRandomThings(WriteRandomThingsDTO dto) // Create specialized UndoRedoCommand auto command = new AlterCommand( - CustomInteractor::tr("Doing WriteRandomThings"), handler, query); + CustomController::tr("Doing WriteRandomThings"), handler, query); // set progress minimum duration command->setProgressMinimumDuration(1000); @@ -82,7 +82,7 @@ QCoro::Task<> CustomInteractor::writeRandomThings(WriteRandomThingsDTO dto) co_return; } -QCoro::Task<> CustomInteractor::runLongOperation() +QCoro::Task<> CustomController::runLongOperation() { RunLongOperationCommand query; @@ -97,7 +97,7 @@ QCoro::Task<> CustomInteractor::runLongOperation() // Create specialized UndoRedoCommand auto command = new AlterCommand( - CustomInteractor::tr("Doing RunLongOperation"), handler, query); + CustomController::tr("Doing RunLongOperation"), handler, query); // set progress minimum duration command->setProgressMinimumDuration(1000); @@ -109,7 +109,7 @@ QCoro::Task<> CustomInteractor::runLongOperation() co_return; } -QCoro::Task<> CustomInteractor::closeSystem() +QCoro::Task<> CustomController::closeSystem() { CloseSystemCommand query; @@ -134,7 +134,7 @@ QCoro::Task<> CustomInteractor::closeSystem() // Create specialized UndoRedoCommand auto command = new AlterCommand( - CustomInteractor::tr("Doing CloseSystem"), handler, query); + CustomController::tr("Doing CloseSystem"), handler, query); // set progress minimum duration command->setProgressMinimumDuration(1000); @@ -146,7 +146,7 @@ QCoro::Task<> CustomInteractor::closeSystem() co_return; } -QCoro::Task CustomInteractor::getCurrentTime() const +QCoro::Task CustomController::getCurrentTime() const { auto queryCommand = new QueryCommand("GetCurrentTime"_L1); diff --git a/examples/simple/src/core/interactor/custom/custom_interactor.h b/examples/simple/src/core/controller/custom/custom_controller.h similarity index 71% rename from examples/simple/src/core/interactor/custom/custom_interactor.h rename to examples/simple/src/core/controller/custom/custom_controller.h index 35493db4..2402b648 100644 --- a/examples/simple/src/core/interactor/custom/custom_interactor.h +++ b/examples/simple/src/core/controller/custom/custom_controller.h @@ -4,7 +4,7 @@ #include "custom/write_random_things_dto.h" #include "event_dispatcher.h" -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include "custom/get_current_time_reply_dto.h" @@ -18,17 +18,17 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace Simple::Contracts::DTO::Custom; -namespace Simple::Interactor::Custom +namespace Simple::Controller::Custom { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CustomInteractor : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT CustomController : public QObject { Q_OBJECT public: - explicit CustomInteractor(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, + explicit CustomController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static CustomInteractor *instance(); + static CustomController *instance(); Q_INVOKABLE QCoro::Task getCurrentTime() const; @@ -41,13 +41,13 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CustomInteractor : public QObject QCoro::Task<> closeSystem(); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - CustomInteractor() = delete; - CustomInteractor(const CustomInteractor &) = delete; - CustomInteractor &operator=(const CustomInteractor &) = delete; + CustomController() = delete; + CustomController(const CustomController &) = delete; + CustomController &operator=(const CustomController &) = delete; }; -} // namespace Simple::Interactor::Custom \ No newline at end of file +} // namespace Simple::Controller::Custom \ No newline at end of file diff --git a/examples/simple/src/core/interactor/custom/custom_signals.h b/examples/simple/src/core/controller/custom/custom_signals.h similarity index 77% rename from examples/simple/src/core/interactor/custom/custom_signals.h rename to examples/simple/src/core/controller/custom/custom_signals.h index 1bc80179..d4bfce5a 100644 --- a/examples/simple/src/core/interactor/custom/custom_signals.h +++ b/examples/simple/src/core/controller/custom/custom_signals.h @@ -2,18 +2,18 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include "custom/get_current_time_reply_dto.h" #include -namespace Simple::Interactor +namespace Simple::Controller { using namespace Simple::Contracts::DTO::Custom; -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CustomSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT CustomSignals : public QObject { Q_OBJECT public: @@ -27,4 +27,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT CustomSignals : public QObject void closeSystemChanged(); void getCurrentTimeReplied(GetCurrentTimeReplyDTO dto); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/error_signals.h b/examples/simple/src/core/controller/error_signals.h similarity index 63% rename from examples/simple/src/core/interactor/error_signals.h rename to examples/simple/src/core/controller/error_signals.h index f56a25f1..edc134d6 100644 --- a/examples/simple/src/core/interactor/error_signals.h +++ b/examples/simple/src/core/controller/error_signals.h @@ -1,13 +1,13 @@ #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include -namespace Simple::Interactor +namespace Simple::Controller { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ErrorSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT ErrorSignals : public QObject { Q_OBJECT public: @@ -19,4 +19,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ErrorSignals : public QObject void warningSent(const Qleany::Error &error); void errorSent(const Qleany::Error &error); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/event_dispatcher.cpp b/examples/simple/src/core/controller/event_dispatcher.cpp similarity index 97% rename from examples/simple/src/core/interactor/event_dispatcher.cpp rename to examples/simple/src/core/controller/event_dispatcher.cpp index 9f08aa84..07937177 100644 --- a/examples/simple/src/core/interactor/event_dispatcher.cpp +++ b/examples/simple/src/core/controller/event_dispatcher.cpp @@ -1,6 +1,6 @@ #include "event_dispatcher.h" -using namespace Simple::Interactor; +using namespace Simple::Controller; QPointer EventDispatcher::s_instance = nullptr; diff --git a/examples/simple/src/core/interactor/event_dispatcher.h b/examples/simple/src/core/controller/event_dispatcher.h similarity index 88% rename from examples/simple/src/core/interactor/event_dispatcher.h rename to examples/simple/src/core/controller/event_dispatcher.h index 3f7eb81c..68c11b83 100644 --- a/examples/simple/src/core/interactor/event_dispatcher.h +++ b/examples/simple/src/core/controller/event_dispatcher.h @@ -2,7 +2,7 @@ #include "error_signals.h" #include "progress_signals.h" -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include "undo_redo/undo_redo_signals.h" @@ -19,9 +19,9 @@ #include #include -namespace Simple::Interactor +namespace Simple::Controller { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT EventDispatcher : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT EventDispatcher : public QObject { Q_OBJECT public: @@ -63,4 +63,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT EventDispatcher : public QObject EventDispatcher(const EventDispatcher &) = delete; EventDispatcher &operator=(const EventDispatcher &) = delete; }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/passenger/passenger_interactor.cpp b/examples/simple/src/core/controller/passenger/passenger_controller.cpp similarity index 89% rename from examples/simple/src/core/interactor/passenger/passenger_interactor.cpp rename to examples/simple/src/core/controller/passenger/passenger_controller.cpp index 08fbd34f..63a3b465 100644 --- a/examples/simple/src/core/interactor/passenger/passenger_interactor.cpp +++ b/examples/simple/src/core/controller/passenger/passenger_controller.cpp @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "passenger_interactor.h" +#include "passenger_controller.h" #include "passenger/commands/create_passenger_command.h" #include "passenger/commands/create_passenger_command_handler.h" @@ -15,16 +15,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace Simple::Interactor; -using namespace Simple::Interactor::Passenger; +using namespace Simple::Controller; +using namespace Simple::Controller::Passenger; using namespace Simple::Application::Features::Passenger::Commands; using namespace Simple::Application::Features::Passenger::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer PassengerInteractor::s_instance = nullptr; +QPointer PassengerController::s_instance = nullptr; -PassengerInteractor::PassengerInteractor(InterfaceRepositoryProvider *repositoryProvider, +PassengerController::PassengerController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -38,12 +38,12 @@ PassengerInteractor::PassengerInteractor(InterfaceRepositoryProvider *repository s_instance = this; } -PassengerInteractor *PassengerInteractor::instance() +PassengerController *PassengerController::instance() { return s_instance.data(); } -QCoro::Task PassengerInteractor::get(int id) const +QCoro::Task PassengerController::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -76,7 +76,7 @@ QCoro::Task PassengerInteractor::get(int id) const co_return optional_result.value(); } -QCoro::Task> PassengerInteractor::getAll() const +QCoro::Task> PassengerController::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -106,7 +106,7 @@ QCoro::Task> PassengerInteractor::getAll() const co_return optional_result.value(); } -QCoro::Task PassengerInteractor::create(const CreatePassengerDTO &dto) +QCoro::Task PassengerController::create(const CreatePassengerDTO &dto) { CreatePassengerCommand query; @@ -138,7 +138,7 @@ QCoro::Task PassengerInteractor::create(const CreatePassengerDTO & // Create specialized UndoRedoCommand auto command = new AlterCommand( - PassengerInteractor::tr("Create passenger"), handler, query); + PassengerController::tr("Create passenger"), handler, query); // push command m_undo_redo_system->push(command, "passenger"_L1); @@ -155,7 +155,7 @@ QCoro::Task PassengerInteractor::create(const CreatePassengerDTO & co_return optional_result.value(); } -QCoro::Task PassengerInteractor::update(const UpdatePassengerDTO &dto) +QCoro::Task PassengerController::update(const UpdatePassengerDTO &dto) { UpdatePassengerCommand query; @@ -173,7 +173,7 @@ QCoro::Task PassengerInteractor::update(const UpdatePassengerDTO & // Create specialized UndoRedoCommand auto command = new AlterCommand( - PassengerInteractor::tr("Update passenger"), handler, query); + PassengerController::tr("Update passenger"), handler, query); // push command m_undo_redo_system->push(command, "passenger"_L1); @@ -190,7 +190,7 @@ QCoro::Task PassengerInteractor::update(const UpdatePassengerDTO & co_return optional_result.value(); } -QCoro::Task PassengerInteractor::remove(int id) +QCoro::Task PassengerController::remove(int id) { RemovePassengerCommand query; @@ -205,7 +205,7 @@ QCoro::Task PassengerInteractor::remove(int id) // Create specialized UndoRedoCommand auto command = new AlterCommand( - PassengerInteractor::tr("Remove passenger"), handler, query); + PassengerController::tr("Remove passenger"), handler, query); // push command m_undo_redo_system->push(command, "passenger"_L1); @@ -222,12 +222,12 @@ QCoro::Task PassengerInteractor::remove(int id) co_return true; } -CreatePassengerDTO PassengerInteractor::getCreateDTO() +CreatePassengerDTO PassengerController::getCreateDTO() { return CreatePassengerDTO(); } -UpdatePassengerDTO PassengerInteractor::getUpdateDTO() +UpdatePassengerDTO PassengerController::getUpdateDTO() { return UpdatePassengerDTO(); } diff --git a/examples/simple/src/core/interactor/passenger/passenger_interactor.h b/examples/simple/src/core/controller/passenger/passenger_controller.h similarity index 75% rename from examples/simple/src/core/interactor/passenger/passenger_interactor.h rename to examples/simple/src/core/controller/passenger/passenger_controller.h index 954fe440..20c0084f 100644 --- a/examples/simple/src/core/interactor/passenger/passenger_interactor.h +++ b/examples/simple/src/core/controller/passenger/passenger_controller.h @@ -6,7 +6,7 @@ #include "passenger/create_passenger_dto.h" #include "passenger/passenger_dto.h" #include "passenger/update_passenger_dto.h" -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include @@ -19,18 +19,18 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace Simple::Contracts::DTO::Passenger; -namespace Simple::Interactor::Passenger +namespace Simple::Controller::Passenger { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT PassengerInteractor : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT PassengerController : public QObject { Q_OBJECT public: - explicit PassengerInteractor(InterfaceRepositoryProvider *repositoryProvider, + explicit PassengerController(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static PassengerInteractor *instance(); + static PassengerController *instance(); Q_INVOKABLE QCoro::Task get(int id) const; @@ -49,13 +49,13 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT PassengerInteractor : public QObject QCoro::Task remove(int id); private: - static QPointer s_instance; + static QPointer s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - PassengerInteractor() = delete; - PassengerInteractor(const PassengerInteractor &) = delete; - PassengerInteractor &operator=(const PassengerInteractor &) = delete; + PassengerController() = delete; + PassengerController(const PassengerController &) = delete; + PassengerController &operator=(const PassengerController &) = delete; }; -} // namespace Simple::Interactor::Passenger \ No newline at end of file +} // namespace Simple::Controller::Passenger \ No newline at end of file diff --git a/examples/simple/src/core/interactor/passenger/passenger_signals.h b/examples/simple/src/core/controller/passenger/passenger_signals.h similarity index 81% rename from examples/simple/src/core/interactor/passenger/passenger_signals.h rename to examples/simple/src/core/controller/passenger/passenger_signals.h index 42976ffa..9f18f7f9 100644 --- a/examples/simple/src/core/interactor/passenger/passenger_signals.h +++ b/examples/simple/src/core/controller/passenger/passenger_signals.h @@ -2,18 +2,18 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include "passenger/passenger_dto.h" #include -namespace Simple::Interactor +namespace Simple::Controller { using namespace Simple::Contracts::DTO::Passenger; -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT PassengerSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT PassengerSignals : public QObject { Q_OBJECT public: @@ -30,4 +30,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT PassengerSignals : public QObject void getReplied(PassengerDTO dto); void getAllReplied(QList dtoList); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/progress_signals.h b/examples/simple/src/core/controller/progress_signals.h similarity index 90% rename from examples/simple/src/core/interactor/progress_signals.h rename to examples/simple/src/core/controller/progress_signals.h index 8e676fe0..6c06acba 100644 --- a/examples/simple/src/core/interactor/progress_signals.h +++ b/examples/simple/src/core/controller/progress_signals.h @@ -1,14 +1,14 @@ #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include #include -namespace Simple::Interactor +namespace Simple::Controller { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ProgressSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT ProgressSignals : public QObject { Q_OBJECT public: @@ -37,4 +37,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT ProgressSignals : public QObject void progressTextChanged(const QString &progressText); void progressValueChanged(int progressValue); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/undo_redo/undo_redo_interactor.cpp b/examples/simple/src/core/controller/undo_redo/undo_redo_controller.cpp similarity index 63% rename from examples/simple/src/core/interactor/undo_redo/undo_redo_interactor.cpp rename to examples/simple/src/core/controller/undo_redo/undo_redo_controller.cpp index a7b45168..6eef421d 100644 --- a/examples/simple/src/core/interactor/undo_redo/undo_redo_interactor.cpp +++ b/examples/simple/src/core/controller/undo_redo/undo_redo_controller.cpp @@ -1,16 +1,16 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "undo_redo_interactor.h" +#include "undo_redo_controller.h" #include -using namespace Simple::Interactor; -using namespace Simple::Interactor::UndoRedo; +using namespace Simple::Controller; +using namespace Simple::Controller::UndoRedo; using namespace Qleany::Tools::UndoRedo; -QPointer UndoRedoInteractor::s_instance = nullptr; +QPointer UndoRedoController::s_instance = nullptr; -UndoRedoInteractor::UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, +UndoRedoController::UndoRedoController(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} { @@ -28,102 +28,102 @@ UndoRedoInteractor::UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, s_instance = this; } -UndoRedoInteractor *UndoRedoInteractor::instance() +UndoRedoController *UndoRedoController::instance() { return s_instance.data(); } -bool UndoRedoInteractor::canUndo() const +bool UndoRedoController::canUndo() const { return m_undo_redo_system->canUndo(); } -bool UndoRedoInteractor::canRedo() const +bool UndoRedoController::canRedo() const { return m_undo_redo_system->canRedo(); } -void UndoRedoInteractor::setUndoLimit(int limit) +void UndoRedoController::setUndoLimit(int limit) { m_undo_redo_system->setUndoLimit(limit); } -int UndoRedoInteractor::undoLimit() const +int UndoRedoController::undoLimit() const { return m_undo_redo_system->undoLimit(); } -QString UndoRedoInteractor::undoText() const +QString UndoRedoController::undoText() const { return m_undo_redo_system->undoText(); } -QString UndoRedoInteractor::redoText() const +QString UndoRedoController::redoText() const { return m_undo_redo_system->redoText(); } -QStringList UndoRedoInteractor::undoRedoTextList() const +QStringList UndoRedoController::undoRedoTextList() const { return m_undo_redo_system->undoRedoTextList(); } -int UndoRedoInteractor::currentIndex() const +int UndoRedoController::currentIndex() const { return m_undo_redo_system->currentIndex(); } -QUuid UndoRedoInteractor::activeStackId() const +QUuid UndoRedoController::activeStackId() const { return m_undo_redo_system->activeStackId(); } -QStringList UndoRedoInteractor::queuedCommandTextListByScope(const QString &scopeFlagString) const +QStringList UndoRedoController::queuedCommandTextListByScope(const QString &scopeFlagString) const { return m_undo_redo_system->queuedCommandTextListByScope(scopeFlagString); } -bool UndoRedoInteractor::isRunning() const +bool UndoRedoController::isRunning() const { return m_undo_redo_system->isRunning(); } -int UndoRedoInteractor::numberOfCommands() const +int UndoRedoController::numberOfCommands() const { return m_undo_redo_system->numberOfCommands(); } -QAction *UndoRedoInteractor::createUndoAction(QObject *parent, const QString &prefix) const +QAction *UndoRedoController::createUndoAction(QObject *parent, const QString &prefix) const { return m_undo_redo_system->createUndoAction(parent, prefix); } -QAction *UndoRedoInteractor::createRedoAction(QObject *parent, const QString &prefix) const +QAction *UndoRedoController::createRedoAction(QObject *parent, const QString &prefix) const { return m_undo_redo_system->createRedoAction(parent, prefix); } -void UndoRedoInteractor::undo() +void UndoRedoController::undo() { return m_undo_redo_system->undo(); } -void UndoRedoInteractor::redo() +void UndoRedoController::redo() { return m_undo_redo_system->redo(); } -void UndoRedoInteractor::clear() +void UndoRedoController::clear() { return m_undo_redo_system->clear(); } -void UndoRedoInteractor::setCurrentIndex(int index) +void UndoRedoController::setCurrentIndex(int index) { return m_undo_redo_system->setCurrentIndex(index); } -void UndoRedoInteractor::setActiveStack(const QUuid &stackId) +void UndoRedoController::setActiveStack(const QUuid &stackId) { return m_undo_redo_system->setActiveStack(stackId); } \ No newline at end of file diff --git a/examples/simple/src/core/interactor/undo_redo/undo_redo_interactor.h b/examples/simple/src/core/controller/undo_redo/undo_redo_controller.h similarity index 75% rename from examples/simple/src/core/interactor/undo_redo/undo_redo_interactor.h rename to examples/simple/src/core/controller/undo_redo/undo_redo_controller.h index 8fddced7..2a832721 100644 --- a/examples/simple/src/core/interactor/undo_redo/undo_redo_interactor.h +++ b/examples/simple/src/core/controller/undo_redo/undo_redo_controller.h @@ -3,7 +3,7 @@ #pragma once #include "event_dispatcher.h" -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include @@ -13,17 +13,17 @@ using namespace Qleany::Tools::UndoRedo; -namespace Simple::Interactor::UndoRedo +namespace Simple::Controller::UndoRedo { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT UndoRedoInteractor : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT UndoRedoController : public QObject { Q_OBJECT public: - explicit UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, + explicit UndoRedoController(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static UndoRedoInteractor *instance(); + static UndoRedoController *instance(); Q_INVOKABLE bool canUndo() const; @@ -61,12 +61,12 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT UndoRedoInteractor : public QObject void setActiveStack(const QUuid &stackId = QUuid()); private: - static QPointer s_instance; + static QPointer s_instance; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - UndoRedoInteractor() = delete; - UndoRedoInteractor(const UndoRedoInteractor &) = delete; - UndoRedoInteractor &operator=(const UndoRedoInteractor &) = delete; + UndoRedoController() = delete; + UndoRedoController(const UndoRedoController &) = delete; + UndoRedoController &operator=(const UndoRedoController &) = delete; }; -} // namespace Simple::Interactor::UndoRedo \ No newline at end of file +} // namespace Simple::Controller::UndoRedo \ No newline at end of file diff --git a/examples/simple/src/core/interactor/undo_redo/undo_redo_signals.h b/examples/simple/src/core/controller/undo_redo/undo_redo_signals.h similarity index 84% rename from examples/simple/src/core/interactor/undo_redo/undo_redo_signals.h rename to examples/simple/src/core/controller/undo_redo/undo_redo_signals.h index 5a766cf2..ad19b485 100644 --- a/examples/simple/src/core/interactor/undo_redo/undo_redo_signals.h +++ b/examples/simple/src/core/controller/undo_redo/undo_redo_signals.h @@ -2,14 +2,14 @@ // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "simple_example_interactor_export.h" +#include "simple_example_controller_export.h" #include #include -namespace Simple::Interactor +namespace Simple::Controller { -class SIMPLE_EXAMPLE_INTERACTOR_EXPORT UndoRedoSignals : public QObject +class SIMPLE_EXAMPLE_CONTROLLER_EXPORT UndoRedoSignals : public QObject { Q_OBJECT public: @@ -40,4 +40,4 @@ class SIMPLE_EXAMPLE_INTERACTOR_EXPORT UndoRedoSignals : public QObject */ void undoing(Qleany::Tools::UndoRedo::Scope scope, bool active); }; -} // namespace Simple::Interactor \ No newline at end of file +} // namespace Simple::Controller \ No newline at end of file diff --git a/examples/simple/src/core/interactor/interactors.cmake b/examples/simple/src/core/interactor/interactors.cmake deleted file mode 100755 index 468c9754..00000000 --- a/examples/simple/src/core/interactor/interactors.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# This file was generated automatically by Qleany's generator, edit at your own risk! -# If you do, be careful to not overwrite it when you run the generator again. -set(INTERACTOR_LIST - car/car_interactor.h - car/car_interactor.cpp - car/car_signals.h - brand/brand_interactor.h - brand/brand_interactor.cpp - brand/brand_signals.h - passenger/passenger_interactor.h - passenger/passenger_interactor.cpp - passenger/passenger_signals.h - client/client_interactor.h - client/client_interactor.cpp - client/client_signals.h - custom/custom_interactor.h - custom/custom_interactor.cpp - custom/custom_signals.h - undo_redo/undo_redo_interactor.h - undo_redo/undo_redo_interactor.cpp - undo_redo/undo_redo_signals.h -) \ No newline at end of file diff --git a/examples/simple/src/gui/desktop_application/CMakeLists.txt b/examples/simple/src/gui/desktop_application/CMakeLists.txt index 16af4106..49b58470 100755 --- a/examples/simple/src/gui/desktop_application/CMakeLists.txt +++ b/examples/simple/src/gui/desktop_application/CMakeLists.txt @@ -28,6 +28,6 @@ target_link_libraries(${APP_NAME} PUBLIC Qt6::Core Qt6::Widgets Qt6::Concurrent target_link_libraries(${APP_NAME} PUBLIC qleany) target_link_libraries(${APP_NAME} PUBLIC simple-example-entities) target_link_libraries(${APP_NAME} PUBLIC simple-example-persistence) -target_link_libraries(${APP_NAME} PUBLIC simple-example-interactor) +target_link_libraries(${APP_NAME} PUBLIC simple-example-controller) target_link_libraries(${APP_NAME} PUBLIC simple-example-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core) diff --git a/examples/simple/src/gui/desktop_application/main.cpp b/examples/simple/src/gui/desktop_application/main.cpp index 38d841ec..a629e5c4 100755 --- a/examples/simple/src/gui/desktop_application/main.cpp +++ b/examples/simple/src/gui/desktop_application/main.cpp @@ -1,5 +1,5 @@ #include "entities_registration.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "mainwindow.h" #include "persistence_registration.h" #include @@ -11,7 +11,7 @@ int main(int argc, char *argv[]) new Simple::Entities::EntitiesRegistration(&a); auto *persistenceRegistration = new Simple::Persistence::PersistenceRegistration(&a); - new Simple::Interactor::InteractorRegistration(&a, persistenceRegistration->repositoryProvider()); + new Simple::Controller::ControllerRegistration(&a, persistenceRegistration->repositoryProvider()); MainWindow w; w.show(); diff --git a/examples/simple/src/gui/desktop_application/mainwindow.cpp b/examples/simple/src/gui/desktop_application/mainwindow.cpp index c145c823..f7af34ba 100755 --- a/examples/simple/src/gui/desktop_application/mainwindow.cpp +++ b/examples/simple/src/gui/desktop_application/mainwindow.cpp @@ -1,6 +1,6 @@ #include "mainwindow.h" -#include "car/car_interactor.h" -#include "passenger/passenger_interactor.h" +#include "car/car_controller.h" +#include "passenger/passenger_controller.h" #include "single_passenger.h" #include "ui_mainwindow.h" @@ -18,19 +18,19 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ui->carListView->setModel(m_carModel); connect(ui->addCarPushButton, &QPushButton::clicked, this, []() { - auto *carInteractor = Simple::Interactor::Car::CarInteractor::instance(); - auto create_DTO = carInteractor->getCreateDTO(); + auto *carController = Simple::Controller::Car::CarController::instance(); + auto create_DTO = carController->getCreateDTO(); create_DTO.setContent("Example car %1"_L1.arg(QString::number(QDateTime::currentMSecsSinceEpoch()))); - Simple::Interactor::Car::CarInteractor::instance()->create(create_DTO); + Simple::Controller::Car::CarController::instance()->create(create_DTO); }); connect(ui->removeCarPushButton, &QPushButton::clicked, this, [this]() { - auto *carInteractor = Simple::Interactor::Car::CarInteractor::instance(); + auto *carController = Simple::Controller::Car::CarController::instance(); if (!ui->carListView->currentIndex().isValid()) return; auto id = ui->carListView->currentIndex().data(Simple::Presenter::CarListModel::IdRole).toInt(); - carInteractor->remove(id); + carController->remove(id); }); // passengers @@ -38,13 +38,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ui->passengerListView->setModel(m_passengerModelFromCarPassengers); connect(ui->addPassengerPushButton, &QPushButton::clicked, this, []() { - auto *passengerInteractor = Simple::Interactor::Passenger::PassengerInteractor::instance(); - auto create_DTO = passengerInteractor->getCreateDTO(); + auto *passengerController = Simple::Controller::Passenger::PassengerController::instance(); + auto create_DTO = passengerController->getCreateDTO(); create_DTO.setName("Example passenger %1"_L1.arg(QString::number(QDateTime::currentMSecsSinceEpoch()))); create_DTO.setCarId(1); create_DTO.setPosition(-1); - Simple::Interactor::Passenger::PassengerInteractor::instance()->create(create_DTO); + Simple::Controller::Passenger::PassengerController::instance()->create(create_DTO); }); // remove on double clicking on passengerListView @@ -52,7 +52,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi if (!index.isValid()) return; auto id = index.data(Simple::Presenter::PassengerListModelFromCarPassengers::IdRole).toInt(); - Simple::Interactor::Passenger::PassengerInteractor::instance()->remove(id); + Simple::Controller::Passenger::PassengerController::instance()->remove(id); }); // one passenger details @@ -91,16 +91,16 @@ MainWindow::~MainWindow() QCoro::Task<> MainWindow::init() { - auto *carInteractor = Simple::Interactor::Car::CarInteractor::instance(); - auto createCarDTO = carInteractor->getCreateDTO(); + auto *carController = Simple::Controller::Car::CarController::instance(); + auto createCarDTO = carController->getCreateDTO(); createCarDTO.setContent("Example car 1"_L1); - const auto &carDto = co_await carInteractor->create(createCarDTO); + const auto &carDto = co_await carController->create(createCarDTO); - auto *passengerInteractor = Simple::Interactor::Passenger::PassengerInteractor::instance(); - auto create_DTO = passengerInteractor->getCreateDTO(); + auto *passengerController = Simple::Controller::Passenger::PassengerController::instance(); + auto create_DTO = passengerController->getCreateDTO(); create_DTO.setName("Example passenger 1"_L1); create_DTO.setCarId(1); - const auto &passengerDto = co_await passengerInteractor->create(create_DTO); + const auto &passengerDto = co_await passengerController->create(create_DTO); m_passengerModelFromCarPassengers->setCarId(carDto.id()); } diff --git a/examples/simple/src/gui/presenter/CMakeLists.txt b/examples/simple/src/gui/presenter/CMakeLists.txt index 9ea3024e..dc57f43f 100755 --- a/examples/simple/src/gui/presenter/CMakeLists.txt +++ b/examples/simple/src/gui/presenter/CMakeLists.txt @@ -39,7 +39,7 @@ target_link_libraries(${LIBRARY_NAME} PRIVATE Qt6::Core Qt6::Gui) target_link_libraries(${LIBRARY_NAME} PRIVATE QCoro::Core) target_link_libraries(${LIBRARY_NAME} PUBLIC qleany) -target_link_libraries(${LIBRARY_NAME} PUBLIC simple-example-interactor) +target_link_libraries(${LIBRARY_NAME} PUBLIC simple-example-controller) if(IOS) install(TARGETS ${LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/examples/simple/src/gui/presenter/car_list_model.cpp b/examples/simple/src/gui/presenter/car_list_model.cpp index f07355f9..8f9dcc7f 100644 --- a/examples/simple/src/gui/presenter/car_list_model.cpp +++ b/examples/simple/src/gui/presenter/car_list_model.cpp @@ -1,9 +1,9 @@ #include "car_list_model.h" -#include "car/car_interactor.h" +#include "car/car_controller.h" #include "event_dispatcher.h" #include -using namespace Simple::Interactor; +using namespace Simple::Controller; using namespace Simple::Presenter; CarListModel::CarListModel(QObject *parent) : QAbstractListModel(parent) @@ -133,7 +133,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setId(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; @@ -159,7 +159,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setUuid(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; @@ -185,7 +185,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setCreationDate(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; @@ -211,7 +211,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setUpdateDate(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; @@ -237,7 +237,7 @@ bool CarListModel::setData(const QModelIndex &index, const QVariant &value, int dto.setId(car.id()); dto.setContent(value.value()); - Car::CarInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Car::CarController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid "; @@ -260,7 +260,7 @@ void CarListModel::populate() m_carIdList.clear(); endResetModel(); - auto task = Car::CarInteractor::instance()->getAll(); + auto task = Car::CarController::instance()->getAll(); QCoro::connect(std::move(task), this, [this](auto &&result) { const QList carList = result; for (const auto &car : carList) diff --git a/examples/simple/src/gui/presenter/passenger_list_model_from_car_passengers.cpp b/examples/simple/src/gui/presenter/passenger_list_model_from_car_passengers.cpp index 65c9a258..fae27300 100644 --- a/examples/simple/src/gui/presenter/passenger_list_model_from_car_passengers.cpp +++ b/examples/simple/src/gui/presenter/passenger_list_model_from_car_passengers.cpp @@ -1,10 +1,10 @@ #include "passenger_list_model_from_car_passengers.h" -#include "car/car_interactor.h" +#include "car/car_controller.h" #include "event_dispatcher.h" -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include -using namespace Simple::Interactor; +using namespace Simple::Controller; using namespace Simple::Presenter; PassengerListModelFromCarPassengers::PassengerListModelFromCarPassengers(QObject *parent) : QAbstractListModel(parent) @@ -15,7 +15,7 @@ PassengerListModelFromCarPassengers::PassengerListModelFromCarPassengers(QObject { return; } - auto task = Car::CarInteractor::instance()->getWithDetails(carId); + auto task = Car::CarController::instance()->getWithDetails(carId); QCoro::connect(std::move(task), this, [this, carId](auto &&carDetails) { if (carDetails.isInvalid()) { @@ -128,10 +128,10 @@ PassengerListModelFromCarPassengers::PassengerListModelFromCarPassengers(QObject QList relatedIds = dto.relatedIds(); std::reverse(relatedIds.begin(), relatedIds.end()); - // fetch passenger list from interactor + // fetch passenger list from controller for (int passengerId : relatedIds) { - Passenger::PassengerInteractor::instance() + Passenger::PassengerController::instance() ->get(passengerId) .then([this, passengerId, position](PassengerDTO passenger) { // add passenger to this model @@ -247,7 +247,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setId(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; @@ -273,7 +273,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setUuid(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; @@ -299,7 +299,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setCreationDate(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; @@ -325,7 +325,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setUpdateDate(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; @@ -351,7 +351,7 @@ bool PassengerListModelFromCarPassengers::setData(const QModelIndex &index, cons dto.setId(passenger.id()); dto.setName(value.value()); - Passenger::PassengerInteractor::instance()->update(dto).then([this, index, role](auto &&result) { + Passenger::PassengerController::instance()->update(dto).then([this, index, role](auto &&result) { if (result.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid car"; @@ -376,7 +376,7 @@ void PassengerListModelFromCarPassengers::populate() m_passengerIdList.clear(); endResetModel(); - auto task = Car::CarInteractor::instance()->getWithDetails(m_carId); + auto task = Car::CarController::instance()->getWithDetails(m_carId); QCoro::connect(std::move(task), this, [this](auto &&result) { const QList passengerList = result.passengers(); for (const auto &passenger : passengerList) diff --git a/examples/simple/src/gui/presenter/single_brand.cpp b/examples/simple/src/gui/presenter/single_brand.cpp index 2a3cd085..82483ec9 100644 --- a/examples/simple/src/gui/presenter/single_brand.cpp +++ b/examples/simple/src/gui/presenter/single_brand.cpp @@ -1,10 +1,10 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "single_brand.h" -#include "brand/brand_interactor.h" +#include "brand/brand_controller.h" #include "event_dispatcher.h" -using namespace Simple::Interactor; +using namespace Simple::Controller; using namespace Simple::Presenter; SingleBrand::SingleBrand(QObject *parent) : QObject{parent} @@ -80,7 +80,7 @@ void SingleBrand::setId(int newId) // set else { - Brand::BrandInteractor::instance()->get(m_id).then( + Brand::BrandController::instance()->get(m_id).then( [this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { @@ -121,7 +121,7 @@ void SingleBrand::setUuid(const QUuid &newUuid) UpdateBrandDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Brand::BrandInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; @@ -145,7 +145,7 @@ void SingleBrand::setCreationDate(const QDateTime &newCreationDate) UpdateBrandDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Brand::BrandInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; @@ -169,7 +169,7 @@ void SingleBrand::setUpdateDate(const QDateTime &newUpdateDate) UpdateBrandDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Brand::BrandInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; @@ -193,7 +193,7 @@ void SingleBrand::setName(const QString &newName) UpdateBrandDTO dto; dto.setId(id()); dto.setName(newName); - Brand::BrandInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { + Brand::BrandController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Brand::BrandDTO &brand) { if (brand.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid brandId"; diff --git a/examples/simple/src/gui/presenter/single_car.cpp b/examples/simple/src/gui/presenter/single_car.cpp index 6c8ea161..3bc86274 100644 --- a/examples/simple/src/gui/presenter/single_car.cpp +++ b/examples/simple/src/gui/presenter/single_car.cpp @@ -1,10 +1,10 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "single_car.h" -#include "car/car_interactor.h" +#include "car/car_controller.h" #include "event_dispatcher.h" -using namespace Simple::Interactor; +using namespace Simple::Controller; using namespace Simple::Presenter; SingleCar::SingleCar(QObject *parent) : QObject{parent} @@ -80,7 +80,7 @@ void SingleCar::setId(int newId) // set else { - Car::CarInteractor::instance()->get(m_id).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->get(m_id).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; @@ -120,7 +120,7 @@ void SingleCar::setUuid(const QUuid &newUuid) UpdateCarDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Car::CarInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; @@ -144,7 +144,7 @@ void SingleCar::setCreationDate(const QDateTime &newCreationDate) UpdateCarDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Car::CarInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; @@ -168,7 +168,7 @@ void SingleCar::setUpdateDate(const QDateTime &newUpdateDate) UpdateCarDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Car::CarInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; @@ -192,7 +192,7 @@ void SingleCar::setContent(const QString &newContent) UpdateCarDTO dto; dto.setId(id()); dto.setContent(newContent); - Car::CarInteractor::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { + Car::CarController::instance()->update(dto).then([this](const Simple::Contracts::DTO::Car::CarDTO &car) { if (car.isInvalid()) { qCritical() << Q_FUNC_INFO << "Invalid carId"; diff --git a/examples/simple/src/gui/presenter/single_client.cpp b/examples/simple/src/gui/presenter/single_client.cpp index e6746b71..b3db96c2 100644 --- a/examples/simple/src/gui/presenter/single_client.cpp +++ b/examples/simple/src/gui/presenter/single_client.cpp @@ -1,10 +1,10 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "single_client.h" -#include "client/client_interactor.h" +#include "client/client_controller.h" #include "event_dispatcher.h" -using namespace Simple::Interactor; +using namespace Simple::Controller; using namespace Simple::Presenter; SingleClient::SingleClient(QObject *parent) : QObject{parent} @@ -72,7 +72,7 @@ void SingleClient::setId(int newId) // set else { - Client::ClientInteractor::instance()->get(m_id).then( + Client::ClientController::instance()->get(m_id).then( [this](const Simple::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { @@ -110,7 +110,7 @@ void SingleClient::setUuid(const QUuid &newUuid) UpdateClientDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Client::ClientInteractor::instance()->update(dto).then( + Client::ClientController::instance()->update(dto).then( [this](const Simple::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { @@ -135,7 +135,7 @@ void SingleClient::setCreationDate(const QDateTime &newCreationDate) UpdateClientDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Client::ClientInteractor::instance()->update(dto).then( + Client::ClientController::instance()->update(dto).then( [this](const Simple::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { @@ -160,7 +160,7 @@ void SingleClient::setUpdateDate(const QDateTime &newUpdateDate) UpdateClientDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Client::ClientInteractor::instance()->update(dto).then( + Client::ClientController::instance()->update(dto).then( [this](const Simple::Contracts::DTO::Client::ClientDTO &client) { if (client.isInvalid()) { diff --git a/examples/simple/src/gui/presenter/single_passenger.cpp b/examples/simple/src/gui/presenter/single_passenger.cpp index cc96fa2b..3e12a27f 100644 --- a/examples/simple/src/gui/presenter/single_passenger.cpp +++ b/examples/simple/src/gui/presenter/single_passenger.cpp @@ -2,9 +2,9 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_passenger.h" #include "event_dispatcher.h" -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" -using namespace Simple::Interactor; +using namespace Simple::Controller; using namespace Simple::Presenter; SinglePassenger::SinglePassenger(QObject *parent) : QObject{parent} @@ -80,7 +80,7 @@ void SinglePassenger::setId(int newId) // set else { - Passenger::PassengerInteractor::instance()->get(m_id).then( + Passenger::PassengerController::instance()->get(m_id).then( [this](const Simple::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { @@ -121,7 +121,7 @@ void SinglePassenger::setUuid(const QUuid &newUuid) UpdatePassengerDTO dto; dto.setId(id()); dto.setUuid(newUuid); - Passenger::PassengerInteractor::instance()->update(dto).then( + Passenger::PassengerController::instance()->update(dto).then( [this](const Simple::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { @@ -146,7 +146,7 @@ void SinglePassenger::setCreationDate(const QDateTime &newCreationDate) UpdatePassengerDTO dto; dto.setId(id()); dto.setCreationDate(newCreationDate); - Passenger::PassengerInteractor::instance()->update(dto).then( + Passenger::PassengerController::instance()->update(dto).then( [this](const Simple::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { @@ -171,7 +171,7 @@ void SinglePassenger::setUpdateDate(const QDateTime &newUpdateDate) UpdatePassengerDTO dto; dto.setId(id()); dto.setUpdateDate(newUpdateDate); - Passenger::PassengerInteractor::instance()->update(dto).then( + Passenger::PassengerController::instance()->update(dto).then( [this](const Simple::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { @@ -196,7 +196,7 @@ void SinglePassenger::setName(const QString &newName) UpdatePassengerDTO dto; dto.setId(id()); dto.setName(newName); - Passenger::PassengerInteractor::instance()->update(dto).then( + Passenger::PassengerController::instance()->update(dto).then( [this](const Simple::Contracts::DTO::Passenger::PassengerDTO &passenger) { if (passenger.isInvalid()) { diff --git a/examples/simple/src/gui/presenter/single_redo.cpp b/examples/simple/src/gui/presenter/single_redo.cpp index 1621fa0e..21ba2bb4 100644 --- a/examples/simple/src/gui/presenter/single_redo.cpp +++ b/examples/simple/src/gui/presenter/single_redo.cpp @@ -2,15 +2,15 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_redo.h" #include "event_dispatcher.h" -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" -using namespace Simple::Interactor; -using namespace Simple::Interactor::UndoRedo; +using namespace Simple::Controller; +using namespace Simple::Controller::UndoRedo; using namespace Simple::Presenter; SingleRedo::SingleRedo(QObject *parent) : QObject{parent} { - m_action = UndoRedoInteractor::instance()->createUndoAction(this, tr("Redo: %1")); + m_action = UndoRedoController::instance()->createUndoAction(this, tr("Redo: %1")); m_enabled = m_action->isEnabled(); connect(m_action, &QAction::enabledChanged, this, [this](bool newEnabled) { @@ -49,5 +49,5 @@ QString SingleRedo::text() const void SingleRedo::redo() { - UndoRedoInteractor::instance()->redo(); + UndoRedoController::instance()->redo(); } \ No newline at end of file diff --git a/examples/simple/src/gui/presenter/single_undo.cpp b/examples/simple/src/gui/presenter/single_undo.cpp index 9107bcee..c86a0f73 100644 --- a/examples/simple/src/gui/presenter/single_undo.cpp +++ b/examples/simple/src/gui/presenter/single_undo.cpp @@ -2,15 +2,15 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_undo.h" #include "event_dispatcher.h" -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" -using namespace Simple::Interactor; -using namespace Simple::Interactor::UndoRedo; +using namespace Simple::Controller; +using namespace Simple::Controller::UndoRedo; using namespace Simple::Presenter; SingleUndo::SingleUndo(QObject *parent) : QObject{parent} { - m_action = UndoRedoInteractor::instance()->createUndoAction(this, tr("Undo: %1")); + m_action = UndoRedoController::instance()->createUndoAction(this, tr("Undo: %1")); m_enabled = m_action->isEnabled(); connect(m_action, &QAction::enabledChanged, this, [this](bool newEnabled) { @@ -49,5 +49,5 @@ QString SingleUndo::text() const void SingleUndo::undo() { - UndoRedoInteractor::instance()->undo(); + UndoRedoController::instance()->undo(); } \ No newline at end of file diff --git a/examples/simple/src/gui/qml_application/CMakeLists.txt b/examples/simple/src/gui/qml_application/CMakeLists.txt index 537e6404..0a8b400f 100755 --- a/examples/simple/src/gui/qml_application/CMakeLists.txt +++ b/examples/simple/src/gui/qml_application/CMakeLists.txt @@ -32,7 +32,7 @@ qt_add_resources(${APP_NAME} "configuration" PREFIX "/" FILES target_link_libraries(${APP_NAME} PUBLIC qleany) target_link_libraries(${APP_NAME} PUBLIC simple-example-entities) target_link_libraries(${APP_NAME} PUBLIC simple-example-persistence) -target_link_libraries(${APP_NAME} PUBLIC simple-example-interactor) +target_link_libraries(${APP_NAME} PUBLIC simple-example-controller) target_link_libraries(${APP_NAME} PUBLIC simple-example-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core QCoro::Qml) diff --git a/examples/simple/src/gui/qml_application/content/App.qml b/examples/simple/src/gui/qml_application/content/App.qml index a0ab703b..00bcf341 100644 --- a/examples/simple/src/gui/qml_application/content/App.qml +++ b/examples/simple/src/gui/qml_application/content/App.qml @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 6.5 import SimpleExampleQML -import Interactors +import Controllers import QtQuick.Dialogs import QtQuick.Layouts import QtQuick.Controls 6.5 diff --git a/examples/simple/src/gui/qml_application/content/Screen01.qml b/examples/simple/src/gui/qml_application/content/Screen01.qml index d8ed5b01..61a126ce 100644 --- a/examples/simple/src/gui/qml_application/content/Screen01.qml +++ b/examples/simple/src/gui/qml_application/content/Screen01.qml @@ -1,6 +1,6 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import Interactors +import Controllers import Singles Screen01Form { @@ -19,7 +19,7 @@ Screen01Form { Connections { target: runLongOperationButton function onClicked() { - CustomInteractor.runLongOperation() + CustomController.runLongOperation() } } @@ -30,22 +30,22 @@ Screen01Form { return } - var dto = PassengerInteractor.getCreateDTO() + var dto = PassengerController.getCreateDTO() dto.name = "p " + passengerNumber passengerNumber = passengerNumber + 1 dto.carId = currentCarId dto.position = 0 - PassengerInteractor.create(dto) + PassengerController.create(dto) } } Connections { target: addCarButton function onClicked() { - var dto = CarInteractor.getCreateDTO() + var dto = CarController.getCreateDTO() dto.content = "c " + carNumber carNumber = carNumber + 1 - CarInteractor.create(dto).then(result => console.log( + CarController.create(dto).then(result => console.log( "Result", result.content)) } } diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/BrandInteractor.qml b/examples/simple/src/gui/qml_application/mock_imports/Interactors/BrandController.qml similarity index 89% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/BrandInteractor.qml rename to examples/simple/src/gui/qml_application/mock_imports/Interactors/BrandController.qml index a891cd60..57e7b5e0 100644 --- a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/BrandInteractor.qml +++ b/examples/simple/src/gui/qml_application/mock_imports/Interactors/BrandController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.brand().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CarInteractor.qml b/examples/simple/src/gui/qml_application/mock_imports/Interactors/CarController.qml similarity index 88% rename from examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CarInteractor.qml rename to examples/simple/src/gui/qml_application/mock_imports/Interactors/CarController.qml index 3105e3f0..90308305 100644 --- a/examples/front_ends/src/gui/kf6_kirigami_application/mock_imports/Interactors/CarInteractor.qml +++ b/examples/simple/src/gui/qml_application/mock_imports/Interactors/CarController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.car().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/simple/src/gui/qml_application/mock_imports/Interactors/ClientInteractor.qml b/examples/simple/src/gui/qml_application/mock_imports/Interactors/ClientController.qml similarity index 88% rename from examples/simple/src/gui/qml_application/mock_imports/Interactors/ClientInteractor.qml rename to examples/simple/src/gui/qml_application/mock_imports/Interactors/ClientController.qml index afdbc1b0..7ea3f16a 100644 --- a/examples/simple/src/gui/qml_application/mock_imports/Interactors/ClientInteractor.qml +++ b/examples/simple/src/gui/qml_application/mock_imports/Interactors/ClientController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getReplied(id)}) @@ -25,7 +25,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getWithDetailsReplied(id)}) @@ -41,7 +41,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().getAllReplied(dtos)}) @@ -64,7 +64,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.client().created(dto)}) @@ -85,7 +85,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -102,7 +102,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CustomInteractor.qml b/examples/simple/src/gui/qml_application/mock_imports/Interactors/CustomController.qml similarity index 91% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CustomInteractor.qml rename to examples/simple/src/gui/qml_application/mock_imports/Interactors/CustomController.qml index 20a0f75b..81019a29 100644 --- a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/CustomInteractor.qml +++ b/examples/simple/src/gui/qml_application/mock_imports/Interactors/CustomController.qml @@ -5,7 +5,7 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function writeRandomThings(dto) { @@ -18,7 +18,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -40,7 +40,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -62,7 +62,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ @@ -84,7 +84,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/PassengerInteractor.qml b/examples/simple/src/gui/qml_application/mock_imports/Interactors/PassengerController.qml similarity index 89% rename from examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/PassengerInteractor.qml rename to examples/simple/src/gui/qml_application/mock_imports/Interactors/PassengerController.qml index 754ca48c..87df22d6 100644 --- a/examples/front_ends/src/gui/qt_design_studio/mock_imports/Interactors/PassengerInteractor.qml +++ b/examples/simple/src/gui/qml_application/mock_imports/Interactors/PassengerController.qml @@ -5,14 +5,14 @@ pragma Singleton import QtQuick QtObject { - id: interactor + id: controller function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getReplied(id)}) @@ -28,7 +28,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().getAllReplied(dtos)}) @@ -51,7 +51,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){EventDispatcher.passenger().created(dto)}) @@ -72,7 +72,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ @@ -89,7 +89,7 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ diff --git a/examples/simple/src/gui/qml_application/mock_imports/Interactors/UndoRedoInteractor.qml b/examples/simple/src/gui/qml_application/mock_imports/Interactors/UndoRedoController.qml similarity index 100% rename from examples/simple/src/gui/qml_application/mock_imports/Interactors/UndoRedoInteractor.qml rename to examples/simple/src/gui/qml_application/mock_imports/Interactors/UndoRedoController.qml diff --git a/examples/simple/src/gui/qml_application/mock_imports/Interactors/qmldir b/examples/simple/src/gui/qml_application/mock_imports/Interactors/qmldir index e7f4fb88..7253ee16 100644 --- a/examples/simple/src/gui/qml_application/mock_imports/Interactors/qmldir +++ b/examples/simple/src/gui/qml_application/mock_imports/Interactors/qmldir @@ -1,17 +1,17 @@ # This file was generated automatically by Qleany's generator, edit at your own risk! # If you do, be careful to not overwrite it when you run the generator again. -Module Interactors -singleton CarInteractor 1.0 CarInteractor.qml +Module Controllers +singleton CarController 1.0 CarController.qml singleton CarSignals 1.0 CarSignals.qml -singleton BrandInteractor 1.0 BrandInteractor.qml +singleton BrandController 1.0 BrandController.qml singleton BrandSignals 1.0 BrandSignals.qml -singleton PassengerInteractor 1.0 PassengerInteractor.qml +singleton PassengerController 1.0 PassengerController.qml singleton PassengerSignals 1.0 PassengerSignals.qml -singleton ClientInteractor 1.0 ClientInteractor.qml +singleton ClientController 1.0 ClientController.qml singleton ClientSignals 1.0 ClientSignals.qml -singleton CustomInteractor 1.0 CustomInteractor.qml +singleton CustomController 1.0 CustomController.qml singleton CustomSignals 1.0 CustomSignals.qml -singleton UndoRedoInteractor 1.0 UndoRedoInteractor.qml +singleton UndoRedoController 1.0 UndoRedoController.qml singleton UndoRedoSignals 1.0 UndoRedoSignals.qml singleton ProgressSignals 1.0 ProgressSignals.qml singleton ErrorSignals 1.0 ErrorSignals.qml diff --git a/examples/simple/src/gui/qml_application/real_imports/CMakeLists.txt b/examples/simple/src/gui/qml_application/real_imports/CMakeLists.txt index 60053a6f..f3f2f06c 100644 --- a/examples/simple/src/gui/qml_application/real_imports/CMakeLists.txt +++ b/examples/simple/src/gui/qml_application/real_imports/CMakeLists.txt @@ -2,5 +2,5 @@ # If you do, be careful to not overwrite it when you run the generator again. add_subdirectory(models) -add_subdirectory(interactors) +add_subdirectory(controllers) add_subdirectory(singles) \ No newline at end of file diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/CMakeLists.txt b/examples/simple/src/gui/qml_application/real_imports/controllers/CMakeLists.txt similarity index 62% rename from examples/simple/src/gui/qml_application/real_imports/interactors/CMakeLists.txt rename to examples/simple/src/gui/qml_application/real_imports/controllers/CMakeLists.txt index d7757d4e..03d90721 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/CMakeLists.txt +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/CMakeLists.txt @@ -3,26 +3,26 @@ find_package(Qt6 COMPONENTS Core Quick Qml REQUIRED) find_package(QCoro6 REQUIRED COMPONENTS Core Qml) -set(PLUGIN_NAME simple-example-qml-interactors) +set(PLUGIN_NAME simple-example-qml-controllers) qt_add_library(${PLUGIN_NAME} STATIC) qt6_add_qml_module(${PLUGIN_NAME} - URI "Interactors" + URI "Controllers" VERSION 1.0 SOURCES - foreign_car_interactor.h - foreign_brand_interactor.h - foreign_passenger_interactor.h - foreign_client_interactor.h - foreign_custom_interactor.h + foreign_car_controller.h + foreign_brand_controller.h + foreign_passenger_controller.h + foreign_client_controller.h + foreign_custom_controller.h foreign_event_dispatcher.h - foreign_undo_redo_interactor.h + foreign_undo_redo_controller.h ) -target_link_libraries(${PLUGIN_NAME} PRIVATE simple-example-interactor) +target_link_libraries(${PLUGIN_NAME} PRIVATE simple-example-controller) target_link_libraries(${PLUGIN_NAME} PRIVATE QCoro::Core QCoro::Qml) target_link_libraries(${PLUGIN_NAME} diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_brand_interactor.h b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_brand_controller.h similarity index 53% rename from examples/simple/src/gui/qml_application/real_imports/interactors/foreign_brand_interactor.h rename to examples/simple/src/gui/qml_application/real_imports/controllers/foreign_brand_controller.h index 4684e12e..4e0120e8 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_brand_interactor.h +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_brand_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "brand/brand_interactor.h" +#include "brand/brand_controller.h" #include #include #include -using namespace Simple::Interactor::Brand; +using namespace Simple::Controller::Brand; -class ForeignBrandInteractor : public QObject +class ForeignBrandController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(BrandInteractor) + QML_NAMED_ELEMENT(BrandController) public: - ForeignBrandInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignBrandController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = BrandInteractor::instance(); + s_controllerInstance = BrandController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateBrandDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateBrandDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateBrandDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateBrandDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - BrandInteractor *s_interactorInstance = nullptr; + BrandController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_car_interactor.h b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_car_controller.h similarity index 53% rename from examples/simple/src/gui/qml_application/real_imports/interactors/foreign_car_interactor.h rename to examples/simple/src/gui/qml_application/real_imports/controllers/foreign_car_controller.h index 443649bb..01dcda1e 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_car_interactor.h +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_car_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "car/car_interactor.h" +#include "car/car_controller.h" #include #include #include -using namespace Simple::Interactor::Car; +using namespace Simple::Controller::Car; -class ForeignCarInteractor : public QObject +class ForeignCarController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CarInteractor) + QML_NAMED_ELEMENT(CarController) public: - ForeignCarInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCarController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CarInteractor::instance(); + s_controllerInstance = CarController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateCarDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateCarDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateCarDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateCarDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - CarInteractor *s_interactorInstance = nullptr; + CarController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_client_interactor.h b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_client_controller.h similarity index 53% rename from examples/simple/src/gui/qml_application/real_imports/interactors/foreign_client_interactor.h rename to examples/simple/src/gui/qml_application/real_imports/controllers/foreign_client_controller.h index 004fcca4..fe088f9e 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_client_interactor.h +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_client_controller.h @@ -1,65 +1,65 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "client/client_interactor.h" +#include "client/client_controller.h" #include #include #include -using namespace Simple::Interactor::Client; +using namespace Simple::Controller::Client; -class ForeignClientInteractor : public QObject +class ForeignClientController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(ClientInteractor) + QML_NAMED_ELEMENT(ClientController) public: - ForeignClientInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignClientController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = ClientInteractor::instance(); + s_controllerInstance = ClientController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreateClientDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdateClientDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreateClientDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdateClientDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - ClientInteractor *s_interactorInstance = nullptr; + ClientController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_custom_interactor.h b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_custom_controller.h similarity index 51% rename from examples/simple/src/gui/qml_application/real_imports/interactors/foreign_custom_interactor.h rename to examples/simple/src/gui/qml_application/real_imports/controllers/foreign_custom_controller.h index 5b936155..d65842e2 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_custom_interactor.h +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_custom_controller.h @@ -1,45 +1,45 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "custom/custom_interactor.h" +#include "custom/custom_controller.h" #include #include #include -using namespace Simple::Interactor::Custom; +using namespace Simple::Controller::Custom; -class ForeignCustomInteractor : public QObject +class ForeignCustomController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(CustomInteractor) + QML_NAMED_ELEMENT(CustomController) public: - ForeignCustomInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignCustomController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = CustomInteractor::instance(); + s_controllerInstance = CustomController::instance(); } Q_INVOKABLE QCoro::QmlTask getCurrentTime() const { - return s_interactorInstance->getCurrentTime(); + return s_controllerInstance->getCurrentTime(); } Q_INVOKABLE QCoro::QmlTask writeRandomThings(WriteRandomThingsDTO dto) { - return s_interactorInstance->writeRandomThings(dto); + return s_controllerInstance->writeRandomThings(dto); } Q_INVOKABLE QCoro::QmlTask runLongOperation() { - return s_interactorInstance->runLongOperation(); + return s_controllerInstance->runLongOperation(); } Q_INVOKABLE QCoro::QmlTask closeSystem() { - return s_interactorInstance->closeSystem(); + return s_controllerInstance->closeSystem(); } private: - CustomInteractor *s_interactorInstance = nullptr; + CustomController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_event_dispatcher.h b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_event_dispatcher.h similarity index 83% rename from examples/simple/src/gui/qml_application/real_imports/interactors/foreign_event_dispatcher.h rename to examples/simple/src/gui/qml_application/real_imports/controllers/foreign_event_dispatcher.h index 4eb14b0f..2574ca78 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_event_dispatcher.h +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_event_dispatcher.h @@ -8,18 +8,18 @@ struct ForeignEventDispatcher { Q_GADGET - QML_FOREIGN(Simple::Interactor::EventDispatcher) + QML_FOREIGN(Simple::Controller::EventDispatcher) QML_SINGLETON QML_NAMED_ELEMENT(EventDispatcher) public: // Initialize this singleton instance with the given engine. - inline static Simple::Interactor::EventDispatcher *s_singletonInstance = nullptr; + inline static Simple::Controller::EventDispatcher *s_singletonInstance = nullptr; - static Simple::Interactor::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) + static Simple::Controller::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = Simple::Interactor::EventDispatcher::instance(); + s_singletonInstance = Simple::Controller::EventDispatcher::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_passenger_interactor.h b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_passenger_controller.h similarity index 52% rename from examples/simple/src/gui/qml_application/real_imports/interactors/foreign_passenger_interactor.h rename to examples/simple/src/gui/qml_application/real_imports/controllers/foreign_passenger_controller.h index 38e3ce5f..4b532df7 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_passenger_interactor.h +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_passenger_controller.h @@ -1,60 +1,60 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "passenger/passenger_interactor.h" +#include "passenger/passenger_controller.h" #include #include #include -using namespace Simple::Interactor::Passenger; +using namespace Simple::Controller::Passenger; -class ForeignPassengerInteractor : public QObject +class ForeignPassengerController : public QObject { Q_OBJECT QML_SINGLETON - QML_NAMED_ELEMENT(PassengerInteractor) + QML_NAMED_ELEMENT(PassengerController) public: - ForeignPassengerInteractor(QObject *parent = nullptr) : QObject(parent) + ForeignPassengerController(QObject *parent = nullptr) : QObject(parent) { - s_interactorInstance = PassengerInteractor::instance(); + s_controllerInstance = PassengerController::instance(); } Q_INVOKABLE QCoro::QmlTask get(int id) const { - return s_interactorInstance->get(id); + return s_controllerInstance->get(id); } Q_INVOKABLE QCoro::QmlTask getAll() const { - return s_interactorInstance->getAll(); + return s_controllerInstance->getAll(); } Q_INVOKABLE CreatePassengerDTO getCreateDTO() { - return s_interactorInstance->getCreateDTO(); + return s_controllerInstance->getCreateDTO(); } Q_INVOKABLE UpdatePassengerDTO getUpdateDTO() { - return s_interactorInstance->getUpdateDTO(); + return s_controllerInstance->getUpdateDTO(); } Q_INVOKABLE QCoro::QmlTask create(const CreatePassengerDTO &dto) { - return s_interactorInstance->create(dto); + return s_controllerInstance->create(dto); } Q_INVOKABLE QCoro::QmlTask update(const UpdatePassengerDTO &dto) { - return s_interactorInstance->update(dto); + return s_controllerInstance->update(dto); } Q_INVOKABLE QCoro::QmlTask remove(int id) { - return s_interactorInstance->remove(id); + return s_controllerInstance->remove(id); } private: - PassengerInteractor *s_interactorInstance = nullptr; + PassengerController *s_controllerInstance = nullptr; }; \ No newline at end of file diff --git a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_undo_redo_interactor.h b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_undo_redo_controller.h similarity index 71% rename from examples/simple/src/gui/qml_application/real_imports/interactors/foreign_undo_redo_interactor.h rename to examples/simple/src/gui/qml_application/real_imports/controllers/foreign_undo_redo_controller.h index 8f79de3f..416283a6 100644 --- a/examples/simple/src/gui/qml_application/real_imports/interactors/foreign_undo_redo_interactor.h +++ b/examples/simple/src/gui/qml_application/real_imports/controllers/foreign_undo_redo_controller.h @@ -1,26 +1,26 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" #include -using namespace Simple::Interactor::UndoRedo; +using namespace Simple::Controller::UndoRedo; -struct ForeignUndoRedoInteractor +struct ForeignUndoRedoController { Q_GADGET - QML_FOREIGN(Simple::Interactor::UndoRedo::UndoRedoInteractor) + QML_FOREIGN(Simple::Controller::UndoRedo::UndoRedoController) QML_SINGLETON - QML_NAMED_ELEMENT(UndoRedoInteractor) + QML_NAMED_ELEMENT(UndoRedoController) public: // Initialize this singleton instance with the given engine. - inline static UndoRedoInteractor *s_singletonInstance = nullptr; + inline static UndoRedoController *s_singletonInstance = nullptr; - static UndoRedoInteractor *create(QQmlEngine *, QJSEngine *engine) + static UndoRedoController *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = UndoRedoInteractor::instance(); + s_singletonInstance = UndoRedoController::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/examples/simple/src/gui/qml_application/realqmlmodules.cmake b/examples/simple/src/gui/qml_application/realqmlmodules.cmake index 2bf9e035..f19b15cb 100644 --- a/examples/simple/src/gui/qml_application/realqmlmodules.cmake +++ b/examples/simple/src/gui/qml_application/realqmlmodules.cmake @@ -4,7 +4,7 @@ add_subdirectory(real_imports) target_link_libraries(${APP_NAME} PRIVATE -simple-example-qml-interactorsplugin +simple-example-qml-controllersplugin simple-example-qml-modelsplugin simple-example-qml-singlesplugin ) diff --git a/examples/simple/src/gui/qml_application/src/main.cpp b/examples/simple/src/gui/qml_application/src/main.cpp index 1602cf0c..2efe9028 100644 --- a/examples/simple/src/gui/qml_application/src/main.cpp +++ b/examples/simple/src/gui/qml_application/src/main.cpp @@ -4,7 +4,7 @@ #include "app_environment.h" #include "entities_registration.h" #include "import_qml_plugins.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "persistence_registration.h" #include #include @@ -17,7 +17,7 @@ int main(int argc, char *argv[]) new Simple::Entities::EntitiesRegistration(&app); auto *persistenceRegistration = new Simple::Persistence::PersistenceRegistration(&app); - new Simple::Interactor::InteractorRegistration(&app, persistenceRegistration->repositoryProvider()); + new Simple::Controller::ControllerRegistration(&app, persistenceRegistration->repositoryProvider()); QCoro::Qml::registerTypes(); diff --git a/tools/qleany/generator/interactor_generator.py b/tools/qleany/generator/controller_generator.py similarity index 80% rename from tools/qleany/generator/interactor_generator.py rename to tools/qleany/generator/controller_generator.py index e8680747..8437d454 100755 --- a/tools/qleany/generator/interactor_generator.py +++ b/tools/qleany/generator/controller_generator.py @@ -59,13 +59,13 @@ def get_generation_dict( application_cpp_domain_name: str, feature_by_name: dict, entities_by_name: dict, - interactor_by_name: dict, - create_undo_redo_interactor: bool, + controller_by_name: dict, + create_undo_redo_controller: bool, ) -> dict: generation_dict = {} generation_dict["folder_path"] = folder_path - generation_dict["all_interactor_files"] = [] + generation_dict["all_controller_files"] = [] # add application name generation_dict["application_cpp_domain_name"] = application_cpp_domain_name @@ -84,8 +84,8 @@ def get_generation_dict( generation_dict["application_uppercase_name"] = application_name.upper() # add export_header - generation_dict["export_header"] = f"{stringcase.snakecase(application_name)}_interactor_export.h" - generation_dict["export"] = f"{stringcase.snakecase(application_name).upper()}_INTERACTOR_EXPORT" + generation_dict["export_header"] = f"{stringcase.snakecase(application_name)}_controller_export.h" + generation_dict["export"] = f"{stringcase.snakecase(application_name).upper()}_CONTROLLER_EXPORT" generation_dict["features"] = [] @@ -178,21 +178,21 @@ def get_generation_dict( ] = get_other_entities_relation_fields(entity_name, entities_by_name) # files : - generation_dict["all_interactor_files"].append( + generation_dict["all_controller_files"].append( os.path.join( folder_path, feature_snake_name, - f"{feature_snake_name}_interactor.h", + f"{feature_snake_name}_controller.h", ) ) - generation_dict["all_interactor_files"].append( + generation_dict["all_controller_files"].append( os.path.join( folder_path, feature_snake_name, - f"{feature_snake_name}_interactor.cpp", + f"{feature_snake_name}_controller.cpp", ) ) - generation_dict["all_interactor_files"].append( + generation_dict["all_controller_files"].append( os.path.join( folder_path, feature_snake_name, @@ -295,19 +295,19 @@ def get_generation_dict( generation_dict["features"].append(final_feature_dict) - # add undo redo interactor - generation_dict["create_undo_redo_interactor"] = create_undo_redo_interactor - if create_undo_redo_interactor: + # add undo redo controller + generation_dict["create_undo_redo_controller"] = create_undo_redo_controller + if create_undo_redo_controller: h_file = os.path.join( folder_path, "undo_redo", - f"undo_redo_interactor.h", + f"undo_redo_controller.h", ) cpp_file = os.path.join( folder_path, "undo_redo", - f"undo_redo_interactor.cpp", + f"undo_redo_controller.cpp", ) signals_file = os.path.join( @@ -316,11 +316,11 @@ def get_generation_dict( f"undo_redo_signals.h", ) - generation_dict["all_interactor_files"].append(h_file) + generation_dict["all_controller_files"].append(h_file) - generation_dict["all_interactor_files"].append(cpp_file) - generation_dict["all_interactor_files"].append(signals_file) - generation_dict["undo_redo_interactor_files"] = [ + generation_dict["all_controller_files"].append(cpp_file) + generation_dict["all_controller_files"].append(signals_file) + generation_dict["undo_redo_controller_files"] = [ h_file, cpp_file, signals_file, @@ -332,7 +332,7 @@ def get_generation_dict( def generate_cmakelists( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) + template_env = Environment(loader=FileSystemLoader("templates/controller")) template = template_env.get_template("cmakelists_template.jinja2") folder_path = generation_dict["folder_path"] @@ -366,30 +366,30 @@ def generate_cmakelists( def generate_cmake_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) - template = template_env.get_template("interactors.cmake.jinja2") + template_env = Environment(loader=FileSystemLoader("templates/controller")) + template = template_env.get_template("controllers.cmake.jinja2") folder_path = generation_dict["folder_path"] - all_interactor_files = generation_dict["all_interactor_files"] + all_controller_files = generation_dict["all_controller_files"] - relative_cmake_file = os.path.join(folder_path, "interactors.cmake") + relative_cmake_file = os.path.join(folder_path, "controllers.cmake") cmake_file = os.path.join(root_path, relative_cmake_file) - # write the interactor cmake list file + # write the controller cmake list file if files_to_be_generated.get(relative_cmake_file, False): - interactor_files = [] - for interactor_file in all_interactor_files: + controller_files = [] + for controller_file in all_controller_files: relative_path = os.path.relpath( - os.path.join(root_path, interactor_file), os.path.dirname(cmake_file) + os.path.join(root_path, controller_file), os.path.dirname(cmake_file) ) - interactor_files.append(relative_path.replace("\\", "/")) + controller_files.append(relative_path.replace("\\", "/")) # Create the directory if it does not exist os.makedirs(os.path.dirname(cmake_file), exist_ok=True) rendered_template = template.render( - interactor_files=interactor_files, + controller_files=controller_files, ) with open(cmake_file, "w") as fh: @@ -400,12 +400,12 @@ def generate_cmake_file( def generate_event_dispatcher_files( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) + template_env = Environment(loader=FileSystemLoader("templates/controller")) # event dispatcher h template = template_env.get_template("event_dispatcher.h.jinja2") folder_path = generation_dict["folder_path"] - all_interactor_files = generation_dict["all_interactor_files"] + all_controller_files = generation_dict["all_controller_files"] relative_event_dispatcher_file = os.path.join(folder_path, "event_dispatcher.h") event_dispatcher_file = os.path.join(root_path, relative_event_dispatcher_file) @@ -413,12 +413,12 @@ def generate_event_dispatcher_files( # write the event dispatcher header file if files_to_be_generated.get(relative_event_dispatcher_file, False): - interactor_files = [] - for interactor_file in all_interactor_files: + controller_files = [] + for controller_file in all_controller_files: relative_path = os.path.relpath( - interactor_file, os.path.dirname(event_dispatcher_file) + controller_file, os.path.dirname(event_dispatcher_file) ) - interactor_files.append(relative_path.replace("\\", "/")) + controller_files.append(relative_path.replace("\\", "/")) # Create the directory if it does not exist os.makedirs(os.path.dirname(event_dispatcher_file), exist_ok=True) @@ -428,7 +428,7 @@ def generate_event_dispatcher_files( export=generation_dict["export"], features=generation_dict["features"], application_cpp_domain_name=generation_dict["application_cpp_domain_name"], - undo_redo_signals=generation_dict["create_undo_redo_interactor"], + undo_redo_signals=generation_dict["create_undo_redo_controller"], ) with open(event_dispatcher_file, "w") as fh: @@ -443,12 +443,12 @@ def generate_event_dispatcher_files( # write the event dispatcher cpp file if files_to_be_generated.get(relative_event_dispatcher_file, False): - interactor_files = [] - for interactor_file in all_interactor_files: + controller_files = [] + for controller_file in all_controller_files: relative_path = os.path.relpath( - interactor_file, os.path.dirname(event_dispatcher_file) + controller_file, os.path.dirname(event_dispatcher_file) ) - interactor_files.append(relative_path.replace("\\", "/")) + controller_files.append(relative_path.replace("\\", "/")) # Create the directory if it does not exist os.makedirs(os.path.dirname(event_dispatcher_file), exist_ok=True) @@ -456,7 +456,7 @@ def generate_event_dispatcher_files( rendered_template = template.render( features=generation_dict["features"], application_cpp_domain_name=generation_dict["application_cpp_domain_name"], - undo_redo_signals=generation_dict["create_undo_redo_interactor"], + undo_redo_signals=generation_dict["create_undo_redo_controller"], ) with open(event_dispatcher_file, "w") as fh: @@ -464,28 +464,28 @@ def generate_event_dispatcher_files( print(f"Successfully wrote file {event_dispatcher_file}") -def _generate_interactor_h_and_cpp_files( +def _generate_controller_h_and_cpp_files( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) + template_env = Environment(loader=FileSystemLoader("templates/controller")) for feature in generation_dict["features"]: - # interactor h - template = template_env.get_template("interactor.h.jinja2") + # controller h + template = template_env.get_template("controller.h.jinja2") folder_path = generation_dict["folder_path"] - relative_interactor_file = os.path.join( + relative_controller_file = os.path.join( folder_path, feature["feature_name_snake"], - f"{feature['feature_name_snake']}_interactor.h", + f"{feature['feature_name_snake']}_controller.h", ) - interactor_file = os.path.join(root_path, relative_interactor_file) + controller_file = os.path.join(root_path, relative_controller_file) - # write the interactor header file + # write the controller header file - if files_to_be_generated.get(relative_interactor_file, False): + if files_to_be_generated.get(relative_controller_file, False): # Create the directory if it does not exist - os.makedirs(os.path.dirname(interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(controller_file), exist_ok=True) rendered_template = template.render( export_header_file=generation_dict["export_header"], @@ -506,24 +506,24 @@ def _generate_interactor_h_and_cpp_files( feature_name_camel=feature["feature_name_camel"], ) - with open(interactor_file, "w") as fh: + with open(controller_file, "w") as fh: fh.write(rendered_template) - print(f"Successfully wrote file {interactor_file}") + print(f"Successfully wrote file {controller_file}") - # interactor cpp - template = template_env.get_template("interactor.cpp.jinja2") - relative_interactor_file = os.path.join( + # controller cpp + template = template_env.get_template("controller.cpp.jinja2") + relative_controller_file = os.path.join( folder_path, feature["feature_name_snake"], - f"{feature['feature_name_snake']}_interactor.cpp", + f"{feature['feature_name_snake']}_controller.cpp", ) - interactor_file = os.path.join(root_path, relative_interactor_file) + controller_file = os.path.join(root_path, relative_controller_file) - # write the interactor cpp file + # write the controller cpp file - if files_to_be_generated.get(relative_interactor_file, False): + if files_to_be_generated.get(relative_controller_file, False): # Create the directory if it does not exist - os.makedirs(os.path.dirname(interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(controller_file), exist_ok=True) rendered_template = template.render( feature=feature, @@ -542,32 +542,32 @@ def _generate_interactor_h_and_cpp_files( feature_name_camel=feature["feature_name_camel"], ) - with open(interactor_file, "w") as fh: + with open(controller_file, "w") as fh: fh.write(rendered_template) - print(f"Successfully wrote file {interactor_file}") + print(f"Successfully wrote file {controller_file}") -def generate_undo_redo_interactor_h_and_cpp_files( +def generate_undo_redo_controller_h_and_cpp_files( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) - # interactor h - template = template_env.get_template("undo_redo_interactor.h.jinja2") + template_env = Environment(loader=FileSystemLoader("templates/controller")) + # controller h + template = template_env.get_template("undo_redo_controller.h.jinja2") folder_path = generation_dict["folder_path"] - relative_interactor_file = os.path.join( + relative_controller_file = os.path.join( folder_path, "undo_redo", - f"undo_redo_interactor.h", + f"undo_redo_controller.h", ) - interactor_file = os.path.join(root_path, relative_interactor_file) + controller_file = os.path.join(root_path, relative_controller_file) - # write the interactor header file + # write the controller header file - if files_to_be_generated.get(relative_interactor_file, False): + if files_to_be_generated.get(relative_controller_file, False): # Create the directory if it does not exist - os.makedirs(os.path.dirname(interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(controller_file), exist_ok=True) rendered_template = template.render( export_header_file=generation_dict["export_header"], @@ -575,53 +575,53 @@ def generate_undo_redo_interactor_h_and_cpp_files( application_cpp_domain_name=generation_dict["application_cpp_domain_name"], ) - with open(interactor_file, "w") as fh: + with open(controller_file, "w") as fh: fh.write(rendered_template) - print(f"Successfully wrote file {interactor_file}") + print(f"Successfully wrote file {controller_file}") - # interactor cpp - template = template_env.get_template("undo_redo_interactor.cpp.jinja2") - relative_interactor_file = os.path.join( + # controller cpp + template = template_env.get_template("undo_redo_controller.cpp.jinja2") + relative_controller_file = os.path.join( folder_path, "undo_redo", - f"undo_redo_interactor.cpp", + f"undo_redo_controller.cpp", ) - interactor_file = os.path.join(root_path, relative_interactor_file) + controller_file = os.path.join(root_path, relative_controller_file) - # write the interactor cpp file + # write the controller cpp file - if files_to_be_generated.get(relative_interactor_file, False): + if files_to_be_generated.get(relative_controller_file, False): # Create the directory if it does not exist - os.makedirs(os.path.dirname(interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(controller_file), exist_ok=True) rendered_template = template.render( application_cpp_domain_name=generation_dict["application_cpp_domain_name"] ) - with open(interactor_file, "w") as fh: + with open(controller_file, "w") as fh: fh.write(rendered_template) - print(f"Successfully wrote file {interactor_file}") + print(f"Successfully wrote file {controller_file}") -def generate_interactor_registration_files( +def generate_controller_registration_files( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) - # interactor_registration.h - template = template_env.get_template("interactor_registration.h.jinja2") + template_env = Environment(loader=FileSystemLoader("templates/controller")) + # controller_registration.h + template = template_env.get_template("controller_registration.h.jinja2") folder_path = generation_dict["folder_path"] - relative_interactor_file = os.path.join( + relative_controller_file = os.path.join( folder_path, - "interactor_registration.h", + "controller_registration.h", ) - interactor_file = os.path.join(root_path, relative_interactor_file) + controller_file = os.path.join(root_path, relative_controller_file) - # write the interactor header file + # write the controller header file - if files_to_be_generated.get(relative_interactor_file, False): + if files_to_be_generated.get(relative_controller_file, False): # Create the directory if it does not exist - os.makedirs(os.path.dirname(interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(controller_file), exist_ok=True) rendered_template = template.render( export_header_file=generation_dict["export_header"], @@ -629,38 +629,38 @@ def generate_interactor_registration_files( application_cpp_domain_name=generation_dict["application_cpp_domain_name"], ) - with open(interactor_file, "w") as fh: + with open(controller_file, "w") as fh: fh.write(rendered_template) - print(f"Successfully wrote file {interactor_file}") + print(f"Successfully wrote file {controller_file}") - # interactor_registration.cpp - template = template_env.get_template("interactor_registration.cpp.jinja2") - relative_interactor_file = os.path.join( + # controller_registration.cpp + template = template_env.get_template("controller_registration.cpp.jinja2") + relative_controller_file = os.path.join( folder_path, - "interactor_registration.cpp", + "controller_registration.cpp", ) - interactor_file = os.path.join(root_path, relative_interactor_file) + controller_file = os.path.join(root_path, relative_controller_file) - # write the interactor cpp file + # write the controller cpp file - if files_to_be_generated.get(relative_interactor_file, False): + if files_to_be_generated.get(relative_controller_file, False): # Create the directory if it does not exist - os.makedirs(os.path.dirname(interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(controller_file), exist_ok=True) rendered_template = template.render( features=generation_dict["features"], application_cpp_domain_name=generation_dict["application_cpp_domain_name"], ) - with open(interactor_file, "w") as fh: + with open(controller_file, "w") as fh: fh.write(rendered_template) - print(f"Successfully wrote file {interactor_file}") + print(f"Successfully wrote file {controller_file}") def generate_error_signals_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) + template_env = Environment(loader=FileSystemLoader("templates/controller")) template = template_env.get_template("error_signals.h.jinja2") folder_path = generation_dict["folder_path"] @@ -693,7 +693,7 @@ def generate_error_signals_file( def generate_undo_redo_signals_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) + template_env = Environment(loader=FileSystemLoader("templates/controller")) template = template_env.get_template("undo_redo_signals.h.jinja2") folder_path = generation_dict["folder_path"] @@ -727,7 +727,7 @@ def generate_undo_redo_signals_file( def generate_progress_signals_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) + template_env = Environment(loader=FileSystemLoader("templates/controller")) template = template_env.get_template("progress_signals.h.jinja2") folder_path = generation_dict["folder_path"] @@ -760,7 +760,7 @@ def generate_progress_signals_file( def generate_signal_files( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] = None ): - template_env = Environment(loader=FileSystemLoader("templates/interactor")) + template_env = Environment(loader=FileSystemLoader("templates/controller")) template = template_env.get_template("signals.h.jinja2") folder_path = generation_dict["folder_path"] @@ -791,7 +791,7 @@ def generate_signal_files( print(f"Successfully wrote file {signal_header_file}") -def generate_interactor_files( +def generate_controller_files( root_path: str, manifest_file: str, files_to_be_generated: dict[str, bool] = None, @@ -827,15 +827,15 @@ def generate_interactor_files( # Organize entities by name for easier lookup entities_by_name = {entity["name"]: entity for entity in entities_list} - interactor_data = manifest_data.get("interactor", {}) - interactor_list = interactor_data.get("features", []) - interactor_by_name = { - interactor["name"]: interactor for interactor in interactor_list + controller_data = manifest_data.get("controller", {}) + controller_list = controller_data.get("features", []) + controller_by_name = { + controller["name"]: controller for controller in controller_list } - folder_path = interactor_data.get("folder_path", "Undefined") - create_undo_redo_interactor = interactor_data.get( - "create_undo_redo_interactor", False + folder_path = controller_data.get("folder_path", "Undefined") + create_undo_redo_controller = controller_data.get( + "create_undo_redo_controller", False ) generation_dict = get_generation_dict( @@ -844,25 +844,25 @@ def generate_interactor_files( application_cpp_domain_name, feature_by_name, entities_by_name, - interactor_by_name, - create_undo_redo_interactor, + controller_by_name, + create_undo_redo_controller, ) generate_event_dispatcher_files(root_path, generation_dict, files_to_be_generated) generate_cmake_file(root_path, generation_dict, files_to_be_generated) generate_cmakelists(root_path, generation_dict, files_to_be_generated) generate_signal_files(root_path, generation_dict, files_to_be_generated) - _generate_interactor_h_and_cpp_files( + _generate_controller_h_and_cpp_files( root_path, generation_dict, files_to_be_generated ) - if create_undo_redo_interactor: - generate_undo_redo_interactor_h_and_cpp_files( + if create_undo_redo_controller: + generate_undo_redo_controller_h_and_cpp_files( root_path, generation_dict, files_to_be_generated ) generate_undo_redo_signals_file( root_path, generation_dict, files_to_be_generated ) - generate_interactor_registration_files( + generate_controller_registration_files( root_path, generation_dict, files_to_be_generated ) generate_error_signals_file(root_path, generation_dict, files_to_be_generated) @@ -888,11 +888,11 @@ def get_files_to_be_generated( with open(manifest_file, "r") as fh: manifest_data = yaml.safe_load(fh) - interactor_data = manifest_data.get("interactor", {}) - create_undo_redo_interactor = interactor_data.get( - "create_undo_redo_interactor", False + controller_data = manifest_data.get("controller", {}) + create_undo_redo_controller = controller_data.get( + "create_undo_redo_controller", False ) - folder_path = interactor_data["folder_path"] + folder_path = controller_data["folder_path"] # Get the list of files to be generated files = [] @@ -903,14 +903,14 @@ def get_files_to_be_generated( os.path.join( folder_path, feature_name_snake, - f"{feature_name_snake}_interactor.h", + f"{feature_name_snake}_controller.h", ) ) files.append( os.path.join( folder_path, feature_name_snake, - f"{feature_name_snake}_interactor.cpp", + f"{feature_name_snake}_controller.cpp", ) ) files.append( @@ -921,13 +921,13 @@ def get_files_to_be_generated( ) ) - # add undo redo interactor - if create_undo_redo_interactor: + # add undo redo controller + if create_undo_redo_controller: files.append( os.path.join( folder_path, "undo_redo", - f"undo_redo_interactor.h", + f"undo_redo_controller.h", ) ) @@ -935,7 +935,7 @@ def get_files_to_be_generated( os.path.join( folder_path, "undo_redo", - f"undo_redo_interactor.cpp", + f"undo_redo_controller.cpp", ) ) @@ -951,7 +951,7 @@ def get_files_to_be_generated( files.append( os.path.join( folder_path, - "interactors.cmake", + "controllers.cmake", ) ) files.append( @@ -988,14 +988,14 @@ def get_files_to_be_generated( files.append( os.path.join( folder_path, - "interactor_registration.h", + "controller_registration.h", ) ) files.append( os.path.join( folder_path, - "interactor_registration.cpp", + "controller_registration.cpp", ) ) @@ -1009,7 +1009,7 @@ def get_files_to_be_generated( # generate the files into the preview folder -def preview_interactor_files( +def preview_controller_files( root_path: str, manifest_file: str, files_to_be_generated: dict[str, bool] = None, @@ -1025,7 +1025,7 @@ def preview_interactor_files( manifest = yaml.safe_load(fh) # remove .. from the path and add preview before the folder name - manifest["interactor"]["folder_path"] = manifest["interactor"][ + manifest["controller"]["folder_path"] = manifest["controller"][ "folder_path" ].replace("..", "") @@ -1041,7 +1041,7 @@ def preview_interactor_files( for path, value in files_to_be_generated.items(): preview_files_to_be_generated[path.replace("..", "")] = value - generate_interactor_files( + generate_controller_files( root_path, manifest_preview_file, preview_files_to_be_generated, @@ -1049,7 +1049,7 @@ def preview_interactor_files( ) else: - generate_interactor_files( + generate_controller_files( root_path, manifest_preview_file, {}, uncrustify_config_file ) @@ -1071,9 +1071,9 @@ def preview_interactor_files( root_path = Path(manifest_file).parent if len(sys.argv) > 2 and sys.argv[2] == "--preview": - preview_interactor_files(root_path, manifest_file) + preview_controller_files(root_path, manifest_file) else: - generate_interactor_files(root_path, manifest_file) + generate_controller_files(root_path, manifest_file) else: print("Error: Manifest file must be named 'qleany.yaml' or 'qleany.yml'") else: diff --git a/tools/qleany/generator/manifest_schema.json b/tools/qleany/generator/manifest_schema.json index a3beef52..a8cd790a 100644 --- a/tools/qleany/generator/manifest_schema.json +++ b/tools/qleany/generator/manifest_schema.json @@ -134,19 +134,19 @@ "base_folder_path" ] }, - "interactor": { + "controller": { "type": "object", "properties": { "folder_path": { "type": "string" }, - "create_undo_redo_interactor": { + "create_undo_redo_controller": { "type": "boolean" } }, "required": [ "folder_path", - "create_undo_redo_interactor" + "create_undo_redo_controller" ] }, "application": { @@ -692,7 +692,7 @@ "global", "entities", "repositories", - "interactor", + "controller", "application", "DTOs", "CQRS", diff --git a/tools/qleany/generator/qleany_generator_gui.py b/tools/qleany/generator/qleany_generator_gui.py index 98522cfb..e17e56a0 100755 --- a/tools/qleany/generator/qleany_generator_gui.py +++ b/tools/qleany/generator/qleany_generator_gui.py @@ -50,7 +50,7 @@ import dto_generator import repositories_generator import cqrs_generator -import interactor_generator +import controller_generator import application_generator import qml_imports_generator import entity_relationship_viewer @@ -359,36 +359,36 @@ def enable_application_buttons(): self.btn_list_application.clicked.connect(enable_application_buttons) - # Generate Interactors + # Generate Controllers - self.generate_interactors_group_box = QGroupBox() - self.generate_interactors_group_box.setTitle("Generate Interactors") - self.generate_interactors_layout = QVBoxLayout() - self.generate_interactors_group_box.setLayout(self.generate_interactors_layout) + self.generate_controllers_group_box = QGroupBox() + self.generate_controllers_group_box.setTitle("Generate Controllers") + self.generate_controllers_layout = QVBoxLayout() + self.generate_controllers_group_box.setLayout(self.generate_controllers_layout) - self.btn_list_interactors = QPushButton("List", self) - self.btn_list_interactors.clicked.connect(self.list_interactors) - self.generate_interactors_layout.addWidget(self.btn_list_interactors) + self.btn_list_controllers = QPushButton("List", self) + self.btn_list_controllers.clicked.connect(self.list_controllers) + self.generate_controllers_layout.addWidget(self.btn_list_controllers) - self.btn_preview_interactors = QPushButton("Preview", self) - self.btn_preview_interactors.clicked.connect(self.preview_interactors) - self.generate_interactors_layout.addWidget(self.btn_preview_interactors) + self.btn_preview_controllers = QPushButton("Preview", self) + self.btn_preview_controllers.clicked.connect(self.preview_controllers) + self.generate_controllers_layout.addWidget(self.btn_preview_controllers) - self.btn_generate_interactors = QPushButton("Generate", self) - self.btn_generate_interactors.clicked.connect(self.generate_interactors) - self.generate_interactors_layout.addWidget(self.btn_generate_interactors) + self.btn_generate_controllers = QPushButton("Generate", self) + self.btn_generate_controllers.clicked.connect(self.generate_controllers) + self.generate_controllers_layout.addWidget(self.btn_generate_controllers) - self.first_row_button_layout.addWidget(self.generate_interactors_group_box) + self.first_row_button_layout.addWidget(self.generate_controllers_group_box) # disable preview and generate buttons if list button is not clicked once - self.btn_preview_interactors.setEnabled(False) - self.btn_generate_interactors.setEnabled(False) + self.btn_preview_controllers.setEnabled(False) + self.btn_generate_controllers.setEnabled(False) - def enable_interactors_buttons(): - self.btn_preview_interactors.setEnabled(True) - self.btn_generate_interactors.setEnabled(True) + def enable_controllers_buttons(): + self.btn_preview_controllers.setEnabled(True) + self.btn_generate_controllers.setEnabled(True) - self.btn_list_interactors.clicked.connect(enable_interactors_buttons) + self.btn_list_controllers.clicked.connect(enable_controllers_buttons) # Generate Presenters @@ -672,7 +672,7 @@ def list_all(self): presenter_generator.get_files_to_be_generated(self.temp_manifest_file) ) list.extend( - interactor_generator.get_files_to_be_generated(self.temp_manifest_file) + controller_generator.get_files_to_be_generated(self.temp_manifest_file) ) list.extend( application_generator.get_files_to_be_generated(self.temp_manifest_file) @@ -739,7 +739,7 @@ def preview_all(self): self.file_list_view.fetch_file_states(), self.uncrustify_config_file, ) - interactor_generator.preview_interactor_files( + controller_generator.preview_controller_files( self.root_path, self.temp_manifest_file, self.file_list_view.fetch_file_states(), @@ -817,7 +817,7 @@ def generate_all(self): ) ) file_list.extend( - interactor_generator.get_files_to_be_generated( + controller_generator.get_files_to_be_generated( self.temp_manifest_file, self.file_list_view.fetch_file_states() ) ) @@ -916,7 +916,7 @@ def generate_all(self): progress.setValue(5) QCoreApplication.processEvents() - interactor_generator.generate_interactor_files( + controller_generator.generate_controller_files( self.root_path, self.temp_manifest_file, self.file_list_view.fetch_file_states(), @@ -1228,18 +1228,18 @@ def generate_presenters(self): self.text_box.clear() self.text_box.setPlainText("Presenters generated") - # Interactors functions + # Controllers functions - def list_interactors(self): - list = interactor_generator.get_files_to_be_generated(self.temp_manifest_file) + def list_controllers(self): + list = controller_generator.get_files_to_be_generated(self.temp_manifest_file) self.text_box.clear() - self.text_box.setPlainText("Interactors to be generated:\n\n") + self.text_box.setPlainText("Controllers to be generated:\n\n") self.text_box.appendPlainText("\n".join(list)) self.file_list_view.list_files(list) - def preview_interactors(self): - self.list_interactors() - interactor_generator.preview_interactor_files( + def preview_controllers(self): + self.list_controllers() + controller_generator.preview_controller_files( self.root_path, self.temp_manifest_file, self.file_list_view.fetch_file_states(), @@ -1250,24 +1250,24 @@ def preview_interactors(self): f'Preview folder NOT cleared beforehand. Do it if needed by clicking on "Clear Preview Folder" button.' ) self.text_box.appendPlainText( - f" Interactors previewed at {Path(__file__).resolve().parent}/qleany_preview/ folder" + f" Controllers previewed at {Path(__file__).resolve().parent}/qleany_preview/ folder" ) - def generate_interactors(self): - self.list_interactors() + def generate_controllers(self): + self.list_controllers() if self.display_overwrite_confirmation( - interactor_generator.get_files_to_be_generated( + controller_generator.get_files_to_be_generated( self.temp_manifest_file, self.file_list_view.fetch_file_states() ) ): - interactor_generator.generate_interactor_files( + controller_generator.generate_controller_files( self.root_path, self.temp_manifest_file, self.file_list_view.fetch_file_states(), self.uncrustify_config_file, ) self.text_box.clear() - self.text_box.setPlainText("Interactors generated") + self.text_box.setPlainText("Controllers generated") # Application functions diff --git a/tools/qleany/generator/qleany_init.py b/tools/qleany/generator/qleany_init.py index e2a9a324..53e7c008 100644 --- a/tools/qleany/generator/qleany_init.py +++ b/tools/qleany/generator/qleany_init.py @@ -69,9 +69,9 @@ def generate_blank_qleany_yaml(folder_path: str): repository_folder_path: src/persistence/repository/ base_folder_path: src/persistence/ -interactor: - folder_path: src/interactor/ - create_undo_redo_interactor: false +controller: + folder_path: src/controller/ + create_undo_redo_controller: false application: common_cmake_folder_path: src/application diff --git a/tools/qleany/generator/qml_imports_generator.py b/tools/qleany/generator/qml_imports_generator.py index c33801ee..51033328 100755 --- a/tools/qleany/generator/qml_imports_generator.py +++ b/tools/qleany/generator/qml_imports_generator.py @@ -25,10 +25,10 @@ def _get_generation_dict( real_imports_folder_path = os.path.join(folder_path, "real_imports") mock_imports_folder_path = os.path.join(folder_path, "mock_imports") - # generating interactor files + # generating controller files generation_dict = {} - generation_dict["interactors"] = {} + generation_dict["controllers"] = {} for feature_name, feature_data in feature_by_name.items(): feature_snake_name = stringcase.snakecase(feature_name) feature_pascal_name = stringcase.pascalcase(feature_name) @@ -77,27 +77,27 @@ def _get_generation_dict( } ) - generation_dict["interactors"][feature_pascal_name] = { - "mock_interactor_file": os.path.join( + generation_dict["controllers"][feature_pascal_name] = { + "mock_controller_file": os.path.join( mock_imports_folder_path, - "Interactors", - f"{feature_pascal_name}Interactor.qml", + "Controllers", + f"{feature_pascal_name}Controller.qml", ), "mock_signals_file": os.path.join( mock_imports_folder_path, - "Interactors", + "Controllers", f"{feature_pascal_name}Signals.qml", ), - "mock_template_path": "QML/mock_imports/interactors/", - "mock_template": "interactor.qml.jinja2", + "mock_template_path": "QML/mock_imports/controllers/", + "mock_template": "controller.qml.jinja2", "mock_signals_template": "signals.qml.jinja2", - "real_interactor_file": os.path.join( + "real_controller_file": os.path.join( real_imports_folder_path, - "interactors", - f"foreign_{feature_snake_name}_interactor.h", + "controllers", + f"foreign_{feature_snake_name}_controller.h", ), - "real_template_path": "QML/real_imports/interactors/", - "real_template": "foreign_interactor.h.jinja2", + "real_template_path": "QML/real_imports/controllers/", + "real_template": "foreign_controller.h.jinja2", "feature_pascal_name": feature_pascal_name, "feature_camel_name": feature_camel_name, "feature_snake_name": feature_snake_name, @@ -117,32 +117,32 @@ def _get_generation_dict( "custom_queries": custom_queries, } - # add mock_custom_functions to the generation_dict["interactors"][feature_pascal_name] dict + # add mock_custom_functions to the generation_dict["controllers"][feature_pascal_name] dict for feature_name, feature_data in feature_by_name.items(): feature_pascal_name = stringcase.pascalcase(feature_name) - generation_dict["interactors"][feature_pascal_name][ + generation_dict["controllers"][feature_pascal_name][ "mock_custom_functions" ] = [] commands = feature_data.get("commands", []) if commands: for command in commands: - generation_dict["interactors"][feature_pascal_name][ + generation_dict["controllers"][feature_pascal_name][ "mock_custom_functions" ] += [stringcase.camelcase(command["name"])] queries = feature_data.get("queries", []) if queries: for query in queries: - generation_dict["interactors"][feature_pascal_name][ + generation_dict["controllers"][feature_pascal_name][ "mock_custom_functions" ] += [stringcase.camelcase(query["name"])] # add qmldir: - interactor_qmldir_file = os.path.join( - mock_imports_folder_path, "Interactors", "qmldir" + controller_qmldir_file = os.path.join( + mock_imports_folder_path, "Controllers", "qmldir" ) - generation_dict["interactor_qmldir_file"] = interactor_qmldir_file + generation_dict["controller_qmldir_file"] = controller_qmldir_file # add common real CmakeLists.txt file common_real_cmakelists_file = os.path.join( @@ -157,84 +157,84 @@ def _get_generation_dict( generation_dict["real_qml_modules_file"] = real_qml_modules_file # add CMakelists.txt: - interactor_cmakelists_file = os.path.join( - real_imports_folder_path, "interactors", "CMakeLists.txt" + controller_cmakelists_file = os.path.join( + real_imports_folder_path, "controllers", "CMakeLists.txt" ) - generation_dict["interactor_cmakelists_file"] = interactor_cmakelists_file - - # add "mock_interactor_file" and "real_interactor_file" to the generation_dict["real_interactor_files"] list - generation_dict["real_interactor_files"] = [] - generation_dict["mock_interactor_files"] = [] - for _, interactor in generation_dict["interactors"].items(): - generation_dict["real_interactor_files"].append( - interactor["real_interactor_file"] + generation_dict["controller_cmakelists_file"] = controller_cmakelists_file + + # add "mock_controller_file" and "real_controller_file" to the generation_dict["real_controller_files"] list + generation_dict["real_controller_files"] = [] + generation_dict["mock_controller_files"] = [] + for _, controller in generation_dict["controllers"].items(): + generation_dict["real_controller_files"].append( + controller["real_controller_file"] ) - generation_dict["mock_interactor_files"].append( - interactor["mock_interactor_file"] + generation_dict["mock_controller_files"].append( + controller["mock_controller_file"] ) - generation_dict["mock_interactor_files"].append(interactor["mock_signals_file"]) + generation_dict["mock_controller_files"].append(controller["mock_signals_file"]) # add event dispatcher real_event_dispatcher_file = os.path.join( real_imports_folder_path, - "interactors", + "controllers", "foreign_event_dispatcher.h", ) - generation_dict["real_interactor_files"].append(real_event_dispatcher_file) + generation_dict["real_controller_files"].append(real_event_dispatcher_file) generation_dict["real_event_dispatcher_file"] = real_event_dispatcher_file mock_event_dispatcher_file = os.path.join( mock_imports_folder_path, - "Interactors", + "Controllers", "EventDispatcher.qml", ) - generation_dict["mock_interactor_files"].append(mock_event_dispatcher_file) + generation_dict["mock_controller_files"].append(mock_event_dispatcher_file) generation_dict["mock_event_dispatcher_file"] = mock_event_dispatcher_file # add undo redo generation_dict["has_undo_redo"] = has_undo_redo if has_undo_redo: - real_undo_redo_interactor_file = os.path.join( - real_imports_folder_path, "interactors", "foreign_undo_redo_interactor.h" + real_undo_redo_controller_file = os.path.join( + real_imports_folder_path, "controllers", "foreign_undo_redo_controller.h" ) - generation_dict["real_interactor_files"].append(real_undo_redo_interactor_file) + generation_dict["real_controller_files"].append(real_undo_redo_controller_file) generation_dict[ - "real_undo_redo_interactor_file" - ] = real_undo_redo_interactor_file + "real_undo_redo_controller_file" + ] = real_undo_redo_controller_file - mock_undo_redo_interactor_file = os.path.join( - mock_imports_folder_path, "Interactors", "UndoRedoInteractor.qml" + mock_undo_redo_controller_file = os.path.join( + mock_imports_folder_path, "Controllers", "UndoRedoController.qml" ) - generation_dict["mock_interactor_files"].append(mock_undo_redo_interactor_file) + generation_dict["mock_controller_files"].append(mock_undo_redo_controller_file) generation_dict[ - "mock_undo_redo_interactor_file" - ] = mock_undo_redo_interactor_file + "mock_undo_redo_controller_file" + ] = mock_undo_redo_controller_file mock_undo_redo_signals_file = os.path.join( - mock_imports_folder_path, "Interactors", "UndoRedoSignals.qml" + mock_imports_folder_path, "Controllers", "UndoRedoSignals.qml" ) - generation_dict["mock_interactor_files"].append(mock_undo_redo_signals_file) + generation_dict["mock_controller_files"].append(mock_undo_redo_signals_file) generation_dict["mock_undo_redo_signals_file"] = mock_undo_redo_signals_file # progress signals mock_progress_signals_file = os.path.join( - mock_imports_folder_path, "Interactors", "ProgressSignals.qml" + mock_imports_folder_path, "Controllers", "ProgressSignals.qml" ) - generation_dict["mock_interactor_files"].append(mock_progress_signals_file) + generation_dict["mock_controller_files"].append(mock_progress_signals_file) generation_dict["mock_progress_signals_file"] = mock_progress_signals_file # error signals mock_error_signals_file = os.path.join( - mock_imports_folder_path, "Interactors", "ErrorSignals.qml" + mock_imports_folder_path, "Controllers", "ErrorSignals.qml" ) - generation_dict["mock_interactor_files"].append(mock_error_signals_file) + generation_dict["mock_controller_files"].append(mock_error_signals_file) generation_dict["mock_error_signals_file"] = mock_error_signals_file # QCoro::QmlTask mock qcoro_qmltask_file = os.path.join( - mock_imports_folder_path, "Interactors", "QCoroQmlTask.qml" + mock_imports_folder_path, "Controllers", "QCoroQmlTask.qml" ) - generation_dict["mock_interactor_files"].append(qcoro_qmltask_file) + generation_dict["mock_controller_files"].append(qcoro_qmltask_file) generation_dict["qcoro_qmltask_file"] = qcoro_qmltask_file # ---- add models @@ -412,28 +412,28 @@ def _get_generation_dict( return generation_dict -def _generate_mock_interactor_file( +def _generate_mock_controller_file( root_path: str, - interactor: dict, + controller: dict, generation_dict: dict, files_to_be_generated: dict[str, bool], ): - # generate the mock interactor file if in the files_to_be_generated dict the value is True - if not files_to_be_generated.get(interactor["mock_interactor_file"], False): + # generate the mock controller file if in the files_to_be_generated dict the value is True + if not files_to_be_generated.get(controller["mock_controller_file"], False): return # Create the jinja2 environment - template_path = os.path.join("templates", interactor["mock_template_path"]) + template_path = os.path.join("templates", controller["mock_template_path"]) env = Environment(loader=FileSystemLoader(template_path)) # Load the template - template = env.get_template(interactor["mock_template"]) + template = env.get_template(controller["mock_template"]) # Render the template output = template.render( - interactor=interactor, + controller=controller, ) - output_file = os.path.join(root_path, interactor["mock_interactor_file"]) + output_file = os.path.join(root_path, controller["mock_controller_file"]) # Create the directory if it does not exist os.makedirs(os.path.dirname(output_file), exist_ok=True) @@ -447,26 +447,26 @@ def _generate_mock_interactor_file( def _generate_mock_signals_file( root_path: str, - interactor: dict, + controller: dict, generation_dict: dict, files_to_be_generated: dict[str, bool], ): # generate the mock signals file if in the files_to_be_generated dict the value is True - if not files_to_be_generated.get(interactor["mock_signals_file"], False): + if not files_to_be_generated.get(controller["mock_signals_file"], False): return # Create the jinja2 environment - template_path = os.path.join("templates", interactor["mock_template_path"]) + template_path = os.path.join("templates", controller["mock_template_path"]) env = Environment(loader=FileSystemLoader(template_path)) # Load the template - template = env.get_template(interactor["mock_signals_template"]) + template = env.get_template(controller["mock_signals_template"]) # Render the template output = template.render( - interactor=interactor, + controller=controller, ) - output_file = os.path.join(root_path, interactor["mock_signals_file"]) + output_file = os.path.join(root_path, controller["mock_signals_file"]) # Create the directory if it does not exist os.makedirs(os.path.dirname(output_file), exist_ok=True) @@ -478,39 +478,39 @@ def _generate_mock_signals_file( print(f"Successfully wrote file {output_file}") -def _generate_mock_undo_redo_interactor_file( +def _generate_mock_undo_redo_controller_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool], ): - # generate the mock undo redo interactor file if in the files_to_be_generated dict the value is True - undo_redo_interactor_file = generation_dict["mock_undo_redo_interactor_file"] + # generate the mock undo redo controller file if in the files_to_be_generated dict the value is True + undo_redo_controller_file = generation_dict["mock_undo_redo_controller_file"] - if not files_to_be_generated.get(undo_redo_interactor_file, False): + if not files_to_be_generated.get(undo_redo_controller_file, False): return - undo_redo_interactor_file = os.path.join( + undo_redo_controller_file = os.path.join( root_path, - undo_redo_interactor_file, + undo_redo_controller_file, ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "mock_imports", "interactors") + template_path = os.path.join("templates", "QML", "mock_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template - template = env.get_template("undo_redo_interactor.qml.jinja2") + template = env.get_template("undo_redo_controller.qml.jinja2") # Render the template output = template.render() # Create the directory if it does not exist - os.makedirs(os.path.dirname(undo_redo_interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(undo_redo_controller_file), exist_ok=True) # Write the output to the file - with open(undo_redo_interactor_file, "w") as fh: + with open(undo_redo_controller_file, "w") as fh: fh.write(output) - print(f"Successfully wrote file {undo_redo_interactor_file}") + print(f"Successfully wrote file {undo_redo_controller_file}") def _generate_mock_undo_redo_signals_file( @@ -530,7 +530,7 @@ def _generate_mock_undo_redo_signals_file( ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "mock_imports", "interactors") + template_path = os.path.join("templates", "QML", "mock_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template template = env.get_template("undo_redo_signals.qml.jinja2") @@ -565,7 +565,7 @@ def _generate_mock_progress_signals_file( ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "mock_imports", "interactors") + template_path = os.path.join("templates", "QML", "mock_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template template = env.get_template("progress_signals.qml.jinja2") @@ -600,7 +600,7 @@ def _generate_mock_error_signals_file( ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "mock_imports", "interactors") + template_path = os.path.join("templates", "QML", "mock_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template template = env.get_template("error_signals.qml.jinja2") @@ -633,14 +633,14 @@ def _generate_mock_event_dispatcher_file( ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "mock_imports", "interactors") + template_path = os.path.join("templates", "QML", "mock_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template template = env.get_template("event_dispatcher.qml.jinja2") # Render the template output = template.render( - interactors=generation_dict["interactors"], + controllers=generation_dict["controllers"], has_undo_redo=generation_dict["has_undo_redo"], ) @@ -669,7 +669,7 @@ def _generate_mock_qcoro_qmltask_file( ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "mock_imports", "interactors") + template_path = os.path.join("templates", "QML", "mock_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template template = env.get_template("qcoro_qmltask.qml.jinja2") @@ -687,29 +687,29 @@ def _generate_mock_qcoro_qmltask_file( print(f"Successfully wrote file {qcoro_qmltask_file}") -def _generate_mock_interactors_qmldir_file( +def _generate_mock_controllers_qmldir_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] ): # generate the mock qmldir file if in the files_to_be_generated dict the value is True - if not files_to_be_generated.get(generation_dict["interactor_qmldir_file"], False): + if not files_to_be_generated.get(generation_dict["controller_qmldir_file"], False): return # Create the jinja2 environment env = Environment( - loader=FileSystemLoader("templates/QML/mock_imports/interactors/") + loader=FileSystemLoader("templates/QML/mock_imports/controllers/") ) # Load the template template = env.get_template("qmldir_template.jinja2") singleton_list = [] - for _, interactor in generation_dict["interactors"].items(): - name = interactor["feature_pascal_name"] - singleton_list.append(f"singleton {name}Interactor 1.0 {name}Interactor.qml") + for _, controller in generation_dict["controllers"].items(): + name = controller["feature_pascal_name"] + singleton_list.append(f"singleton {name}Controller 1.0 {name}Controller.qml") singleton_list.append(f"singleton {name}Signals 1.0 {name}Signals.qml") if generation_dict["has_undo_redo"]: singleton_list.append( - f"singleton UndoRedoInteractor 1.0 UndoRedoInteractor.qml" + f"singleton UndoRedoController 1.0 UndoRedoController.qml" ) singleton_list.append(f"singleton UndoRedoSignals 1.0 UndoRedoSignals.qml") singleton_list.append(f"singleton ProgressSignals 1.0 ProgressSignals.qml") @@ -720,7 +720,7 @@ def _generate_mock_interactors_qmldir_file( # Render the template output = template.render(singleton_list=singleton_list) - output_file = os.path.join(root_path, generation_dict["interactor_qmldir_file"]) + output_file = os.path.join(root_path, generation_dict["controller_qmldir_file"]) # Create the directory if it does not exist os.makedirs(os.path.dirname(output_file), exist_ok=True) @@ -732,32 +732,32 @@ def _generate_mock_interactors_qmldir_file( print(f"Successfully wrote file {output_file}") -def _generate_real_interactor_file( +def _generate_real_controller_file( root_path: str, - interactor: dict, + controller: dict, generation_dict: dict, files_to_be_generated: dict[str, bool], uncrustify_config_file: str, ): - # generate the real interactor file if in the files_to_be_generated dict the value is True - real_interactor_file = interactor["real_interactor_file"] + # generate the real controller file if in the files_to_be_generated dict the value is True + real_controller_file = controller["real_controller_file"] - if not files_to_be_generated.get(real_interactor_file, False): + if not files_to_be_generated.get(real_controller_file, False): return # Create the jinja2 environment - template_path = os.path.join("templates", interactor["real_template_path"]) + template_path = os.path.join("templates", controller["real_template_path"]) env = Environment(loader=FileSystemLoader(template_path)) # Load the template - template = env.get_template(interactor["real_template"]) + template = env.get_template(controller["real_template"]) # Render the template output = template.render( - interactor=interactor, + controller=controller, application_cpp_domain_name=generation_dict["application_cpp_domain_name"], ) - output_file = os.path.join(root_path, real_interactor_file) + output_file = os.path.join(root_path, real_controller_file) # Create the directory if it does not exist os.makedirs(os.path.dirname(output_file), exist_ok=True) @@ -767,31 +767,31 @@ def _generate_real_interactor_file( fh.write(output) # if uncrustify_config_file: - # uncrustify.run_uncrustify(real_interactor_file, uncrustify_config_file) + # uncrustify.run_uncrustify(real_controller_file, uncrustify_config_file) clang_format_runner.run_clang_format(output_file) print(f"Successfully wrote file {output_file}") -def _generate_real_undo_redo_interactor_file( +def _generate_real_undo_redo_controller_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] ): - # generate the real undo redo interactor file if in the files_to_be_generated dict the value is True - undo_redo_interactor_file = generation_dict["real_undo_redo_interactor_file"] + # generate the real undo redo controller file if in the files_to_be_generated dict the value is True + undo_redo_controller_file = generation_dict["real_undo_redo_controller_file"] - if not files_to_be_generated.get(undo_redo_interactor_file, False): + if not files_to_be_generated.get(undo_redo_controller_file, False): return - undo_redo_interactor_file = os.path.join( + undo_redo_controller_file = os.path.join( root_path, - undo_redo_interactor_file, + undo_redo_controller_file, ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "real_imports", "interactors") + template_path = os.path.join("templates", "QML", "real_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template - template = env.get_template("foreign_undo_redo_interactor.h.jinja2") + template = env.get_template("foreign_undo_redo_controller.h.jinja2") # Render the template output = template.render( @@ -799,17 +799,17 @@ def _generate_real_undo_redo_interactor_file( ) # Create the directory if it does not exist - os.makedirs(os.path.dirname(undo_redo_interactor_file), exist_ok=True) + os.makedirs(os.path.dirname(undo_redo_controller_file), exist_ok=True) # Write the output to the file - with open(undo_redo_interactor_file, "w") as fh: + with open(undo_redo_controller_file, "w") as fh: fh.write(output) # if uncrustify_config_file: - # uncrustify.run_uncrustify(undo_redo_interactor_file, uncrustify_config_file) - clang_format_runner.run_clang_format(undo_redo_interactor_file) + # uncrustify.run_uncrustify(undo_redo_controller_file, uncrustify_config_file) + clang_format_runner.run_clang_format(undo_redo_controller_file) - print(f"Successfully wrote file {undo_redo_interactor_file}") + print(f"Successfully wrote file {undo_redo_controller_file}") def _generate_real_event_dispatcher_file( @@ -827,7 +827,7 @@ def _generate_real_event_dispatcher_file( ) # Create the jinja2 environment - template_path = os.path.join("templates", "QML", "real_imports", "interactors") + template_path = os.path.join("templates", "QML", "real_imports", "controllers") env = Environment(loader=FileSystemLoader(template_path)) # Load the template template = env.get_template("foreign_event_dispatcher.h.jinja2") @@ -914,25 +914,25 @@ def _generate_real_qml_modules_file( print(f"Successfully wrote file {output_file}") -def _generate_real_interactors_cmakelists_file( +def _generate_real_controllers_cmakelists_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] ): - interactor_cmakelists_file = generation_dict["interactor_cmakelists_file"] + controller_cmakelists_file = generation_dict["controller_cmakelists_file"] # generate the real cmakelists file if in the files_to_be_generated dict the value is True - if not files_to_be_generated.get(interactor_cmakelists_file, False): + if not files_to_be_generated.get(controller_cmakelists_file, False): return - output_file = os.path.join(root_path, interactor_cmakelists_file) + output_file = os.path.join(root_path, controller_cmakelists_file) # Create the jinja2 environment env = Environment( - loader=FileSystemLoader("templates/QML/real_imports/interactors/") + loader=FileSystemLoader("templates/QML/real_imports/controllers/") ) # Load the template template = env.get_template("cmakelists.txt.jinja2") - files = generation_dict["real_interactor_files"] + files = generation_dict["real_controller_files"] relative_files = [] for file in files: relative_files.append( @@ -1065,13 +1065,13 @@ def _generate_mock_models_qmldir_file( def _generate_real_models_cmakelists_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] ): - interactor_cmakelists_file = generation_dict["model_cmakelists_file"] + controller_cmakelists_file = generation_dict["model_cmakelists_file"] # generate the real cmakelists file if in the files_to_be_generated dict the value is True - if not files_to_be_generated.get(interactor_cmakelists_file, False): + if not files_to_be_generated.get(controller_cmakelists_file, False): return - output_file = os.path.join(root_path, interactor_cmakelists_file) + output_file = os.path.join(root_path, controller_cmakelists_file) # Create the jinja2 environment env = Environment(loader=FileSystemLoader("templates/QML/real_imports/models/")) @@ -1210,13 +1210,13 @@ def _generate_mock_singles_qmldir_file( def _generate_real_singles_cmakelists_file( root_path: str, generation_dict: dict, files_to_be_generated: dict[str, bool] ): - interactor_cmakelists_file = generation_dict["single_cmakelists_file"] + controller_cmakelists_file = generation_dict["single_cmakelists_file"] # generate the real cmakelists file if in the files_to_be_generated dict the value is True - if not files_to_be_generated.get(interactor_cmakelists_file, False): + if not files_to_be_generated.get(controller_cmakelists_file, False): return - output_file = os.path.join(root_path, interactor_cmakelists_file) + output_file = os.path.join(root_path, controller_cmakelists_file) # Create the jinja2 environment env = Environment(loader=FileSystemLoader("templates/QML/real_imports/singles/")) @@ -1284,8 +1284,8 @@ def generate_qml_imports_files( # Organize feature_list by name for easier lookup feature_by_name = {feature["name"]: feature for feature in feature_list} - interactor_data = manifest_data.get("interactor", {}) - has_undo_redo = interactor_data.get("create_undo_redo_interactor", False) + controller_data = manifest_data.get("controller", {}) + has_undo_redo = controller_data.get("create_undo_redo_controller", False) presenter_data = manifest_data.get("presenter", {}) create_undo_and_redo_singles = presenter_data.get( @@ -1308,19 +1308,19 @@ def generate_qml_imports_files( ) # generate mock files - for _, interactor in generation_dict["interactors"].items(): - _generate_mock_interactor_file( - root_path, interactor, generation_dict, files_to_be_generated + for _, controller in generation_dict["controllers"].items(): + _generate_mock_controller_file( + root_path, controller, generation_dict, files_to_be_generated ) _generate_mock_signals_file( - root_path, interactor, generation_dict, files_to_be_generated + root_path, controller, generation_dict, files_to_be_generated ) _generate_mock_event_dispatcher_file( root_path, generation_dict, files_to_be_generated ) if has_undo_redo: - _generate_mock_undo_redo_interactor_file( + _generate_mock_undo_redo_controller_file( root_path, generation_dict, files_to_be_generated ) _generate_mock_undo_redo_signals_file( @@ -1335,15 +1335,15 @@ def generate_qml_imports_files( _generate_mock_qcoro_qmltask_file(root_path, generation_dict, files_to_be_generated) # generate mock qmldir file - _generate_mock_interactors_qmldir_file( + _generate_mock_controllers_qmldir_file( root_path, generation_dict, files_to_be_generated ) # generate real files - for _, interactor in generation_dict["interactors"].items(): - _generate_real_interactor_file( + for _, controller in generation_dict["controllers"].items(): + _generate_real_controller_file( root_path, - interactor, + controller, generation_dict, files_to_be_generated, uncrustify_config_file, @@ -1354,7 +1354,7 @@ def generate_qml_imports_files( ) if has_undo_redo: - _generate_real_undo_redo_interactor_file( + _generate_real_undo_redo_controller_file( root_path, generation_dict, files_to_be_generated ) @@ -1369,7 +1369,7 @@ def generate_qml_imports_files( ) # generate real CMakeLists.txt file - _generate_real_interactors_cmakelists_file( + _generate_real_controllers_cmakelists_file( root_path, generation_dict, files_to_be_generated ) @@ -1437,8 +1437,8 @@ def get_files_to_be_generated( application_data = manifest_data.get("application", {}) - interactor_data = manifest_data.get("interactor", {}) - has_undo_redo = interactor_data.get("create_undo_redo_interactor", False) + controller_data = manifest_data.get("controller", {}) + has_undo_redo = controller_data.get("create_undo_redo_controller", False) feature_list = application_data.get("features", []) @@ -1466,19 +1466,19 @@ def get_files_to_be_generated( application_cpp_domain_name, ) - files += generation_dict["real_interactor_files"] - files += generation_dict["mock_interactor_files"] + files += generation_dict["real_controller_files"] + files += generation_dict["mock_controller_files"] - # for _, interactor in generation_dict["interactors"].items(): - # files += feature["real_interactor_files"] + # for _, controller in generation_dict["controllers"].items(): + # files += feature["real_controller_files"] # # add CMakelists.txt: - interactor_cmakelists_file = generation_dict["interactor_cmakelists_file"] - files.append(interactor_cmakelists_file) + controller_cmakelists_file = generation_dict["controller_cmakelists_file"] + files.append(controller_cmakelists_file) # # add qmldir: - interactor_qmldir_file = generation_dict["interactor_qmldir_file"] - files.append(interactor_qmldir_file) + controller_qmldir_file = generation_dict["controller_qmldir_file"] + files.append(controller_qmldir_file) # list models files += generation_dict["real_model_files"] diff --git a/tools/qleany/generator/root_generator.py b/tools/qleany/generator/root_generator.py index 982081d9..a60df2ba 100644 --- a/tools/qleany/generator/root_generator.py +++ b/tools/qleany/generator/root_generator.py @@ -49,8 +49,8 @@ def _get_generation_dict(manifest_data) -> dict: cmakelists_dict["application_path"] = manifest_data.get("application", {}).get( "common_cmake_folder_path", "src/application" ) - cmakelists_dict["interactor_path"] = manifest_data.get("interactor", {}).get( - "folder_path", "src/interactor" + cmakelists_dict["controller_path"] = manifest_data.get("controller", {}).get( + "folder_path", "src/controller" ) cmakelists_dict["presenter_path"] = manifest_data.get("presenter", {}).get( "folder_path", "src/presenters" @@ -153,7 +153,7 @@ def _generate_cmakelists_file( contracts_dto_path=cmakelists_dict["contracts_dto_path"], contracts_cqrs_path=cmakelists_dict["contracts_cqrs_path"], application_path=cmakelists_dict["application_path"], - interactor_path=cmakelists_dict["interactor_path"], + controller_path=cmakelists_dict["controller_path"], presenter_path=cmakelists_dict["presenter_path"], front_ends=cmakelists_dict["front_ends"], ) @@ -199,7 +199,7 @@ def _generate_cmakelists_file_for_multiple_uis( contracts_dto_path=cmakelists_dict["contracts_dto_path"], contracts_cqrs_path=cmakelists_dict["contracts_cqrs_path"], application_path=cmakelists_dict["application_path"], - interactor_path=cmakelists_dict["interactor_path"], + controller_path=cmakelists_dict["controller_path"], presenter_path=cmakelists_dict["presenter_path"], front_ends=cmakelists_dict["front_ends"], ) @@ -244,7 +244,7 @@ def _generate_cmakelists_file_for_no_ui( contracts_dto_path=cmakelists_dict["contracts_dto_path"], contracts_cqrs_path=cmakelists_dict["contracts_cqrs_path"], application_path=cmakelists_dict["application_path"], - interactor_path=cmakelists_dict["interactor_path"], + controller_path=cmakelists_dict["controller_path"], presenter_path=cmakelists_dict["presenter_path"], front_ends=cmakelists_dict["front_ends"], ) diff --git a/tools/qleany/generator/temp/manifest_preview.yaml b/tools/qleany/generator/temp/manifest_preview.yaml index 5525f534..3e066f3f 100755 --- a/tools/qleany/generator/temp/manifest_preview.yaml +++ b/tools/qleany/generator/temp/manifest_preview.yaml @@ -218,9 +218,9 @@ global: organisation: domain: qleany.eu name: frontendsexample -interactor: - create_undo_redo_interactor: true - folder_path: src/core/interactor/ +controller: + create_undo_redo_controller: true + folder_path: src/core/controller/ presenter: create_undo_and_redo_singles: true folder_path: src/gui/presenter diff --git a/tools/qleany/generator/temp/manifest_temp.yaml b/tools/qleany/generator/temp/manifest_temp.yaml index b28fc3be..7bb926b7 100755 --- a/tools/qleany/generator/temp/manifest_temp.yaml +++ b/tools/qleany/generator/temp/manifest_temp.yaml @@ -216,9 +216,9 @@ global: organisation: domain: qleany.eu name: frontendsexample -interactor: - create_undo_redo_interactor: true - folder_path: src/core/interactor/ +controller: + create_undo_redo_controller: true + folder_path: src/core/controller/ presenter: create_undo_and_redo_singles: true folder_path: src/gui/presenter diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/interactor.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/controller.qml.jinja2 similarity index 69% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/interactor.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/controller.qml.jinja2 index 62882291..e597c2fb 100755 --- a/tools/qleany/generator/templates/QML/mock_imports/interactors/interactor.qml.jinja2 +++ b/tools/qleany/generator/templates/QML/mock_imports/controllers/controller.qml.jinja2 @@ -5,37 +5,37 @@ pragma Singleton import QtQuick QtObject { - id: interactor -{% if interactor.crud.enabled %} -{% if interactor.crud.get %} + id: controller +{% if controller.crud.enabled %} +{% if controller.crud.get %} function get(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); - task.setSignalFn(function(){EventDispatcher.{{ interactor.feature_camel_name }}().getReplied(id)}) + task.setSignalFn(function(){EventDispatcher.{{ controller.feature_camel_name }}().getReplied(id)}) } return task } {% endif -%} -{% if interactor.crud.get_with_details %} +{% if controller.crud.get_with_details %} function getWithDetails(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); - task.setSignalFn(function(){EventDispatcher.{{ interactor.feature_camel_name }}().getWithDetailsReplied(id)}) + task.setSignalFn(function(){EventDispatcher.{{ controller.feature_camel_name }}().getWithDetailsReplied(id)}) } return task } {% endif -%} -{% if interactor.crud.get_all %} +{% if controller.crud.get_all %} function getAll() { // fill it with whatever you want to return var dtos = [] @@ -43,19 +43,19 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dtos); task.setDelay(50); - task.setSignalFn(function(){EventDispatcher.{{ interactor.feature_camel_name }}().getAllReplied(dtos)}) + task.setSignalFn(function(){EventDispatcher.{{ controller.feature_camel_name }}().getAllReplied(dtos)}) } return task } {% endif -%} -{% if interactor.crud.create %} +{% if controller.crud.create %} function getCreateDTO() { return { - "content": "{{ interactor.feature_pascal_name }} 1" + "content": "{{ controller.feature_pascal_name }} 1" } } @@ -67,16 +67,16 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); - task.setSignalFn(function(){EventDispatcher.{{ interactor.feature_camel_name }}().created(dto)}) + task.setSignalFn(function(){EventDispatcher.{{ controller.feature_camel_name }}().created(dto)}) } return task } {% endif -%} -{% if interactor.crud.update_ %} +{% if controller.crud.update_ %} function getUpdateDTO() { return { "id": 0, @@ -89,29 +89,29 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ - EventDispatcher.{{ interactor.feature_camel_name }}().updated(dto); - EventDispatcher.{{ interactor.feature_camel_name }}().allRelationsInvalidated(dto.id); + EventDispatcher.{{ controller.feature_camel_name }}().updated(dto); + EventDispatcher.{{ controller.feature_camel_name }}().allRelationsInvalidated(dto.id); }) } return task } {% endif -%} -{% if interactor.crud.remove %} - signal {{ interactor.feature_camel_name }}Removed(int id) +{% if controller.crud.remove %} + signal {{ controller.feature_camel_name }}Removed(int id) function remove(id) { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(dto); task.setDelay(50); task.setSignalFn(function(){ - EventDispatcher.{{ interactor.feature_camel_name }}().removed(id); + EventDispatcher.{{ controller.feature_camel_name }}().removed(id); }) } @@ -120,7 +120,7 @@ QtObject { {% endif -%} {% endif -%} -{%- for command in interactor.custom_commands %} +{%- for command in controller.custom_commands %} function {{ command.camel_name }}(dto) { // TODO: change this dict below to conform to the command's dto out @@ -132,12 +132,12 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ // TODO: change this signal name to the correct one - EventDispatcher.{{ interactor.feature_camel_name }}().{{ command.camel_name }}Changed(reply_dto); + EventDispatcher.{{ controller.feature_camel_name }}().{{ command.camel_name }}Changed(reply_dto); }) } @@ -156,7 +156,7 @@ QtObject { {% endfor %} -{%- for query in interactor.custom_queries %} +{%- for query in controller.custom_queries %} function {{ query.camel_name }}(dto) { // TODO: change this dict below to conform to the query's dto out @@ -168,12 +168,12 @@ QtObject { // mocking QCoro::Task var component = Qt.createComponent("QCoroQmlTask.qml"); if (component.status === Component.Ready) { - var task = component.createObject(interactor); + var task = component.createObject(controller); task.setValue(reply_dto); task.setDelay(50); task.setSignalFn(function(){ // TODO: change this signal name to the correct one - EventDispatcher.{{ interactor.feature_camel_name }}().{{ query.camel_name }}Replied(reply_dto); + EventDispatcher.{{ controller.feature_camel_name }}().{{ query.camel_name }}Replied(reply_dto); }) } diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/error_signals.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/error_signals.qml.jinja2 similarity index 100% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/error_signals.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/error_signals.qml.jinja2 diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/event_dispatcher.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/event_dispatcher.qml.jinja2 similarity index 72% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/event_dispatcher.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/event_dispatcher.qml.jinja2 index c98ef8e5..7abbae56 100644 --- a/tools/qleany/generator/templates/QML/mock_imports/interactors/event_dispatcher.qml.jinja2 +++ b/tools/qleany/generator/templates/QML/mock_imports/controllers/event_dispatcher.qml.jinja2 @@ -17,9 +17,9 @@ QtObject { } {% endif %} -{% for feature_name, interactor in interactors.items() %} - function {{ interactor.feature_camel_name }}() { - return {{ interactor.feature_pascal_name }}Signals; +{% for feature_name, controller in controllers.items() %} + function {{ controller.feature_camel_name }}() { + return {{ controller.feature_pascal_name }}Signals; } {% endfor %} } diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/progress_signals.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/progress_signals.qml.jinja2 similarity index 100% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/progress_signals.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/progress_signals.qml.jinja2 diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/qcoro_qmltask.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/qcoro_qmltask.qml.jinja2 similarity index 100% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/qcoro_qmltask.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/qcoro_qmltask.qml.jinja2 diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/qmldir_template.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/qmldir_template.jinja2 similarity index 90% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/qmldir_template.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/qmldir_template.jinja2 index 3686313c..95bdf7db 100755 --- a/tools/qleany/generator/templates/QML/mock_imports/interactors/qmldir_template.jinja2 +++ b/tools/qleany/generator/templates/QML/mock_imports/controllers/qmldir_template.jinja2 @@ -1,6 +1,6 @@ # This file was generated automatically by Qleany's generator, edit at your own risk! # If you do, be careful to not overwrite it when you run the generator again. -Module Interactors +Module Controllers {% for singleton in singleton_list -%} {{ singleton }} {% endfor %} diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/signals.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/signals.qml.jinja2 similarity index 64% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/signals.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/signals.qml.jinja2 index 55724996..9328bc00 100755 --- a/tools/qleany/generator/templates/QML/mock_imports/interactors/signals.qml.jinja2 +++ b/tools/qleany/generator/templates/QML/mock_imports/controllers/signals.qml.jinja2 @@ -5,36 +5,36 @@ pragma Singleton import QtQuick QtObject { -{%- if interactor.crud.enabled %} -{%- if interactor.crud.get %} +{%- if controller.crud.enabled %} +{%- if controller.crud.get %} signal getReplied(var dto) {%- endif %} -{%- if interactor.crud.get_with_details %} +{%- if controller.crud.get_with_details %} signal getWithDetailsReplied(var dto) {%- endif %} -{%- if interactor.crud.get_all %} +{%- if controller.crud.get_all %} signal getAllReplied(list dto) {%- endif %} -{%- if interactor.crud.remove %} +{%- if controller.crud.remove %} signal removed(list removedIds) {%- endif %} -{%- if interactor.crud.create %} +{%- if controller.crud.create %} signal created(var dto) {%- endif %} -{%- if interactor.crud.update_ %} +{%- if controller.crud.update_ %} signal updated(var dto) signal allRelationsInvalidated(int itemId) {%- endif %} -{%- if interactor.crud.entity_has_relation_fields %} +{%- if controller.crud.entity_has_relation_fields %} signal relationInserted(var relationDto) signal relationRemoved(var relationDto) {%- endif %} {%- endif -%} -{%- for command in interactor.custom_commands %} +{%- for command in controller.custom_commands %} signal {{ command.camel_name }}Changed(var dto) {%- endfor %} -{%- for query in interactor.custom_queries %} +{%- for query in controller.custom_queries %} signal {{ query.camel_name }}Replied(var dto) {%- endfor %} } diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/undo_redo_interactor.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/undo_redo_controller.qml.jinja2 similarity index 100% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/undo_redo_interactor.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/undo_redo_controller.qml.jinja2 diff --git a/tools/qleany/generator/templates/QML/mock_imports/interactors/undo_redo_signals.qml.jinja2 b/tools/qleany/generator/templates/QML/mock_imports/controllers/undo_redo_signals.qml.jinja2 similarity index 100% rename from tools/qleany/generator/templates/QML/mock_imports/interactors/undo_redo_signals.qml.jinja2 rename to tools/qleany/generator/templates/QML/mock_imports/controllers/undo_redo_signals.qml.jinja2 diff --git a/tools/qleany/generator/templates/QML/real_imports/cmakelists.txt.jinja2 b/tools/qleany/generator/templates/QML/real_imports/cmakelists.txt.jinja2 index 75833ed1..b1dcde6b 100755 --- a/tools/qleany/generator/templates/QML/real_imports/cmakelists.txt.jinja2 +++ b/tools/qleany/generator/templates/QML/real_imports/cmakelists.txt.jinja2 @@ -2,5 +2,5 @@ # If you do, be careful to not overwrite it when you run the generator again. add_subdirectory(models) -add_subdirectory(interactors) +add_subdirectory(controllers) add_subdirectory(singles) diff --git a/tools/qleany/generator/templates/QML/real_imports/interactors/cmakelists.txt.jinja2 b/tools/qleany/generator/templates/QML/real_imports/controllers/cmakelists.txt.jinja2 similarity index 84% rename from tools/qleany/generator/templates/QML/real_imports/interactors/cmakelists.txt.jinja2 rename to tools/qleany/generator/templates/QML/real_imports/controllers/cmakelists.txt.jinja2 index f2d5d4b1..bf79fb5e 100755 --- a/tools/qleany/generator/templates/QML/real_imports/interactors/cmakelists.txt.jinja2 +++ b/tools/qleany/generator/templates/QML/real_imports/controllers/cmakelists.txt.jinja2 @@ -3,12 +3,12 @@ find_package(Qt6 COMPONENTS Core Quick Qml REQUIRED) find_package(QCoro6 REQUIRED COMPONENTS Core Qml) -set(PLUGIN_NAME {{ application_name }}-qml-interactors) +set(PLUGIN_NAME {{ application_name }}-qml-controllers) qt_add_library(${PLUGIN_NAME} STATIC) qt6_add_qml_module(${PLUGIN_NAME} - URI "Interactors" + URI "Controllers" VERSION 1.0 SOURCES {% for file in files %} @@ -17,7 +17,7 @@ qt6_add_qml_module(${PLUGIN_NAME} ) -target_link_libraries(${PLUGIN_NAME} PRIVATE {{ application_name }}-interactor) +target_link_libraries(${PLUGIN_NAME} PRIVATE {{ application_name }}-controller) target_link_libraries(${PLUGIN_NAME} PRIVATE QCoro::Core QCoro::Qml) target_link_libraries(${PLUGIN_NAME} diff --git a/tools/qleany/generator/templates/QML/real_imports/controllers/foreign_controller.h.jinja2 b/tools/qleany/generator/templates/QML/real_imports/controllers/foreign_controller.h.jinja2 new file mode 100755 index 00000000..881eb256 --- /dev/null +++ b/tools/qleany/generator/templates/QML/real_imports/controllers/foreign_controller.h.jinja2 @@ -0,0 +1,120 @@ +// This file was generated automatically by Qleany's generator, edit at your own risk! +// If you do, be careful to not overwrite it when you run the generator again. +#pragma once +#include "{{ controller.feature_snake_name }}/{{ controller.feature_snake_name }}_controller.h" +#include +#include +#include + + +using namespace {{ application_cpp_domain_name }}::Controller::{{ controller.feature_pascal_name }}; + +class Foreign{{ controller.feature_pascal_name }}Controller : public QObject +{ + Q_OBJECT + QML_SINGLETON + QML_NAMED_ELEMENT({{ controller.feature_pascal_name }}Controller) + +public: + + Foreign{{ controller.feature_pascal_name }}Controller(QObject *parent = nullptr) : QObject(parent) + { + s_controllerInstance = {{ controller.feature_pascal_name }}Controller::instance(); + } + +{% if controller.crud.enabled %} + {%if controller.crud.get %} + Q_INVOKABLE QCoro::QmlTask get(int id) const + { + return s_controllerInstance->get(id); + } + {% endif %} + + {%if controller.crud.get_with_details %} + Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const + { + return s_controllerInstance->get(id); + } + {% endif %} + + {%if controller.crud.get_all %} + Q_INVOKABLE QCoro::QmlTask getAll() const + { + return s_controllerInstance->getAll(); + } + {% endif %} + + {%if controller.crud.create %} + Q_INVOKABLE Create{{ controller.feature_pascal_name }}DTO getCreateDTO() + { + return s_controllerInstance->getCreateDTO(); + } + {% endif %} + + {%if controller.crud.update_ %} + Q_INVOKABLE Update{{ controller.feature_pascal_name }}DTO getUpdateDTO() + { + return s_controllerInstance->getUpdateDTO(); + } + {% endif %} +{% endif %} + + {% for query in controller.custom_queries %} + Q_INVOKABLE QCoro::QmlTask {{ query.camel_name }}({% if query.dto_in_enabled %}{{ query.dto_in_pascal_type_prefix }}DTO dto{% endif %}) const + { + return s_controllerInstance->{{ query.camel_name }}({% if query.dto_in_enabled %}dto{% endif %}); + } + + {%if query.dto_in_enabled %} + Q_INVOKABLE {{ query.dto_in_pascal_type_prefix }}DTO get{{ query.dto_in_pascal_type_prefix }}DTO() + { + return s_controllerInstance->get{{ query.dto_in_pascal_type_prefix }}DTO(); + } + {% endif %} + + {% endfor %} + +{% if controller.crud.enabled %} + {% if controller.crud.create %} + + Q_INVOKABLE QCoro::QmlTask create(const Create{{ controller.feature_pascal_name }}DTO &dto) + { + return s_controllerInstance->create(dto); + } + {% endif %} + + {% if controller.crud.update_ %} + Q_INVOKABLE QCoro::QmlTask update(const Update{{ controller.feature_pascal_name }}DTO &dto) + { + return s_controllerInstance->update(dto); + } + {% endif %} + + {%if controller.crud.remove %} + Q_INVOKABLE QCoro::QmlTask remove(int id) + { + return s_controllerInstance->remove(id); + } + {% endif %} +{% endif %} + + {% for command in controller.custom_commands %} + Q_INVOKABLE QCoro::QmlTask {{ command.camel_name }}({% if command.dto_in_enabled %}{{ command.dto_in_pascal_type_prefix }}DTO dto{% endif %}) + { + return s_controllerInstance->{{ command.camel_name }}({% if command.dto_in_enabled %}dto{% endif %}); + } + + {%if command.dto_in_enabled %} + Q_INVOKABLE {{ command.dto_in_pascal_type_prefix }}DTO get{{ command.dto_in_pascal_type_prefix }}DTO() + { + return s_controllerInstance->get{{ command.dto_in_pascal_type_prefix }}DTO(); + } + {% endif %} + + {% endfor %} + + +private: + + {{ controller.feature_pascal_name }}Controller *s_controllerInstance = nullptr; +}; diff --git a/tools/qleany/generator/templates/QML/real_imports/interactors/foreign_event_dispatcher.h.jinja2 b/tools/qleany/generator/templates/QML/real_imports/controllers/foreign_event_dispatcher.h.jinja2 similarity index 85% rename from tools/qleany/generator/templates/QML/real_imports/interactors/foreign_event_dispatcher.h.jinja2 rename to tools/qleany/generator/templates/QML/real_imports/controllers/foreign_event_dispatcher.h.jinja2 index cbc65618..9d8ebd15 100644 --- a/tools/qleany/generator/templates/QML/real_imports/interactors/foreign_event_dispatcher.h.jinja2 +++ b/tools/qleany/generator/templates/QML/real_imports/controllers/foreign_event_dispatcher.h.jinja2 @@ -8,18 +8,18 @@ struct ForeignEventDispatcher { Q_GADGET - QML_FOREIGN({{ application_cpp_domain_name }}::Interactor::EventDispatcher) + QML_FOREIGN({{ application_cpp_domain_name }}::Controller::EventDispatcher) QML_SINGLETON QML_NAMED_ELEMENT(EventDispatcher) public: // Initialize this singleton instance with the given engine. - inline static {{ application_cpp_domain_name }}::Interactor::EventDispatcher *s_singletonInstance = nullptr; + inline static {{ application_cpp_domain_name }}::Controller::EventDispatcher *s_singletonInstance = nullptr; - static {{ application_cpp_domain_name }}::Interactor::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) + static {{ application_cpp_domain_name }}::Controller::EventDispatcher *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = {{ application_cpp_domain_name }}::Interactor::EventDispatcher::instance(); + s_singletonInstance = {{ application_cpp_domain_name }}::Controller::EventDispatcher::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/tools/qleany/generator/templates/QML/real_imports/interactors/foreign_undo_redo_interactor.h.jinja2 b/tools/qleany/generator/templates/QML/real_imports/controllers/foreign_undo_redo_controller.h.jinja2 similarity index 67% rename from tools/qleany/generator/templates/QML/real_imports/interactors/foreign_undo_redo_interactor.h.jinja2 rename to tools/qleany/generator/templates/QML/real_imports/controllers/foreign_undo_redo_controller.h.jinja2 index 6eb483c8..804b699a 100755 --- a/tools/qleany/generator/templates/QML/real_imports/interactors/foreign_undo_redo_interactor.h.jinja2 +++ b/tools/qleany/generator/templates/QML/real_imports/controllers/foreign_undo_redo_controller.h.jinja2 @@ -1,27 +1,27 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #pragma once -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" #include -using namespace {{ application_cpp_domain_name }}::Interactor::UndoRedo; +using namespace {{ application_cpp_domain_name }}::Controller::UndoRedo; -struct ForeignUndoRedoInteractor +struct ForeignUndoRedoController { Q_GADGET - QML_FOREIGN({{ application_cpp_domain_name }}::Interactor::UndoRedo::UndoRedoInteractor) + QML_FOREIGN({{ application_cpp_domain_name }}::Controller::UndoRedo::UndoRedoController) QML_SINGLETON - QML_NAMED_ELEMENT(UndoRedoInteractor) + QML_NAMED_ELEMENT(UndoRedoController) public: // Initialize this singleton instance with the given engine. - inline static UndoRedoInteractor *s_singletonInstance = nullptr; + inline static UndoRedoController *s_singletonInstance = nullptr; - static UndoRedoInteractor *create(QQmlEngine *, QJSEngine *engine) + static UndoRedoController *create(QQmlEngine *, QJSEngine *engine) { - s_singletonInstance = UndoRedoInteractor::instance(); + s_singletonInstance = UndoRedoController::instance(); // The instance has to exist before it is used. We cannot replace it. Q_ASSERT(s_singletonInstance); diff --git a/tools/qleany/generator/templates/QML/real_imports/interactors/foreign_interactor.h.jinja2 b/tools/qleany/generator/templates/QML/real_imports/interactors/foreign_interactor.h.jinja2 deleted file mode 100755 index 3a93dcb0..00000000 --- a/tools/qleany/generator/templates/QML/real_imports/interactors/foreign_interactor.h.jinja2 +++ /dev/null @@ -1,120 +0,0 @@ -// This file was generated automatically by Qleany's generator, edit at your own risk! -// If you do, be careful to not overwrite it when you run the generator again. -#pragma once -#include "{{ interactor.feature_snake_name }}/{{ interactor.feature_snake_name }}_interactor.h" -#include -#include -#include - - -using namespace {{ application_cpp_domain_name }}::Interactor::{{ interactor.feature_pascal_name }}; - -class Foreign{{ interactor.feature_pascal_name }}Interactor : public QObject -{ - Q_OBJECT - QML_SINGLETON - QML_NAMED_ELEMENT({{ interactor.feature_pascal_name }}Interactor) - -public: - - Foreign{{ interactor.feature_pascal_name }}Interactor(QObject *parent = nullptr) : QObject(parent) - { - s_interactorInstance = {{ interactor.feature_pascal_name }}Interactor::instance(); - } - -{% if interactor.crud.enabled %} - {%if interactor.crud.get %} - Q_INVOKABLE QCoro::QmlTask get(int id) const - { - return s_interactorInstance->get(id); - } - {% endif %} - - {%if interactor.crud.get_with_details %} - Q_INVOKABLE QCoro::QmlTask getWithDetails(int id) const - { - return s_interactorInstance->get(id); - } - {% endif %} - - {%if interactor.crud.get_all %} - Q_INVOKABLE QCoro::QmlTask getAll() const - { - return s_interactorInstance->getAll(); - } - {% endif %} - - {%if interactor.crud.create %} - Q_INVOKABLE Create{{ interactor.feature_pascal_name }}DTO getCreateDTO() - { - return s_interactorInstance->getCreateDTO(); - } - {% endif %} - - {%if interactor.crud.update_ %} - Q_INVOKABLE Update{{ interactor.feature_pascal_name }}DTO getUpdateDTO() - { - return s_interactorInstance->getUpdateDTO(); - } - {% endif %} -{% endif %} - - {% for query in interactor.custom_queries %} - Q_INVOKABLE QCoro::QmlTask {{ query.camel_name }}({% if query.dto_in_enabled %}{{ query.dto_in_pascal_type_prefix }}DTO dto{% endif %}) const - { - return s_interactorInstance->{{ query.camel_name }}({% if query.dto_in_enabled %}dto{% endif %}); - } - - {%if query.dto_in_enabled %} - Q_INVOKABLE {{ query.dto_in_pascal_type_prefix }}DTO get{{ query.dto_in_pascal_type_prefix }}DTO() - { - return s_interactorInstance->get{{ query.dto_in_pascal_type_prefix }}DTO(); - } - {% endif %} - - {% endfor %} - -{% if interactor.crud.enabled %} - {% if interactor.crud.create %} - - Q_INVOKABLE QCoro::QmlTask create(const Create{{ interactor.feature_pascal_name }}DTO &dto) - { - return s_interactorInstance->create(dto); - } - {% endif %} - - {% if interactor.crud.update_ %} - Q_INVOKABLE QCoro::QmlTask update(const Update{{ interactor.feature_pascal_name }}DTO &dto) - { - return s_interactorInstance->update(dto); - } - {% endif %} - - {%if interactor.crud.remove %} - Q_INVOKABLE QCoro::QmlTask remove(int id) - { - return s_interactorInstance->remove(id); - } - {% endif %} -{% endif %} - - {% for command in interactor.custom_commands %} - Q_INVOKABLE QCoro::QmlTask {{ command.camel_name }}({% if command.dto_in_enabled %}{{ command.dto_in_pascal_type_prefix }}DTO dto{% endif %}) - { - return s_interactorInstance->{{ command.camel_name }}({% if command.dto_in_enabled %}dto{% endif %}); - } - - {%if command.dto_in_enabled %} - Q_INVOKABLE {{ command.dto_in_pascal_type_prefix }}DTO get{{ command.dto_in_pascal_type_prefix }}DTO() - { - return s_interactorInstance->get{{ command.dto_in_pascal_type_prefix }}DTO(); - } - {% endif %} - - {% endfor %} - - -private: - - {{ interactor.feature_pascal_name }}Interactor *s_interactorInstance = nullptr; -}; diff --git a/tools/qleany/generator/templates/QML/realqmlmodules.cmake.jinja2 b/tools/qleany/generator/templates/QML/realqmlmodules.cmake.jinja2 index fa4c7005..ff6dcd76 100644 --- a/tools/qleany/generator/templates/QML/realqmlmodules.cmake.jinja2 +++ b/tools/qleany/generator/templates/QML/realqmlmodules.cmake.jinja2 @@ -6,7 +6,7 @@ add_subdirectory(real_imports) # For integration in QT Design Studio project, you may have to replace # ${APP_NAME} by ${CMAKE_PROJECT_NAME} or by the name of your project target_link_libraries(${APP_NAME} PRIVATE -{{ application_name }}-qml-interactorsplugin +{{ application_name }}-qml-controllersplugin {{ application_name }}-qml-modelsplugin {{ application_name }}-qml-singlesplugin ) diff --git a/tools/qleany/generator/templates/UIs/kf6_kirigami/CMakeLists.txt.jinja2 b/tools/qleany/generator/templates/UIs/kf6_kirigami/CMakeLists.txt.jinja2 index a0d793f3..2b75aef2 100644 --- a/tools/qleany/generator/templates/UIs/kf6_kirigami/CMakeLists.txt.jinja2 +++ b/tools/qleany/generator/templates/UIs/kf6_kirigami/CMakeLists.txt.jinja2 @@ -22,7 +22,7 @@ qcoro_enable_coroutines() target_link_libraries(${APP_NAME} PUBLIC {{ application_name_spinal }}-entities) target_link_libraries(${APP_NAME} PUBLIC {{ application_name_spinal }}-persistence) -target_link_libraries(${APP_NAME} PUBLIC {{ application_name_spinal }}-interactor) +target_link_libraries(${APP_NAME} PUBLIC {{ application_name_spinal }}-controller) target_link_libraries(${APP_NAME} PUBLIC {{ application_name_spinal }}-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core QCoro::Qml) diff --git a/tools/qleany/generator/templates/UIs/kf6_kirigami/main.cpp.jinja2 b/tools/qleany/generator/templates/UIs/kf6_kirigami/main.cpp.jinja2 index 329106f9..34433f03 100644 --- a/tools/qleany/generator/templates/UIs/kf6_kirigami/main.cpp.jinja2 +++ b/tools/qleany/generator/templates/UIs/kf6_kirigami/main.cpp.jinja2 @@ -24,7 +24,7 @@ #ifndef BUILD_WITH_MOCKS #include "entities_registration.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "persistence_registration.h" #endif #include "{{ application_name_lower }}config.h" @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) new {{ application_cpp_domain_name }}::Entities::EntitiesRegistration(&app); auto *persistenceRegistration = new {{ application_cpp_domain_name }}::Persistence::PersistenceRegistration(&app); - new {{ application_cpp_domain_name }}::Interactor::InteractorRegistration(&app, persistenceRegistration->repositoryProvider()); + new {{ application_cpp_domain_name }}::Controller::ControllerRegistration(&app, persistenceRegistration->repositoryProvider()); #endif #ifdef Q_OS_WINDOWS diff --git a/tools/qleany/generator/templates/UIs/qt_quick/CMakeLists.txt.jinja2 b/tools/qleany/generator/templates/UIs/qt_quick/CMakeLists.txt.jinja2 index eb20d01c..4885dfbc 100644 --- a/tools/qleany/generator/templates/UIs/qt_quick/CMakeLists.txt.jinja2 +++ b/tools/qleany/generator/templates/UIs/qt_quick/CMakeLists.txt.jinja2 @@ -31,7 +31,7 @@ qt_add_resources(${APP_NAME} "configuration" PREFIX "/" FILES target_link_libraries(${APP_NAME} PUBLIC qleany) target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-entities) target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-persistence) -target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-interactor) +target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-controller) target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core QCoro::Qml) diff --git a/tools/qleany/generator/templates/UIs/qt_quick/content/App.qml.jinja2 b/tools/qleany/generator/templates/UIs/qt_quick/content/App.qml.jinja2 index ffc931a6..9e8da6ab 100644 --- a/tools/qleany/generator/templates/UIs/qt_quick/content/App.qml.jinja2 +++ b/tools/qleany/generator/templates/UIs/qt_quick/content/App.qml.jinja2 @@ -6,7 +6,7 @@ import QtQuick.Layouts import QtQuick.Controls // Components -import Interactors +import Controllers import Models import Singles diff --git a/tools/qleany/generator/templates/UIs/qt_quick/main.cpp.jinja2 b/tools/qleany/generator/templates/UIs/qt_quick/main.cpp.jinja2 index b761ad90..dd610c65 100644 --- a/tools/qleany/generator/templates/UIs/qt_quick/main.cpp.jinja2 +++ b/tools/qleany/generator/templates/UIs/qt_quick/main.cpp.jinja2 @@ -2,7 +2,7 @@ // If you do, be careful to not overwrite it when you run the generator again. #ifndef BUILD_WITH_MOCKS #include "entities_registration.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "persistence_registration.h" #endif #include @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) new {{ application_cpp_domain_name }}::Entities::EntitiesRegistration(&app); auto *persistenceRegistration = new {{ application_cpp_domain_name }}::Persistence::PersistenceRegistration(&app); - new {{ application_cpp_domain_name }}::Interactor::InteractorRegistration(&app, persistenceRegistration->repositoryProvider()); + new {{ application_cpp_domain_name }}::Controller::ControllerRegistration(&app, persistenceRegistration->repositoryProvider()); #endif QCoro::Qml::registerTypes(); diff --git a/tools/qleany/generator/templates/UIs/qt_widgets/CMakeLists.txt.jinja2 b/tools/qleany/generator/templates/UIs/qt_widgets/CMakeLists.txt.jinja2 index f8b86161..6366c771 100644 --- a/tools/qleany/generator/templates/UIs/qt_widgets/CMakeLists.txt.jinja2 +++ b/tools/qleany/generator/templates/UIs/qt_widgets/CMakeLists.txt.jinja2 @@ -27,6 +27,6 @@ target_link_libraries(${APP_NAME} PUBLIC Qt6::Core Qt6::Widgets Qt6::Concurrent target_link_libraries(${APP_NAME} PUBLIC qleany) target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-entities) target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-persistence) -target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-interactor) +target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-controller) target_link_libraries(${APP_NAME} PUBLIC {{ application_spinal_name }}-presenter) target_link_libraries(${APP_NAME} PRIVATE QCoro::Core) diff --git a/tools/qleany/generator/templates/UIs/qt_widgets/main.cpp.jinja2 b/tools/qleany/generator/templates/UIs/qt_widgets/main.cpp.jinja2 index b03da3b5..94ff963d 100644 --- a/tools/qleany/generator/templates/UIs/qt_widgets/main.cpp.jinja2 +++ b/tools/qleany/generator/templates/UIs/qt_widgets/main.cpp.jinja2 @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. #include "entities_registration.h" -#include "interactor_registration.h" +#include "controller_registration.h" #include "mainwindow.h" #include "persistence_registration.h" #include @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) new {{ application_cpp_domain_name }}::Entities::EntitiesRegistration(&a); auto *persistenceRegistration = new {{ application_cpp_domain_name }}::Persistence::PersistenceRegistration(&a); - new {{ application_cpp_domain_name }}::Interactor::InteractorRegistration(&a, persistenceRegistration->repositoryProvider()); + new {{ application_cpp_domain_name }}::Controller::ControllerRegistration(&a, persistenceRegistration->repositoryProvider()); MainWindow window; window.show(); diff --git a/tools/qleany/generator/templates/UIs/qt_widgets/mainwindow.cpp.jinja2 b/tools/qleany/generator/templates/UIs/qt_widgets/mainwindow.cpp.jinja2 index 70e266f5..cafc54c8 100644 --- a/tools/qleany/generator/templates/UIs/qt_widgets/mainwindow.cpp.jinja2 +++ b/tools/qleany/generator/templates/UIs/qt_widgets/mainwindow.cpp.jinja2 @@ -3,8 +3,8 @@ #include "mainwindow.h" #include "ui_mainwindow.h" -// example of using an interactor -// #include "my_feature/my_feature_interactor.h" +// example of using an controller +// #include "my_feature/my_feature_controller.h" // example of using a 'single', which represents one entity // #include "single_my_entity.h" @@ -13,10 +13,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ui->setupUi(this); - // auto *myfeatureInteractor = {{ application_cpp_domain_name }}::Interactor::MyFeature::MyFeatureInteractor::instance(); - // auto createMyFeatureDTO = myfeatureInteractor->getCreateDTO(); + // auto *myfeatureController = {{ application_cpp_domain_name }}::Controller::MyFeature::MyFeatureController::instance(); + // auto createMyFeatureDTO = myfeatureController->getCreateDTO(); // createMyFeatureDTO.setContent("Example myfeature 1"); - // const auto &myfeatureDto = co_await myfeatureInteractor->create(createMyFeatureDTO); + // const auto &myfeatureDto = co_await myfeatureController->create(createMyFeatureDTO); // auto *singleMyEntity = new {{ application_cpp_domain_name }}::Presenter::SingleMyEntity(this); diff --git a/tools/qleany/generator/templates/interactor/cmakelists_template.jinja2 b/tools/qleany/generator/templates/controller/cmakelists_template.jinja2 similarity index 83% rename from tools/qleany/generator/templates/interactor/cmakelists_template.jinja2 rename to tools/qleany/generator/templates/controller/cmakelists_template.jinja2 index b322d912..14c61e93 100755 --- a/tools/qleany/generator/templates/interactor/cmakelists_template.jinja2 +++ b/tools/qleany/generator/templates/controller/cmakelists_template.jinja2 @@ -5,7 +5,7 @@ find_package(Qt6 COMPONENTS Core Gui REQUIRED) find_package(QCoro6 REQUIRED COMPONENTS Core) find_package(qleany CONFIG REQUIRED) -set(LIBRARY_NAME {{ application_spinalcase_name }}-interactor) +set(LIBRARY_NAME {{ application_spinalcase_name }}-controller) option(BUILD_SHARED_LIBS "Build libraries as shared libraries" ON) @@ -16,23 +16,23 @@ else() endif() -include(interactors.cmake) +include(controllers.cmake) set(SRCS {{ export_header_file }} event_dispatcher.h event_dispatcher.cpp - interactor_registration.h + controller_registration.h error_signals.h progress_signals.h - interactor_registration.cpp + controller_registration.cpp ) -qt_add_library(${LIBRARY_NAME} ${LIB_TYPE} ${SRCS} ${INTERACTOR_LIST}) +qt_add_library(${LIBRARY_NAME} ${LIB_TYPE} ${SRCS} ${CONTROLLER_LIST}) include(GenerateExportHeader) generate_export_header(${LIBRARY_NAME} - BASE_NAME {{ application_snakecase_name }}_interactor) + BASE_NAME {{ application_snakecase_name }}_controller) target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tools/qleany/generator/templates/interactor/interactor.cpp.jinja2 b/tools/qleany/generator/templates/controller/controller.cpp.jinja2 similarity index 89% rename from tools/qleany/generator/templates/interactor/interactor.cpp.jinja2 rename to tools/qleany/generator/templates/controller/controller.cpp.jinja2 index 8fbf5411..636e1f93 100755 --- a/tools/qleany/generator/templates/interactor/interactor.cpp.jinja2 +++ b/tools/qleany/generator/templates/controller/controller.cpp.jinja2 @@ -1,7 +1,7 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "{{ feature_name_snake }}_interactor.h" +#include "{{ feature_name_snake }}_controller.h" {% if feature.crud.enabled -%} {%if feature.crud.get -%} @@ -43,16 +43,16 @@ #include "qleany/tools/undo_redo/query_command.h" #include -using namespace {{ application_cpp_domain_name }}::Interactor; -using namespace {{ application_cpp_domain_name }}::Interactor::{{ feature_name_pascal }}; +using namespace {{ application_cpp_domain_name }}::Controller; +using namespace {{ application_cpp_domain_name }}::Controller::{{ feature_name_pascal }}; using namespace {{ application_cpp_domain_name }}::Application::Features::{{ feature_name_pascal }}::Commands; using namespace {{ application_cpp_domain_name }}::Application::Features::{{ feature_name_pascal }}::Queries; using namespace Qleany::Tools::UndoRedo; using namespace Qleany::Contracts::Repository; -QPointer<{{ feature_name_pascal }}Interactor> {{ feature_name_pascal }}Interactor::s_instance = nullptr; +QPointer<{{ feature_name_pascal }}Controller> {{ feature_name_pascal }}Controller::s_instance = nullptr; -{{ feature_name_pascal }}Interactor::{{ feature_name_pascal }}Interactor(InterfaceRepositoryProvider *repositoryProvider, +{{ feature_name_pascal }}Controller::{{ feature_name_pascal }}Controller(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} @@ -66,14 +66,14 @@ QPointer<{{ feature_name_pascal }}Interactor> {{ feature_name_pascal }}Interacto s_instance = this; } -{{ feature_name_pascal }}Interactor *{{ feature_name_pascal }}Interactor::instance() +{{ feature_name_pascal }}Controller *{{ feature_name_pascal }}Controller::instance() { return s_instance.data(); } {% if feature.crud.enabled %} {%if feature.crud.get %} -QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::get(int id) const +QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Controller::get(int id) const { auto queryCommand = new QueryCommand("get"_L1); @@ -108,7 +108,7 @@ QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::ge {% endif %} {%if feature.crud.get_with_details %} - QCoro::Task<{{ entity_name_pascal }}WithDetailsDTO> {{ feature_name_pascal }}Interactor::getWithDetails(int id) const + QCoro::Task<{{ entity_name_pascal }}WithDetailsDTO> {{ feature_name_pascal }}Controller::getWithDetails(int id) const { auto queryCommand = new QueryCommand("getWithDetails"_L1); @@ -144,7 +144,7 @@ QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::ge {% endif %} {%if feature.crud.get_all %} -QCoro::Task> {{ feature_name_pascal }}Interactor::getAll() const +QCoro::Task> {{ feature_name_pascal }}Controller::getAll() const { auto queryCommand = new QueryCommand("getAll"_L1); @@ -176,7 +176,7 @@ QCoro::Task> {{ feature_name_pascal }}Interac {% endif %} {%if feature.crud.create %} -QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::create(const Create{{ entity_name_pascal }}DTO &dto) +QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Controller::create(const Create{{ entity_name_pascal }}DTO &dto) { Create{{ entity_name_pascal }}Command query; @@ -205,7 +205,7 @@ QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::cr // Create specialized UndoRedoCommand auto command = new AlterCommand( - {{ feature_name_pascal }}Interactor::tr("Create {{ entity_name_camel }}"), handler, query); + {{ feature_name_pascal }}Controller::tr("Create {{ entity_name_camel }}"), handler, query); // push command m_undo_redo_system->push(command, "{{ feature_name_camel }}"_L1); @@ -224,7 +224,7 @@ QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::cr {% endif %} {%if feature.crud.update_ %} -QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::update(const Update{{ entity_name_pascal }}DTO &dto) +QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Controller::update(const Update{{ entity_name_pascal }}DTO &dto) { Update{{ entity_name_pascal }}Command query; @@ -241,7 +241,7 @@ QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::up // Create specialized UndoRedoCommand auto command = new AlterCommand( - {{ feature_name_pascal }}Interactor::tr("Update {{ entity_name_camel }}"), handler, query); + {{ feature_name_pascal }}Controller::tr("Update {{ entity_name_camel }}"), handler, query); // push command m_undo_redo_system->push(command, "{{ feature_name_camel }}"_L1); @@ -260,7 +260,7 @@ QCoro::Task<{{ entity_name_pascal }}DTO> {{ feature_name_pascal }}Interactor::up {% endif %} {%if feature.crud.remove %} -QCoro::Task {{ feature_name_pascal }}Interactor::remove(int id) +QCoro::Task {{ feature_name_pascal }}Controller::remove(int id) { Remove{{ entity_name_pascal }}Command query; @@ -275,7 +275,7 @@ QCoro::Task {{ feature_name_pascal }}Interactor::remove(int id) // Create specialized UndoRedoCommand auto command = new AlterCommand( - {{ feature_name_pascal }}Interactor::tr("Remove {{ entity_name_camel }}"), handler, query); + {{ feature_name_pascal }}Controller::tr("Remove {{ entity_name_camel }}"), handler, query); // push command m_undo_redo_system->push(command, "{{ feature_name_camel }}"_L1); @@ -295,13 +295,13 @@ QCoro::Task {{ feature_name_pascal }}Interactor::remove(int id) {% endif %} {%if feature.crud.create %} -Create{{ entity_name_pascal }}DTO {{ feature_name_pascal }}Interactor::getCreateDTO() +Create{{ entity_name_pascal }}DTO {{ feature_name_pascal }}Controller::getCreateDTO() { return Create{{ entity_name_pascal }}DTO(); } {% endif %} {%if feature.crud.update_ %} -Update{{ entity_name_pascal }}DTO {{ feature_name_pascal }}Interactor::getUpdateDTO() +Update{{ entity_name_pascal }}DTO {{ feature_name_pascal }}Controller::getUpdateDTO() { return Update{{ entity_name_pascal }}DTO(); } @@ -309,7 +309,7 @@ Update{{ entity_name_pascal }}DTO {{ feature_name_pascal }}Interactor::getUpdate {% endif %} {% for command in custom_commands %} -QCoro::Task<{% if command.dto_out_enabled %}{{ command.dto_out }}DTO{% endif %}> {{ feature_name_pascal }}Interactor::{{ command.name_camel }}({% if command.dto_in_enabled %}{{ command.dto_in }}DTO dto{% endif %}) +QCoro::Task<{% if command.dto_out_enabled %}{{ command.dto_out }}DTO{% endif %}> {{ feature_name_pascal }}Controller::{{ command.name_camel }}({% if command.dto_in_enabled %}{{ command.dto_in }}DTO dto{% endif %}) { {{ command.name }}Command query; @@ -335,7 +335,7 @@ QCoro::Task<{% if command.dto_out_enabled %}{{ command.dto_out }}DTO{% endif %}> // Create specialized UndoRedoCommand auto command = new AlterCommand<{{ command.name }}CommandHandler, {{ command.name }}Command>( - {{ feature_name_pascal }}Interactor::tr("Doing {{ command.name }}"), handler, query); + {{ feature_name_pascal }}Controller::tr("Doing {{ command.name }}"), handler, query); // set progress minimum duration command->setProgressMinimumDuration(1000); @@ -361,7 +361,7 @@ QCoro::Task<{% if command.dto_out_enabled %}{{ command.dto_out }}DTO{% endif %}> } {% if command.dto_in_enabled %} -{{ command.dto_in }}DTO {{ feature_name_pascal }}Interactor::get{{ command.dto_in }}DTO() +{{ command.dto_in }}DTO {{ feature_name_pascal }}Controller::get{{ command.dto_in }}DTO() { return {{ command.dto_in }}DTO(); } @@ -370,7 +370,7 @@ QCoro::Task<{% if command.dto_out_enabled %}{{ command.dto_out }}DTO{% endif %}> {% for query in custom_queries %} -QCoro::Task<{{ query.dto_out }}DTO> {{ feature_name_pascal }}Interactor::{{ query.name_camel }}({% if query.dto_in_enabled %}{{ query.dto_in }}DTO dto{% endif %}) const +QCoro::Task<{{ query.dto_out }}DTO> {{ feature_name_pascal }}Controller::{{ query.name_camel }}({% if query.dto_in_enabled %}{{ query.dto_in }}DTO dto{% endif %}) const { auto queryCommand = new QueryCommand("{{ query.name }}"_L1); @@ -411,7 +411,7 @@ QCoro::Task<{{ query.dto_out }}DTO> {{ feature_name_pascal }}Interactor::{{ quer } {% if query.dto_in_enabled %} -{{ query.dto_in }}DTO {{ feature_name_pascal }}Interactor::get{{ query.dto_in }}DTO() +{{ query.dto_in }}DTO {{ feature_name_pascal }}Controller::get{{ query.dto_in }}DTO() { return {{ query.dto_in }}DTO(); } diff --git a/tools/qleany/generator/templates/interactor/interactor.h.jinja2 b/tools/qleany/generator/templates/controller/controller.h.jinja2 similarity index 84% rename from tools/qleany/generator/templates/interactor/interactor.h.jinja2 rename to tools/qleany/generator/templates/controller/controller.h.jinja2 index 5ac4266f..5a07aaab 100755 --- a/tools/qleany/generator/templates/interactor/interactor.h.jinja2 +++ b/tools/qleany/generator/templates/controller/controller.h.jinja2 @@ -35,18 +35,18 @@ using namespace Qleany::Contracts::Repository; using namespace Qleany::Tools::UndoRedo; using namespace {{ application_cpp_domain_name }}::Contracts::DTO::{{ feature_name_pascal }}; -namespace {{ application_cpp_domain_name }}::Interactor::{{ feature_name_pascal }} +namespace {{ application_cpp_domain_name }}::Controller::{{ feature_name_pascal }} { -class {{ export }} {{ feature_name_pascal }}Interactor : public QObject +class {{ export }} {{ feature_name_pascal }}Controller : public QObject { Q_OBJECT public: - explicit {{ feature_name_pascal }}Interactor(InterfaceRepositoryProvider *repositoryProvider, + explicit {{ feature_name_pascal }}Controller(InterfaceRepositoryProvider *repositoryProvider, ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static {{ feature_name_pascal }}Interactor *instance(); + static {{ feature_name_pascal }}Controller *instance(); {% if feature.crud.enabled %} {%if feature.crud.get %} @@ -99,13 +99,13 @@ class {{ export }} {{ feature_name_pascal }}Interactor : public QObject {%- endfor %} private: - static QPointer<{{ feature_name_pascal }}Interactor> s_instance; + static QPointer<{{ feature_name_pascal }}Controller> s_instance; InterfaceRepositoryProvider *m_repositoryProvider; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - {{ feature_name_pascal }}Interactor() = delete; - {{ feature_name_pascal }}Interactor(const {{ feature_name_pascal }}Interactor &) = delete; - {{ feature_name_pascal }}Interactor &operator=(const {{ feature_name_pascal }}Interactor &) = delete; + {{ feature_name_pascal }}Controller() = delete; + {{ feature_name_pascal }}Controller(const {{ feature_name_pascal }}Controller &) = delete; + {{ feature_name_pascal }}Controller &operator=(const {{ feature_name_pascal }}Controller &) = delete; }; -} // namespace {{ application_cpp_domain_name }}::Interactor::{{ feature_name_pascal }} +} // namespace {{ application_cpp_domain_name }}::Controller::{{ feature_name_pascal }} diff --git a/tools/qleany/generator/templates/interactor/interactor_registration.cpp.jinja2 b/tools/qleany/generator/templates/controller/controller_registration.cpp.jinja2 similarity index 88% rename from tools/qleany/generator/templates/interactor/interactor_registration.cpp.jinja2 rename to tools/qleany/generator/templates/controller/controller_registration.cpp.jinja2 index f48fad2d..49ca55f4 100755 --- a/tools/qleany/generator/templates/interactor/interactor_registration.cpp.jinja2 +++ b/tools/qleany/generator/templates/controller/controller_registration.cpp.jinja2 @@ -1,18 +1,18 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "interactor_registration.h" +#include "controller_registration.h" #include "event_dispatcher.h" {% for feature in features -%} -#include "{{ feature.feature_name_snake }}/{{ feature.feature_name_snake }}_interactor.h" +#include "{{ feature.feature_name_snake }}/{{ feature.feature_name_snake }}_controller.h" {% endfor -%} #include #include #include -using namespace {{ application_cpp_domain_name }}::Interactor; +using namespace {{ application_cpp_domain_name }}::Controller; -InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceRepositoryProvider *repositoryProvider) +ControllerRegistration::ControllerRegistration(QObject *parent, InterfaceRepositoryProvider *repositoryProvider) : QObject{parent} { @@ -40,9 +40,9 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit }); {% for feature in features%} - // {{ feature.feature_name_pascal }}Interactor + // {{ feature.feature_name_pascal }}Controller - new {{ feature.feature_name_pascal }}::{{ feature.feature_name_pascal }}Interactor(repositoryProvider, undoRedoSystem, dispatcher); + new {{ feature.feature_name_pascal }}::{{ feature.feature_name_pascal }}Controller(repositoryProvider, undoRedoSystem, dispatcher); {% if feature.crud.enabled %} @@ -75,6 +75,6 @@ InteractorRegistration::InteractorRegistration(QObject *parent, InterfaceReposit } -InteractorRegistration::~InteractorRegistration() +ControllerRegistration::~ControllerRegistration() { } \ No newline at end of file diff --git a/tools/qleany/generator/templates/interactor/interactor_registration.h.jinja2 b/tools/qleany/generator/templates/controller/controller_registration.h.jinja2 similarity index 62% rename from tools/qleany/generator/templates/interactor/interactor_registration.h.jinja2 rename to tools/qleany/generator/templates/controller/controller_registration.h.jinja2 index 37a2fc13..10b9f4f8 100755 --- a/tools/qleany/generator/templates/interactor/interactor_registration.h.jinja2 +++ b/tools/qleany/generator/templates/controller/controller_registration.h.jinja2 @@ -7,18 +7,18 @@ #include #include -namespace {{ application_cpp_domain_name }}::Interactor +namespace {{ application_cpp_domain_name }}::Controller { -class {{ export }} InteractorRegistration : public QObject +class {{ export }} ControllerRegistration : public QObject { Q_OBJECT public: - explicit InteractorRegistration(QObject *parent, + explicit ControllerRegistration(QObject *parent, Qleany::Contracts::Repository::InterfaceRepositoryProvider *repositoryProvider); - ~InteractorRegistration(); + ~ControllerRegistration(); private: }; -} // namespace {{ application_cpp_domain_name }}::Interactor +} // namespace {{ application_cpp_domain_name }}::Controller diff --git a/tools/qleany/generator/templates/interactor/interactors.cmake.jinja2 b/tools/qleany/generator/templates/controller/controllers.cmake.jinja2 similarity index 75% rename from tools/qleany/generator/templates/interactor/interactors.cmake.jinja2 rename to tools/qleany/generator/templates/controller/controllers.cmake.jinja2 index 29d1c276..e69df797 100755 --- a/tools/qleany/generator/templates/interactor/interactors.cmake.jinja2 +++ b/tools/qleany/generator/templates/controller/controllers.cmake.jinja2 @@ -1,7 +1,7 @@ # This file was generated automatically by Qleany's generator, edit at your own risk! # If you do, be careful to not overwrite it when you run the generator again. -set(INTERACTOR_LIST -{%- for file in interactor_files %} +set(CONTROLLER_LIST +{%- for file in controller_files %} {{ file }} {%- endfor %} ) diff --git a/tools/qleany/generator/templates/interactor/error_signals.h.jinja2 b/tools/qleany/generator/templates/controller/error_signals.h.jinja2 similarity index 73% rename from tools/qleany/generator/templates/interactor/error_signals.h.jinja2 rename to tools/qleany/generator/templates/controller/error_signals.h.jinja2 index 3992e0c6..6a771411 100755 --- a/tools/qleany/generator/templates/interactor/error_signals.h.jinja2 +++ b/tools/qleany/generator/templates/controller/error_signals.h.jinja2 @@ -4,7 +4,7 @@ #include "{{ export_header_file }}" #include -namespace {{ application_cpp_domain_name }}::Interactor +namespace {{ application_cpp_domain_name }}::Controller { class {{ export }} ErrorSignals : public QObject @@ -19,4 +19,4 @@ class {{ export }} ErrorSignals : public QObject void warningSent(const Qleany::Error &error); void errorSent(const Qleany::Error &error); }; -} // namespace {{ application_cpp_domain_name }}::Interactor +} // namespace {{ application_cpp_domain_name }}::Controller diff --git a/tools/qleany/generator/templates/interactor/event_dispatcher.cpp.jinja2 b/tools/qleany/generator/templates/controller/event_dispatcher.cpp.jinja2 similarity index 90% rename from tools/qleany/generator/templates/interactor/event_dispatcher.cpp.jinja2 rename to tools/qleany/generator/templates/controller/event_dispatcher.cpp.jinja2 index bcdf5bf7..57a6f26c 100755 --- a/tools/qleany/generator/templates/interactor/event_dispatcher.cpp.jinja2 +++ b/tools/qleany/generator/templates/controller/event_dispatcher.cpp.jinja2 @@ -1,6 +1,6 @@ #include "event_dispatcher.h" -using namespace {{ application_cpp_domain_name }}::Interactor; +using namespace {{ application_cpp_domain_name }}::Controller; QPointer EventDispatcher::s_instance = nullptr; diff --git a/tools/qleany/generator/templates/interactor/event_dispatcher.h.jinja2 b/tools/qleany/generator/templates/controller/event_dispatcher.h.jinja2 similarity index 88% rename from tools/qleany/generator/templates/interactor/event_dispatcher.h.jinja2 rename to tools/qleany/generator/templates/controller/event_dispatcher.h.jinja2 index d800a84e..81089ad7 100755 --- a/tools/qleany/generator/templates/interactor/event_dispatcher.h.jinja2 +++ b/tools/qleany/generator/templates/controller/event_dispatcher.h.jinja2 @@ -12,7 +12,7 @@ #include #include -namespace {{ application_cpp_domain_name }}::Interactor +namespace {{ application_cpp_domain_name }}::Controller { class {{ export }} EventDispatcher : public QObject { @@ -44,4 +44,4 @@ class {{ export }} EventDispatcher : public QObject EventDispatcher(const EventDispatcher &) = delete; EventDispatcher &operator=(const EventDispatcher &) = delete; }; -} // namespace {{ application_cpp_domain_name }}::Interactor +} // namespace {{ application_cpp_domain_name }}::Controller diff --git a/tools/qleany/generator/templates/interactor/progress_signals.h.jinja2 b/tools/qleany/generator/templates/controller/progress_signals.h.jinja2 similarity index 91% rename from tools/qleany/generator/templates/interactor/progress_signals.h.jinja2 rename to tools/qleany/generator/templates/controller/progress_signals.h.jinja2 index 5b49c6b3..8d2000c2 100755 --- a/tools/qleany/generator/templates/interactor/progress_signals.h.jinja2 +++ b/tools/qleany/generator/templates/controller/progress_signals.h.jinja2 @@ -5,7 +5,7 @@ #include "{{ export_header_file }}" #include -namespace {{ application_cpp_domain_name }}::Interactor +namespace {{ application_cpp_domain_name }}::Controller { class {{ export }} ProgressSignals : public QObject @@ -37,4 +37,4 @@ class {{ export }} ProgressSignals : public QObject void progressTextChanged(const QString &progressText); void progressValueChanged(int progressValue); }; -} // namespace {{ application_cpp_domain_name }}::Interactor +} // namespace {{ application_cpp_domain_name }}::Controller diff --git a/tools/qleany/generator/templates/interactor/signals.h.jinja2 b/tools/qleany/generator/templates/controller/signals.h.jinja2 similarity index 93% rename from tools/qleany/generator/templates/interactor/signals.h.jinja2 rename to tools/qleany/generator/templates/controller/signals.h.jinja2 index ef9abbd1..dc6468dd 100755 --- a/tools/qleany/generator/templates/interactor/signals.h.jinja2 +++ b/tools/qleany/generator/templates/controller/signals.h.jinja2 @@ -21,7 +21,7 @@ #include -namespace {{ application_cpp_domain_name }}::Interactor +namespace {{ application_cpp_domain_name }}::Controller { using namespace {{ application_cpp_domain_name }}::Contracts::DTO::{{ feature.feature_name_pascal }}; @@ -69,4 +69,4 @@ class {{ export }} {{ feature.feature_name_pascal }}Signals : public QObject {%- endfor -%} }; -} // namespace {{ application_cpp_domain_name }}::Interactor +} // namespace {{ application_cpp_domain_name }}::Controller diff --git a/tools/qleany/generator/templates/interactor/undo_redo_interactor.cpp.jinja2 b/tools/qleany/generator/templates/controller/undo_redo_controller.cpp.jinja2 similarity index 62% rename from tools/qleany/generator/templates/interactor/undo_redo_interactor.cpp.jinja2 rename to tools/qleany/generator/templates/controller/undo_redo_controller.cpp.jinja2 index 142ba8cb..97542079 100755 --- a/tools/qleany/generator/templates/interactor/undo_redo_interactor.cpp.jinja2 +++ b/tools/qleany/generator/templates/controller/undo_redo_controller.cpp.jinja2 @@ -1,16 +1,16 @@ // This file was generated automatically by Qleany's generator, edit at your own risk! // If you do, be careful to not overwrite it when you run the generator again. -#include "undo_redo_interactor.h" +#include "undo_redo_controller.h" #include -using namespace {{ application_cpp_domain_name }}::Interactor; -using namespace {{ application_cpp_domain_name }}::Interactor::UndoRedo; +using namespace {{ application_cpp_domain_name }}::Controller; +using namespace {{ application_cpp_domain_name }}::Controller::UndoRedo; using namespace Qleany::Tools::UndoRedo; -QPointer UndoRedoInteractor::s_instance = nullptr; +QPointer UndoRedoController::s_instance = nullptr; -UndoRedoInteractor::UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, +UndoRedoController::UndoRedoController(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher) : QObject{nullptr} { @@ -28,102 +28,102 @@ UndoRedoInteractor::UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, s_instance = this; } -UndoRedoInteractor *UndoRedoInteractor::instance() +UndoRedoController *UndoRedoController::instance() { return s_instance.data(); } -bool UndoRedoInteractor::canUndo() const +bool UndoRedoController::canUndo() const { return m_undo_redo_system->canUndo(); } -bool UndoRedoInteractor::canRedo() const +bool UndoRedoController::canRedo() const { return m_undo_redo_system->canRedo(); } -void UndoRedoInteractor::setUndoLimit(int limit) +void UndoRedoController::setUndoLimit(int limit) { m_undo_redo_system->setUndoLimit(limit); } -int UndoRedoInteractor::undoLimit() const +int UndoRedoController::undoLimit() const { return m_undo_redo_system->undoLimit(); } -QString UndoRedoInteractor::undoText() const +QString UndoRedoController::undoText() const { return m_undo_redo_system->undoText(); } -QString UndoRedoInteractor::redoText() const +QString UndoRedoController::redoText() const { return m_undo_redo_system->redoText(); } -QStringList UndoRedoInteractor::undoRedoTextList() const +QStringList UndoRedoController::undoRedoTextList() const { return m_undo_redo_system->undoRedoTextList(); } -int UndoRedoInteractor::currentIndex() const +int UndoRedoController::currentIndex() const { return m_undo_redo_system->currentIndex(); } -QUuid UndoRedoInteractor::activeStackId() const +QUuid UndoRedoController::activeStackId() const { return m_undo_redo_system->activeStackId(); } -QStringList UndoRedoInteractor::queuedCommandTextListByScope(const QString &scopeFlagString) const +QStringList UndoRedoController::queuedCommandTextListByScope(const QString &scopeFlagString) const { return m_undo_redo_system->queuedCommandTextListByScope(scopeFlagString); } -bool UndoRedoInteractor::isRunning() const +bool UndoRedoController::isRunning() const { return m_undo_redo_system->isRunning(); } -int UndoRedoInteractor::numberOfCommands() const +int UndoRedoController::numberOfCommands() const { return m_undo_redo_system->numberOfCommands(); } -QAction *UndoRedoInteractor::createUndoAction(QObject *parent, const QString &prefix) const +QAction *UndoRedoController::createUndoAction(QObject *parent, const QString &prefix) const { return m_undo_redo_system->createUndoAction(parent, prefix); } -QAction *UndoRedoInteractor::createRedoAction(QObject *parent, const QString &prefix) const +QAction *UndoRedoController::createRedoAction(QObject *parent, const QString &prefix) const { return m_undo_redo_system->createRedoAction(parent, prefix); } -void UndoRedoInteractor::undo() +void UndoRedoController::undo() { return m_undo_redo_system->undo(); } -void UndoRedoInteractor::redo() +void UndoRedoController::redo() { return m_undo_redo_system->redo(); } -void UndoRedoInteractor::clear() +void UndoRedoController::clear() { return m_undo_redo_system->clear(); } -void UndoRedoInteractor::setCurrentIndex(int index) +void UndoRedoController::setCurrentIndex(int index) { return m_undo_redo_system->setCurrentIndex(index); } -void UndoRedoInteractor::setActiveStack(const QUuid &stackId) +void UndoRedoController::setActiveStack(const QUuid &stackId) { return m_undo_redo_system->setActiveStack(stackId); } diff --git a/tools/qleany/generator/templates/interactor/undo_redo_interactor.h.jinja2 b/tools/qleany/generator/templates/controller/undo_redo_controller.h.jinja2 similarity index 76% rename from tools/qleany/generator/templates/interactor/undo_redo_interactor.h.jinja2 rename to tools/qleany/generator/templates/controller/undo_redo_controller.h.jinja2 index f0ec2079..f19c8aeb 100755 --- a/tools/qleany/generator/templates/interactor/undo_redo_interactor.h.jinja2 +++ b/tools/qleany/generator/templates/controller/undo_redo_controller.h.jinja2 @@ -13,17 +13,17 @@ using namespace Qleany::Tools::UndoRedo; -namespace {{ application_cpp_domain_name }}::Interactor::UndoRedo +namespace {{ application_cpp_domain_name }}::Controller::UndoRedo { -class {{ export }} UndoRedoInteractor : public QObject +class {{ export }} UndoRedoController : public QObject { Q_OBJECT public: - explicit UndoRedoInteractor(ThreadedUndoRedoSystem *undo_redo_system, + explicit UndoRedoController(ThreadedUndoRedoSystem *undo_redo_system, QSharedPointer eventDispatcher); - static UndoRedoInteractor *instance(); + static UndoRedoController *instance(); Q_INVOKABLE bool canUndo() const; @@ -61,12 +61,12 @@ class {{ export }} UndoRedoInteractor : public QObject void setActiveStack(const QUuid &stackId = QUuid()); private: - static QPointer s_instance; + static QPointer s_instance; ThreadedUndoRedoSystem *m_undo_redo_system; QSharedPointer m_eventDispatcher; - UndoRedoInteractor() = delete; - UndoRedoInteractor(const UndoRedoInteractor &) = delete; - UndoRedoInteractor &operator=(const UndoRedoInteractor &) = delete; + UndoRedoController() = delete; + UndoRedoController(const UndoRedoController &) = delete; + UndoRedoController &operator=(const UndoRedoController &) = delete; }; -} // namespace {{ application_cpp_domain_name }}::Interactor::UndoRedo +} // namespace {{ application_cpp_domain_name }}::Controller::UndoRedo diff --git a/tools/qleany/generator/templates/interactor/undo_redo_signals.h.jinja2 b/tools/qleany/generator/templates/controller/undo_redo_signals.h.jinja2 similarity index 89% rename from tools/qleany/generator/templates/interactor/undo_redo_signals.h.jinja2 rename to tools/qleany/generator/templates/controller/undo_redo_signals.h.jinja2 index 9a3a6a83..b994e21b 100644 --- a/tools/qleany/generator/templates/interactor/undo_redo_signals.h.jinja2 +++ b/tools/qleany/generator/templates/controller/undo_redo_signals.h.jinja2 @@ -6,7 +6,7 @@ #include #include -namespace {{ application_cpp_domain_name }}::Interactor +namespace {{ application_cpp_domain_name }}::Controller { class {{ export }} UndoRedoSignals : public QObject @@ -40,4 +40,4 @@ class {{ export }} UndoRedoSignals : public QObject */ void undoing(Qleany::Tools::UndoRedo::Scope scope, bool active); }; -} // namespace {{ application_cpp_domain_name }}::Interactor +} // namespace {{ application_cpp_domain_name }}::Controller diff --git a/tools/qleany/generator/templates/presenter/cmakelists_template.jinja2 b/tools/qleany/generator/templates/presenter/cmakelists_template.jinja2 index 03c0770e..480f03c6 100755 --- a/tools/qleany/generator/templates/presenter/cmakelists_template.jinja2 +++ b/tools/qleany/generator/templates/presenter/cmakelists_template.jinja2 @@ -32,7 +32,7 @@ target_link_libraries(${LIBRARY_NAME} PRIVATE Qt6::Core Qt6::Gui) target_link_libraries(${LIBRARY_NAME} PRIVATE QCoro::Core) target_link_libraries(${LIBRARY_NAME} PUBLIC qleany) -target_link_libraries(${LIBRARY_NAME} PUBLIC {{ application_spinalcase_name }}-interactor) +target_link_libraries(${LIBRARY_NAME} PUBLIC {{ application_spinalcase_name }}-controller) if(IOS) install(TARGETS ${LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/tools/qleany/generator/templates/presenter/entity_list_model.cpp.jinja2 b/tools/qleany/generator/templates/presenter/entity_list_model.cpp.jinja2 index e6e11bd9..c2be7ee1 100755 --- a/tools/qleany/generator/templates/presenter/entity_list_model.cpp.jinja2 +++ b/tools/qleany/generator/templates/presenter/entity_list_model.cpp.jinja2 @@ -1,9 +1,9 @@ #include "{{ model.class_name_snake }}.h" -#include "{{ model.entity_name_snake }}/{{ model.entity_name_snake }}_interactor.h" +#include "{{ model.entity_name_snake }}/{{ model.entity_name_snake }}_controller.h" #include "event_dispatcher.h" #include -using namespace {{ application_cpp_domain_name }}::Interactor; +using namespace {{ application_cpp_domain_name }}::Controller; using namespace {{ application_cpp_domain_name }}::Presenter; {{ model.class_name_pascal }}::{{ model.class_name_pascal }}(QObject *parent) : QAbstractListModel(parent) @@ -127,7 +127,7 @@ bool {{ model.class_name_pascal }}::setData(const QModelIndex &index, const QVar dto.setId({{ model.entity_name_camel }}.id()); dto.set{{ field.pascal_name }}(value.value<{{ field.type }}>()); - {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Interactor::instance()->update(dto) + {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Controller::instance()->update(dto) .then([this, index, role](auto &&result) { if(result.isInvalid()){ qCritical() << Q_FUNC_INFO << "Invalid {{ model.related_name_camel }}"; @@ -152,7 +152,7 @@ void {{ model.class_name_pascal }}::populate() m_{{ model.entity_name_camel }}IdList.clear(); endResetModel(); - auto task = {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Interactor::instance()->getAll(); + auto task = {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Controller::instance()->getAll(); QCoro::connect(std::move(task), this, [this](auto &&result) { const QList<{{ application_cpp_domain_name }}::Contracts::DTO::{{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}DTO> {{ model.entity_name_camel }}List = result; for (const auto &{{ model.entity_name_camel }} : {{ model.entity_name_camel }}List) diff --git a/tools/qleany/generator/templates/presenter/list_model.cpp.jinja2 b/tools/qleany/generator/templates/presenter/list_model.cpp.jinja2 index 8b12a1ea..ffe67a32 100755 --- a/tools/qleany/generator/templates/presenter/list_model.cpp.jinja2 +++ b/tools/qleany/generator/templates/presenter/list_model.cpp.jinja2 @@ -1,10 +1,10 @@ #include "{{ model.class_name_snake }}.h" -#include "{{ model.entity_name_snake }}/{{ model.entity_name_snake }}_interactor.h" -#include "{{ model.related_name_snake }}/{{ model.related_name_snake }}_interactor.h" +#include "{{ model.entity_name_snake }}/{{ model.entity_name_snake }}_controller.h" +#include "{{ model.related_name_snake }}/{{ model.related_name_snake }}_controller.h" #include "event_dispatcher.h" #include -using namespace {{ application_cpp_domain_name }}::Interactor; +using namespace {{ application_cpp_domain_name }}::Controller; using namespace {{ application_cpp_domain_name }}::Presenter; {{ model.class_name_pascal }}::{{ model.class_name_pascal }}(QObject *parent) : QAbstractListModel(parent) @@ -15,7 +15,7 @@ using namespace {{ application_cpp_domain_name }}::Presenter; { return; } - auto task = {{ model.entity_name_pascal }}::Interactor::{{ model.related_name_pascal }}::{{ model.related_name_pascal }}Interactor::instance()->getWithDetails({{ model.related_name_camel }}Id); + auto task = {{ model.entity_name_pascal }}::Controller::{{ model.related_name_pascal }}::{{ model.related_name_pascal }}Controller::instance()->getWithDetails({{ model.related_name_camel }}Id); QCoro::connect(std::move(task), this, [this, {{ model.related_name_camel }}Id](auto &&{{ model.related_name_camel }}Details) { if (!{{ model.related_name_camel }}Details.isValid()) { @@ -112,10 +112,10 @@ using namespace {{ application_cpp_domain_name }}::Presenter; QList relatedIds = dto.relatedIds(); std::reverse(relatedIds.begin(), relatedIds.end()); - // fetch {{ model.entity_name_camel }} list from interactor + // fetch {{ model.entity_name_camel }} list from controller for (int {{ model.entity_name_camel }}Id : relatedIds) { - {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Interactor::instance() + {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Controller::instance() ->get({{ model.entity_name_camel }}Id) .then([this, {{ model.entity_name_camel }}Id]({{ model.entity_name_pascal }}DTO {{ model.entity_name_camel }}) { // add {{ model.entity_name_camel }} to this model @@ -226,7 +226,7 @@ bool {{ model.class_name_pascal }}::setData(const QModelIndex &index, const QVar dto.setId({{ model.entity_name_camel }}.id()); dto.set{{ field.pascal_name }}(value.value<{{ field.type }}>()); - {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Interactor::instance()->update(dto) + {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Controller::instance()->update(dto) .then([this, index, role](auto &&result) { if(result.isInvalid()){ @@ -256,7 +256,7 @@ void {{ model.class_name_pascal }}::populate() m_{{ model.entity_name_camel }}Ids.clear(); endResetModel(); - auto task = {{ model.related_name_pascal }}::{{ model.related_name_pascal }}Interactor::instance()->getWithDetails(m_{{ model.related_name_camel }}Id); + auto task = {{ model.related_name_pascal }}::{{ model.related_name_pascal }}Controller::instance()->getWithDetails(m_{{ model.related_name_camel }}Id); QCoro::connect(std::move(task), this, [this](auto &&result) { const QList<{{ application_cpp_domain_name }}::Contracts::DTO::{{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}DTO> {{ model.entity_name_camel }}List = result.{{ model.related_field_name_camel }}(); for (const auto &{{ model.entity_name_camel }} : {{ model.entity_name_camel }}List) diff --git a/tools/qleany/generator/templates/presenter/ordered_list_model.cpp.jinja2 b/tools/qleany/generator/templates/presenter/ordered_list_model.cpp.jinja2 index 84d91ee8..98921e6c 100755 --- a/tools/qleany/generator/templates/presenter/ordered_list_model.cpp.jinja2 +++ b/tools/qleany/generator/templates/presenter/ordered_list_model.cpp.jinja2 @@ -1,10 +1,10 @@ #include "{{ model.class_name_snake }}.h" -#include "{{ model.entity_name_snake }}/{{ model.entity_name_snake }}_interactor.h" -#include "{{ model.related_name_snake }}/{{ model.related_name_snake }}_interactor.h" +#include "{{ model.entity_name_snake }}/{{ model.entity_name_snake }}_controller.h" +#include "{{ model.related_name_snake }}/{{ model.related_name_snake }}_controller.h" #include "event_dispatcher.h" #include -using namespace {{ application_cpp_domain_name }}::Interactor; +using namespace {{ application_cpp_domain_name }}::Controller; using namespace {{ application_cpp_domain_name }}::Presenter; {{ model.class_name_pascal }}::{{ model.class_name_pascal }}(QObject *parent) : QAbstractListModel(parent) @@ -15,7 +15,7 @@ using namespace {{ application_cpp_domain_name }}::Presenter; { return; } - auto task = {{ model.related_name_pascal }}::{{ model.related_name_pascal }}Interactor::instance()->getWithDetails({{ model.related_name_camel }}Id); + auto task = {{ model.related_name_pascal }}::{{ model.related_name_pascal }}Controller::instance()->getWithDetails({{ model.related_name_camel }}Id); QCoro::connect(std::move(task), this, [this, {{ model.related_name_camel }}Id](auto &&{{ model.related_name_camel }}Details) { if ({{ model.related_name_camel }}Details.isInvalid()) { @@ -133,10 +133,10 @@ using namespace {{ application_cpp_domain_name }}::Presenter; QList relatedIds = dto.relatedIds(); std::reverse(relatedIds.begin(), relatedIds.end()); - // fetch {{ model.entity_name_camel }} list from interactor + // fetch {{ model.entity_name_camel }} list from controller for (int {{ model.entity_name_camel }}Id : relatedIds) { - {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Interactor::instance() + {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Controller::instance() ->get({{ model.entity_name_camel }}Id) .then([this, {{ model.entity_name_camel }}Id, position]({{ model.entity_name_pascal }}DTO {{ model.entity_name_camel }}) { // add {{ model.entity_name_camel }} to this model @@ -243,7 +243,7 @@ bool {{ model.class_name_pascal }}::setData(const QModelIndex &index, const QVar dto.setId({{ model.entity_name_camel }}.id()); dto.set{{ field.pascal_name }}(value.value<{{ field.type }}>()); - {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Interactor::instance()->update(dto) + {{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}Controller::instance()->update(dto) .then([this, index, role](auto &&result) { if(result.isInvalid()){ @@ -271,7 +271,7 @@ void {{ model.class_name_pascal }}::populate() m_{{ model.entity_name_camel }}IdList.clear(); endResetModel(); - auto task = {{ model.related_name_pascal }}::{{ model.related_name_pascal }}Interactor::instance()->getWithDetails(m_{{ model.related_name_camel }}Id); + auto task = {{ model.related_name_pascal }}::{{ model.related_name_pascal }}Controller::instance()->getWithDetails(m_{{ model.related_name_camel }}Id); QCoro::connect(std::move(task), this, [this](auto &&result) { const QList<{{ application_cpp_domain_name }}::Contracts::DTO::{{ model.entity_name_pascal }}::{{ model.entity_name_pascal }}DTO> {{ model.entity_name_camel }}List = result.{{ model.related_field_name_camel }}(); for (const auto &{{ model.entity_name_camel }} : {{ model.entity_name_camel }}List) diff --git a/tools/qleany/generator/templates/presenter/single.cpp.jinja2 b/tools/qleany/generator/templates/presenter/single.cpp.jinja2 index ca406f6a..e254cb89 100755 --- a/tools/qleany/generator/templates/presenter/single.cpp.jinja2 +++ b/tools/qleany/generator/templates/presenter/single.cpp.jinja2 @@ -2,9 +2,9 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "{{ single.class_name_snake }}.h" #include "event_dispatcher.h" -#include "{{ single.entity_name_snake }}/{{ single.entity_name_snake }}_interactor.h" +#include "{{ single.entity_name_snake }}/{{ single.entity_name_snake }}_controller.h" -using namespace {{ application_cpp_domain_name }}::Interactor; +using namespace {{ application_cpp_domain_name }}::Controller; using namespace {{ application_cpp_domain_name }}::Presenter; {{ single.class_name_pascal }}::{{ single.class_name_pascal }}(QObject *parent) : QObject{parent} @@ -55,7 +55,7 @@ void {{ single.class_name_pascal }}::setId(int newId) // set else { - {{ single.entity_name_pascal }}::{{ single.entity_name_pascal }}Interactor::instance()->get(m_id).then( + {{ single.entity_name_pascal }}::{{ single.entity_name_pascal }}Controller::instance()->get(m_id).then( [this](const {{ application_cpp_domain_name }}::Contracts::DTO::{{ single.entity_name_pascal }}::{{ single.entity_name_pascal }}DTO &{{ single.entity_name_camel }}) { if({{ single.entity_name_camel }}.isInvalid()){ qCritical() << Q_FUNC_INFO << "Invalid {{ single.entity_name_camel }}Id"; @@ -92,7 +92,7 @@ void {{ single.class_name_pascal }}::set{{ field.pascal_name }}({% if field.type Update{{ single.entity_name_pascal }}DTO dto; dto.setId(id()); dto.set{{ field.pascal_name }}(new{{ field.pascal_name }}); - {{ single.entity_name_pascal }}::{{ single.entity_name_pascal }}Interactor::instance()->update(dto).then( + {{ single.entity_name_pascal }}::{{ single.entity_name_pascal }}Controller::instance()->update(dto).then( [this](const {{ application_cpp_domain_name }}::Contracts::DTO::{{ single.entity_name_pascal }}::{{ single.entity_name_pascal }}DTO &{{ single.entity_name_camel }}) { if({{ single.entity_name_camel }}.isInvalid()){ qCritical() << Q_FUNC_INFO << "Invalid {{ single.entity_name_camel }}Id"; diff --git a/tools/qleany/generator/templates/presenter/single_redo.cpp.jinja2 b/tools/qleany/generator/templates/presenter/single_redo.cpp.jinja2 index 35952cf0..89ee1c61 100755 --- a/tools/qleany/generator/templates/presenter/single_redo.cpp.jinja2 +++ b/tools/qleany/generator/templates/presenter/single_redo.cpp.jinja2 @@ -2,15 +2,15 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_redo.h" #include "event_dispatcher.h" -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" -using namespace {{ application_cpp_domain_name }}::Interactor; -using namespace {{ application_cpp_domain_name }}::Interactor::UndoRedo; +using namespace {{ application_cpp_domain_name }}::Controller; +using namespace {{ application_cpp_domain_name }}::Controller::UndoRedo; using namespace {{ application_cpp_domain_name }}::Presenter; SingleRedo::SingleRedo(QObject *parent) : QObject{parent} { - m_action = UndoRedoInteractor::instance()->createUndoAction(this, tr("Redo: %1")); + m_action = UndoRedoController::instance()->createUndoAction(this, tr("Redo: %1")); m_enabled = m_action->isEnabled(); connect(m_action, &QAction::enabledChanged, this, [this](bool newEnabled) { @@ -49,5 +49,5 @@ QString SingleRedo::text() const void SingleRedo::redo() { - UndoRedoInteractor::instance()->redo(); + UndoRedoController::instance()->redo(); } diff --git a/tools/qleany/generator/templates/presenter/single_undo.cpp.jinja2 b/tools/qleany/generator/templates/presenter/single_undo.cpp.jinja2 index 5932aea7..62edfb51 100755 --- a/tools/qleany/generator/templates/presenter/single_undo.cpp.jinja2 +++ b/tools/qleany/generator/templates/presenter/single_undo.cpp.jinja2 @@ -2,15 +2,15 @@ // If you do, be careful to not overwrite it when you run the generator again. #include "single_undo.h" #include "event_dispatcher.h" -#include "undo_redo/undo_redo_interactor.h" +#include "undo_redo/undo_redo_controller.h" -using namespace {{ application_cpp_domain_name }}::Interactor; -using namespace {{ application_cpp_domain_name }}::Interactor::UndoRedo; +using namespace {{ application_cpp_domain_name }}::Controller; +using namespace {{ application_cpp_domain_name }}::Controller::UndoRedo; using namespace {{ application_cpp_domain_name }}::Presenter; SingleUndo::SingleUndo(QObject *parent) : QObject{parent} { - m_action = UndoRedoInteractor::instance()->createUndoAction(this, tr("Undo: %1")); + m_action = UndoRedoController::instance()->createUndoAction(this, tr("Undo: %1")); m_enabled = m_action->isEnabled(); connect(m_action, &QAction::enabledChanged, this, [this](bool newEnabled) { @@ -49,5 +49,5 @@ QString SingleUndo::text() const void SingleUndo::undo() { - UndoRedoInteractor::instance()->undo(); + UndoRedoController::instance()->undo(); } diff --git a/tools/qleany/generator/templates/root/CMakeLists.txt.jinja2 b/tools/qleany/generator/templates/root/CMakeLists.txt.jinja2 index 00b6d393..a5a8f6f4 100644 --- a/tools/qleany/generator/templates/root/CMakeLists.txt.jinja2 +++ b/tools/qleany/generator/templates/root/CMakeLists.txt.jinja2 @@ -152,7 +152,7 @@ add_subdirectory({{ contracts_cqrs_path }}) add_subdirectory({{ application_path }}) # handles the interaction between the system's inner layers (use cases, DTOs) and the external world -add_subdirectory({{ interactor_path }}) +add_subdirectory({{ controller_path }}) # handles the Qt models add_subdirectory({{ presenter_path }}) diff --git a/tools/qleany/generator/templates/root/CMakeLists.txt.no_ui.jinja2 b/tools/qleany/generator/templates/root/CMakeLists.txt.no_ui.jinja2 index 6a4f2832..a602a313 100644 --- a/tools/qleany/generator/templates/root/CMakeLists.txt.no_ui.jinja2 +++ b/tools/qleany/generator/templates/root/CMakeLists.txt.no_ui.jinja2 @@ -41,7 +41,7 @@ add_subdirectory({{ contracts_cqrs_path }}) add_subdirectory({{ application_path }}) # handles the interaction between the system's inner layers (use cases, DTOs) and the external world -add_subdirectory({{ interactor_path }}) +add_subdirectory({{ controller_path }}) # handles the Qt models add_subdirectory({{ presenter_path }}) diff --git a/tools/qleany/generator/templates/root/kf6_kirigami/CMakeLists.txt.jinja2 b/tools/qleany/generator/templates/root/kf6_kirigami/CMakeLists.txt.jinja2 index d1235628..6ebca881 100644 --- a/tools/qleany/generator/templates/root/kf6_kirigami/CMakeLists.txt.jinja2 +++ b/tools/qleany/generator/templates/root/kf6_kirigami/CMakeLists.txt.jinja2 @@ -78,7 +78,7 @@ add_subdirectory({{ contracts_cqrs_path }}) add_subdirectory({{ application_path }}) # handles the interaction between the system's inner layers (use cases, DTOs) and the external world -add_subdirectory({{ interactor_path }}) +add_subdirectory({{ controller_path }}) # handles the Qt models add_subdirectory({{ presenter_path }}) diff --git a/tools/qleany/generator/templates/root/qt_quick/CMakeLists.txt.jinja2 b/tools/qleany/generator/templates/root/qt_quick/CMakeLists.txt.jinja2 index e27d5053..de9a1d59 100644 --- a/tools/qleany/generator/templates/root/qt_quick/CMakeLists.txt.jinja2 +++ b/tools/qleany/generator/templates/root/qt_quick/CMakeLists.txt.jinja2 @@ -39,7 +39,7 @@ add_subdirectory({{ contracts_cqrs_path }}) add_subdirectory({{ application_path }}) # handles the interaction between the system's inner layers (use cases, DTOs) and the external world -add_subdirectory({{ interactor_path }}) +add_subdirectory({{ controller_path }}) # handles the Qt models add_subdirectory({{ presenter_path }}) diff --git a/tools/qleany/generator/templates/root/qt_widgets/CMakeLists.txt.jinja2 b/tools/qleany/generator/templates/root/qt_widgets/CMakeLists.txt.jinja2 index d7ba61fd..e369c3ce 100644 --- a/tools/qleany/generator/templates/root/qt_widgets/CMakeLists.txt.jinja2 +++ b/tools/qleany/generator/templates/root/qt_widgets/CMakeLists.txt.jinja2 @@ -41,7 +41,7 @@ add_subdirectory({{ contracts_cqrs_path }}) add_subdirectory({{ application_path }}) # handles the interaction between the system's inner layers (use cases, DTOs) and the external world -add_subdirectory({{ interactor_path }}) +add_subdirectory({{ controller_path }}) # handles the Qt models add_subdirectory({{ presenter_path }})