mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
XFA: xfa engine basics
This commit is contained in:
@ -15,9 +15,7 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
QT += core gui xml
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
QT += core gui xml widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
|
@ -446,6 +446,11 @@ private:
|
||||
GeneratedCodeStorage* m_storage = nullptr;
|
||||
};
|
||||
|
||||
class XFACodeGenerator
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace codegen
|
||||
|
||||
Q_DECLARE_METATYPE(codegen::GeneratedCodeStorage*)
|
||||
|
@ -88,6 +88,9 @@ void GeneratorMainWindow::saveSettings()
|
||||
settings.setValue("fileName", m_defaultFileName);
|
||||
settings.setValue("headerFile", m_headerFileName);
|
||||
settings.setValue("sourceFile", m_sourceFileName);
|
||||
settings.setValue("XFAdefinitionFileName", m_XFAdefinitionFileName);
|
||||
settings.setValue("XFAheaderFileName", m_XFAheaderFileName);
|
||||
settings.setValue("XFAsourceFileName", m_XFAsourceFileName);
|
||||
}
|
||||
|
||||
void GeneratorMainWindow::loadGeneratedSettings()
|
||||
@ -356,6 +359,9 @@ void GeneratorMainWindow::loadSettings()
|
||||
m_defaultFileName = settings.value("fileName").toString();
|
||||
m_headerFileName = settings.value("headerFile", QVariant()).toString();
|
||||
m_sourceFileName = settings.value("sourceFile", QVariant()).toString();
|
||||
m_XFAdefinitionFileName = settings.value("XFAdefinitionFileName", QVariant()).toString();
|
||||
m_XFAheaderFileName = settings.value("XFAheaderFileName", QVariant()).toString();
|
||||
m_XFAsourceFileName = settings.value("XFAsourceFileName", QVariant()).toString();
|
||||
}
|
||||
|
||||
void GeneratorMainWindow::save(const QString& fileName)
|
||||
@ -521,3 +527,38 @@ void GeneratorMainWindow::on_actionGenerate_code_triggered()
|
||||
m_generator->generateCode(m_headerFileName, m_sourceFileName);
|
||||
}
|
||||
}
|
||||
|
||||
void GeneratorMainWindow::on_actionSet_code_header_XFA_triggered()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select cpp header"), QString(), "cpp header (*.h)");
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
m_XFAheaderFileName = fileName;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void GeneratorMainWindow::on_actionSet_code_source_XFA_triggered()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select cpp source"), QString(), "cpp source (*.cpp)");
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
m_XFAsourceFileName = fileName;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void GeneratorMainWindow::on_actionSet_XFA_description_triggered()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select xml definition"), QString(), "XML file (*.xml)");
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
m_XFAdefinitionFileName = fileName;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void GeneratorMainWindow::on_actionGenerate_XFA_code_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -80,6 +80,10 @@ private slots:
|
||||
void on_actionSet_code_header_h_triggered();
|
||||
void on_actionSet_code_source_cpp_triggered();
|
||||
void on_actionGenerate_code_triggered();
|
||||
void on_actionSet_code_header_XFA_triggered();
|
||||
void on_actionSet_code_source_XFA_triggered();
|
||||
void on_actionGenerate_XFA_code_triggered();
|
||||
void on_actionSet_XFA_description_triggered();
|
||||
|
||||
private:
|
||||
void loadSettings();
|
||||
@ -104,6 +108,10 @@ private:
|
||||
QString m_sourceFileName;
|
||||
std::map<codegen::GeneratedFunction*, QTreeWidgetItem*> m_mapFunctionToWidgetItem;
|
||||
bool m_isLoadingData;
|
||||
|
||||
QString m_XFAdefinitionFileName;
|
||||
QString m_XFAheaderFileName;
|
||||
QString m_XFAsourceFileName;
|
||||
};
|
||||
|
||||
#endif // GENERATORMAINWINDOW_H
|
||||
|
@ -241,8 +241,18 @@
|
||||
<addaction name="actionSet_code_source_cpp"/>
|
||||
<addaction name="actionGenerate_code"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuXFA">
|
||||
<property name="title">
|
||||
<string>XFA</string>
|
||||
</property>
|
||||
<addaction name="actionSet_XFA_description"/>
|
||||
<addaction name="actionSet_code_header_XFA"/>
|
||||
<addaction name="actionSet_code_source_XFA"/>
|
||||
<addaction name="actionGenerate_XFA_code"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuCode"/>
|
||||
<addaction name="menuXFA"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionLoad">
|
||||
@ -284,6 +294,26 @@
|
||||
<string>Ctrl+G</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_code_header_XFA">
|
||||
<property name="text">
|
||||
<string>Set code header XFA</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_code_source_XFA">
|
||||
<property name="text">
|
||||
<string>Set code source XFA</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGenerate_XFA_code">
|
||||
<property name="text">
|
||||
<string>Generate XFA code</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_XFA_description">
|
||||
<property name="text">
|
||||
<string>Set XFA description</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
Reference in New Issue
Block a user