File indexing completed on 2024-12-22 03:46:49

0001 /*
0002   This file is part of the KTextTemplate library
0003 
0004   SPDX-FileCopyrightText: 2010 Stephen Kelly <steveire@gmail.com>
0005 
0006   SPDX-License-Identifier: LGPL-2.1-or-later
0007 
0008 */
0009 
0010 #include <QWidget>
0011 
0012 #ifndef DESIGNWIDGET_H
0013 #define DESIGNWIDGET_H
0014 
0015 #include "ui_designwidget.h"
0016 
0017 #include <KTextTemplate/Context>
0018 
0019 class ArgsModel;
0020 class MethodModel;
0021 
0022 class DesignWidget : public QWidget
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit DesignWidget(QWidget *parent = nullptr);
0027 
0028     KTextTemplate::Context getContext();
0029 
0030     QString outputType() const;
0031 
0032 Q_SIGNALS:
0033     void generateClicked(bool clicked);
0034 
0035 private:
0036     void setInitialContent();
0037     void insertProperty(int row, const QString &type, const QString &name, bool readonly);
0038     void
0039     insertMethod(const QString &access, bool _virtual, const QString &type, const QString &name, bool _const, QList<QStringList> args = QList<QStringList>());
0040 
0041 private Q_SLOTS:
0042     void setArgsRootIndex(const QModelIndex &index);
0043 
0044 private:
0045     Ui::DesignWidget ui;
0046 
0047     MethodModel *m_methodModel;
0048     ArgsModel *m_argsModel;
0049 };
0050 
0051 #endif