summaryrefslogtreecommitdiffstats
path: root/src/shared-main-lib/notificationimpl.h
blob: 2e71e4263b1415098c3d147b98c05413e036fa16 (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
44
45
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2019 Luxoft Sweden AB
// Copyright (C) 2018 Pelagicore AG
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef NOTIFICATIONIMPL_H
#define NOTIFICATIONIMPL_H

#include <QtCore/QObject>
#include <QtCore/QUrl>
#include <QtCore/QVariantMap>
#include <QtAppManCommon/global.h>

QT_BEGIN_NAMESPACE_AM

class Notification;

class NotificationImpl
{
public:
    static void setFactory(const std::function<NotificationImpl *(Notification *, const QString &)> &factory);

    static NotificationImpl *create(Notification *notification, const QString &applicationId);

    virtual ~NotificationImpl() = default;

    Notification *notification();

    virtual void classBegin();
    virtual void componentComplete();
    virtual uint show() = 0;
    virtual void close() = 0;

protected:
    NotificationImpl(Notification *notification);

private:
    Notification *m_notification = nullptr;
    static std::function<NotificationImpl *(Notification *, const QString &)> s_factory;
    Q_DISABLE_COPY_MOVE(NotificationImpl)
};

QT_END_NAMESPACE_AM

#endif // NOTIFICATIONIMPL_H