File indexing completed on 2024-05-05 04:39:49

0001 /*
0002     SPDX-FileCopyrightText: 2012 Miha Čančula <miha@noughmad.eu>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_PLUGIN_TEMPLATEPREVIEWTOOLVIEW_H
0008 #define KDEVPLATFORM_PLUGIN_TEMPLATEPREVIEWTOOLVIEW_H
0009 
0010 #include <QWidget>
0011 #include <language/codegen/templaterenderer.h>
0012 
0013 namespace KTextEditor
0014 {
0015 class Document;
0016 }
0017 
0018 namespace KDevelop
0019 {
0020 class IDocument;
0021 }
0022 
0023 namespace Ui
0024 {
0025 class TemplatePreviewToolView;
0026 }
0027 
0028 class FileTemplatesPlugin;
0029 class TemplatePreview;
0030 
0031 class TemplatePreviewToolView : public QWidget
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     explicit TemplatePreviewToolView(FileTemplatesPlugin* plugin, QWidget* parent);
0037     ~TemplatePreviewToolView() override;
0038 
0039 private:
0040     Ui::TemplatePreviewToolView* ui;
0041     KTextEditor::Document* m_original;
0042     FileTemplatesPlugin* m_plugin;
0043     KDevelop::TemplateRenderer::EmptyLinesPolicy m_policy;
0044 
0045 private Q_SLOTS:
0046     void sourceTextChanged(const QString& text);
0047 
0048 protected:
0049     void showEvent(QShowEvent*) override;
0050 
0051 public Q_SLOTS:
0052     void documentActivated(KDevelop::IDocument* document);
0053     void documentChanged(KTextEditor::Document* textDocument);
0054     void documentClosed(KDevelop::IDocument* document);
0055     void selectedRendererChanged();
0056 };
0057 
0058 #endif // KDEVPLATFORM_PLUGIN_TEMPLATEPREVIEWTOOLVIEW_H