KTextEditor

screenshotdialog.h
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
An object representing a section of text, from one Cursor to another.
Handles all of the work of rendering the text (used for the views and printing)
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 12:01:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.