Attica

platformdependent_v3.h
1// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
2// SPDX-FileCopyrightText: 2024 Harald Sitter <sitter@kde.org>
3
4#pragma once
5
6#include <QObject>
7
8#include "attica_export.h"
9#include "platformdependent_v2.h"
10
11namespace Attica
12{
13
14/**
15 * @brief Platform integration plugin v3
16 *
17 * Version 3 introduces an async ready state where dependents need to mark themselves ready for requests before
18 * Attica dispatches them. This in particular allows dependents to carry out async initializations such as loading
19 * credentials.
20 */
21class ATTICA_EXPORT PlatformDependentV3 : public QObject, public PlatformDependentV2
22{
23 Q_OBJECT
24 Q_PROPERTY(bool ready READ isReady NOTIFY readyChanged)
25public:
26 using QObject::QObject;
27 ~PlatformDependentV3() override;
28 Q_DISABLE_COPY_MOVE(PlatformDependentV3)
29
30 /**
31 * Whether the dependent is ready for use (e.g. has loaded credentials).
32 * No requests are dispatched to this dependent until the ready change has been reached!
33 */
34 [[nodiscard]] virtual bool isReady() = 0;
35
36Q_SIGNALS:
37 /**
38 * Emit this when the ready state changes. Please note that reverting to not ready results in undefined behavior.
39 */
41};
42
43} // namespace Attica
44
45Q_DECLARE_INTERFACE(Attica::PlatformDependentV3, "org.kde.Attica.InternalsV3/1.0")
Platform integration plugin v3.
void readyChanged()
Emit this when the ready state changes.
virtual bool isReady()=0
Whether the dependent is ready for use (e.g.
The Attica namespace,.
QObject(QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.