#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include #include #include #include #include #include #include "apiclient.h" #include "models/types.h" // IWYU pragma: keep #include "models/filterparams.h" #include "utils/buttonhoverwatcher.h" // IWYU pragma: keep namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); void setClient(ApiClient *newClient); private: template void fillTable(const QMap &map); void fillListWidget(const QList &devices); void updateDevices(int entityId); QWidget* createMessageEmptyCard(); QWidget* createDeviceCard(const Device &device); QString normalizeTypeName(const QString &name); void addMessageEmptyToList(); void addDeviceToList(const Device &device); void returnToDeviceList(); void showTableWithStructureElements(const QList& elements); void showTableWithDeviceModelCharacteristics(const DeviceModel& model); void clearSpinBoxes(); void clearFilters(); void clearDevicesOutputSettings(); int getSelectedElementId(); QMap getDevicesMap(const QList &devices); private slots: void updateTableWidget(int index); void updateListWidget(); void showItemInfo(QListWidgetItem*); void changeSortOrder(); void pushButtonBackClicked(); void pushButtonClearClicked(); void pushButtonSearchClicked(); void pushButtonDisregardPriceClicked(); void pushButtonApplyFiltersClicked(); void pushButtonCancelFiltersClicked(); void pushButtonStructureClicked(); void pushButtonCharacteristicsClicked(); void pushButtonDefaultClicked(); void onDevicesReceived(const QList &devices); void onDepartmentsReceived(const QMap &departments); void onDeviceModelsReceived(const QMap &deviceModels); void onDeviceTypesReceived(const QMap &deviceTypes); void onManufacturersReceived(const QMap &manufacturers); void onLocationsReceived(const QMap &locations); private: Ui::MainWindow *ui; ApiClient *_client; QString _searchInfo = ""; FilterParams _filterParams; bool _initialTypesLoad = true; int _idCard = 0; QMap _deviceTypeImages; QMap _mapDevices; }; #endif // MAINWINDOW_H