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/FITKPython/FITKPythonInterface.h

130 lines
3.8 KiB
C

/**
* @brief Python
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
#ifndef _FITKPYTHONINTERFACE_H_
#define _FITKPYTHONINTERFACE_H_
#include "FITKPythonAPI.h"
#include <QString>
class QObject;
class QWidget;
class QStringList;
class QMutex;
namespace Python
{
class PythonAgent;
/**
* @brief Python
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
class FITKPythonAPI FITKPythonInterface
{
public:
/**
* @brief
* @return FITKPythonInterface*
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
static FITKPythonInterface* getInstance();
/**
* @brief PythonQt
* @param[i] obj
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void addDecorator(QObject* obj);
/**
* @brief PythonQtc++
* @param[i] typeName
* @param[i] parentTypeName
* @param[i] package (private)
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void registerCPPClass(const char* typeName, const char* parentTypeName = nullptr, const char* package = nullptr);
/**
* @brief python
* @param[i] script python
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-27
*/
void submit(const QString &script);
/**
* @brief python
* @param[i] scripts Python
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-27
*/
void submit(const QStringList &scripts);
/**
* @brief python
* @param[i] filePath
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void submitFile(const QString &filePath);
/**
* @brief
* @param[i] filePath
* @return true
* @return false
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
bool saveScriptHistory(const QString &filePath);
/**
* @brief python
* @param[i] package python
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-01
*/
void importPython(const QString package = "*");
/**
* @brief python
* @return QWidget*
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-27
*/
QWidget* getPyWidget();
private:
/**
* @brief Construct a new FITKPythonInterface object
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
FITKPythonInterface();
/**
* @brief Destroy the FITKPythonInterface object
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
~FITKPythonInterface();
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-29
*/
static QMutex m_mutex;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
static FITKPythonInterface* m_interface;
/**
* @brief PythonQt
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
PythonAgent* m_pyAgent = nullptr;
};
}
#endif