| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/components/controls/noopqmlitem.cpp`/ |
| 2 | // Copyright 2021 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "noopqmlitem.h"cxx . . $ `<file>/src/core/components/controls/noopqmlitem.h`/ |
| 5 | |
| 6 | #include "core/qmlcomponentregistry.h"cxx . . $ `<file>/src/core/qmlcomponentregistry.h`/ |
| 7 | #include "noop.h"cxx . . $ `<file>/src/core/components/controls/noop.h`/ |
| 8 | #include <QQmlApplicationEngine> |
| 9 | #include <QQmlComponent> |
| 10 | #include <QString> |
| 11 | #include <QtGlobal> |
| 12 | #include <QtQml> |
| 13 | #include <memory> |
| 14 | |
| 15 | char const *const NoopQMLItemcxx . . $ NoopQMLItem#::trStringscxx . . $ NoopQMLItem#trStrings.[] = { |
| 16 | QT_TRANSLATE_NOOPcxx . . $ `<external>/7871922715575640492/qttranslation.h:21:9`!("ControlModeQMLItem", "NOOP"), |
| 17 | }; |
| 18 | |
| 19 | class NoopQMLItemcxx . . $ NoopQMLItem#::Initializercxx . . $ NoopQMLItem#Initializer# final |
| 20 | : public QMLItemcxx . . $ QMLItem#::Initializercxx . . $ QMLItem#Initializer# |
| 21 | , public IControlcxx . . $ IControl#::Exportercxx . . $ IControl#Exporter# |
| 22 | { |
| 23 | public: |
| 24 | Initializercxx . . $ NoopQMLItem#Initializer#Initializer(7bea08729f51bff0).(IQMLComponentFactorycxx . . $ IQMLComponentFactory# const &qmlComponentFactory, |
| 25 | QQmlApplicationEnginecxx . . $ QQmlApplicationEngine# &qmlEngine, NoopQMLItemcxx . . $ NoopQMLItem# &qmlItem) noexcept |
| 26 | : QMLItemcxx . . $ QMLItem#::Initializercxx . . $ QMLItem#Initializer#(qmlComponentFactory, qmlEngine) |
| 27 | , outer_cxx . . $ NoopQMLItem#Initializer#outer_.(qmlItem) |
| 28 | { |
| 29 | } |
| 30 | |
| 31 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<Exportablecxx . . $ Exportable#::Exportercxx . . $ Exportable#Exporter#>> |
| 32 | provideExportercxx . . $ NoopQMLItem#Initializer#provideExporter(3acccbde2694e33a).(Itemcxx . . $ Item# const &) override |
| 33 | { |
| 34 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 35 | } |
| 36 | |
| 37 | void takeActivecxx . . $ NoopQMLItem#Initializer#takeActive(b45ddcbc8423892c).(bool active) override; |
| 38 | |
| 39 | private: |
| 40 | NoopQMLItemcxx . . $ NoopQMLItem# &outer_cxx . . $ NoopQMLItem#Initializer#outer_.; |
| 41 | }; |
| 42 | |
| 43 | void NoopQMLItemcxx . . $ NoopQMLItem#::Initializercxx . . $ NoopQMLItem#Initializer#::takeActivecxx . . $ NoopQMLItem#Initializer#takeActive(b45ddcbc8423892c).(bool active) |
| 44 | { |
| 45 | outer_cxx . . $ NoopQMLItem#Initializer#outer_..takeActivecxx . . $ NoopQMLItem#takeActive(b45ddcbc8423892c).(active); |
| 46 | } |
| 47 | |
| 48 | NoopQMLItemcxx . . $ NoopQMLItem#::NoopQMLItemcxx . . $ NoopQMLItem#NoopQMLItem(ced63f7c635d850d).() noexcept |
| 49 | { |
| 50 | setNamecxx . . $ QMLItem#setName(3520e46b33348bf6).(trcxx . . $ NoopQMLItem#tr(75d9f1c324b4579d).(Noopcxx . . $ Noop#::ItemIDcxx . . $ Noop#ItemID..datacxx . . $ std/basic_string_view#data(8e614c7de0b1573e).())); |
| 51 | } |
| 52 | |
| 53 | void NoopQMLItemcxx . . $ NoopQMLItem#::activatecxx . . $ NoopQMLItem#activate(b45ddcbc8423892c).(bool active) |
| 54 | { |
| 55 | takeActivecxx . . $ NoopQMLItem#takeActive(b45ddcbc8423892c).(active); |
| 56 | } |
| 57 | |
| 58 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<Importablecxx . . $ Importable#::Importercxx . . $ Importable#Importer#>> |
| 59 | NoopQMLItemcxx . . $ NoopQMLItem#::provideImportercxx . . $ NoopQMLItem#provideImporter(c13a3bcac0db4745).(Itemcxx . . $ Item# const &) |
| 60 | { |
| 61 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 62 | } |
| 63 | |
| 64 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<Exportablecxx . . $ Exportable#::Exportercxx . . $ Exportable#Exporter#>> |
| 65 | NoopQMLItemcxx . . $ NoopQMLItem#::provideExportercxx . . $ NoopQMLItem#provideExporter(3acccbde2694e33a).(Itemcxx . . $ Item# const &) |
| 66 | { |
| 67 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 68 | } |
| 69 | |
| 70 | bool NoopQMLItemcxx . . $ NoopQMLItem#::provideActivecxx . . $ NoopQMLItem#provideActive(50ce9a9e25b4a850).() const |
| 71 | { |
| 72 | return active_cxx . . $ NoopQMLItem#active_.; |
| 73 | } |
| 74 | |
| 75 | void NoopQMLItemcxx . . $ NoopQMLItem#::takeActivecxx . . $ NoopQMLItem#takeActive(b45ddcbc8423892c).(bool active) |
| 76 | { |
| 77 | active_cxx . . $ NoopQMLItem#active_. = active; |
| 78 | setVisiblecxx . . $ QQuickItem#setVisible(b45ddcbc8423892c).(active); |
| 79 | } |
| 80 | |
| 81 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<Exportablecxx . . $ Exportable#::Exportercxx . . $ Exportable#Exporter#> |
| 82 | NoopQMLItemcxx . . $ NoopQMLItem#::initializercxx . . $ NoopQMLItem#initializer(7a83657deb216afe).(IQMLComponentFactorycxx . . $ IQMLComponentFactory# const &qmlComponentFactory, |
| 83 | QQmlApplicationEnginecxx . . $ QQmlApplicationEngine# &qmlEngine) |
| 84 | { |
| 85 | return stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<NoopQMLItemcxx . . $ NoopQMLItem#::Initializercxx . . $ NoopQMLItem#Initializer#>(qmlComponentFactory, |
| 86 | qmlEngine, *this); |
| 87 | } |
| 88 | |
| 89 | bool NoopQMLItemcxx . . $ NoopQMLItem#::register_cxx . . $ NoopQMLItem#register_(c9857a73d68e59ba).() |
| 90 | { |
| 91 | QMLComponentRegistrycxx . . $ QMLComponentRegistry#::addQMLTypeRegisterercxx . . $ QMLComponentRegistry#addQMLTypeRegisterer(9f2ee88c4f5f1585).([cxx . . $ std/function#function(bdc3712e480e4d04).]() { |
| 92 | qmlRegisterTypecxx . . $ qmlRegisterType(f18a5d83a8a5ac9a).<NoopQMLItemcxx . . $ NoopQMLItem#>("CoreCtrl.UIComponents", 1, 0, |
| 93 | Noopcxx . . $ Noop#::ItemIDcxx . . $ Noop#ItemID..datacxx . . $ std/basic_string_view#data(8e614c7de0b1573e).()); |
| 94 | }); |
| 95 | |
| 96 | QMLComponentRegistrycxx . . $ QMLComponentRegistry#::addQMLItemProvidercxx . . $ QMLComponentRegistry#addQMLItemProvider(810b0b7f5440dcb9).( |
| 97 | Noopcxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::ItemIDcxx . . $ Noop#ItemID., [cxx . . $ std/function#function(bdc3712e480e4d04).](QQmlApplicationEnginecxx . . $ QQmlApplicationEngine# &engine) { |
| 98 | QQmlComponentcxx . . $ QQmlComponent# componentcxx . . $ QQmlComponent#QQmlComponent(13033182df0c9ae5).(&engine, |
| 99 | QStringLiteralcxx . . $ `<external>/13954984326995544643/qstring.h:1789:9`!("qrc:/qml/NoopForm.qml")); |
| 100 | return qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<QMLItemcxx . . $ QMLItem# *>(component.createcxx . . $ QQmlComponent#create(1adc5df52fdd8588).()); |
| 101 | }); |
| 102 | |
| 103 | return true; |
| 104 | } |
| 105 | |
| 106 | bool const NoopQMLItemcxx . . $ NoopQMLItem#::registered_cxx . . $ NoopQMLItem#registered_. = NoopQMLItemcxx . . $ NoopQMLItem#::register_cxx . . $ NoopQMLItem#register_(c9857a73d68e59ba).(); |