Files
GenericQtClientCore/genericcore.h

68 lines
1.7 KiB
C
Raw Normal View History

2025-10-02 11:19:14 +02:00
#ifndef GENERICCORE_H
#define GENERICCORE_H
#include <QObject>
class QUndoStack;
class QAbstractItemModel;
class QAbstractItemModelTester;
2025-10-02 16:22:47 +02:00
class QString;
class TableModel;
class GeneralSortFilterModel;
class ServerCommunicator;
class GenericCore : public QObject {
Q_OBJECT
public:
GenericCore();
~GenericCore();
2025-10-02 16:22:47 +02:00
QString toString() const;
void sayHello() const;
bool isApplicationUpdateAvailable();
void triggerApplicationUpdate(const bool saveChanges);
QUndoStack* getModelUndoStack() const;
std::shared_ptr<TableModel> getModel() const;
std::shared_ptr<GeneralSortFilterModel> getSortFilterModel() const;
void saveItems();
void importCSVFile(const QString& filePath);
2026-01-06 10:04:26 +01:00
bool exportCSVFile(const QString& filePath);
bool isSyncServerSetup() const;
public slots:
void onSendItemTriggered(const int row);
void onItemsFetched(const QByteArray jsonDoc);
void onItemsFetchFailure(const QString errorString);
void onPostRequestSuccessful(const QString message);
void onPostRequestFailure(const QString errorString);
signals:
void displayStatusMessage(QString message);
void fetchItemsFromServer();
void sendItemToServer(int row);
private:
QUndoStack* m_modelUndoStack;
std::shared_ptr<TableModel> m_mainModel;
std::shared_ptr<GeneralSortFilterModel> m_sortFilterModel;
std::unique_ptr<QAbstractItemModelTester> m_mainModelTester;
std::unique_ptr<QAbstractItemModelTester> m_proxyModelTester;
void setupModels();
void initModelData();
QString getMaintenanceToolFilePath() const;
/// Network communication
std::unique_ptr<ServerCommunicator> m_serverCommunicator;
void setupServerConfiguration();
2025-10-02 11:19:14 +02:00
};
#endif // GENERICCORE_H