RasterProcessTool/RasterProcessToolWidget/ToolBoxManager/pluginBase.cpp

122 lines
1.8 KiB
C++
Raw Permalink Normal View History

#include "pluginBase.h"
#include <QTranslator>
#include <QSettings>
#include <QCoreApplication>
2025-02-05 08:45:52 +00:00
#include <windows.h>
#include <WinBase.h>
2025-02-05 08:45:52 +00:00
namespace Plugins
{
PluginBase::PluginBase()
{
_translator = new QTranslator;
}
PluginBase::~PluginBase()
{
if (_translator != nullptr) delete _translator;
}
void PluginBase::setFileName(QString f)
{
_libFileName = f;
}
QString PluginBase::getFileName()
{
return _libFileName;
}
Plugins::PluginType PluginBase::getPluginType()
{
return _pluginType;
}
void PluginBase::readINI(QSettings* settings)
{
Q_UNUSED(settings)
}
void PluginBase::writeINI(QSettings*)
{
}
void PluginBase::setWinModule(HMODULE m)
{
_winModule = m;
}
HMODULE PluginBase::getWinModule()
{
return _winModule;
}
QString PluginBase::getDescribe()
{
return _describe;
}
bool PluginBase::uninstall()
{
QString path = qApp->applicationDirPath();
2025-02-05 08:45:52 +00:00
QSettings settingwrite(path + "/RasterSetting.ini", QSettings::IniFormat);
this->writeINI(&settingwrite);
return false;
}
bool PluginBase::install()
{
QString path = qApp->applicationDirPath();
2025-02-05 08:45:52 +00:00
QSettings settingreader(path + "/RasterSetting.ini", QSettings::IniFormat);
this->readINI(&settingreader);
return false;
}
void PluginBase::reTranslate(QString lang)
{
qDebug() << lang;
}
void PluginBase::exec(int commandType)
{
Q_UNUSED(commandType)
}
2025-02-05 08:45:52 +00:00
void PluginBase::setType(PluginType t)
{
_pluginType = t;
}
Plugins::PluginType PluginBase::getType()
{
return _pluginType;
}
void PluginBase::writeToProjectFile(QDomDocument* doc, QDomElement* parent)
{
Q_UNUSED(doc)
Q_UNUSED(parent)
}
void PluginBase::readFromProjectFile(QDomElement* parentEle)
{
Q_UNUSED(parentEle)
}
bool PluginBase::hasInfoToSave()
{
return false;
}
}