Krita

Scratchpad.h
1 /*
2  * SPDX-FileCopyrightText: 2020 Scott Petrovic <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 #ifndef LIBKIS_SCRATCHPAD_H
7 #define LIBKIS_SCRATCHPAD_H
8 
9 #include <QObject>
10 #include <QColor>
11 #include <kis_types.h>
12 #include "kritalibkis_export.h"
13 #include "libkis.h"
14 #include "kis_scratch_pad.h"
15 #include "View.h"
16 
17 class KoCanvasBase;
18 class Canvas; // This comes from Python. This would be maybe better
19 class KisView;
20 
21 /**
22  * @brief The Scratchpad class
23  * A scratchpad is a type of blank canvas area that can be painted on
24  * with the normal painting devices
25  *
26  */
27 class KRITALIBKIS_EXPORT Scratchpad: public QWidget
28 {
29  Q_OBJECT
30 public:
31  Scratchpad(View *view, const QColor & defaultColor, QWidget *parent = 0);
32  ~Scratchpad();
33 
34 public Q_SLOTS:
35 
36  /**
37  * @brief Clears out scratchpad with color specified set during setup
38  */
39  void clear();
40 
41  /**
42  * @brief Fill the entire scratchpad with a color
43  * @param Color to fill the canvas with
44  */
45  void setFillColor(QColor color);
46 
47  /**
48  * @brief Switches between a GUI controlling the current mode and when mouse clicks control mode
49  * @param Setting to true allows GUI to control the mode with explicitly setting mode
50  */
51  void setModeManually(bool value);
52 
53 
54  /**
55  * @brief Manually set what mode scratchpad is in. Ignored if "setModeManually is set to false
56  * @param Available options are: "painting", "panning", and "colorsampling"
57  */
58  void setMode(QString modeName);
59 
60  /**
61  * @brief Makes a connection between the zoom of the canvas and scratchpad area so they zoom in sync
62  * @param Should the scratchpad share the zoom level. Default is true
63  */
64  void linkCanvasZoom(bool value);
65 
66 
67  /**
68  * @brief Load image data to the scratchpad
69  * @param Image object to load
70  */
71  void loadScratchpadImage(QImage image);
72 
73  /**
74  * @brief Take what is on the scratchpad area and grab image
75  * @return the image data from the scratchpad
76  */
77  QImage copyScratchpadImageData();
78 
79 
80 private:
81  struct Private;
83 
84 };
85 
86 #endif // LIBKIS_SCRATCHPAD_H
87 
Q_SLOTSQ_SLOTS
View represents one view on a document.
Definition: View.h:24
The Scratchpad class A scratchpad is a type of blank canvas area that can be painted on with the norm...
Definition: Scratchpad.h:27
Canvas wraps the canvas inside a view on an image/document.
Definition: Canvas.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 29 2023 04:08:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.