You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/FITK_Kernel/FITKAppFramework/FITKAppFramework.h

345 lines
11 KiB
C

/**
*
* @file FITKAppFramework.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*
*/
#ifndef __FITKAPPFRAMEWORK_H___
#define __FITKAPPFRAMEWORK_H___
#include <QApplication>
#include <QString>
#include "FITKAppFrameworkAPI.h"
namespace AppFrame
{
class FITKGlobalData;
class FITKCmponents;
class FITKAbstractMainwindowGenerator;
class FITKAbstractGlobalDataFactory;
class FITKAbstractAutoSaver;
class FITKComponentFactory;
class FITKSignalTransfer;
class FITKGlobalEventFilter;
class FITKAbstractEventFilter;
class FITKAppSettings;
class FITKCommandLineHandler;
class FITKWorkBenchHandler;
class FITKProgramTaskManeger;
class FITKAbstractPythonRegister;
class FITKAbstractSysChecker;
/**
* @brief AppFrame
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
class FITKAppFrameworkAPI FITKApplication : public QApplication
{
Q_OBJECT
public:
/**
* @brief Construct a new FITKApplication object
* @param[i] argc
* @param[i] argv
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
explicit FITKApplication(int &argc, char **argv);
/**
* @brief Destroy the FITKApplication object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
virtual ~FITKApplication();
/**
* @brief
* @param[i] checker
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-09-18
*/
void checkSystem(FITKAbstractSysChecker* checker);
/**
* @brief
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
int exec();
/**
* @brief
* @param[i] generator
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void regMainWindowGenerator(FITKAbstractMainwindowGenerator* generator);
/**
* @brief
* @param[i] fac
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-29
*/
void regGlobalDataFactory(FITKAbstractGlobalDataFactory* fac);
/**
* @brief
* @param[i] handler
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-05
*/
void regCommandLineHandler(FITKCommandLineHandler* handler);
/**
* @brief
* @return FITKCommandLineHandler*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-05
*/
FITKCommandLineHandler* getCommandLineHandler();
/**
* @brief
* @param[i] settings
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-05
*/
void regAppSettings(FITKAppSettings* settings);
/**
* @brief
* @return FITKAppSettings*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-05
*/
FITKAppSettings* getAppSettings();
/**
* @brief
* @return FITKGlobalData*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-26
*/
FITKGlobalData* getGlobalData();
/**
* @brief
* @param[i] fac
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-05
*/
void regComponentsFactory(FITKComponentFactory* fac);
/**
* @brief Python
* @param[i] pyreg
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-06-18
*/
void regPythonRegister(FITKAbstractPythonRegister* pyreg);
/**
* @brief
* @return FITKCmponents*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-05
*/
FITKCmponents* getComponents();
/**
* @brief
* @return FITKSignalTransfer*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-05
*/
FITKSignalTransfer* getSignalTransfer();
/**
* @brief
* @return FITKProgramTaskManeger*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-06-09
*/
FITKProgramTaskManeger* getProgramTaskManager();
/**
* @brief signalTransfer
* @param[i] obj
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-08
*/
void addGolbalSignalProcesser(QObject* obj);
/**
* @brief
* @param[i] filter
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-30
*/
void addEventFilter(FITKAbstractEventFilter* filter);
/**
* @brief
* @param[i] saver
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-09-13
*/
void regAutoSaver(FITKAbstractAutoSaver* saver);
/**
* @brief
* @return FITKAbstractAutoSaver*
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-09-13
*/
FITKAbstractAutoSaver* getAutoSaver();
/**
* @brief exec
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
virtual bool init();
/**
* @brief
* @return FITKGlobalEventFilter*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-30
*/
FITKGlobalEventFilter* getGlobalEventFilter();
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-30
*/
virtual void showCopyrightDlg();
/**
* @brief globaldata
* @param savedIDs ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-30
*/
void resetDataObjects(const QList<int>& savedIDs = QList<int>());
/**
* @brief workbench
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-08-19
*/
bool workingInWorkBench();
/**
* @brief workbench
* @param[i] handler
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-19
*/
void regWorkBenchHandler(FITKWorkBenchHandler* handler );
/**
* @brief workbench
* @return * FITKWorkBenchHandler*
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-19
*/
FITKWorkBenchHandler* getWorkBenchHandler();
private:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
void execCommand();
private:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-09-18
*/
bool _passSystemCheck{ true };
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
FITKAbstractMainwindowGenerator* _mwGenerator{};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-29
*/
FITKAbstractGlobalDataFactory* _gDataFactory{};
/**
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
FITKGlobalData* _golbalData{};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-05
*/
FITKComponentFactory* _componentsFactory{};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-05
*/
FITKCmponents* _components{};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-05
*/
FITKSignalTransfer* _signalTransfer{};
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
FITKGlobalEventFilter* _globalEvent = nullptr;
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-06
*/
FITKCommandLineHandler* _commandLineHandler{};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-06
*/
FITKAppSettings* _settings{};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-06-09
*/
FITKProgramTaskManeger* _programTaskManager{};
/**
* @brief Python
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-06-18
*/
FITKAbstractPythonRegister* _pyReg{};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-19
*/
FITKWorkBenchHandler* _workbenchHandler{};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-09-12
*/
FITKAbstractAutoSaver* _autoSaver{};
};
}
/**
* @brief 访
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-29
*/
#define FITKAPP (dynamic_cast<AppFrame::FITKApplication*>(qApp))
#define FITKGLODATA (FITKAPP->getGlobalData())
#endif