41 #ifndef __OPENFLUID_WARESDEV_WARESRCFACTORY_HPP__
42 #define __OPENFLUID_WARESDEV_WARESRCFACTORY_HPP__
53 namespace openfluid {
namespace waresdev {
64 QList<openfluid::builderext::ExtensionMode> BextMode_Data;
66 QStringList BextCategory_Data;
68 QStringList Sim2docMode_Data;
116 ParamsUiEnabled(false), ParamsUiClassname(
"ParamsUiWidget"), ParamsUiRootCppFilename(
""),
117 ParamsUiRootHppFilename(
"ParamsUiWidget.hpp"), ParamsUiComment(
"//"), Sim2docModeIndex(0),
118 Sim2docInstall(false), BuilderExtModeIndex(-1), BuilderExtCategoryIndex(0)
123 BextCategory_Data <<
"openfluid::builderext::CAT_SPATIAL" <<
"openfluid::builderext::CAT_MODEL"
124 <<
"openfluid::builderext::CAT_RESULTS" <<
"openfluid::builderext::CAT_OTHER";
126 Sim2docMode_Data <<
"ON" <<
"AUTO" <<
"OFF";
131 QStringList BextMode_Texts;
132 BextMode_Texts << QObject::tr(
"Modal") << QObject::tr(
"Modeless") << QObject::tr(
"Workspace");
133 return BextMode_Texts;
138 QStringList BextCategory_Texts;
139 BextCategory_Texts << QObject::tr(
"Spatial domain") << QObject::tr(
"Model") << QObject::tr(
"Results")
140 << QObject::tr(
"Other");
141 return BextCategory_Texts;
146 QStringList Sim2docMode_Texts;
147 Sim2docMode_Texts << QObject::tr(
"On - sim2doc must be run manually")
148 << QObject::tr(
"Auto - sim2doc is automatically run")
149 << QObject::tr(
"Off - sim2doc is disabled");
150 return Sim2docMode_Texts;
160 return BextCategory_Data.value(BuilderExtCategoryIndex,
"");
165 return Sim2docMode_Data.value(Sim2docModeIndex,
"");
170 return ParamsUiEnabled ?
"ON" :
"OFF";
175 return Sim2docInstall ?
"OFF" :
"ON";
183 QDir m_SharedTemplatesDir;
185 QDir m_TypedTemplatesDir;
191 bool copyTemplateToNewFile(
const QString& TemplatePath,
const QString& NewFileName, QString& NewFilePath,
194 bool replaceInFile(
const Replacements& R,
const QString& NewFilePath, QString& ErrMsg);
202 void setWareId(
const QString& Id);
210 bool createCMakeListsFile(
const Replacements& R, QString& NewFilePath, QString& ErrMsg);
218 bool createJsonFile(QString& NewFilePath, QString& ErrMsg);
228 bool createCppFile(
const Replacements& R, QString& NewFilePath, QString& ErrMsg);
238 bool createHppFile(
const Replacements& R, QString& NewFilePath, QString& ErrMsg);
248 bool createParamUiCppFile(
const Replacements& R, QString& NewFilePath, QString& ErrMsg);
258 bool createParamUiHppFile(
const Replacements& R, QString& NewFilePath, QString& ErrMsg);
267 bool createCmakeConfigFile(
const Replacements& R, QString& NewFilePath, QString& ErrMsg);
269 static QRegExp getCppFilenameRegExp(QString& Tooltip,
bool IsHpp =
false);
271 static QRegExp getClassnameRegExp(QString& Tooltip);
273 static QRegExp getWareIdRegExp(QString& Tooltip);
275 static QString getHeaderGuard(
const QString& HppFilename);
277 static QString getHppFilename(
const QString& CppFilename);