Albert
Loading...
Searching...
No Matches
inputhistory.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <QObject>
6#include <QString>
7#include <albert/export.h>
8#include <memory>
9
10namespace albert::util
11{
12
18class ALBERT_EXPORT InputHistory final : public QObject
19{
20 Q_OBJECT
21
22public:
23
24 InputHistory(const QString &path = {});
25 ~InputHistory() override;
26
34 Q_INVOKABLE void add(const QString& str);
35
42 Q_INVOKABLE QString next(const QString &pattern = QString{});
43
50 Q_INVOKABLE QString prev(const QString &pattern = QString{});
51
55 Q_INVOKABLE void resetIterator();
56
60 Q_INVOKABLE void clear();
61
65 Q_INVOKABLE uint limit() const;
66
70 Q_INVOKABLE void setLimit(uint);
71
72private:
73
74 class Private;
75 std::unique_ptr<Private> d;
76
77};
78
79}
Input history class.
Definition inputhistory.h:19
Q_INVOKABLE void setLimit(uint)
Sets the maximum amount of history entries.
Q_INVOKABLE uint limit() const
Returns the maximum amount of history entries.
InputHistory(const QString &path={})
Q_INVOKABLE void resetIterator()
Resets history search.
Q_INVOKABLE QString prev(const QString &pattern=QString{})
Gets previous history item matching the pattern.
Q_INVOKABLE void add(const QString &str)
Adds text to history search.
Q_INVOKABLE void clear()
Clears the history.
Q_INVOKABLE QString next(const QString &pattern=QString{})
Gets next history item matching the pattern.
Definition backgroundexecutor.h:12