KUserFeedback

auditloguicontroller.h
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef KUSERFEEDBACK_AUDITLOGUICONTROLLER_H
8#define KUSERFEEDBACK_AUDITLOGUICONTROLLER_H
9
10#include "kuserfeedbackcore_export.h"
11
12#include <QAbstractItemModel>
13#include <QObject>
14
15#include <memory>
16
17QT_BEGIN_NAMESPACE
18class QDateTime;
19QT_END_NAMESPACE
20
21namespace KUserFeedback {
22
23class AuditLogUiControllerPrivate;
24
25/** Widget/QtQuick-independent logic and data for the audit log browser UI. */
26class KUSERFEEDBACKCORE_EXPORT AuditLogUiController : public QObject
27{
28 Q_OBJECT
29 /** Returns a model listing all log entries.
30 * @see logEntryModel()
31 */
32 Q_PROPERTY(QAbstractItemModel* logEntryModel READ logEntryModel CONSTANT)
33 /** Returns @c true if there are log entries to display. */
34 Q_PROPERTY(bool hasLogEntries READ hasLogEntries NOTIFY logEntryCountChanged)
35public:
36 AuditLogUiController(QObject *parent = nullptr);
37 ~AuditLogUiController() override;
38
39 /** Returns @c true if there are log entries to display. */
40 bool hasLogEntries() const;
41
42 /** Returns a model listing all telemetry data submission events.
43 * Qt::UserRole contains the timestamp of the log entry for use in logEntry().
44 */
45 QAbstractItemModel* logEntryModel() const;
46
47 /** Returns a formatted text for display of the specified log entry. */
48 Q_INVOKABLE QString logEntry(const QDateTime &dt) const;
49
50public Q_SLOTS:
51 /** Delete all audit log entries. */
52 void clear();
53
54Q_SIGNALS:
55 /** Change notification for the hasLogEntries property. */
56 void logEntryCountChanged();
57
58private:
59 std::unique_ptr<AuditLogUiControllerPrivate> d;
60};
61
62}
63
64#endif // KUSERFEEDBACK_AUDITLOGUICONTROLLER_H
Widget/QtQuick-independent logic and data for the audit log browser UI.
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:56 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.