┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinnewfilemenuobserver.h
blob: 23bd6a8362ddc948366ca7b0a581fb82740c6eea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * SPDX-FileCopyrightText: 2009 Peter Penz <[email protected]>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef DOLPHINNEWFILEMENUOBSERVER_H
#define DOLPHINNEWFILEMENUOBSERVER_H

#include "dolphin_export.h"

#include <QObject>

class DolphinNewFileMenu;

/**
 * @brief Allows to observe new file items that have been created
 *        by a DolphinNewFileMenu instance.
 *
 * As soon as a DolphinNewFileMenu instance created a new item,
 * the observer will emit the signal itemCreated().
 */
class DOLPHIN_EXPORT DolphinNewFileMenuObserver : public QObject
{
    Q_OBJECT

public:
    static DolphinNewFileMenuObserver &instance();
    void attach(const DolphinNewFileMenu *menu);
    void detach(const DolphinNewFileMenu *menu);

Q_SIGNALS:
    void itemCreated(const QUrl &url);
    void errorMessage(const QString &error);

private:
    DolphinNewFileMenuObserver();
    ~DolphinNewFileMenuObserver() override;

    friend class DolphinNewFileMenuObserverSingleton;
};

#endif