Krita

Notifier.h
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
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
16class KisMainWindow;
17class KisDocument;
18
19/**
20 * The Notifier can be used to be informed of state changes in the Krita application.
21 */
22class KRITALIBKIS_EXPORT Notifier : public QObject
23{
24 Q_OBJECT
26
27 Q_PROPERTY(bool Active READ active WRITE setActive)
28
29public:
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
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 */
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 */
87
88 /**
89 * @brief windowIsCreated is emitted after main window is completely created
90 */
92
93 /**
94 * @brief configurationChanged is emitted every time Krita's configuration
95 * has changed.
96 */
98
99private 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
109private:
110 struct Private;
111 Private *const d;
112
113};
114
115#endif // LIBKIS_NOTIFIER_H
The Document class encapsulates a Krita Document/Image.
Definition Document.h:34
The Notifier can be used to be informed of state changes in the Krita application.
Definition Notifier.h:23
void applicationClosing()
applicationClosing is emitted when the application is about to close.
void viewCreated(View *view)
viewCreated is emitted whenever a new view is created.
void configurationChanged()
configurationChanged is emitted every time Krita's configuration has changed.
void imageCreated(Document *image)
imageCreated is emitted whenever a new image is created and registered with the application.
void windowCreated()
windowIsCreated is emitted after main window is completely created
void viewClosed(View *view)
viewClosed is emitted whenever a view is closed
void imageClosed(const QString &filename)
imageClosed is emitted whenever the last view on an image is closed.
void imageSaved(const QString &filename)
imageSaved is emitted whenever a document is saved.
void windowIsBeingCreated(Window *window)
windowCreated is emitted whenever a window is being created
View represents one view on a document.
Definition View.h:25
Window represents one Krita mainwindow.
Definition Window.h:23
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:53 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.