1/*
2 SPDX-FileCopyrightText: 2023 Waqar Ahmed <waqar.17a@gmail.com>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5#ifndef KTE_Screenshot_dialog_h
6#define KTE_Screenshot_dialog_h
7
8#include <KTextEditor/Range>
9#include <QDialog>
10
11class QPushButton;
12class KateRenderer;
13class BaseWidget;
14class QScrollArea;
15class QToolButton;
16class QTimer;
17class QMenu;
18class QCheckBox;
19
20namespace KTextEditor
21{
22class ViewPrivate;
23}
24
25class ScreenshotDialog : public QDialog
26{
27public:
28 explicit ScreenshotDialog(KTextEditor::Range selRange, KTextEditor::ViewPrivate *parent = nullptr);
29 ~ScreenshotDialog() override;
30
31 void renderScreenshot(KateRenderer *renderer);
32
33private:
34 void onSaveClicked();
35 void onCopyClicked();
36 enum {
37 DontShowLineNums,
38 ShowAbsoluteLineNums,
39 ShowActualLineNums,
40 };
41 void onLineNumChangedClicked(int i);
42 void resizeEvent(QResizeEvent *e) override;
43
44private:
45 BaseWidget *const m_base;
46 const KTextEditor::Range m_selRange;
47 QScrollArea *const m_scrollArea;
48 QPushButton *const m_saveButton;
49 QPushButton *const m_copyButton;
50 QPushButton *const m_changeBGColor;
51 QToolButton *const m_lineNumButton;
52 QCheckBox *const m_extraDecorations;
53 QCheckBox *const m_windowDecorations;
54 QMenu *const m_lineNumMenu;
55 QTimer *m_resizeTimer;
56 bool m_firstShow = true;
57 bool m_showLineNumbers = true;
58 bool m_absoluteLineNumbers = true;
59};
60
61#endif
62

source code of ktexteditor/src/view/screenshotdialog.h