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 | |
11 | class QPushButton; |
12 | class KateRenderer; |
13 | class BaseWidget; |
14 | class QScrollArea; |
15 | class QToolButton; |
16 | class QTimer; |
17 | class ; |
18 | class QCheckBox; |
19 | |
20 | namespace KTextEditor |
21 | { |
22 | class ViewPrivate; |
23 | } |
24 | |
25 | class ScreenshotDialog : public QDialog |
26 | { |
27 | public: |
28 | explicit ScreenshotDialog(KTextEditor::Range selRange, KTextEditor::ViewPrivate *parent = nullptr); |
29 | ~ScreenshotDialog() override; |
30 | |
31 | void renderScreenshot(KateRenderer *renderer); |
32 | |
33 | private: |
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 | |
44 | private: |
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 ; |
53 | QCheckBox *const m_windowDecorations; |
54 | QMenu *const ; |
55 | QTimer *m_resizeTimer; |
56 | bool m_firstShow = true; |
57 | bool m_showLineNumbers = true; |
58 | bool m_absoluteLineNumbers = true; |
59 | }; |
60 | |
61 | #endif |
62 | |