Krita

Notifier.h
1 /*
2  * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 #ifndef LIBKIS_NOTIFIER_H
7 #define LIBKIS_NOTIFIER_H
8 
9 #include <QObject>
10 
11 #include "kritalibkis_export.h"
12 #include <kis_types.h>
13 #include "libkis.h"
14 #include <KisView.h>
15 
16 class KisMainWindow;
17 class KisDocument;
18 
19 /**
20  * The Notifier can be used to be informed of state changes in the Krita application.
21  */
22 class KRITALIBKIS_EXPORT Notifier : public QObject
23 {
24  Q_OBJECT
26 
27  Q_PROPERTY(bool Active READ active WRITE setActive)
28 
29 public:
30  explicit Notifier(QObject *parent = 0);
31  ~Notifier() override;
32 
33  /**
34  * @return true if the Notifier is active.
35  */
36  bool active() const;
37 
38  /**
39  * Enable or disable the Notifier
40  */
41  void setActive(bool value);
42 
43 Q_SIGNALS:
44 
45  /**
46  * @brief applicationClosing is emitted when the application is about to close. This
47  * happens after any documents and windows are closed.
48  */
49  void applicationClosing();
50 
51  /**
52  * @brief imageCreated is emitted whenever a new image is created and registered with
53  * the application.
54  */
55  void imageCreated(Document *image);
56 
57  /**
58  * @brief imageSaved is emitted whenever a document is saved.
59  * @param filename the filename of the document that has been saved.
60  */
61  void imageSaved(const QString &filename);
62 
63  /**
64  * @brief imageClosed is emitted whenever the last view on an image is closed. The image
65  * does not exist anymore in Krita
66  * @param filename the filename of the image.
67  */
68  void imageClosed(const QString &filename);
69 
70  /**
71  * @brief viewCreated is emitted whenever a new view is created.
72  * @param view the view
73  */
74  void viewCreated(View *view);
75 
76  /**
77  * @brief viewClosed is emitted whenever a view is closed
78  * @param view the view
79  */
80  void viewClosed(View *view);
81 
82  /**
83  * @brief windowCreated is emitted whenever a window is being created
84  * @param window the window; this is called from the constructor of the window, before the xmlgui file is loaded
85  */
86  void windowIsBeingCreated(Window *window);
87 
88  /**
89  * @brief windowIsCreated is emitted after main window is completely created
90  */
91  void windowCreated();
92 
93  /**
94  * @brief configurationChanged is emitted every time Krita's configuration
95  * has changed.
96  */
97  void configurationChanged();
98 
99 private Q_SLOTS:
100 
101  void imageCreated(KisDocument *document);
102 
103  void viewCreated(KisView *view);
104  void viewClosed(KisView *view);
105 
106  void windowIsBeingCreated(KisMainWindow *window);
107 
108 
109 private:
110  struct Private;
111  Private *const d;
112 
113 };
114 
115 #endif // LIBKIS_NOTIFIER_H
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
Window represents one Krita mainwindow.
Definition: Window.h:22
The Document class encapsulates a Krita Document/Image.
Definition: Document.h:33
View represents one view on a document.
Definition: View.h:24
The Notifier can be used to be informed of state changes in the Krita application.
Definition: Notifier.h:22
Q_SIGNALSQ_SIGNALS
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Dec 4 2022 04:12:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.