mirror of
https://github.com/RustyRaptor/plasma-keyboard.git
synced 2026-12-03 15:55:19 -07:00
33 lines
801 B
C++
33 lines
801 B
C++
/*
|
|
SPDX-FileCopyrightText: 2026 Devin Lin <devin@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "abstracttextcomposer.h"
|
|
|
|
#include <qqmlintegration.h>
|
|
|
|
/**
|
|
* Text composer that passes input directly to the backend, applying the requested letter case.
|
|
*/
|
|
class DirectTextComposer : public AbstractTextComposer
|
|
{
|
|
Q_OBJECT
|
|
QML_NAMED_ELEMENT(DirectTextComposer)
|
|
|
|
public:
|
|
explicit DirectTextComposer(QObject *parent = nullptr);
|
|
|
|
bool autoCapitalizationSupported() const override;
|
|
bool setTextCase(TextCase textCase) override;
|
|
bool keyEvent(Qt::Key key, const QString &text) override;
|
|
|
|
private:
|
|
QString transformedText(const QString &text) const;
|
|
|
|
TextCase m_textCase = TextCase::Lower;
|
|
};
|