Renamed core subproject into BeetRoundCore.
This commit is contained in:
73
libs/BeetRoundCore/genericcore.h
Normal file
73
libs/BeetRoundCore/genericcore.h
Normal file
@ -0,0 +1,73 @@
|
||||
#ifndef GENERICCORE_H
|
||||
#define GENERICCORE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QUndoStack;
|
||||
class QAbstractItemModel;
|
||||
class QAbstractItemModelTester;
|
||||
class QString;
|
||||
|
||||
class TableModel;
|
||||
class GeneralSortFilterModel;
|
||||
class ServerCommunicator;
|
||||
|
||||
class GenericCore : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GenericCore();
|
||||
~GenericCore();
|
||||
|
||||
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);
|
||||
bool exportCSVFile(const QString& filePath);
|
||||
|
||||
QVariantMap getSettings(QString group = "") const;
|
||||
void applySettings(QVariantMap settingMap, QString group = "");
|
||||
bool isSyncServerSetup() const;
|
||||
|
||||
public slots:
|
||||
void onSendItemTriggered(const QByteArray& jsonData);
|
||||
void onItemsFetched(const QByteArray jsonData);
|
||||
void onItemsFetchFailure(const QString errorString);
|
||||
void onPostRequestSuccessful(const QByteArray responseData);
|
||||
void onPostRequestFailure(const QString errorString);
|
||||
void onDeleteRequestSuccessful(const QByteArray responseData);
|
||||
void onDeleteRequestFailure(const QString errorString);
|
||||
|
||||
signals:
|
||||
void displayStatusMessage(QString message);
|
||||
void fetchItemsFromServer();
|
||||
void postItemToServer(const QByteArray& jsonData);
|
||||
void deleteItemFromServer(const QString& id);
|
||||
|
||||
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();
|
||||
void applyServerConfiguration();
|
||||
};
|
||||
|
||||
#endif // GENERICCORE_H
|
||||
Reference in New Issue
Block a user