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{
29 /** Returns a model listing all log entries.
30 * @see logEntryModel()
31 */
33 /** Returns @c true if there are log entries to display. */
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 */
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
55 /** Change notification for the hasLogEntries property. */
57
58private:
59 std::unique_ptr<AuditLogUiControllerPrivate> d;
60};
61
62}
63
64#endif // KUSERFEEDBACK_AUDITLOGUICONTROLLER_H
void logEntryCountChanged()
Change notification for the hasLogEntries property.
QAbstractItemModel * logEntryModel
Returns a model listing all log entries.
Q_INVOKABLE QString logEntry(const QDateTime &dt) const
Returns a formatted text for display of the specified log entry.
void clear()
Delete all audit log entries.
bool hasLogEntries
Returns true if there are log entries to display.
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
QObject(QObject *parent)
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:11:33 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.