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/PythonAgent.h

131 lines
3.8 KiB
C

/**
*
* @file PythonAgent.h
* @brief PythonQt
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*
*/
#ifndef _PYTHONAGENT_H_
#define _PYTHONAGENT_H_
#include <PythonQtObjectPtr.h>
#include <QStringList>
#include <QMutex>
class QObject;
class QWidget;
class PythonQtScriptingConsole;
namespace Python
{
/**
* @brief PythonQt
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
class PythonAgent
{
public:
/**
* @brief Construct a new Python Agent object
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
PythonAgent();
/**
* @brief Destroy the Python Agent object
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
~PythonAgent();
/**
* @brief PythonQt
* @param[i] obj
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void addPyQtDecorator(QObject* obj);
/**
* @brief PythonQtc++
* @param[i] typeName
* @param[i] parentTypeName
* @param[i] package (private)
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void registerPyQtCPPClass(const char* typeName, const char* parentTypeName = nullptr, const char* package = nullptr);
/**
* @brief
* @param[i] file
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void submitScriptFile(const QString &ScriptFile);
/**
* @brief
* @param[i] Script
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void submitScript(const QString &Script);
/**
* @brief
* @param[i] Scripts
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
void submitScript(const QStringList &Scripts);
/**
* @brief
* @param[i] filePath
* @return true
* @return false
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-27
*/
bool saveScriptHistory(const QString &filePath);
/**
* @brief python
* @return QWidget*
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-27
*/
QWidget* getPyWidget();
/**
* @brief
* @param[i] typeName
* @return true
* @return false
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
bool classIsExist(const char* typeName);
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-27
*/
static QMutex m_mutex;
/**
* @brief PythonQt main
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
PythonQtObjectPtr m_mainModule;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-26
*/
QStringList m_regClassNames = {};
/**
* @brief python
* @author BaGuijun (baguijun@163.com)
* @date 2024-02-27
*/
PythonQtScriptingConsole* m_Console = nullptr;
};
}
#endif